@uniformdev/canvas 14.2.1-alpha.34 → 15.0.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/cli.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import{a as Ce,b as Xs,c as ea,d as A,h as ie,q as ta,r as nr}from"../chunk-BU3NFPPR.mjs";var Ls=Xs((mn,tn)=>{A();var qf=200,Xi="__lodash_hash_undefined__",hs=1,Kn=2,ms=9007199254740991,Yn="[object Arguments]",zi="[object Array]",gs="[object Boolean]",bs="[object Date]",ys="[object Error]",ws="[object Function]",Gf="[object GeneratorFunction]",kn="[object Map]",Cs="[object Number]",en="[object Object]",rs="[object Promise]",As="[object RegExp]",zn="[object Set]",vs="[object String]",Kf="[object Symbol]",qi="[object WeakMap]",xs="[object ArrayBuffer]",qn="[object DataView]",Vf="[object Float32Array]",Jf="[object Float64Array]",Qf="[object Int8Array]",Zf="[object Int16Array]",Xf="[object Int32Array]",eu="[object Uint8Array]",tu="[object Uint8ClampedArray]",nu="[object Uint16Array]",iu="[object Uint32Array]",ru=/[\\^$.*+?()[\]{}|]/g,ou=/^\[object .+?Constructor\]$/,su=/^(?:0|[1-9]\d*)$/,te={};te[Vf]=te[Jf]=te[Qf]=te[Zf]=te[Xf]=te[eu]=te[tu]=te[nu]=te[iu]=!0;te[Yn]=te[zi]=te[xs]=te[gs]=te[qn]=te[bs]=te[ys]=te[ws]=te[kn]=te[Cs]=te[en]=te[As]=te[zn]=te[vs]=te[qi]=!1;var Os=typeof global=="object"&&global&&global.Object===Object&&global,au=typeof self=="object"&&self&&self.Object===Object&&self,lt=Os||au||Function("return this")(),_s=typeof mn=="object"&&mn&&!mn.nodeType&&mn,os=_s&&typeof tn=="object"&&tn&&!tn.nodeType&&tn,lu=os&&os.exports===_s,ss=lu&&Os.process,as=function(){try{return ss&&ss.binding("util")}catch(e){}}(),ls=as&&as.isTypedArray;function cu(e,t){for(var n=-1,i=e?e.length:0;++n<i;)if(t(e[n],n,e))return!0;return!1}function fu(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function uu(e){return function(t){return e(t)}}function pu(e,t){return e==null?void 0:e[t]}function Gi(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function du(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function hu(e,t){return function(n){return e(t(n))}}function mu(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var gu=Array.prototype,bu=Function.prototype,Vn=Object.prototype,Yi=lt["__core-js_shared__"],cs=function(){var e=/[^.]+$/.exec(Yi&&Yi.keys&&Yi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Es=bu.toString,Je=Vn.hasOwnProperty,yn=Vn.toString,yu=RegExp("^"+Es.call(Je).replace(ru,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fs=lt.Symbol,us=lt.Uint8Array,wu=Vn.propertyIsEnumerable,Cu=gu.splice,Au=hu(Object.keys,Object),Ki=nn(lt,"DataView"),gn=nn(lt,"Map"),Vi=nn(lt,"Promise"),Ji=nn(lt,"Set"),Qi=nn(lt,"WeakMap"),bn=nn(Object,"create"),vu=Wt(Ki),xu=Wt(gn),Ou=Wt(Vi),_u=Wt(Ji),Eu=Wt(Qi),ps=fs?fs.prototype:void 0,ki=ps?ps.valueOf:void 0;function Ht(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Su(){this.__data__=bn?bn(null):{}}function Iu(e){return this.has(e)&&delete this.__data__[e]}function ju(e){var t=this.__data__;if(bn){var n=t[e];return n===Xi?void 0:n}return Je.call(t,e)?t[e]:void 0}function Pu(e){var t=this.__data__;return bn?t[e]!==void 0:Je.call(t,e)}function Mu(e,t){var n=this.__data__;return n[e]=bn&&t===void 0?Xi:t,this}Ht.prototype.clear=Su;Ht.prototype.delete=Iu;Ht.prototype.get=ju;Ht.prototype.has=Pu;Ht.prototype.set=Mu;function Qe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Fu(){this.__data__=[]}function Lu(e){var t=this.__data__,n=Jn(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():Cu.call(t,n,1),!0}function Du(e){var t=this.__data__,n=Jn(t,e);return n<0?void 0:t[n][1]}function Nu(e){return Jn(this.__data__,e)>-1}function Tu(e,t){var n=this.__data__,i=Jn(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}Qe.prototype.clear=Fu;Qe.prototype.delete=Lu;Qe.prototype.get=Du;Qe.prototype.has=Nu;Qe.prototype.set=Tu;function Bt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Ru(){this.__data__={hash:new Ht,map:new(gn||Qe),string:new Ht}}function $u(e){return Qn(this,e).delete(e)}function Uu(e){return Qn(this,e).get(e)}function Hu(e){return Qn(this,e).has(e)}function Bu(e,t){return Qn(this,e).set(e,t),this}Bt.prototype.clear=Ru;Bt.prototype.delete=$u;Bt.prototype.get=Uu;Bt.prototype.has=Hu;Bt.prototype.set=Bu;function Gn(e){var t=-1,n=e?e.length:0;for(this.__data__=new Bt;++t<n;)this.add(e[t])}function Wu(e){return this.__data__.set(e,Xi),this}function Yu(e){return this.__data__.has(e)}Gn.prototype.add=Gn.prototype.push=Wu;Gn.prototype.has=Yu;function at(e){this.__data__=new Qe(e)}function ku(){this.__data__=new Qe}function zu(e){return this.__data__.delete(e)}function qu(e){return this.__data__.get(e)}function Gu(e){return this.__data__.has(e)}function Ku(e,t){var n=this.__data__;if(n instanceof Qe){var i=n.__data__;if(!gn||i.length<qf-1)return i.push([e,t]),this;n=this.__data__=new Bt(i)}return n.set(e,t),this}at.prototype.clear=ku;at.prototype.delete=zu;at.prototype.get=qu;at.prototype.has=Gu;at.prototype.set=Ku;function Vu(e,t){var n=Zi(e)||ap(e)?fu(e.length,String):[],i=n.length,r=!!i;for(var s in e)(t||Je.call(e,s))&&!(r&&(s=="length"||ip(s,i)))&&n.push(s);return n}function Jn(e,t){for(var n=e.length;n--;)if(js(e[n][0],t))return n;return-1}function Ju(e){return yn.call(e)}function Ss(e,t,n,i,r){return e===t?!0:e==null||t==null||!er(e)&&!tr(t)?e!==e&&t!==t:Qu(e,t,Ss,n,i,r)}function Qu(e,t,n,i,r,s){var o=Zi(e),a=Zi(t),l=zi,f=zi;o||(l=st(e),l=l==Yn?en:l),a||(f=st(t),f=f==Yn?en:f);var u=l==en&&!Gi(e),c=f==en&&!Gi(t),p=l==f;if(p&&!u)return s||(s=new at),o||fp(e)?Is(e,t,n,i,r,s):tp(e,t,l,n,i,r,s);if(!(r&Kn)){var h=u&&Je.call(e,"__wrapped__"),b=c&&Je.call(t,"__wrapped__");if(h||b){var g=h?e.value():e,m=b?t.value():t;return s||(s=new at),n(g,m,i,r,s)}}return p?(s||(s=new at),np(e,t,n,i,r,s)):!1}function Zu(e){if(!er(e)||op(e))return!1;var t=Ms(e)||Gi(e)?yu:ou;return t.test(Wt(e))}function Xu(e){return tr(e)&&Fs(e.length)&&!!te[yn.call(e)]}function ep(e){if(!sp(e))return Au(e);var t=[];for(var n in Object(e))Je.call(e,n)&&n!="constructor"&&t.push(n);return t}function Is(e,t,n,i,r,s){var o=r&Kn,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var f=s.get(e);if(f&&s.get(t))return f==t;var u=-1,c=!0,p=r&hs?new Gn:void 0;for(s.set(e,t),s.set(t,e);++u<a;){var h=e[u],b=t[u];if(i)var g=o?i(b,h,u,t,e,s):i(h,b,u,e,t,s);if(g!==void 0){if(g)continue;c=!1;break}if(p){if(!cu(t,function(m,x){if(!p.has(x)&&(h===m||n(h,m,i,r,s)))return p.add(x)})){c=!1;break}}else if(!(h===b||n(h,b,i,r,s))){c=!1;break}}return s.delete(e),s.delete(t),c}function tp(e,t,n,i,r,s,o){switch(n){case qn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case xs:return!(e.byteLength!=t.byteLength||!i(new us(e),new us(t)));case gs:case bs:case Cs:return js(+e,+t);case ys:return e.name==t.name&&e.message==t.message;case As:case vs:return e==t+"";case kn:var a=du;case zn:var l=s&Kn;if(a||(a=mu),e.size!=t.size&&!l)return!1;var f=o.get(e);if(f)return f==t;s|=hs,o.set(e,t);var u=Is(a(e),a(t),i,r,s,o);return o.delete(e),u;case Kf:if(ki)return ki.call(e)==ki.call(t)}return!1}function np(e,t,n,i,r,s){var o=r&Kn,a=ds(e),l=a.length,f=ds(t),u=f.length;if(l!=u&&!o)return!1;for(var c=l;c--;){var p=a[c];if(!(o?p in t:Je.call(t,p)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var b=!0;s.set(e,t),s.set(t,e);for(var g=o;++c<l;){p=a[c];var m=e[p],x=t[p];if(i)var O=o?i(x,m,p,t,e,s):i(m,x,p,e,t,s);if(!(O===void 0?m===x||n(m,x,i,r,s):O)){b=!1;break}g||(g=p=="constructor")}if(b&&!g){var $=e.constructor,z=t.constructor;$!=z&&"constructor"in e&&"constructor"in t&&!(typeof $=="function"&&$ instanceof $&&typeof z=="function"&&z instanceof z)&&(b=!1)}return s.delete(e),s.delete(t),b}function Qn(e,t){var n=e.__data__;return rp(t)?n[typeof t=="string"?"string":"hash"]:n.map}function nn(e,t){var n=pu(e,t);return Zu(n)?n:void 0}var st=Ju;(Ki&&st(new Ki(new ArrayBuffer(1)))!=qn||gn&&st(new gn)!=kn||Vi&&st(Vi.resolve())!=rs||Ji&&st(new Ji)!=zn||Qi&&st(new Qi)!=qi)&&(st=function(e){var t=yn.call(e),n=t==en?e.constructor:void 0,i=n?Wt(n):void 0;if(i)switch(i){case vu:return qn;case xu:return kn;case Ou:return rs;case _u:return zn;case Eu:return qi}return t});function ip(e,t){return t=t==null?ms:t,!!t&&(typeof e=="number"||su.test(e))&&e>-1&&e%1==0&&e<t}function rp(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function op(e){return!!cs&&cs in e}function sp(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Vn;return e===n}function Wt(e){if(e!=null){try{return Es.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function js(e,t){return e===t||e!==e&&t!==t}function ap(e){return lp(e)&&Je.call(e,"callee")&&(!wu.call(e,"callee")||yn.call(e)==Yn)}var Zi=Array.isArray;function Ps(e){return e!=null&&Fs(e.length)&&!Ms(e)}function lp(e){return tr(e)&&Ps(e)}function cp(e,t,n){n=typeof n=="function"?n:void 0;var i=n?n(e,t):void 0;return i===void 0?Ss(e,t,n):!!i}function Ms(e){var t=er(e)?yn.call(e):"";return t==ws||t==Gf}function Fs(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ms}function er(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function tr(e){return!!e&&typeof e=="object"}var fp=ls?uu(ls):Xu;function ds(e){return Ps(e)?Vu(e):ep(e)}tn.exports=cp});A();A();A();import{notStrictEqual as Sa,strictEqual as Ia}from"assert";A();A();var na={right:aa,center:la},ia=0,Cn=1,ra=2,An=3,rr=class{constructor(t){var n;this.width=t.width,this.wrap=(n=t.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...t){let n=this.div(...t);n.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let n=t.map(i=>typeof i=="string"?this.colFromString(i):i);return this.rows.push(n),n}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let n=t.split(`
1
+ import{a as Ce,b as Xs,c as ea,d as A,h as ie,q as ta,r as nr}from"../chunk-IFTDQQUZ.mjs";var Ls=Xs((mn,tn)=>{A();var qf=200,Xi="__lodash_hash_undefined__",hs=1,Kn=2,ms=9007199254740991,Yn="[object Arguments]",zi="[object Array]",gs="[object Boolean]",bs="[object Date]",ys="[object Error]",ws="[object Function]",Gf="[object GeneratorFunction]",kn="[object Map]",Cs="[object Number]",en="[object Object]",rs="[object Promise]",As="[object RegExp]",zn="[object Set]",xs="[object String]",Kf="[object Symbol]",qi="[object WeakMap]",vs="[object ArrayBuffer]",qn="[object DataView]",Vf="[object Float32Array]",Jf="[object Float64Array]",Qf="[object Int8Array]",Zf="[object Int16Array]",Xf="[object Int32Array]",eu="[object Uint8Array]",tu="[object Uint8ClampedArray]",nu="[object Uint16Array]",iu="[object Uint32Array]",ru=/[\\^$.*+?()[\]{}|]/g,ou=/^\[object .+?Constructor\]$/,su=/^(?:0|[1-9]\d*)$/,te={};te[Vf]=te[Jf]=te[Qf]=te[Zf]=te[Xf]=te[eu]=te[tu]=te[nu]=te[iu]=!0;te[Yn]=te[zi]=te[vs]=te[gs]=te[qn]=te[bs]=te[ys]=te[ws]=te[kn]=te[Cs]=te[en]=te[As]=te[zn]=te[xs]=te[qi]=!1;var Os=typeof global=="object"&&global&&global.Object===Object&&global,au=typeof self=="object"&&self&&self.Object===Object&&self,lt=Os||au||Function("return this")(),_s=typeof mn=="object"&&mn&&!mn.nodeType&&mn,os=_s&&typeof tn=="object"&&tn&&!tn.nodeType&&tn,lu=os&&os.exports===_s,ss=lu&&Os.process,as=function(){try{return ss&&ss.binding("util")}catch(e){}}(),ls=as&&as.isTypedArray;function cu(e,t){for(var n=-1,i=e?e.length:0;++n<i;)if(t(e[n],n,e))return!0;return!1}function fu(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function uu(e){return function(t){return e(t)}}function pu(e,t){return e==null?void 0:e[t]}function Gi(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function du(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function hu(e,t){return function(n){return e(t(n))}}function mu(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var gu=Array.prototype,bu=Function.prototype,Vn=Object.prototype,Yi=lt["__core-js_shared__"],cs=function(){var e=/[^.]+$/.exec(Yi&&Yi.keys&&Yi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Es=bu.toString,Je=Vn.hasOwnProperty,yn=Vn.toString,yu=RegExp("^"+Es.call(Je).replace(ru,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fs=lt.Symbol,us=lt.Uint8Array,wu=Vn.propertyIsEnumerable,Cu=gu.splice,Au=hu(Object.keys,Object),Ki=nn(lt,"DataView"),gn=nn(lt,"Map"),Vi=nn(lt,"Promise"),Ji=nn(lt,"Set"),Qi=nn(lt,"WeakMap"),bn=nn(Object,"create"),xu=Wt(Ki),vu=Wt(gn),Ou=Wt(Vi),_u=Wt(Ji),Eu=Wt(Qi),ps=fs?fs.prototype:void 0,ki=ps?ps.valueOf:void 0;function Ht(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Su(){this.__data__=bn?bn(null):{}}function Iu(e){return this.has(e)&&delete this.__data__[e]}function ju(e){var t=this.__data__;if(bn){var n=t[e];return n===Xi?void 0:n}return Je.call(t,e)?t[e]:void 0}function Pu(e){var t=this.__data__;return bn?t[e]!==void 0:Je.call(t,e)}function Mu(e,t){var n=this.__data__;return n[e]=bn&&t===void 0?Xi:t,this}Ht.prototype.clear=Su;Ht.prototype.delete=Iu;Ht.prototype.get=ju;Ht.prototype.has=Pu;Ht.prototype.set=Mu;function Qe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Fu(){this.__data__=[]}function Lu(e){var t=this.__data__,n=Jn(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():Cu.call(t,n,1),!0}function Du(e){var t=this.__data__,n=Jn(t,e);return n<0?void 0:t[n][1]}function Nu(e){return Jn(this.__data__,e)>-1}function Tu(e,t){var n=this.__data__,i=Jn(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}Qe.prototype.clear=Fu;Qe.prototype.delete=Lu;Qe.prototype.get=Du;Qe.prototype.has=Nu;Qe.prototype.set=Tu;function Bt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Ru(){this.__data__={hash:new Ht,map:new(gn||Qe),string:new Ht}}function $u(e){return Qn(this,e).delete(e)}function Uu(e){return Qn(this,e).get(e)}function Hu(e){return Qn(this,e).has(e)}function Bu(e,t){return Qn(this,e).set(e,t),this}Bt.prototype.clear=Ru;Bt.prototype.delete=$u;Bt.prototype.get=Uu;Bt.prototype.has=Hu;Bt.prototype.set=Bu;function Gn(e){var t=-1,n=e?e.length:0;for(this.__data__=new Bt;++t<n;)this.add(e[t])}function Wu(e){return this.__data__.set(e,Xi),this}function Yu(e){return this.__data__.has(e)}Gn.prototype.add=Gn.prototype.push=Wu;Gn.prototype.has=Yu;function at(e){this.__data__=new Qe(e)}function ku(){this.__data__=new Qe}function zu(e){return this.__data__.delete(e)}function qu(e){return this.__data__.get(e)}function Gu(e){return this.__data__.has(e)}function Ku(e,t){var n=this.__data__;if(n instanceof Qe){var i=n.__data__;if(!gn||i.length<qf-1)return i.push([e,t]),this;n=this.__data__=new Bt(i)}return n.set(e,t),this}at.prototype.clear=ku;at.prototype.delete=zu;at.prototype.get=qu;at.prototype.has=Gu;at.prototype.set=Ku;function Vu(e,t){var n=Zi(e)||ap(e)?fu(e.length,String):[],i=n.length,r=!!i;for(var s in e)(t||Je.call(e,s))&&!(r&&(s=="length"||ip(s,i)))&&n.push(s);return n}function Jn(e,t){for(var n=e.length;n--;)if(js(e[n][0],t))return n;return-1}function Ju(e){return yn.call(e)}function Ss(e,t,n,i,r){return e===t?!0:e==null||t==null||!er(e)&&!tr(t)?e!==e&&t!==t:Qu(e,t,Ss,n,i,r)}function Qu(e,t,n,i,r,s){var o=Zi(e),a=Zi(t),l=zi,f=zi;o||(l=st(e),l=l==Yn?en:l),a||(f=st(t),f=f==Yn?en:f);var u=l==en&&!Gi(e),c=f==en&&!Gi(t),p=l==f;if(p&&!u)return s||(s=new at),o||fp(e)?Is(e,t,n,i,r,s):tp(e,t,l,n,i,r,s);if(!(r&Kn)){var h=u&&Je.call(e,"__wrapped__"),b=c&&Je.call(t,"__wrapped__");if(h||b){var g=h?e.value():e,m=b?t.value():t;return s||(s=new at),n(g,m,i,r,s)}}return p?(s||(s=new at),np(e,t,n,i,r,s)):!1}function Zu(e){if(!er(e)||op(e))return!1;var t=Ms(e)||Gi(e)?yu:ou;return t.test(Wt(e))}function Xu(e){return tr(e)&&Fs(e.length)&&!!te[yn.call(e)]}function ep(e){if(!sp(e))return Au(e);var t=[];for(var n in Object(e))Je.call(e,n)&&n!="constructor"&&t.push(n);return t}function Is(e,t,n,i,r,s){var o=r&Kn,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var f=s.get(e);if(f&&s.get(t))return f==t;var u=-1,c=!0,p=r&hs?new Gn:void 0;for(s.set(e,t),s.set(t,e);++u<a;){var h=e[u],b=t[u];if(i)var g=o?i(b,h,u,t,e,s):i(h,b,u,e,t,s);if(g!==void 0){if(g)continue;c=!1;break}if(p){if(!cu(t,function(m,v){if(!p.has(v)&&(h===m||n(h,m,i,r,s)))return p.add(v)})){c=!1;break}}else if(!(h===b||n(h,b,i,r,s))){c=!1;break}}return s.delete(e),s.delete(t),c}function tp(e,t,n,i,r,s,o){switch(n){case qn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case vs:return!(e.byteLength!=t.byteLength||!i(new us(e),new us(t)));case gs:case bs:case Cs:return js(+e,+t);case ys:return e.name==t.name&&e.message==t.message;case As:case xs:return e==t+"";case kn:var a=du;case zn:var l=s&Kn;if(a||(a=mu),e.size!=t.size&&!l)return!1;var f=o.get(e);if(f)return f==t;s|=hs,o.set(e,t);var u=Is(a(e),a(t),i,r,s,o);return o.delete(e),u;case Kf:if(ki)return ki.call(e)==ki.call(t)}return!1}function np(e,t,n,i,r,s){var o=r&Kn,a=ds(e),l=a.length,f=ds(t),u=f.length;if(l!=u&&!o)return!1;for(var c=l;c--;){var p=a[c];if(!(o?p in t:Je.call(t,p)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var b=!0;s.set(e,t),s.set(t,e);for(var g=o;++c<l;){p=a[c];var m=e[p],v=t[p];if(i)var O=o?i(v,m,p,t,e,s):i(m,v,p,e,t,s);if(!(O===void 0?m===v||n(m,v,i,r,s):O)){b=!1;break}g||(g=p=="constructor")}if(b&&!g){var U=e.constructor,B=t.constructor;U!=B&&"constructor"in e&&"constructor"in t&&!(typeof U=="function"&&U instanceof U&&typeof B=="function"&&B instanceof B)&&(b=!1)}return s.delete(e),s.delete(t),b}function Qn(e,t){var n=e.__data__;return rp(t)?n[typeof t=="string"?"string":"hash"]:n.map}function nn(e,t){var n=pu(e,t);return Zu(n)?n:void 0}var st=Ju;(Ki&&st(new Ki(new ArrayBuffer(1)))!=qn||gn&&st(new gn)!=kn||Vi&&st(Vi.resolve())!=rs||Ji&&st(new Ji)!=zn||Qi&&st(new Qi)!=qi)&&(st=function(e){var t=yn.call(e),n=t==en?e.constructor:void 0,i=n?Wt(n):void 0;if(i)switch(i){case xu:return qn;case vu:return kn;case Ou:return rs;case _u:return zn;case Eu:return qi}return t});function ip(e,t){return t=t==null?ms:t,!!t&&(typeof e=="number"||su.test(e))&&e>-1&&e%1==0&&e<t}function rp(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function op(e){return!!cs&&cs in e}function sp(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Vn;return e===n}function Wt(e){if(e!=null){try{return Es.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function js(e,t){return e===t||e!==e&&t!==t}function ap(e){return lp(e)&&Je.call(e,"callee")&&(!wu.call(e,"callee")||yn.call(e)==Yn)}var Zi=Array.isArray;function Ps(e){return e!=null&&Fs(e.length)&&!Ms(e)}function lp(e){return tr(e)&&Ps(e)}function cp(e,t,n){n=typeof n=="function"?n:void 0;var i=n?n(e,t):void 0;return i===void 0?Ss(e,t,n):!!i}function Ms(e){var t=er(e)?yn.call(e):"";return t==ws||t==Gf}function Fs(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ms}function er(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function tr(e){return!!e&&typeof e=="object"}var fp=ls?uu(ls):Xu;function ds(e){return Ps(e)?Vu(e):ep(e)}tn.exports=cp});A();A();A();import{notStrictEqual as Sa,strictEqual as Ia}from"assert";A();A();var na={right:aa,center:la},ia=0,Cn=1,ra=2,An=3,rr=class{constructor(t){var n;this.width=t.width,this.wrap=(n=t.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...t){let n=this.div(...t);n.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let n=t.map(i=>typeof i=="string"?this.colFromString(i):i);return this.rows.push(n),n}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let n=t.split(`
2
2
  `).map(r=>r.split(" ")),i=0;return n.forEach(r=>{r.length>1&&Se.stringWidth(r[0])>i&&(i=Math.min(Math.floor(this.width*.5),Se.stringWidth(r[0])))}),n.forEach(r=>{this.div(...r.map((s,o)=>({text:s.trim(),padding:this.measurePadding(s),width:o===0&&r.length>1?i:void 0})))}),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){let n=Se.stripAnsi(t);return[0,n.match(/\s*$/)[0].length,0,n.match(/^\s*/)[0].length]}toString(){let t=[];return this.rows.forEach(n=>{this.rowToString(n,t)}),t.filter(n=>!n.hidden).map(n=>n.text).join(`
3
3
  `)}rowToString(t,n){return this.rasterize(t).forEach((i,r)=>{let s="";i.forEach((o,a)=>{let{width:l}=t[a],f=this.negatePadding(t[a]),u=o;f>Se.stringWidth(o)&&(u+=" ".repeat(f-Se.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap&&(u=na[t[a].align](u,f),Se.stringWidth(u)<f&&(u+=" ".repeat((l||0)-Se.stringWidth(u)-1)));let c=t[a].padding||[0,0,0,0];c[An]&&(s+=" ".repeat(c[An])),s+=ir(t[a],u,"| "),s+=u,s+=ir(t[a],u," |"),c[Cn]&&(s+=" ".repeat(c[Cn])),r===0&&n.length>0&&(s=this.renderInline(s,n[n.length-1]))}),n.push({text:s.replace(/ +$/,""),span:t.span})}),n}renderInline(t,n){let i=t.match(/^ */),r=i?i[0].length:0,s=n.text,o=Se.stringWidth(s.trimRight());return n.span?this.wrap?r<o?t:(n.hidden=!0,s.trimRight()+" ".repeat(r-o)+t.trimLeft()):(n.hidden=!0,s+t):t}rasterize(t){let n=[],i=this.columnWidths(t),r;return t.forEach((s,o)=>{s.width=i[o],this.wrap?r=Se.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
4
4
  `):r=s.text.split(`
5
5
  `),s.border&&(r.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),r.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(r.unshift(...new Array(s.padding[ia]||0).fill("")),r.push(...new Array(s.padding[ra]||0).fill(""))),r.forEach((a,l)=>{n[l]||n.push([]);let f=n[l];for(let u=0;u<o;u++)f[u]===void 0&&f.push("");f.push(a)})}),n}negatePadding(t){let n=t.width||0;return t.padding&&(n-=(t.padding[An]||0)+(t.padding[Cn]||0)),t.border&&(n-=4),n}columnWidths(t){if(!this.wrap)return t.map(o=>o.width||Se.stringWidth(o.text));let n=t.length,i=this.width,r=t.map(o=>{if(o.width)return n--,i-=o.width,o.width}),s=n?Math.floor(i/n):0;return r.map((o,a)=>o===void 0?Math.max(s,oa(t[a])):o)}};function ir(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function oa(e){let t=e.padding||[],n=1+(t[An]||0)+(t[Cn]||0);return e.border?n+4:n}function sa(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function aa(e,t){e=e.trim();let n=Se.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function la(e,t){e=e.trim();let n=Se.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var Se;function or(e,t){return Se=t,new rr({width:(e==null?void 0:e.width)||sa(),wrap:e==null?void 0:e.wrap})}A();var sr=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function oi(e){return e.replace(sr,"")}function ar(e,t){let[n,i]=e.match(sr)||["",""];e=oi(e);let r="";for(let s=0;s<e.length;s++)s!==0&&s%t===0&&(r+=`
6
- `),r+=e.charAt(s);return n&&i&&(r=`${n}${r}${i}`),r}function si(e){return or(e,{stringWidth:t=>[...t].length,stripAnsi:oi,wrap:ar})}A();import{dirname as lr,resolve as cr}from"path";import{readdirSync as ca,statSync as fa}from"fs";function fr(e,t){let n=cr(".",e),i;for(fa(n).isDirectory()||(n=lr(n));;){if(i=t(n,ca(n)),i)return cr(n,i);if(n=lr(i=n),i===n)break}}import{inspect as ja}from"util";import{readFileSync as Pa}from"fs";import{fileURLToPath as Ma}from"url";A();import{format as da}from"util";import{normalize as ha,resolve as ma}from"path";A();function _t(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let n="",i=!1,r=e.match(/^-+/);for(let s=r?r[0].length:0;s<e.length;s++){let o=e.charAt(s);i&&(i=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?i=!0:o!=="-"&&o!=="_"&&(n+=o)}return n}}function vn(e,t){let n=e.toLowerCase();t=t||"-";let i="";for(let r=0;r<e.length;r++){let s=n.charAt(r),o=e.charAt(r);s!==o&&r>0?i+=`${t}${n.charAt(r)}`:i+=o}return i}function xn(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}A();A();function ur(e){if(Array.isArray(e))return e.map(o=>typeof o!="string"?o+"":o);e=e.trim();let t=0,n=null,i=null,r=null,s=[];for(let o=0;o<e.length;o++){if(n=i,i=e.charAt(o),i===" "&&!r){n!==" "&&t++;continue}i===r?r=null:(i==="'"||i==='"')&&!r&&(r=i),s[t]||(s[t]=""),s[t]+=i}return s}A();var Me;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(Me||(Me={}));var Ge,li=class{constructor(t){Ge=t}parse(t,n){let i=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},n),r=ur(t),s=typeof t=="string",o=ua(Object.assign(Object.create(null),i.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},i.configuration),l=Object.assign(Object.create(null),i.default),f=i.configObjects||[],u=i.envPrefix,c=a["populate--"],p=c?"--":"_",h=Object.create(null),b=Object.create(null),g=i.__||Ge.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},x=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,O=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(i.array||[]).filter(Boolean).forEach(function(y){let C=typeof y=="object"?y.key:y,_=Object.keys(y).map(function(v){return{boolean:"bools",string:"strings",number:"numbers"}[v]}).filter(Boolean).pop();_&&(m[_][C]=!0),m.arrays[C]=!0,m.keys.push(C)}),[].concat(i.boolean||[]).filter(Boolean).forEach(function(y){m.bools[y]=!0,m.keys.push(y)}),[].concat(i.string||[]).filter(Boolean).forEach(function(y){m.strings[y]=!0,m.keys.push(y)}),[].concat(i.number||[]).filter(Boolean).forEach(function(y){m.numbers[y]=!0,m.keys.push(y)}),[].concat(i.count||[]).filter(Boolean).forEach(function(y){m.counts[y]=!0,m.keys.push(y)}),[].concat(i.normalize||[]).filter(Boolean).forEach(function(y){m.normalize[y]=!0,m.keys.push(y)}),typeof i.narg=="object"&&Object.entries(i.narg).forEach(([y,C])=>{typeof C=="number"&&(m.nargs[y]=C,m.keys.push(y))}),typeof i.coerce=="object"&&Object.entries(i.coerce).forEach(([y,C])=>{typeof C=="function"&&(m.coercions[y]=C,m.keys.push(y))}),typeof i.config!="undefined"&&(Array.isArray(i.config)||typeof i.config=="string"?[].concat(i.config).filter(Boolean).forEach(function(y){m.configs[y]=!0}):typeof i.config=="object"&&Object.entries(i.config).forEach(([y,C])=>{(typeof C=="boolean"||typeof C=="function")&&(m.configs[y]=C)})),Ot(i.key,o,i.default,m.arrays),Object.keys(l).forEach(function(y){(m.aliases[y]||[]).forEach(function(C){l[C]=l[y]})});let $=null;wn();let z=[],V=Object.assign(Object.create(null),{_:[]}),Y={};for(let y=0;y<r.length;y++){let C=r[y],_=C.replace(/^-{3,}/,"---"),v,w,M,S,T,be;if(C!=="--"&&le(C))N(C);else if(_.match(/---+(=|$)/)){N(C);continue}else if(C.match(/^--.+=/)||!a["short-option-groups"]&&C.match(/^-.+=/))S=C.match(/^--?([^=]+)=([\s\S]*)$/),S!==null&&Array.isArray(S)&&S.length>=3&&(B(S[1],m.arrays)?y=Z(y,S[1],r,S[2]):B(S[1],m.nargs)!==!1?y=K(y,S[1],r,S[2]):k(S[1],S[2],!0));else if(C.match(O)&&a["boolean-negation"])S=C.match(O),S!==null&&Array.isArray(S)&&S.length>=2&&(w=S[1],k(w,B(w,m.arrays)?[!1]:!1));else if(C.match(/^--.+/)||!a["short-option-groups"]&&C.match(/^-[^-]+/))S=C.match(/^--?(.+)/),S!==null&&Array.isArray(S)&&S.length>=2&&(w=S[1],B(w,m.arrays)?y=Z(y,w,r):B(w,m.nargs)!==!1?y=K(y,w,r):(T=r[y+1],T!==void 0&&(!T.match(/^-/)||T.match(x))&&!B(w,m.bools)&&!B(w,m.counts)||/^(true|false)$/.test(T)?(k(w,T),y++):k(w,ce(w))));else if(C.match(/^-.\..+=/))S=C.match(/^-([^=]+)=([\s\S]*)$/),S!==null&&Array.isArray(S)&&S.length>=3&&k(S[1],S[2]);else if(C.match(/^-.\..+/)&&!C.match(x))T=r[y+1],S=C.match(/^-(.\..+)/),S!==null&&Array.isArray(S)&&S.length>=2&&(w=S[1],T!==void 0&&!T.match(/^-/)&&!B(w,m.bools)&&!B(w,m.counts)?(k(w,T),y++):k(w,ce(w)));else if(C.match(/^-[^-]+/)&&!C.match(x)){M=C.slice(1,-1).split(""),v=!1;for(let xe=0;xe<M.length;xe++){if(T=C.slice(xe+2),M[xe+1]&&M[xe+1]==="="){be=C.slice(xe+3),w=M[xe],B(w,m.arrays)?y=Z(y,w,r,be):B(w,m.nargs)!==!1?y=K(y,w,r,be):k(w,be),v=!0;break}if(T==="-"){k(M[xe],T);continue}if(/[A-Za-z]/.test(M[xe])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(T)&&B(T,m.bools)===!1){k(M[xe],T),v=!0;break}if(M[xe+1]&&M[xe+1].match(/\W/)){k(M[xe],T),v=!0;break}else k(M[xe],ce(M[xe]))}w=C.slice(-1)[0],!v&&w!=="-"&&(B(w,m.arrays)?y=Z(y,w,r):B(w,m.nargs)!==!1?y=K(y,w,r):(T=r[y+1],T!==void 0&&(!/^(-|--)[^-]/.test(T)||T.match(x))&&!B(w,m.bools)&&!B(w,m.counts)||/^(true|false)$/.test(T)?(k(w,T),y++):k(w,ce(w))))}else if(C.match(/^-[0-9]$/)&&C.match(x)&&B(C.slice(1),m.bools))w=C.slice(1),k(w,ce(w));else if(C==="--"){z=r.slice(y+1);break}else if(a["halt-at-non-option"]){z=r.slice(y);break}else N(C)}Q(V,!0),Q(V,!1),q(V),ue(),ae(V,m.aliases,l,!0),me(V),a["set-placeholder-key"]&&xt(V),Object.keys(m.counts).forEach(function(y){ze(V,y.split("."))||k(y,0)}),c&&z.length&&(V[p]=[]),z.forEach(function(y){V[p].push(y)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(V).filter(y=>y!=="--"&&y.includes("-")).forEach(y=>{delete V[y]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(y=>o[y])).forEach(y=>{a["camel-case-expansion"]&&y.includes("-")&&delete V[y.split(".").map(C=>_t(C)).join(".")],delete V[y]});function N(y){let C=U("_",y);(typeof C=="string"||typeof C=="number")&&V._.push(C)}function K(y,C,_,v){let w,M=B(C,m.nargs);if(M=typeof M!="number"||isNaN(M)?1:M,M===0)return Re(v)||($=Error(g("Argument unexpected for: %s",C))),k(C,ce(C)),y;let S=Re(v)?0:1;if(a["nargs-eats-options"])_.length-(y+1)+S<M&&($=Error(g("Not enough arguments following: %s",C))),S=M;else{for(w=y+1;w<_.length&&(!_[w].match(/^-[^0-9]/)||_[w].match(x)||le(_[w]));w++)S++;S<M&&($=Error(g("Not enough arguments following: %s",C)))}let T=Math.min(S,M);for(!Re(v)&&T>0&&(k(C,v),T--),w=y+1;w<T+y+1;w++)k(C,_[w]);return y+T}function Z(y,C,_,v){let w=[],M=v||_[y+1],S=B(C,m.nargs);if(B(C,m.bools)&&!/^(true|false)$/.test(M))w.push(!0);else if(Re(M)||Re(v)&&/^-/.test(M)&&!x.test(M)&&!le(M)){if(l[C]!==void 0){let T=l[C];w=Array.isArray(T)?T:[T]}}else{Re(v)||w.push(E(C,v,!0));for(let T=y+1;T<_.length&&!(!a["greedy-arrays"]&&w.length>0||S&&typeof S=="number"&&w.length>=S||(M=_[T],/^-/.test(M)&&!x.test(M)&&!le(M)));T++)y=T,w.push(E(C,M,s))}return typeof S=="number"&&(S&&w.length<S||isNaN(S)&&w.length===0)&&($=Error(g("Not enough arguments following: %s",C))),k(C,w),y}function k(y,C,_=s){if(/-/.test(y)&&a["camel-case-expansion"]){let M=y.split(".").map(function(S){return _t(S)}).join(".");I(y,M)}let v=E(y,C,_),w=y.split(".");qe(V,w,v),m.aliases[y]&&m.aliases[y].forEach(function(M){let S=M.split(".");qe(V,S,v)}),w.length>1&&a["dot-notation"]&&(m.aliases[w[0]]||[]).forEach(function(M){let S=M.split("."),T=[].concat(w);T.shift(),S=S.concat(T),(m.aliases[y]||[]).includes(S.join("."))||qe(V,S,v)}),B(y,m.normalize)&&!B(y,m.arrays)&&[y].concat(m.aliases[y]||[]).forEach(function(S){Object.defineProperty(Y,S,{enumerable:!0,get(){return C},set(T){C=typeof T=="string"?Ge.normalize(T):T}})})}function I(y,C){m.aliases[y]&&m.aliases[y].length||(m.aliases[y]=[C],h[C]=!0),m.aliases[C]&&m.aliases[C].length||I(C,y)}function E(y,C,_){_&&(C=pa(C)),(B(y,m.bools)||B(y,m.counts))&&typeof C=="string"&&(C=C==="true");let v=Array.isArray(C)?C.map(function(w){return U(y,w)}):U(y,C);return B(y,m.counts)&&(Re(v)||typeof v=="boolean")&&(v=ai()),B(y,m.normalize)&&B(y,m.arrays)&&(Array.isArray(C)?v=C.map(w=>Ge.normalize(w)):v=Ge.normalize(C)),v}function U(y,C){return!a["parse-positional-numbers"]&&y==="_"||!B(y,m.strings)&&!B(y,m.bools)&&!Array.isArray(C)&&(xn(C)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${C}`)))||!Re(C)&&B(y,m.numbers))&&(C=Number(C)),C}function q(y){let C=Object.create(null);ae(C,m.aliases,l),Object.keys(m.configs).forEach(function(_){let v=y[_]||C[_];if(v)try{let w=null,M=Ge.resolve(Ge.cwd(),v),S=m.configs[_];if(typeof S=="function"){try{w=S(M)}catch(T){w=T}if(w instanceof Error){$=w;return}}else w=Ge.require(M);X(w)}catch(w){w.name==="PermissionDenied"?$=w:y[_]&&($=Error(g("Invalid JSON config file: %s",v)))}})}function X(y,C){Object.keys(y).forEach(function(_){let v=y[_],w=C?C+"."+_:_;typeof v=="object"&&v!==null&&!Array.isArray(v)&&a["dot-notation"]?X(v,w):(!ze(V,w.split("."))||B(w,m.arrays)&&a["combine-arrays"])&&k(w,v)})}function ue(){typeof f!="undefined"&&f.forEach(function(y){X(y)})}function Q(y,C){if(typeof u=="undefined")return;let _=typeof u=="string"?u:"",v=Ge.env();Object.keys(v).forEach(function(w){if(_===""||w.lastIndexOf(_,0)===0){let M=w.split("__").map(function(S,T){return T===0&&(S=S.substring(_.length)),_t(S)});(C&&m.configs[M.join(".")]||!C)&&!ze(y,M)&&k(M.join("."),v[w])}})}function me(y){let C,_=new Set;Object.keys(y).forEach(function(v){if(!_.has(v)&&(C=B(v,m.coercions),typeof C=="function"))try{let w=U(v,C(y[v]));[].concat(m.aliases[v]||[],v).forEach(M=>{_.add(M),y[M]=w})}catch(w){$=w}})}function xt(y){return m.keys.forEach(C=>{~C.indexOf(".")||typeof y[C]=="undefined"&&(y[C]=void 0)}),y}function ae(y,C,_,v=!1){Object.keys(_).forEach(function(w){ze(y,w.split("."))||(qe(y,w.split("."),_[w]),v&&(b[w]=!0),(C[w]||[]).forEach(function(M){ze(y,M.split("."))||qe(y,M.split("."),_[w])}))})}function ze(y,C){let _=y;a["dot-notation"]||(C=[C.join(".")]),C.slice(0,-1).forEach(function(w){_=_[w]||{}});let v=C[C.length-1];return typeof _!="object"?!1:v in _}function qe(y,C,_){let v=y;a["dot-notation"]||(C=[C.join(".")]),C.slice(0,-1).forEach(function(be){be=pr(be),typeof v=="object"&&v[be]===void 0&&(v[be]={}),typeof v[be]!="object"||Array.isArray(v[be])?(Array.isArray(v[be])?v[be].push({}):v[be]=[v[be],{}],v=v[be][v[be].length-1]):v=v[be]});let w=pr(C[C.length-1]),M=B(C.join("."),m.arrays),S=Array.isArray(_),T=a["duplicate-arguments-array"];!T&&B(w,m.nargs)&&(T=!0,(!Re(v[w])&&m.nargs[w]===1||Array.isArray(v[w])&&v[w].length===m.nargs[w])&&(v[w]=void 0)),_===ai()?v[w]=ai(v[w]):Array.isArray(v[w])?T&&M&&S?v[w]=a["flatten-duplicate-arrays"]?v[w].concat(_):(Array.isArray(v[w][0])?v[w]:[v[w]]).concat([_]):!T&&Boolean(M)===Boolean(S)?v[w]=_:v[w]=v[w].concat([_]):v[w]===void 0&&M?v[w]=S?_:[_]:T&&!(v[w]===void 0||B(w,m.counts)||B(w,m.bools))?v[w]=[v[w],_]:v[w]=_}function Ot(...y){y.forEach(function(C){Object.keys(C||{}).forEach(function(_){m.aliases[_]||(m.aliases[_]=[].concat(o[_]||[]),m.aliases[_].concat(_).forEach(function(v){if(/-/.test(v)&&a["camel-case-expansion"]){let w=_t(v);w!==_&&m.aliases[_].indexOf(w)===-1&&(m.aliases[_].push(w),h[w]=!0)}}),m.aliases[_].concat(_).forEach(function(v){if(v.length>1&&/[A-Z]/.test(v)&&a["camel-case-expansion"]){let w=vn(v,"-");w!==_&&m.aliases[_].indexOf(w)===-1&&(m.aliases[_].push(w),h[w]=!0)}}),m.aliases[_].forEach(function(v){m.aliases[v]=[_].concat(m.aliases[_].filter(function(w){return v!==w}))}))})})}function B(y,C){let _=[].concat(m.aliases[y]||[],y),v=Object.keys(C),w=_.find(M=>v.includes(M));return w?C[w]:!1}function ri(y){let C=Object.keys(m);return[].concat(C.map(v=>m[v])).some(function(v){return Array.isArray(v)?v.includes(y):v[y]})}function H(y,...C){return[].concat(...C).some(function(v){let w=y.match(v);return w&&ri(w[1])})}function ne(y){if(y.match(x)||!y.match(/^-[^-]+/))return!1;let C=!0,_,v=y.slice(1).split("");for(let w=0;w<v.length;w++){if(_=y.slice(w+2),!ri(v[w])){C=!1;break}if(v[w+1]&&v[w+1]==="="||_==="-"||/[A-Za-z]/.test(v[w])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(_)||v[w+1]&&v[w+1].match(/\W/))break}return C}function le(y){return a["unknown-options-as-args"]&&J(y)}function J(y){return y=y.replace(/^-{3,}/,"--"),y.match(x)||ne(y)?!1:!H(y,/^-+([^=]+?)=[\s\S]*$/,O,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function ce(y){return!B(y,m.bools)&&!B(y,m.counts)&&`${y}`in l?l[y]:pe(Te(y))}function pe(y){return{[Me.BOOLEAN]:!0,[Me.STRING]:"",[Me.NUMBER]:void 0,[Me.ARRAY]:[]}[y]}function Te(y){let C=Me.BOOLEAN;return B(y,m.strings)?C=Me.STRING:B(y,m.numbers)?C=Me.NUMBER:B(y,m.bools)?C=Me.BOOLEAN:B(y,m.arrays)&&(C=Me.ARRAY),C}function Re(y){return y===void 0}function wn(){Object.keys(m.counts).find(y=>B(y,m.arrays)?($=Error(g("Invalid configuration: %s, opts.count excludes opts.array.",y)),!0):B(y,m.nargs)?($=Error(g("Invalid configuration: %s, opts.count excludes opts.narg.",y)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(Y,V),configuration:a,defaulted:Object.assign({},b),error:$,newAliases:Object.assign({},h)}}};function ua(e){let t=[],n=Object.create(null),i=!0;for(Object.keys(e).forEach(function(r){t.push([].concat(e[r],r))});i;){i=!1;for(let r=0;r<t.length;r++)for(let s=r+1;s<t.length;s++)if(t[r].filter(function(a){return t[s].indexOf(a)!==-1}).length){t[r]=t[r].concat(t[s]),t.splice(s,1),i=!0;break}}return t.forEach(function(r){r=r.filter(function(o,a,l){return l.indexOf(o)===a});let s=r.pop();s!==void 0&&typeof s=="string"&&(n[s]=r)}),n}function ai(e){return e!==void 0?e+1:1}function pr(e){return e==="__proto__"?"___proto___":e}function pa(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}import{readFileSync as ga}from"fs";var dr=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1])<dr)throw Error(`yargs parser supports a minimum Node.js version of ${dr}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var ba=process?process.env:{},hr=new li({cwd:process.cwd,env:()=>ba,format:da,normalize:ha,resolve:ma,require:e=>{if(typeof Ce!="undefined")return Ce(e);if(e.match(/\.json$/))return JSON.parse(ga(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),sn=function(t,n){return hr.parse(t.slice(),n).argv};sn.detailed=function(e,t){return hr.parse(e.slice(),t)};sn.camelCase=_t;sn.decamelize=vn;sn.looksLikeNumber=xn;var mr=sn;import{basename as Fa,dirname as La,extname as Da,relative as Na,resolve as Ar}from"path";A();function ya(){return wa()?0:1}function wa(){return Ca()&&!process.defaultApp}function Ca(){return!!process.versions.electron}function gr(){return process.argv[ya()]}A();var ee=class extends Error{constructor(t){super(t||"yargs error");this.name="YError",Error.captureStackTrace(this,ee)}};A();A();import{readFileSync as Aa,statSync as va,writeFile as xa}from"fs";import{format as Oa}from"util";import{resolve as _a}from"path";var br={fs:{readFileSync:Aa,writeFile:xa},format:Oa,resolve:_a,exists:e=>{try{return va(e).isFile()}catch(t){return!1}}};A();var $e,yr=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=t.shift(),i=function(){};return typeof t[t.length-1]=="function"&&(i=t.pop()),i=i||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i(),$e.format.apply($e.format,[this.cache[this.locale][n]||n].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),n=t.shift(),i=t.shift(),r=t.shift(),s=function(){};typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let o=r===1?n:i;this.cache[this.locale][n]&&(o=this.cache[this.locale][n][r===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:i},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[o];return~o.indexOf("%d")&&a.push(r),$e.format.apply($e.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this.cache[this.locale][n]=t[n])}_taggedLiteral(t,...n){let i="";return t.forEach(function(r,s){let o=n[s+1];i+=r,typeof o!="undefined"&&(i+="%s")}),this.__.apply(this,[i].concat([].slice.call(n,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,n=this.writeQueue[0],i=n.directory,r=n.locale,s=n.cb,o=this._resolveLocaleFile(i,r),a=JSON.stringify(this.cache[r],null,2);$e.fs.writeFile(o,a,"utf-8",function(l){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(l)})}_readLocaleFile(){let t={},n=this._resolveLocaleFile(this.directory,this.locale);try{$e.fs.readFileSync&&(t=JSON.parse($e.fs.readFileSync(n,"utf-8")))}catch(i){if(i instanceof SyntaxError&&(i.message="syntax error in "+n),i.code==="ENOENT")t={};else throw i}this.cache[this.locale]=t}_resolveLocaleFile(t,n){let i=$e.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(i)&&~n.lastIndexOf("_")){let r=$e.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(r)&&(i=r)}return i}_fileExistsSync(t){return $e.exists(t)}};function wr(e,t){$e=t;let n=new yr(e);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var Ea=e=>wr(e,br),Cr=Ea;var $a={},Ta="require is not supported by ESM",vr="loading a directory of commands is not supported yet for ESM",On;try{On=Ma($a.url)}catch(e){On=process.cwd()}var Ra=On.split("node_modules")[0],xr={assert:{notStrictEqual:Sa,strictEqual:Ia},cliui:si,findUp:fr,getEnv:e=>process.env[e],inspect:ja,getCallerFile:()=>{throw new ee(vr)},getProcessArgvBin:gr,mainFilename:Ra||process.cwd(),Parser:mr,path:{basename:Fa,dirname:La,extname:Da,relative:Na,resolve:Ar},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns!="undefined"?process.stdout.columns:null},readFileSync:Pa,require:()=>{throw new ee(Ta)},requireDirectory:()=>{throw new ee(vr)},stringWidth:e=>[...e].length,y18n:Cr({directory:Ar(On,"../../../locales"),updateFiles:!1})};A();A();A();function Oe(e,t,n,i){n.assert.notStrictEqual(e,t,i)}function ci(e,t){t.assert.strictEqual(typeof e,"string")}function Yt(e){return Object.keys(e)}A();function re(e){return!!e&&!!e.then&&typeof e.then=="function"}A();A();A();function Ze(e){let n=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),i=/\.*[\][<>]/g,r=n.shift();if(!r)throw new Error(`No command found in: ${e}`);let s={cmd:r.replace(i,""),demanded:[],optional:[]};return n.forEach((o,a)=>{let l=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===n.length-1&&(l=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(i,"").split("|"),variadic:l}):s.demanded.push({cmd:o.replace(i,"").split("|"),variadic:l})}),s}var Ua=["first","second","third","fourth","fifth","sixth"];function j(e,t,n){function i(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[Ze(`cmd ${e}`),t,n]}try{let r=0,[s,o,a]=i(),l=[].slice.call(o);for(;l.length&&l[l.length-1]===void 0;)l.pop();let f=a||l.length;if(f<s.demanded.length)throw new ee(`Not enough arguments provided. Expected ${s.demanded.length} but received ${l.length}.`);let u=s.demanded.length+s.optional.length;if(f>u)throw new ee(`Too many arguments provided. Expected max ${u} but received ${f}.`);s.demanded.forEach(c=>{let p=l.shift(),h=Or(p);c.cmd.filter(g=>g===h||g==="*").length===0&&_r(h,c.cmd,r),r+=1}),s.optional.forEach(c=>{if(l.length===0)return;let p=l.shift(),h=Or(p);c.cmd.filter(g=>g===h||g==="*").length===0&&_r(h,c.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function Or(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function _r(e,t,n){throw new ee(`Invalid ${Ua[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var fi=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,i=!0,r=!1){if(j("<array|function> [boolean] [boolean] [boolean]",[t,n,i],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let o=t[s];o.applyBeforeValidation=n,o.global=i}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=n,s.global=i,s.mutates=r,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,n){let i=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(r=>{let s=[...i[n]||[],n];return r.option?!s.includes(r.option):!0}),t.option=n,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function Er(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function Et(e,t,n,i){return n.reduce((r,s)=>{if(s.applyBeforeValidation!==i)return r;if(s.mutates){if(s.applied)return r;s.applied=!0}if(re(r))return r.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(r,t);return re(o)?o.then(a=>Object.assign(r,a)):Object.assign(r,o)}},e)}A();function St(e,t,n=i=>{throw i}){try{let i=Ha(e)?e():e;return re(i)?i.then(r=>t(r)):t(i)}catch(i){return n(i)}}function Ha(e){return typeof e=="function"}A();function ui(e){if(typeof Ce=="undefined")return null;for(let t=0,n=Object.keys(Ce.cache),i;t<n.length;t++)if(i=Ce.cache[n[t]],i.exports===e)return i;return null}var kt=/(^\*)|(^\$0)/,Ir=class{constructor(t,n,i,r){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=r,this.usage=t,this.globalMiddleware=i,this.validation=n}addDirectory(t,n,i,r){r=r||{},typeof r.recurse!="boolean"&&(r.recurse=!1),Array.isArray(r.extensions)||(r.extensions=["js"]);let s=typeof r.visit=="function"?r.visit:o=>o;r.visit=(o,a,l)=>{let f=s(o,a,l);if(f){if(this.requireCache.has(a))return f;this.requireCache.add(a),this.addHandler(f)}return f},this.shim.requireDirectory({require:n,filename:i},t,r)}addHandler(t,n,i,r,s,o){let a=[],l=Er(s);if(r=r||(()=>{}),Array.isArray(t))if(Ba(t))[t,...a]=t;else for(let f of t)this.addHandler(f);else if(Ya(t)){let f=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(f=[].concat(f).concat(t.aliases)),this.addHandler(f,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(Sr(i)){this.addHandler([t].concat(a),n,i.builder,i.handler,i.middlewares,i.deprecated);return}if(typeof t=="string"){let f=Ze(t);a=a.map(p=>Ze(p).cmd);let u=!1,c=[f.cmd].concat(a).filter(p=>kt.test(p)?(u=!0,!1):!0);c.length===0&&u&&c.push("$0"),u&&(f.cmd=c[0],a=c.slice(1),t=t.replace(kt,f.cmd)),a.forEach(p=>{this.aliasMap[p]=f.cmd}),n!==!1&&this.usage.command(t,n,u,a,o),this.handlers[f.cmd]={original:t,description:n,handler:r,builder:i||{},middlewares:l,deprecated:o,demanded:f.demanded,optional:f.optional},u&&(this.defaultCommand=this.handlers[f.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,n,i,r,s,o){let a=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,l=n.getInternalMethods().getContext(),f=l.commands.slice(),u=!t;t&&(l.commands.push(t),l.fullCommands.push(a.original));let c=this.applyBuilderUpdateUsageAndParse(u,a,n,i.aliases,f,r,s,o);return re(c)?c.then(p=>this.applyMiddlewareAndGetResult(u,a,p.innerArgv,l,s,p.aliases,n)):this.applyMiddlewareAndGetResult(u,a,c.innerArgv,l,s,c.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,i,r,s,o,a,l){let f=n.builder,u=i;if(_n(f)){let c=f(i.getInternalMethods().reset(r),l);if(re(c))return c.then(p=>(u=Pr(p)?p:i,this.parseAndUpdateUsage(t,n,u,s,o,a)))}else Wa(f)&&(u=i.getInternalMethods().reset(r),Object.keys(n.builder).forEach(c=>{u.option(c,f[c])}));return this.parseAndUpdateUsage(t,n,u,s,o,a)}parseAndUpdateUsage(t,n,i,r,s,o){t&&i.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(i)&&i.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,n),n.description);let a=i.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return re(a)?a.then(l=>({aliases:i.parsed.aliases,innerArgv:l})):{aliases:i.parsed.aliases,innerArgv:a}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,n){let i=kt.test(n.original)?n.original.replace(kt,"").trim():n.original,r=t.filter(s=>!kt.test(s));return r.push(i),`$0 ${r.join(" ")}`}applyMiddlewareAndGetResult(t,n,i,r,s,o,a){let l={};if(s)return i;a.getInternalMethods().getHasOutput()||(l=this.populatePositionals(n,i,r,a));let f=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares);if(i=Et(i,a,f,!0),!a.getInternalMethods().getHasOutput()){let u=a.getInternalMethods().runValidation(o,l,a.parsed.error,t);i=St(i,c=>(u(c),c))}if(n.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let u=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(i,u,!1,!1),i=Et(i,a,f,!1),i=St(i,c=>{let p=n.handler(c);return re(p)?p.then(()=>c):c}),t||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),re(i)&&!a.getInternalMethods().hasParseCallback()&&i.catch(c=>{try{a.getInternalMethods().getUsageInstance().fail(null,c)}catch(p){}})}return t||(r.commands.pop(),r.fullCommands.pop()),i}populatePositionals(t,n,i,r){n._=n._.slice(i.commands.length);let s=t.demanded.slice(0),o=t.optional.slice(0),a={};for(this.validation.positionalCount(s.length,n._.length);s.length;){let l=s.shift();this.populatePositional(l,n,a)}for(;o.length;){let l=o.shift();this.populatePositional(l,n,a)}return n._=i.commands.concat(n._.map(l=>""+l)),this.postProcessPositionals(n,a,this.cmdToParseOptions(t.original),r),a}populatePositional(t,n,i){let r=t.cmd[0];t.variadic?i[r]=n._.splice(0).map(String):n._.length&&(i[r]=[String(n._.shift())])}cmdToParseOptions(t){let n={array:[],default:{},alias:{},demand:{}},i=Ze(t);return i.demanded.forEach(r=>{let[s,...o]=r.cmd;r.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o,n.demand[s]=!0}),i.optional.forEach(r=>{let[s,...o]=r.cmd;r.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o}),n}postProcessPositionals(t,n,i,r){let s=Object.assign({},r.getOptions());s.default=Object.assign(i.default,s.default);for(let f of Object.keys(i.alias))s.alias[f]=(s.alias[f]||[]).concat(i.alias[f]);s.array=s.array.concat(i.array),s.config={};let o=[];if(Object.keys(n).forEach(f=>{n[f].map(u=>{s.configuration["unknown-options-as-args"]&&(s.key[f]=!0),o.push(`--${f}`),o.push(u)})}),!o.length)return;let a=Object.assign({},s.configuration,{"populate--":!1}),l=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:a}));if(l.error)r.getInternalMethods().getUsageInstance().fail(l.error.message,l.error);else{let f=Object.keys(n);Object.keys(n).forEach(c=>{f.push(...l.aliases[c])});let u=r.getOptions().default;Object.keys(l.argv).forEach(c=>{f.includes(c)&&(n[c]||(n[c]=l.argv[c]),!Object.prototype.hasOwnProperty.call(u,c)&&Object.prototype.hasOwnProperty.call(t,c)&&Object.prototype.hasOwnProperty.call(l.argv,c)&&(Array.isArray(t[c])||Array.isArray(l.argv[c]))?t[c]=[].concat(t[c],l.argv[c]):t[c]=l.argv[c])})}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let i=kt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(i,this.defaultCommand.description)}let n=this.defaultCommand.builder;if(_n(n))return n(t,!0);Sr(n)||Object.keys(n).forEach(i=>{t.option(i,n[i])})}moduleName(t){let n=ui(t);if(!n)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(n.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:n,desc:i}){for(let r of[t,n,i]){if(typeof r=="string"||r===!1)return r;Oe(r,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();Oe(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function jr(e,t,n,i){return new Ir(e,t,n,i)}function Sr(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function Ba(e){return e.every(t=>typeof t=="string")}function _n(e){return typeof e=="function"}function Wa(e){return typeof e=="object"}function Ya(e){return typeof e=="object"&&!Array.isArray(e)}A();A();function Xe(e={},t=()=>!0){let n={};return Yt(e).forEach(i=>{t(i,e[i])&&(n[i]=e[i])}),n}A();function et(e){typeof process!="undefined"&&[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking=="function"&&n._handle.setBlocking(e)})}function ka(e){return typeof e=="boolean"}function Fr(e,t){let n=t.y18n.__,i={},r=[];i.failFn=function(E){r.push(E)};let s=null,o=!0;i.showHelpOnFail=function(E=!0,U){function q(){return typeof E=="string"?[!0,E]:[E,U]}let[X,ue]=q();return s=ue,o=X,i};let a=!1;i.fail=function(E,U){let q=e.getInternalMethods().getLoggerInstance();if(r.length)for(let X=r.length-1;X>=0;--X){let ue=r[X];if(ka(ue)){if(U)throw U;if(E)throw Error(E)}else ue(E,U,i)}else{if(e.getExitProcess()&&et(!0),a||(a=!0,o&&(e.showHelp("error"),q.error()),(E||U)&&q.error(E||U),s&&((E||U)&&q.error(""),q.error(s))),U=U||new ee(E),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,U);throw U}};let l=[],f=!1;i.usage=(I,E)=>I===null?(f=!0,l=[],i):(f=!1,l.push([I,E||""]),i),i.getUsage=()=>l,i.getUsageDisabled=()=>f,i.getPositionalGroupName=()=>n("Positionals:");let u=[];i.example=(I,E)=>{u.push([I,E||""])};let c=[];i.command=function(E,U,q,X,ue=!1){q&&(c=c.map(Q=>(Q[2]=!1,Q))),c.push([E,U||"",q,X,ue])},i.getCommands=()=>c;let p={};i.describe=function(E,U){Array.isArray(E)?E.forEach(q=>{i.describe(q,U)}):typeof E=="object"?Object.keys(E).forEach(q=>{i.describe(q,E[q])}):p[E]=U},i.getDescriptions=()=>p;let h=[];i.epilog=I=>{h.push(I)};let b=!1,g;i.wrap=I=>{b=!0,g=I};function m(){return b||(g=K(),b=!0),g}let x="__yargsString__:";i.deferY18nLookup=I=>x+I,i.help=function(){if(z)return z;$();let E=e.customScriptName?e.$0:t.path.basename(e.$0),U=e.getDemandedOptions(),q=e.getDemandedCommands(),X=e.getDeprecatedOptions(),ue=e.getGroups(),Q=e.getOptions(),me=[];me=me.concat(Object.keys(p)),me=me.concat(Object.keys(U)),me=me.concat(Object.keys(q)),me=me.concat(Object.keys(Q.default)),me=me.filter(Y),me=Object.keys(me.reduce((H,ne)=>(ne!=="_"&&(H[ne]=!0),H),{}));let xt=m(),ae=t.cliui({width:xt,wrap:!!xt});if(!f){if(l.length)l.forEach(H=>{ae.div({text:`${H[0].replace(/\$0/g,E)}`}),H[1]&&ae.div({text:`${H[1]}`,padding:[1,0,0,0]})}),ae.div();else if(c.length){let H=null;q._?H=`${E} <${n("command")}>
6
+ `),r+=e.charAt(s);return n&&i&&(r=`${n}${r}${i}`),r}function si(e){return or(e,{stringWidth:t=>[...t].length,stripAnsi:oi,wrap:ar})}A();import{dirname as lr,resolve as cr}from"path";import{readdirSync as ca,statSync as fa}from"fs";function fr(e,t){let n=cr(".",e),i;for(fa(n).isDirectory()||(n=lr(n));;){if(i=t(n,ca(n)),i)return cr(n,i);if(n=lr(i=n),i===n)break}}import{inspect as ja}from"util";import{readFileSync as Pa}from"fs";import{fileURLToPath as Ma}from"url";A();import{format as da}from"util";import{normalize as ha,resolve as ma}from"path";A();function _t(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let n="",i=!1,r=e.match(/^-+/);for(let s=r?r[0].length:0;s<e.length;s++){let o=e.charAt(s);i&&(i=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?i=!0:o!=="-"&&o!=="_"&&(n+=o)}return n}}function xn(e,t){let n=e.toLowerCase();t=t||"-";let i="";for(let r=0;r<e.length;r++){let s=n.charAt(r),o=e.charAt(r);s!==o&&r>0?i+=`${t}${n.charAt(r)}`:i+=o}return i}function vn(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}A();A();function ur(e){if(Array.isArray(e))return e.map(o=>typeof o!="string"?o+"":o);e=e.trim();let t=0,n=null,i=null,r=null,s=[];for(let o=0;o<e.length;o++){if(n=i,i=e.charAt(o),i===" "&&!r){n!==" "&&t++;continue}i===r?r=null:(i==="'"||i==='"')&&!r&&(r=i),s[t]||(s[t]=""),s[t]+=i}return s}A();var Me;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(Me||(Me={}));var Ge,li=class{constructor(t){Ge=t}parse(t,n){let i=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},n),r=ur(t),s=typeof t=="string",o=ua(Object.assign(Object.create(null),i.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},i.configuration),l=Object.assign(Object.create(null),i.default),f=i.configObjects||[],u=i.envPrefix,c=a["populate--"],p=c?"--":"_",h=Object.create(null),b=Object.create(null),g=i.__||Ge.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},v=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,O=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(i.array||[]).filter(Boolean).forEach(function(y){let C=typeof y=="object"?y.key:y,_=Object.keys(y).map(function(x){return{boolean:"bools",string:"strings",number:"numbers"}[x]}).filter(Boolean).pop();_&&(m[_][C]=!0),m.arrays[C]=!0,m.keys.push(C)}),[].concat(i.boolean||[]).filter(Boolean).forEach(function(y){m.bools[y]=!0,m.keys.push(y)}),[].concat(i.string||[]).filter(Boolean).forEach(function(y){m.strings[y]=!0,m.keys.push(y)}),[].concat(i.number||[]).filter(Boolean).forEach(function(y){m.numbers[y]=!0,m.keys.push(y)}),[].concat(i.count||[]).filter(Boolean).forEach(function(y){m.counts[y]=!0,m.keys.push(y)}),[].concat(i.normalize||[]).filter(Boolean).forEach(function(y){m.normalize[y]=!0,m.keys.push(y)}),typeof i.narg=="object"&&Object.entries(i.narg).forEach(([y,C])=>{typeof C=="number"&&(m.nargs[y]=C,m.keys.push(y))}),typeof i.coerce=="object"&&Object.entries(i.coerce).forEach(([y,C])=>{typeof C=="function"&&(m.coercions[y]=C,m.keys.push(y))}),typeof i.config!="undefined"&&(Array.isArray(i.config)||typeof i.config=="string"?[].concat(i.config).filter(Boolean).forEach(function(y){m.configs[y]=!0}):typeof i.config=="object"&&Object.entries(i.config).forEach(([y,C])=>{(typeof C=="boolean"||typeof C=="function")&&(m.configs[y]=C)})),Ot(i.key,o,i.default,m.arrays),Object.keys(l).forEach(function(y){(m.aliases[y]||[]).forEach(function(C){l[C]=l[y]})});let U=null;wn();let B=[],V=Object.assign(Object.create(null),{_:[]}),k={};for(let y=0;y<r.length;y++){let C=r[y],_=C.replace(/^-{3,}/,"---"),x,w,F,S,R,be;if(C!=="--"&&le(C))T(C);else if(_.match(/---+(=|$)/)){T(C);continue}else if(C.match(/^--.+=/)||!a["short-option-groups"]&&C.match(/^-.+=/))S=C.match(/^--?([^=]+)=([\s\S]*)$/),S!==null&&Array.isArray(S)&&S.length>=3&&(W(S[1],m.arrays)?y=Z(y,S[1],r,S[2]):W(S[1],m.nargs)!==!1?y=K(y,S[1],r,S[2]):z(S[1],S[2],!0));else if(C.match(O)&&a["boolean-negation"])S=C.match(O),S!==null&&Array.isArray(S)&&S.length>=2&&(w=S[1],z(w,W(w,m.arrays)?[!1]:!1));else if(C.match(/^--.+/)||!a["short-option-groups"]&&C.match(/^-[^-]+/))S=C.match(/^--?(.+)/),S!==null&&Array.isArray(S)&&S.length>=2&&(w=S[1],W(w,m.arrays)?y=Z(y,w,r):W(w,m.nargs)!==!1?y=K(y,w,r):(R=r[y+1],R!==void 0&&(!R.match(/^-/)||R.match(v))&&!W(w,m.bools)&&!W(w,m.counts)||/^(true|false)$/.test(R)?(z(w,R),y++):z(w,ce(w))));else if(C.match(/^-.\..+=/))S=C.match(/^-([^=]+)=([\s\S]*)$/),S!==null&&Array.isArray(S)&&S.length>=3&&z(S[1],S[2]);else if(C.match(/^-.\..+/)&&!C.match(v))R=r[y+1],S=C.match(/^-(.\..+)/),S!==null&&Array.isArray(S)&&S.length>=2&&(w=S[1],R!==void 0&&!R.match(/^-/)&&!W(w,m.bools)&&!W(w,m.counts)?(z(w,R),y++):z(w,ce(w)));else if(C.match(/^-[^-]+/)&&!C.match(v)){F=C.slice(1,-1).split(""),x=!1;for(let ve=0;ve<F.length;ve++){if(R=C.slice(ve+2),F[ve+1]&&F[ve+1]==="="){be=C.slice(ve+3),w=F[ve],W(w,m.arrays)?y=Z(y,w,r,be):W(w,m.nargs)!==!1?y=K(y,w,r,be):z(w,be),x=!0;break}if(R==="-"){z(F[ve],R);continue}if(/[A-Za-z]/.test(F[ve])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(R)&&W(R,m.bools)===!1){z(F[ve],R),x=!0;break}if(F[ve+1]&&F[ve+1].match(/\W/)){z(F[ve],R),x=!0;break}else z(F[ve],ce(F[ve]))}w=C.slice(-1)[0],!x&&w!=="-"&&(W(w,m.arrays)?y=Z(y,w,r):W(w,m.nargs)!==!1?y=K(y,w,r):(R=r[y+1],R!==void 0&&(!/^(-|--)[^-]/.test(R)||R.match(v))&&!W(w,m.bools)&&!W(w,m.counts)||/^(true|false)$/.test(R)?(z(w,R),y++):z(w,ce(w))))}else if(C.match(/^-[0-9]$/)&&C.match(v)&&W(C.slice(1),m.bools))w=C.slice(1),z(w,ce(w));else if(C==="--"){B=r.slice(y+1);break}else if(a["halt-at-non-option"]){B=r.slice(y);break}else T(C)}Q(V,!0),Q(V,!1),q(V),ue(),ae(V,m.aliases,l,!0),me(V),a["set-placeholder-key"]&&vt(V),Object.keys(m.counts).forEach(function(y){ze(V,y.split("."))||z(y,0)}),c&&B.length&&(V[p]=[]),B.forEach(function(y){V[p].push(y)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(V).filter(y=>y!=="--"&&y.includes("-")).forEach(y=>{delete V[y]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(y=>o[y])).forEach(y=>{a["camel-case-expansion"]&&y.includes("-")&&delete V[y.split(".").map(C=>_t(C)).join(".")],delete V[y]});function T(y){let C=P("_",y);(typeof C=="string"||typeof C=="number")&&V._.push(C)}function K(y,C,_,x){let w,F=W(C,m.nargs);if(F=typeof F!="number"||isNaN(F)?1:F,F===0)return Re(x)||(U=Error(g("Argument unexpected for: %s",C))),z(C,ce(C)),y;let S=Re(x)?0:1;if(a["nargs-eats-options"])_.length-(y+1)+S<F&&(U=Error(g("Not enough arguments following: %s",C))),S=F;else{for(w=y+1;w<_.length&&(!_[w].match(/^-[^0-9]/)||_[w].match(v)||le(_[w]));w++)S++;S<F&&(U=Error(g("Not enough arguments following: %s",C)))}let R=Math.min(S,F);for(!Re(x)&&R>0&&(z(C,x),R--),w=y+1;w<R+y+1;w++)z(C,_[w]);return y+R}function Z(y,C,_,x){let w=[],F=x||_[y+1],S=W(C,m.nargs);if(W(C,m.bools)&&!/^(true|false)$/.test(F))w.push(!0);else if(Re(F)||Re(x)&&/^-/.test(F)&&!v.test(F)&&!le(F)){if(l[C]!==void 0){let R=l[C];w=Array.isArray(R)?R:[R]}}else{Re(x)||w.push(E(C,x,!0));for(let R=y+1;R<_.length&&!(!a["greedy-arrays"]&&w.length>0||S&&typeof S=="number"&&w.length>=S||(F=_[R],/^-/.test(F)&&!v.test(F)&&!le(F)));R++)y=R,w.push(E(C,F,s))}return typeof S=="number"&&(S&&w.length<S||isNaN(S)&&w.length===0)&&(U=Error(g("Not enough arguments following: %s",C))),z(C,w),y}function z(y,C,_=s){if(/-/.test(y)&&a["camel-case-expansion"]){let F=y.split(".").map(function(S){return _t(S)}).join(".");I(y,F)}let x=E(y,C,_),w=y.split(".");qe(V,w,x),m.aliases[y]&&m.aliases[y].forEach(function(F){let S=F.split(".");qe(V,S,x)}),w.length>1&&a["dot-notation"]&&(m.aliases[w[0]]||[]).forEach(function(F){let S=F.split("."),R=[].concat(w);R.shift(),S=S.concat(R),(m.aliases[y]||[]).includes(S.join("."))||qe(V,S,x)}),W(y,m.normalize)&&!W(y,m.arrays)&&[y].concat(m.aliases[y]||[]).forEach(function(S){Object.defineProperty(k,S,{enumerable:!0,get(){return C},set(R){C=typeof R=="string"?Ge.normalize(R):R}})})}function I(y,C){m.aliases[y]&&m.aliases[y].length||(m.aliases[y]=[C],h[C]=!0),m.aliases[C]&&m.aliases[C].length||I(C,y)}function E(y,C,_){_&&(C=pa(C)),(W(y,m.bools)||W(y,m.counts))&&typeof C=="string"&&(C=C==="true");let x=Array.isArray(C)?C.map(function(w){return P(y,w)}):P(y,C);return W(y,m.counts)&&(Re(x)||typeof x=="boolean")&&(x=ai()),W(y,m.normalize)&&W(y,m.arrays)&&(Array.isArray(C)?x=C.map(w=>Ge.normalize(w)):x=Ge.normalize(C)),x}function P(y,C){return!a["parse-positional-numbers"]&&y==="_"||!W(y,m.strings)&&!W(y,m.bools)&&!Array.isArray(C)&&(vn(C)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${C}`)))||!Re(C)&&W(y,m.numbers))&&(C=Number(C)),C}function q(y){let C=Object.create(null);ae(C,m.aliases,l),Object.keys(m.configs).forEach(function(_){let x=y[_]||C[_];if(x)try{let w=null,F=Ge.resolve(Ge.cwd(),x),S=m.configs[_];if(typeof S=="function"){try{w=S(F)}catch(R){w=R}if(w instanceof Error){U=w;return}}else w=Ge.require(F);X(w)}catch(w){w.name==="PermissionDenied"?U=w:y[_]&&(U=Error(g("Invalid JSON config file: %s",x)))}})}function X(y,C){Object.keys(y).forEach(function(_){let x=y[_],w=C?C+"."+_:_;typeof x=="object"&&x!==null&&!Array.isArray(x)&&a["dot-notation"]?X(x,w):(!ze(V,w.split("."))||W(w,m.arrays)&&a["combine-arrays"])&&z(w,x)})}function ue(){typeof f!="undefined"&&f.forEach(function(y){X(y)})}function Q(y,C){if(typeof u=="undefined")return;let _=typeof u=="string"?u:"",x=Ge.env();Object.keys(x).forEach(function(w){if(_===""||w.lastIndexOf(_,0)===0){let F=w.split("__").map(function(S,R){return R===0&&(S=S.substring(_.length)),_t(S)});(C&&m.configs[F.join(".")]||!C)&&!ze(y,F)&&z(F.join("."),x[w])}})}function me(y){let C,_=new Set;Object.keys(y).forEach(function(x){if(!_.has(x)&&(C=W(x,m.coercions),typeof C=="function"))try{let w=P(x,C(y[x]));[].concat(m.aliases[x]||[],x).forEach(F=>{_.add(F),y[F]=w})}catch(w){U=w}})}function vt(y){return m.keys.forEach(C=>{~C.indexOf(".")||typeof y[C]=="undefined"&&(y[C]=void 0)}),y}function ae(y,C,_,x=!1){Object.keys(_).forEach(function(w){ze(y,w.split("."))||(qe(y,w.split("."),_[w]),x&&(b[w]=!0),(C[w]||[]).forEach(function(F){ze(y,F.split("."))||qe(y,F.split("."),_[w])}))})}function ze(y,C){let _=y;a["dot-notation"]||(C=[C.join(".")]),C.slice(0,-1).forEach(function(w){_=_[w]||{}});let x=C[C.length-1];return typeof _!="object"?!1:x in _}function qe(y,C,_){let x=y;a["dot-notation"]||(C=[C.join(".")]),C.slice(0,-1).forEach(function(be){be=pr(be),typeof x=="object"&&x[be]===void 0&&(x[be]={}),typeof x[be]!="object"||Array.isArray(x[be])?(Array.isArray(x[be])?x[be].push({}):x[be]=[x[be],{}],x=x[be][x[be].length-1]):x=x[be]});let w=pr(C[C.length-1]),F=W(C.join("."),m.arrays),S=Array.isArray(_),R=a["duplicate-arguments-array"];!R&&W(w,m.nargs)&&(R=!0,(!Re(x[w])&&m.nargs[w]===1||Array.isArray(x[w])&&x[w].length===m.nargs[w])&&(x[w]=void 0)),_===ai()?x[w]=ai(x[w]):Array.isArray(x[w])?R&&F&&S?x[w]=a["flatten-duplicate-arrays"]?x[w].concat(_):(Array.isArray(x[w][0])?x[w]:[x[w]]).concat([_]):!R&&Boolean(F)===Boolean(S)?x[w]=_:x[w]=x[w].concat([_]):x[w]===void 0&&F?x[w]=S?_:[_]:R&&!(x[w]===void 0||W(w,m.counts)||W(w,m.bools))?x[w]=[x[w],_]:x[w]=_}function Ot(...y){y.forEach(function(C){Object.keys(C||{}).forEach(function(_){m.aliases[_]||(m.aliases[_]=[].concat(o[_]||[]),m.aliases[_].concat(_).forEach(function(x){if(/-/.test(x)&&a["camel-case-expansion"]){let w=_t(x);w!==_&&m.aliases[_].indexOf(w)===-1&&(m.aliases[_].push(w),h[w]=!0)}}),m.aliases[_].concat(_).forEach(function(x){if(x.length>1&&/[A-Z]/.test(x)&&a["camel-case-expansion"]){let w=xn(x,"-");w!==_&&m.aliases[_].indexOf(w)===-1&&(m.aliases[_].push(w),h[w]=!0)}}),m.aliases[_].forEach(function(x){m.aliases[x]=[_].concat(m.aliases[_].filter(function(w){return x!==w}))}))})})}function W(y,C){let _=[].concat(m.aliases[y]||[],y),x=Object.keys(C),w=_.find(F=>x.includes(F));return w?C[w]:!1}function ri(y){let C=Object.keys(m);return[].concat(C.map(x=>m[x])).some(function(x){return Array.isArray(x)?x.includes(y):x[y]})}function H(y,...C){return[].concat(...C).some(function(x){let w=y.match(x);return w&&ri(w[1])})}function ne(y){if(y.match(v)||!y.match(/^-[^-]+/))return!1;let C=!0,_,x=y.slice(1).split("");for(let w=0;w<x.length;w++){if(_=y.slice(w+2),!ri(x[w])){C=!1;break}if(x[w+1]&&x[w+1]==="="||_==="-"||/[A-Za-z]/.test(x[w])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(_)||x[w+1]&&x[w+1].match(/\W/))break}return C}function le(y){return a["unknown-options-as-args"]&&J(y)}function J(y){return y=y.replace(/^-{3,}/,"--"),y.match(v)||ne(y)?!1:!H(y,/^-+([^=]+?)=[\s\S]*$/,O,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function ce(y){return!W(y,m.bools)&&!W(y,m.counts)&&`${y}`in l?l[y]:pe(Te(y))}function pe(y){return{[Me.BOOLEAN]:!0,[Me.STRING]:"",[Me.NUMBER]:void 0,[Me.ARRAY]:[]}[y]}function Te(y){let C=Me.BOOLEAN;return W(y,m.strings)?C=Me.STRING:W(y,m.numbers)?C=Me.NUMBER:W(y,m.bools)?C=Me.BOOLEAN:W(y,m.arrays)&&(C=Me.ARRAY),C}function Re(y){return y===void 0}function wn(){Object.keys(m.counts).find(y=>W(y,m.arrays)?(U=Error(g("Invalid configuration: %s, opts.count excludes opts.array.",y)),!0):W(y,m.nargs)?(U=Error(g("Invalid configuration: %s, opts.count excludes opts.narg.",y)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(k,V),configuration:a,defaulted:Object.assign({},b),error:U,newAliases:Object.assign({},h)}}};function ua(e){let t=[],n=Object.create(null),i=!0;for(Object.keys(e).forEach(function(r){t.push([].concat(e[r],r))});i;){i=!1;for(let r=0;r<t.length;r++)for(let s=r+1;s<t.length;s++)if(t[r].filter(function(a){return t[s].indexOf(a)!==-1}).length){t[r]=t[r].concat(t[s]),t.splice(s,1),i=!0;break}}return t.forEach(function(r){r=r.filter(function(o,a,l){return l.indexOf(o)===a});let s=r.pop();s!==void 0&&typeof s=="string"&&(n[s]=r)}),n}function ai(e){return e!==void 0?e+1:1}function pr(e){return e==="__proto__"?"___proto___":e}function pa(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}import{readFileSync as ga}from"fs";var dr=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1])<dr)throw Error(`yargs parser supports a minimum Node.js version of ${dr}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var ba=process?process.env:{},hr=new li({cwd:process.cwd,env:()=>ba,format:da,normalize:ha,resolve:ma,require:e=>{if(typeof Ce!="undefined")return Ce(e);if(e.match(/\.json$/))return JSON.parse(ga(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),sn=function(t,n){return hr.parse(t.slice(),n).argv};sn.detailed=function(e,t){return hr.parse(e.slice(),t)};sn.camelCase=_t;sn.decamelize=xn;sn.looksLikeNumber=vn;var mr=sn;import{basename as Fa,dirname as La,extname as Da,relative as Na,resolve as Ar}from"path";A();function ya(){return wa()?0:1}function wa(){return Ca()&&!process.defaultApp}function Ca(){return!!process.versions.electron}function gr(){return process.argv[ya()]}A();var ee=class extends Error{constructor(t){super(t||"yargs error");this.name="YError",Error.captureStackTrace(this,ee)}};A();A();import{readFileSync as Aa,statSync as xa,writeFile as va}from"fs";import{format as Oa}from"util";import{resolve as _a}from"path";var br={fs:{readFileSync:Aa,writeFile:va},format:Oa,resolve:_a,exists:e=>{try{return xa(e).isFile()}catch(t){return!1}}};A();var $e,yr=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=t.shift(),i=function(){};return typeof t[t.length-1]=="function"&&(i=t.pop()),i=i||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i(),$e.format.apply($e.format,[this.cache[this.locale][n]||n].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),n=t.shift(),i=t.shift(),r=t.shift(),s=function(){};typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let o=r===1?n:i;this.cache[this.locale][n]&&(o=this.cache[this.locale][n][r===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:i},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[o];return~o.indexOf("%d")&&a.push(r),$e.format.apply($e.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this.cache[this.locale][n]=t[n])}_taggedLiteral(t,...n){let i="";return t.forEach(function(r,s){let o=n[s+1];i+=r,typeof o!="undefined"&&(i+="%s")}),this.__.apply(this,[i].concat([].slice.call(n,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,n=this.writeQueue[0],i=n.directory,r=n.locale,s=n.cb,o=this._resolveLocaleFile(i,r),a=JSON.stringify(this.cache[r],null,2);$e.fs.writeFile(o,a,"utf-8",function(l){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(l)})}_readLocaleFile(){let t={},n=this._resolveLocaleFile(this.directory,this.locale);try{$e.fs.readFileSync&&(t=JSON.parse($e.fs.readFileSync(n,"utf-8")))}catch(i){if(i instanceof SyntaxError&&(i.message="syntax error in "+n),i.code==="ENOENT")t={};else throw i}this.cache[this.locale]=t}_resolveLocaleFile(t,n){let i=$e.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(i)&&~n.lastIndexOf("_")){let r=$e.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(r)&&(i=r)}return i}_fileExistsSync(t){return $e.exists(t)}};function wr(e,t){$e=t;let n=new yr(e);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var Ea=e=>wr(e,br),Cr=Ea;var $a={},Ta="require is not supported by ESM",xr="loading a directory of commands is not supported yet for ESM",On;try{On=Ma($a.url)}catch(e){On=process.cwd()}var Ra=On.split("node_modules")[0],vr={assert:{notStrictEqual:Sa,strictEqual:Ia},cliui:si,findUp:fr,getEnv:e=>process.env[e],inspect:ja,getCallerFile:()=>{throw new ee(xr)},getProcessArgvBin:gr,mainFilename:Ra||process.cwd(),Parser:mr,path:{basename:Fa,dirname:La,extname:Da,relative:Na,resolve:Ar},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns!="undefined"?process.stdout.columns:null},readFileSync:Pa,require:()=>{throw new ee(Ta)},requireDirectory:()=>{throw new ee(xr)},stringWidth:e=>[...e].length,y18n:Cr({directory:Ar(On,"../../../locales"),updateFiles:!1})};A();A();A();function Oe(e,t,n,i){n.assert.notStrictEqual(e,t,i)}function ci(e,t){t.assert.strictEqual(typeof e,"string")}function Yt(e){return Object.keys(e)}A();function re(e){return!!e&&!!e.then&&typeof e.then=="function"}A();A();A();function Ze(e){let n=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),i=/\.*[\][<>]/g,r=n.shift();if(!r)throw new Error(`No command found in: ${e}`);let s={cmd:r.replace(i,""),demanded:[],optional:[]};return n.forEach((o,a)=>{let l=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===n.length-1&&(l=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(i,"").split("|"),variadic:l}):s.demanded.push({cmd:o.replace(i,"").split("|"),variadic:l})}),s}var Ua=["first","second","third","fourth","fifth","sixth"];function j(e,t,n){function i(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[Ze(`cmd ${e}`),t,n]}try{let r=0,[s,o,a]=i(),l=[].slice.call(o);for(;l.length&&l[l.length-1]===void 0;)l.pop();let f=a||l.length;if(f<s.demanded.length)throw new ee(`Not enough arguments provided. Expected ${s.demanded.length} but received ${l.length}.`);let u=s.demanded.length+s.optional.length;if(f>u)throw new ee(`Too many arguments provided. Expected max ${u} but received ${f}.`);s.demanded.forEach(c=>{let p=l.shift(),h=Or(p);c.cmd.filter(g=>g===h||g==="*").length===0&&_r(h,c.cmd,r),r+=1}),s.optional.forEach(c=>{if(l.length===0)return;let p=l.shift(),h=Or(p);c.cmd.filter(g=>g===h||g==="*").length===0&&_r(h,c.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function Or(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function _r(e,t,n){throw new ee(`Invalid ${Ua[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var fi=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,i=!0,r=!1){if(j("<array|function> [boolean] [boolean] [boolean]",[t,n,i],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let o=t[s];o.applyBeforeValidation=n,o.global=i}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=n,s.global=i,s.mutates=r,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,n){let i=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(r=>{let s=[...i[n]||[],n];return r.option?!s.includes(r.option):!0}),t.option=n,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function Er(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function Et(e,t,n,i){return n.reduce((r,s)=>{if(s.applyBeforeValidation!==i)return r;if(s.mutates){if(s.applied)return r;s.applied=!0}if(re(r))return r.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(r,t);return re(o)?o.then(a=>Object.assign(r,a)):Object.assign(r,o)}},e)}A();function St(e,t,n=i=>{throw i}){try{let i=Ha(e)?e():e;return re(i)?i.then(r=>t(r)):t(i)}catch(i){return n(i)}}function Ha(e){return typeof e=="function"}A();function ui(e){if(typeof Ce=="undefined")return null;for(let t=0,n=Object.keys(Ce.cache),i;t<n.length;t++)if(i=Ce.cache[n[t]],i.exports===e)return i;return null}var kt=/(^\*)|(^\$0)/,Ir=class{constructor(t,n,i,r){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=r,this.usage=t,this.globalMiddleware=i,this.validation=n}addDirectory(t,n,i,r){r=r||{},typeof r.recurse!="boolean"&&(r.recurse=!1),Array.isArray(r.extensions)||(r.extensions=["js"]);let s=typeof r.visit=="function"?r.visit:o=>o;r.visit=(o,a,l)=>{let f=s(o,a,l);if(f){if(this.requireCache.has(a))return f;this.requireCache.add(a),this.addHandler(f)}return f},this.shim.requireDirectory({require:n,filename:i},t,r)}addHandler(t,n,i,r,s,o){let a=[],l=Er(s);if(r=r||(()=>{}),Array.isArray(t))if(Ba(t))[t,...a]=t;else for(let f of t)this.addHandler(f);else if(Ya(t)){let f=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(f=[].concat(f).concat(t.aliases)),this.addHandler(f,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(Sr(i)){this.addHandler([t].concat(a),n,i.builder,i.handler,i.middlewares,i.deprecated);return}if(typeof t=="string"){let f=Ze(t);a=a.map(p=>Ze(p).cmd);let u=!1,c=[f.cmd].concat(a).filter(p=>kt.test(p)?(u=!0,!1):!0);c.length===0&&u&&c.push("$0"),u&&(f.cmd=c[0],a=c.slice(1),t=t.replace(kt,f.cmd)),a.forEach(p=>{this.aliasMap[p]=f.cmd}),n!==!1&&this.usage.command(t,n,u,a,o),this.handlers[f.cmd]={original:t,description:n,handler:r,builder:i||{},middlewares:l,deprecated:o,demanded:f.demanded,optional:f.optional},u&&(this.defaultCommand=this.handlers[f.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,n,i,r,s,o){let a=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,l=n.getInternalMethods().getContext(),f=l.commands.slice(),u=!t;t&&(l.commands.push(t),l.fullCommands.push(a.original));let c=this.applyBuilderUpdateUsageAndParse(u,a,n,i.aliases,f,r,s,o);return re(c)?c.then(p=>this.applyMiddlewareAndGetResult(u,a,p.innerArgv,l,s,p.aliases,n)):this.applyMiddlewareAndGetResult(u,a,c.innerArgv,l,s,c.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,i,r,s,o,a,l){let f=n.builder,u=i;if(_n(f)){let c=f(i.getInternalMethods().reset(r),l);if(re(c))return c.then(p=>(u=Pr(p)?p:i,this.parseAndUpdateUsage(t,n,u,s,o,a)))}else Wa(f)&&(u=i.getInternalMethods().reset(r),Object.keys(n.builder).forEach(c=>{u.option(c,f[c])}));return this.parseAndUpdateUsage(t,n,u,s,o,a)}parseAndUpdateUsage(t,n,i,r,s,o){t&&i.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(i)&&i.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,n),n.description);let a=i.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return re(a)?a.then(l=>({aliases:i.parsed.aliases,innerArgv:l})):{aliases:i.parsed.aliases,innerArgv:a}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,n){let i=kt.test(n.original)?n.original.replace(kt,"").trim():n.original,r=t.filter(s=>!kt.test(s));return r.push(i),`$0 ${r.join(" ")}`}applyMiddlewareAndGetResult(t,n,i,r,s,o,a){let l={};if(s)return i;a.getInternalMethods().getHasOutput()||(l=this.populatePositionals(n,i,r,a));let f=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares);if(i=Et(i,a,f,!0),!a.getInternalMethods().getHasOutput()){let u=a.getInternalMethods().runValidation(o,l,a.parsed.error,t);i=St(i,c=>(u(c),c))}if(n.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let u=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(i,u,!1,!1),i=Et(i,a,f,!1),i=St(i,c=>{let p=n.handler(c);return re(p)?p.then(()=>c):c}),t||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),re(i)&&!a.getInternalMethods().hasParseCallback()&&i.catch(c=>{try{a.getInternalMethods().getUsageInstance().fail(null,c)}catch(p){}})}return t||(r.commands.pop(),r.fullCommands.pop()),i}populatePositionals(t,n,i,r){n._=n._.slice(i.commands.length);let s=t.demanded.slice(0),o=t.optional.slice(0),a={};for(this.validation.positionalCount(s.length,n._.length);s.length;){let l=s.shift();this.populatePositional(l,n,a)}for(;o.length;){let l=o.shift();this.populatePositional(l,n,a)}return n._=i.commands.concat(n._.map(l=>""+l)),this.postProcessPositionals(n,a,this.cmdToParseOptions(t.original),r),a}populatePositional(t,n,i){let r=t.cmd[0];t.variadic?i[r]=n._.splice(0).map(String):n._.length&&(i[r]=[String(n._.shift())])}cmdToParseOptions(t){let n={array:[],default:{},alias:{},demand:{}},i=Ze(t);return i.demanded.forEach(r=>{let[s,...o]=r.cmd;r.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o,n.demand[s]=!0}),i.optional.forEach(r=>{let[s,...o]=r.cmd;r.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o}),n}postProcessPositionals(t,n,i,r){let s=Object.assign({},r.getOptions());s.default=Object.assign(i.default,s.default);for(let f of Object.keys(i.alias))s.alias[f]=(s.alias[f]||[]).concat(i.alias[f]);s.array=s.array.concat(i.array),s.config={};let o=[];if(Object.keys(n).forEach(f=>{n[f].map(u=>{s.configuration["unknown-options-as-args"]&&(s.key[f]=!0),o.push(`--${f}`),o.push(u)})}),!o.length)return;let a=Object.assign({},s.configuration,{"populate--":!1}),l=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:a}));if(l.error)r.getInternalMethods().getUsageInstance().fail(l.error.message,l.error);else{let f=Object.keys(n);Object.keys(n).forEach(c=>{f.push(...l.aliases[c])});let u=r.getOptions().default;Object.keys(l.argv).forEach(c=>{f.includes(c)&&(n[c]||(n[c]=l.argv[c]),!Object.prototype.hasOwnProperty.call(u,c)&&Object.prototype.hasOwnProperty.call(t,c)&&Object.prototype.hasOwnProperty.call(l.argv,c)&&(Array.isArray(t[c])||Array.isArray(l.argv[c]))?t[c]=[].concat(t[c],l.argv[c]):t[c]=l.argv[c])})}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let i=kt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(i,this.defaultCommand.description)}let n=this.defaultCommand.builder;if(_n(n))return n(t,!0);Sr(n)||Object.keys(n).forEach(i=>{t.option(i,n[i])})}moduleName(t){let n=ui(t);if(!n)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(n.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:n,desc:i}){for(let r of[t,n,i]){if(typeof r=="string"||r===!1)return r;Oe(r,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();Oe(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function jr(e,t,n,i){return new Ir(e,t,n,i)}function Sr(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function Ba(e){return e.every(t=>typeof t=="string")}function _n(e){return typeof e=="function"}function Wa(e){return typeof e=="object"}function Ya(e){return typeof e=="object"&&!Array.isArray(e)}A();A();function Xe(e={},t=()=>!0){let n={};return Yt(e).forEach(i=>{t(i,e[i])&&(n[i]=e[i])}),n}A();function et(e){typeof process!="undefined"&&[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking=="function"&&n._handle.setBlocking(e)})}function ka(e){return typeof e=="boolean"}function Fr(e,t){let n=t.y18n.__,i={},r=[];i.failFn=function(E){r.push(E)};let s=null,o=!0;i.showHelpOnFail=function(E=!0,P){function q(){return typeof E=="string"?[!0,E]:[E,P]}let[X,ue]=q();return s=ue,o=X,i};let a=!1;i.fail=function(E,P){let q=e.getInternalMethods().getLoggerInstance();if(r.length)for(let X=r.length-1;X>=0;--X){let ue=r[X];if(ka(ue)){if(P)throw P;if(E)throw Error(E)}else ue(E,P,i)}else{if(e.getExitProcess()&&et(!0),a||(a=!0,o&&(e.showHelp("error"),q.error()),(E||P)&&q.error(E||P),s&&((E||P)&&q.error(""),q.error(s))),P=P||new ee(E),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,P);throw P}};let l=[],f=!1;i.usage=(I,E)=>I===null?(f=!0,l=[],i):(f=!1,l.push([I,E||""]),i),i.getUsage=()=>l,i.getUsageDisabled=()=>f,i.getPositionalGroupName=()=>n("Positionals:");let u=[];i.example=(I,E)=>{u.push([I,E||""])};let c=[];i.command=function(E,P,q,X,ue=!1){q&&(c=c.map(Q=>(Q[2]=!1,Q))),c.push([E,P||"",q,X,ue])},i.getCommands=()=>c;let p={};i.describe=function(E,P){Array.isArray(E)?E.forEach(q=>{i.describe(q,P)}):typeof E=="object"?Object.keys(E).forEach(q=>{i.describe(q,E[q])}):p[E]=P},i.getDescriptions=()=>p;let h=[];i.epilog=I=>{h.push(I)};let b=!1,g;i.wrap=I=>{b=!0,g=I};function m(){return b||(g=K(),b=!0),g}let v="__yargsString__:";i.deferY18nLookup=I=>v+I,i.help=function(){if(B)return B;U();let E=e.customScriptName?e.$0:t.path.basename(e.$0),P=e.getDemandedOptions(),q=e.getDemandedCommands(),X=e.getDeprecatedOptions(),ue=e.getGroups(),Q=e.getOptions(),me=[];me=me.concat(Object.keys(p)),me=me.concat(Object.keys(P)),me=me.concat(Object.keys(q)),me=me.concat(Object.keys(Q.default)),me=me.filter(k),me=Object.keys(me.reduce((H,ne)=>(ne!=="_"&&(H[ne]=!0),H),{}));let vt=m(),ae=t.cliui({width:vt,wrap:!!vt});if(!f){if(l.length)l.forEach(H=>{ae.div({text:`${H[0].replace(/\$0/g,E)}`}),H[1]&&ae.div({text:`${H[1]}`,padding:[1,0,0,0]})}),ae.div();else if(c.length){let H=null;q._?H=`${E} <${n("command")}>
7
7
  `:H=`${E} [${n("command")}]
8
- `,ae.div(`${H}`)}}if(c.length>1||c.length===1&&!c[0][2]){ae.div(n("Commands:"));let H=e.getInternalMethods().getContext(),ne=H.commands.length?`${H.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(c=c.sort((J,ce)=>J[0].localeCompare(ce[0])));let le=E?`${E} `:"";c.forEach(J=>{let ce=`${le}${ne}${J[0].replace(/^\$0 ?/,"")}`;ae.span({text:ce,padding:[0,2,0,2],width:O(c,xt,`${E}${ne}`)+4},{text:J[1]});let pe=[];J[2]&&pe.push(`[${n("default")}]`),J[3]&&J[3].length&&pe.push(`[${n("aliases:")} ${J[3].join(", ")}]`),J[4]&&(typeof J[4]=="string"?pe.push(`[${n("deprecated: %s",J[4])}]`):pe.push(`[${n("deprecated")}]`)),pe.length?ae.div({text:pe.join(" "),padding:[0,0,0,2],align:"right"}):ae.div()}),ae.div()}let ze=(Object.keys(Q.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);me=me.filter(H=>!e.parsed.newAliases[H]&&ze.every(ne=>(Q.alias[ne]||[]).indexOf(H)===-1));let qe=n("Options:");ue[qe]||(ue[qe]=[]),V(me,Q.alias,ue,qe);let Ot=H=>/^--/.test(En(H)),B=Object.keys(ue).filter(H=>ue[H].length>0).map(H=>{let ne=ue[H].filter(Y).map(le=>{if(ze.includes(le))return le;for(let J=0,ce;(ce=ze[J])!==void 0;J++)if((Q.alias[ce]||[]).includes(le))return ce;return le});return{groupName:H,normalizedKeys:ne}}).filter(({normalizedKeys:H})=>H.length>0).map(({groupName:H,normalizedKeys:ne})=>{let le=ne.reduce((J,ce)=>(J[ce]=[ce].concat(Q.alias[ce]||[]).map(pe=>H===i.getPositionalGroupName()?pe:(/^[0-9]$/.test(pe)?Q.boolean.includes(ce)?"-":"--":pe.length>1?"--":"-")+pe).sort((pe,Te)=>Ot(pe)===Ot(Te)?0:Ot(pe)?1:-1).join(", "),J),{});return{groupName:H,normalizedKeys:ne,switches:le}});if(B.filter(({groupName:H})=>H!==i.getPositionalGroupName()).some(({normalizedKeys:H,switches:ne})=>!H.every(le=>Ot(ne[le])))&&B.filter(({groupName:H})=>H!==i.getPositionalGroupName()).forEach(({normalizedKeys:H,switches:ne})=>{H.forEach(le=>{Ot(ne[le])&&(ne[le]=za(ne[le],4))})}),B.forEach(({groupName:H,normalizedKeys:ne,switches:le})=>{ae.div(H),ne.forEach(J=>{let ce=le[J],pe=p[J]||"",Te=null;pe.includes(x)&&(pe=n(pe.substring(x.length))),Q.boolean.includes(J)&&(Te=`[${n("boolean")}]`),Q.count.includes(J)&&(Te=`[${n("count")}]`),Q.string.includes(J)&&(Te=`[${n("string")}]`),Q.normalize.includes(J)&&(Te=`[${n("string")}]`),Q.array.includes(J)&&(Te=`[${n("array")}]`),Q.number.includes(J)&&(Te=`[${n("number")}]`);let Re=y=>typeof y=="string"?`[${n("deprecated: %s",y)}]`:`[${n("deprecated")}]`,wn=[J in X?Re(X[J]):null,Te,J in U?`[${n("required")}]`:null,Q.choices&&Q.choices[J]?`[${n("choices:")} ${i.stringifiedValues(Q.choices[J])}]`:null,N(Q.default[J],Q.defaultDescription[J])].filter(Boolean).join(" ");ae.span({text:En(ce),padding:[0,2,0,2+Mr(ce)],width:O(le,xt)+4},pe),wn?ae.div({text:wn,padding:[0,0,0,2],align:"right"}):ae.div()}),ae.div()}),u.length&&(ae.div(n("Examples:")),u.forEach(H=>{H[0]=H[0].replace(/\$0/g,E)}),u.forEach(H=>{H[1]===""?ae.div({text:H[0],padding:[0,2,0,2]}):ae.div({text:H[0],padding:[0,2,0,2],width:O(u,xt)+4},{text:H[1]})}),ae.div()),h.length>0){let H=h.map(ne=>ne.replace(/\$0/g,E)).join(`
8
+ `,ae.div(`${H}`)}}if(c.length>1||c.length===1&&!c[0][2]){ae.div(n("Commands:"));let H=e.getInternalMethods().getContext(),ne=H.commands.length?`${H.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(c=c.sort((J,ce)=>J[0].localeCompare(ce[0])));let le=E?`${E} `:"";c.forEach(J=>{let ce=`${le}${ne}${J[0].replace(/^\$0 ?/,"")}`;ae.span({text:ce,padding:[0,2,0,2],width:O(c,vt,`${E}${ne}`)+4},{text:J[1]});let pe=[];J[2]&&pe.push(`[${n("default")}]`),J[3]&&J[3].length&&pe.push(`[${n("aliases:")} ${J[3].join(", ")}]`),J[4]&&(typeof J[4]=="string"?pe.push(`[${n("deprecated: %s",J[4])}]`):pe.push(`[${n("deprecated")}]`)),pe.length?ae.div({text:pe.join(" "),padding:[0,0,0,2],align:"right"}):ae.div()}),ae.div()}let ze=(Object.keys(Q.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);me=me.filter(H=>!e.parsed.newAliases[H]&&ze.every(ne=>(Q.alias[ne]||[]).indexOf(H)===-1));let qe=n("Options:");ue[qe]||(ue[qe]=[]),V(me,Q.alias,ue,qe);let Ot=H=>/^--/.test(En(H)),W=Object.keys(ue).filter(H=>ue[H].length>0).map(H=>{let ne=ue[H].filter(k).map(le=>{if(ze.includes(le))return le;for(let J=0,ce;(ce=ze[J])!==void 0;J++)if((Q.alias[ce]||[]).includes(le))return ce;return le});return{groupName:H,normalizedKeys:ne}}).filter(({normalizedKeys:H})=>H.length>0).map(({groupName:H,normalizedKeys:ne})=>{let le=ne.reduce((J,ce)=>(J[ce]=[ce].concat(Q.alias[ce]||[]).map(pe=>H===i.getPositionalGroupName()?pe:(/^[0-9]$/.test(pe)?Q.boolean.includes(ce)?"-":"--":pe.length>1?"--":"-")+pe).sort((pe,Te)=>Ot(pe)===Ot(Te)?0:Ot(pe)?1:-1).join(", "),J),{});return{groupName:H,normalizedKeys:ne,switches:le}});if(W.filter(({groupName:H})=>H!==i.getPositionalGroupName()).some(({normalizedKeys:H,switches:ne})=>!H.every(le=>Ot(ne[le])))&&W.filter(({groupName:H})=>H!==i.getPositionalGroupName()).forEach(({normalizedKeys:H,switches:ne})=>{H.forEach(le=>{Ot(ne[le])&&(ne[le]=za(ne[le],4))})}),W.forEach(({groupName:H,normalizedKeys:ne,switches:le})=>{ae.div(H),ne.forEach(J=>{let ce=le[J],pe=p[J]||"",Te=null;pe.includes(v)&&(pe=n(pe.substring(v.length))),Q.boolean.includes(J)&&(Te=`[${n("boolean")}]`),Q.count.includes(J)&&(Te=`[${n("count")}]`),Q.string.includes(J)&&(Te=`[${n("string")}]`),Q.normalize.includes(J)&&(Te=`[${n("string")}]`),Q.array.includes(J)&&(Te=`[${n("array")}]`),Q.number.includes(J)&&(Te=`[${n("number")}]`);let Re=y=>typeof y=="string"?`[${n("deprecated: %s",y)}]`:`[${n("deprecated")}]`,wn=[J in X?Re(X[J]):null,Te,J in P?`[${n("required")}]`:null,Q.choices&&Q.choices[J]?`[${n("choices:")} ${i.stringifiedValues(Q.choices[J])}]`:null,T(Q.default[J],Q.defaultDescription[J])].filter(Boolean).join(" ");ae.span({text:En(ce),padding:[0,2,0,2+Mr(ce)],width:O(le,vt)+4},pe),wn?ae.div({text:wn,padding:[0,0,0,2],align:"right"}):ae.div()}),ae.div()}),u.length&&(ae.div(n("Examples:")),u.forEach(H=>{H[0]=H[0].replace(/\$0/g,E)}),u.forEach(H=>{H[1]===""?ae.div({text:H[0],padding:[0,2,0,2]}):ae.div({text:H[0],padding:[0,2,0,2],width:O(u,vt)+4},{text:H[1]})}),ae.div()),h.length>0){let H=h.map(ne=>ne.replace(/\$0/g,E)).join(`
9
9
  `);ae.div(`${H}
10
- `)}return ae.toString().replace(/\s*$/,"")};function O(I,E,U){let q=0;return Array.isArray(I)||(I=Object.values(I).map(X=>[X])),I.forEach(X=>{q=Math.max(t.stringWidth(U?`${U} ${En(X[0])}`:En(X[0]))+Mr(X[0]),q)}),E&&(q=Math.min(q,parseInt((E*.5).toString(),10))),q}function $(){let I=e.getDemandedOptions(),E=e.getOptions();(Object.keys(E.alias)||[]).forEach(U=>{E.alias[U].forEach(q=>{p[q]&&i.describe(U,p[q]),q in I&&e.demandOption(U,I[q]),E.boolean.includes(q)&&e.boolean(U),E.count.includes(q)&&e.count(U),E.string.includes(q)&&e.string(U),E.normalize.includes(q)&&e.normalize(U),E.array.includes(q)&&e.array(U),E.number.includes(q)&&e.number(U)})})}let z;i.cacheHelpMessage=function(){z=this.help()},i.clearCachedHelpMessage=function(){z=void 0},i.hasCachedHelpMessage=function(){return!!z};function V(I,E,U,q){let X=[],ue=null;return Object.keys(U).forEach(Q=>{X=X.concat(U[Q])}),I.forEach(Q=>{ue=[Q].concat(E[Q]),ue.some(me=>X.indexOf(me)!==-1)||U[q].push(Q)}),X}function Y(I){return e.getOptions().hiddenOptions.indexOf(I)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}i.showHelp=I=>{let E=e.getInternalMethods().getLoggerInstance();I||(I="error"),(typeof I=="function"?I:E[I])(i.help())},i.functionDescription=I=>{let E=I.name?t.Parser.decamelize(I.name,"-"):n("generated-value");return["(",E,")"].join("")},i.stringifiedValues=function(E,U){let q="",X=U||", ",ue=[].concat(E);return!E||!ue.length||ue.forEach(Q=>{q.length&&(q+=X),q+=JSON.stringify(Q)}),q};function N(I,E){let U=`[${n("default:")} `;if(I===void 0&&!E)return null;if(E)U+=E;else switch(typeof I){case"string":U+=`"${I}"`;break;case"object":U+=JSON.stringify(I);break;default:U+=I}return`${U}]`}function K(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let Z=null;i.version=I=>{Z=I},i.showVersion=I=>{let E=e.getInternalMethods().getLoggerInstance();I||(I="error"),(typeof I=="function"?I:E[I])(Z)},i.reset=function(E){return s=null,a=!1,l=[],f=!1,h=[],u=[],c=[],p=Xe(p,U=>!E[U]),i};let k=[];return i.freeze=function(){k.push({failMessage:s,failureOutput:a,usages:l,usageDisabled:f,epilogs:h,examples:u,commands:c,descriptions:p})},i.unfreeze=function(){let E=k.pop();!E||({failMessage:s,failureOutput:a,usages:l,usageDisabled:f,epilogs:h,examples:u,commands:c,descriptions:p}=E)},i}function pi(e){return typeof e=="object"}function za(e,t){return pi(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function Mr(e){return pi(e)?e.indentation:0}function En(e){return pi(e)?e.text:e}A();A();var Lr=`###-begin-{{app_name}}-completions-###
10
+ `)}return ae.toString().replace(/\s*$/,"")};function O(I,E,P){let q=0;return Array.isArray(I)||(I=Object.values(I).map(X=>[X])),I.forEach(X=>{q=Math.max(t.stringWidth(P?`${P} ${En(X[0])}`:En(X[0]))+Mr(X[0]),q)}),E&&(q=Math.min(q,parseInt((E*.5).toString(),10))),q}function U(){let I=e.getDemandedOptions(),E=e.getOptions();(Object.keys(E.alias)||[]).forEach(P=>{E.alias[P].forEach(q=>{p[q]&&i.describe(P,p[q]),q in I&&e.demandOption(P,I[q]),E.boolean.includes(q)&&e.boolean(P),E.count.includes(q)&&e.count(P),E.string.includes(q)&&e.string(P),E.normalize.includes(q)&&e.normalize(P),E.array.includes(q)&&e.array(P),E.number.includes(q)&&e.number(P)})})}let B;i.cacheHelpMessage=function(){B=this.help()},i.clearCachedHelpMessage=function(){B=void 0},i.hasCachedHelpMessage=function(){return!!B};function V(I,E,P,q){let X=[],ue=null;return Object.keys(P).forEach(Q=>{X=X.concat(P[Q])}),I.forEach(Q=>{ue=[Q].concat(E[Q]),ue.some(me=>X.indexOf(me)!==-1)||P[q].push(Q)}),X}function k(I){return e.getOptions().hiddenOptions.indexOf(I)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}i.showHelp=I=>{let E=e.getInternalMethods().getLoggerInstance();I||(I="error"),(typeof I=="function"?I:E[I])(i.help())},i.functionDescription=I=>{let E=I.name?t.Parser.decamelize(I.name,"-"):n("generated-value");return["(",E,")"].join("")},i.stringifiedValues=function(E,P){let q="",X=P||", ",ue=[].concat(E);return!E||!ue.length||ue.forEach(Q=>{q.length&&(q+=X),q+=JSON.stringify(Q)}),q};function T(I,E){let P=`[${n("default:")} `;if(I===void 0&&!E)return null;if(E)P+=E;else switch(typeof I){case"string":P+=`"${I}"`;break;case"object":P+=JSON.stringify(I);break;default:P+=I}return`${P}]`}function K(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let Z=null;i.version=I=>{Z=I},i.showVersion=I=>{let E=e.getInternalMethods().getLoggerInstance();I||(I="error"),(typeof I=="function"?I:E[I])(Z)},i.reset=function(E){return s=null,a=!1,l=[],f=!1,h=[],u=[],c=[],p=Xe(p,P=>!E[P]),i};let z=[];return i.freeze=function(){z.push({failMessage:s,failureOutput:a,usages:l,usageDisabled:f,epilogs:h,examples:u,commands:c,descriptions:p})},i.unfreeze=function(E=!1){let P=z.pop();!P||(E?(p={...P.descriptions,...p},c=[...P.commands,...c],l=[...P.usages,...l],u=[...P.examples,...u],h=[...P.epilogs,...h]):{failMessage:s,failureOutput:a,usages:l,usageDisabled:f,epilogs:h,examples:u,commands:c,descriptions:p}=P)},i}function pi(e){return typeof e=="object"}function za(e,t){return pi(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function Mr(e){return pi(e)?e.indentation:0}function En(e){return pi(e)?e.text:e}A();A();var Lr=`###-begin-{{app_name}}-completions-###
11
11
  #
12
12
  # yargs command completion script
13
13
  #
@@ -54,53 +54,53 @@ _{{app_name}}_yargs_completions()
54
54
  }
55
55
  compdef _{{app_name}}_yargs_completions {{app_name}}
56
56
  ###-end-{{app_name}}-completions-###
57
- `;var Nr=class{constructor(t,n,i,r){var s,o,a;this.yargs=t,this.usage=n,this.command=i,this.shim=r,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.zshShell=(a=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(t,n,i,r){let s=this.command.getCommandHandlers();for(let a=0,l=t.length;a<l;++a)if(s[t[a]]&&s[t[a]].builder){let f=s[t[a]].builder;if(_n(f)){let u=this.yargs.getInternalMethods().reset();return f(u,!0),u.argv}}let o=[];this.commandCompletions(o,t,i),this.optionCompletions(o,t,n,i),this.choicesCompletions(o,t,n,i),r(null,o)}commandCompletions(t,n,i){let r=this.yargs.getInternalMethods().getContext().commands;!i.match(/^-/)&&r[r.length-1]!==i&&!this.previousArgHasChoices(n)&&this.usage.getCommands().forEach(s=>{let o=Ze(s[0]).cmd;if(n.indexOf(o)===-1)if(!this.zshShell)t.push(o);else{let a=s[1]||"";t.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(t,n,i,r){if((r.match(/^-/)||r===""&&t.length===0)&&!this.previousArgHasChoices(n)){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(a=>{let l=!!s.configuration["boolean-negation"]&&s.boolean.includes(a);!o.includes(a)&&!this.argsContainKey(n,i,a,l)&&(this.completeOptionKey(a,t,r),l&&!!s.default[a]&&this.completeOptionKey(`no-${a}`,t,r))})}}choicesCompletions(t,n,i,r){if(this.previousArgHasChoices(n)){let s=this.getPreviousArgChoices(n);s&&s.length>0&&t.push(...s)}}getPreviousArgChoices(t){if(t.length<1)return;let n=t[t.length-1],i="";if(!n.startsWith("--")&&t.length>1&&(i=n,n=t[t.length-2]),!n.startsWith("--"))return;let r=n.replace(/-/g,""),s=this.yargs.getOptions();if(Object.keys(s.key).some(o=>o===r)&&Array.isArray(s.choices[r]))return s.choices[r].filter(o=>!i||o.startsWith(i))}previousArgHasChoices(t){let n=this.getPreviousArgChoices(t);return n!==void 0&&n.length>0}argsContainKey(t,n,i,r){if(t.indexOf(`--${i}`)!==-1||r&&t.indexOf(`--no-${i}`)!==-1)return!0;if(this.aliases){for(let s of this.aliases[i])if(n[s]!==void 0)return!0}return!1}completeOptionKey(t,n,i){let r=this.usage.getDescriptions(),s=l=>/^--/.test(l),o=l=>/^[^0-9]$/.test(l),a=!s(i)&&o(t)?"-":"--";if(!this.zshShell)n.push(a+t);else{let l=r[t]||"";n.push(a+`${t.replace(/:/g,"\\:")}:${l.replace("__yargsString__:","")}`)}}customCompletion(t,n,i,r){if(Oe(this.customCompletionFunction,null,this.shim),Ga(this.customCompletionFunction)){let s=this.customCompletionFunction(i,n);return re(s)?s.then(o=>{this.shim.process.nextTick(()=>{r(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{r(o,void 0)})}):r(null,s)}else return Ka(this.customCompletionFunction)?this.customCompletionFunction(i,n,(s=r)=>this.defaultCompletion(t,n,i,s),s=>{r(null,s)}):this.customCompletionFunction(i,n,s=>{r(null,s)})}getCompletion(t,n){let i=t.length?t[t.length-1]:"",r=this.yargs.parse(t,!0),s=this.customCompletionFunction?o=>this.customCompletion(t,o,i,n):o=>this.defaultCompletion(t,o,i,n);return re(r)?r.then(s):s(r)}generateCompletionScript(t,n){let i=this.zshShell?Dr:Lr,r=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),i=i.replace(/{{app_name}}/g,r),i=i.replace(/{{completion_command}}/g,n),i.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}};function Tr(e,t,n,i){return new Nr(e,t,n,i)}function Ga(e){return e.length<3}function Ka(e){return e.length>3}A();A();function Rr(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[],i;for(i=0;i<=t.length;i++)n[i]=[i];let r;for(r=0;r<=e.length;r++)n[0][r]=r;for(i=1;i<=t.length;i++)for(r=1;r<=e.length;r++)t.charAt(i-1)===e.charAt(r-1)?n[i][r]=n[i-1][r-1]:i>1&&r>1&&t.charAt(i-2)===e.charAt(r-1)&&t.charAt(i-1)===e.charAt(r-2)?n[i][r]=n[i-2][r-2]+1:n[i][r]=Math.min(n[i-1][r-1]+1,Math.min(n[i][r-1]+1,n[i-1][r]+1));return n[t.length][e.length]}var $r=["$0","--","_"];function Ur(e,t,n){let i=n.y18n.__,r=n.y18n.__n,s={};s.nonOptionCount=function(c){let p=e.getDemandedCommands(),b=c._.length+(c["--"]?c["--"].length:0)-e.getInternalMethods().getContext().commands.length;p._&&(b<p._.min||b>p._.max)&&(b<p._.min?p._.minMsg!==void 0?t.fail(p._.minMsg?p._.minMsg.replace(/\$0/g,b.toString()).replace(/\$1/,p._.min.toString()):null):t.fail(r("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",b,b.toString(),p._.min.toString())):b>p._.max&&(p._.maxMsg!==void 0?t.fail(p._.maxMsg?p._.maxMsg.replace(/\$0/g,b.toString()).replace(/\$1/,p._.max.toString()):null):t.fail(r("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",b,b.toString(),p._.max.toString()))))},s.positionalCount=function(c,p){p<c&&t.fail(r("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",p,p+"",c+""))},s.requiredArguments=function(c,p){let h=null;for(let b of Object.keys(p))(!Object.prototype.hasOwnProperty.call(c,b)||typeof c[b]=="undefined")&&(h=h||{},h[b]=p[b]);if(h){let b=[];for(let m of Object.keys(h)){let x=h[m];x&&b.indexOf(x)<0&&b.push(x)}let g=b.length?`
57
+ `;var Nr=class{constructor(t,n,i,r){var s,o,a;this.yargs=t,this.usage=n,this.command=i,this.shim=r,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(t,n,i,r){let s=this.command.getCommandHandlers();for(let a=0,l=t.length;a<l;++a)if(s[t[a]]&&s[t[a]].builder){let f=s[t[a]].builder;if(_n(f)){this.indexAfterLastReset=a+1;let u=this.yargs.getInternalMethods().reset();return f(u,!0),u.argv}}let o=[];this.commandCompletions(o,t,i),this.optionCompletions(o,t,n,i),this.choicesFromOptionsCompletions(o,t,n,i),this.choicesFromPositionalsCompletions(o,t,n,i),r(null,o)}commandCompletions(t,n,i){let r=this.yargs.getInternalMethods().getContext().commands;!i.match(/^-/)&&r[r.length-1]!==i&&!this.previousArgHasChoices(n)&&this.usage.getCommands().forEach(s=>{let o=Ze(s[0]).cmd;if(n.indexOf(o)===-1)if(!this.zshShell)t.push(o);else{let a=s[1]||"";t.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(t,n,i,r){if((r.match(/^-/)||r===""&&t.length===0)&&!this.previousArgHasChoices(n)){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(a=>{let l=!!s.configuration["boolean-negation"]&&s.boolean.includes(a);!o.includes(a)&&!this.argsContainKey(n,i,a,l)&&(this.completeOptionKey(a,t,r),l&&!!s.default[a]&&this.completeOptionKey(`no-${a}`,t,r))})}}choicesFromOptionsCompletions(t,n,i,r){if(this.previousArgHasChoices(n)){let s=this.getPreviousArgChoices(n);s&&s.length>0&&t.push(...s)}}choicesFromPositionalsCompletions(t,n,i,r){let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=i._.slice(o),l=s[a.length-1];if(!l)return;let f=this.yargs.getOptions().choices[l]||[];for(let u of f)u.startsWith(r)&&t.push(u)}getPreviousArgChoices(t){if(t.length<1)return;let n=t[t.length-1],i="";if(!n.startsWith("-")&&t.length>1&&(i=n,n=t[t.length-2]),!n.startsWith("-"))return;let r=n.replace(/^-+/,""),s=this.yargs.getOptions(),o=[r,...this.yargs.getAliases()[r]||[]],a;for(let l of o)if(Object.prototype.hasOwnProperty.call(s.key,l)&&Array.isArray(s.choices[l])){a=s.choices[l];break}if(a)return a.filter(l=>!i||l.startsWith(i))}previousArgHasChoices(t){let n=this.getPreviousArgChoices(t);return n!==void 0&&n.length>0}argsContainKey(t,n,i,r){if(t.indexOf(`--${i}`)!==-1||r&&t.indexOf(`--no-${i}`)!==-1)return!0;if(this.aliases){for(let s of this.aliases[i])if(n[s]!==void 0)return!0}return!1}completeOptionKey(t,n,i){let r=this.usage.getDescriptions(),s=l=>/^--/.test(l),o=l=>/^[^0-9]$/.test(l),a=!s(i)&&o(t)?"-":"--";if(!this.zshShell)n.push(a+t);else{let l=r[t]||"";n.push(a+`${t.replace(/:/g,"\\:")}:${l.replace("__yargsString__:","")}`)}}customCompletion(t,n,i,r){if(Oe(this.customCompletionFunction,null,this.shim),Ga(this.customCompletionFunction)){let s=this.customCompletionFunction(i,n);return re(s)?s.then(o=>{this.shim.process.nextTick(()=>{r(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{r(o,void 0)})}):r(null,s)}else return Ka(this.customCompletionFunction)?this.customCompletionFunction(i,n,(s=r)=>this.defaultCompletion(t,n,i,s),s=>{r(null,s)}):this.customCompletionFunction(i,n,s=>{r(null,s)})}getCompletion(t,n){let i=t.length?t[t.length-1]:"",r=this.yargs.parse(t,!0),s=this.customCompletionFunction?o=>this.customCompletion(t,o,i,n):o=>this.defaultCompletion(t,o,i,n);return re(r)?r.then(s):s(r)}generateCompletionScript(t,n){let i=this.zshShell?Dr:Lr,r=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),i=i.replace(/{{app_name}}/g,r),i=i.replace(/{{completion_command}}/g,n),i.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}};function Tr(e,t,n,i){return new Nr(e,t,n,i)}function Ga(e){return e.length<3}function Ka(e){return e.length>3}A();A();function Rr(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[],i;for(i=0;i<=t.length;i++)n[i]=[i];let r;for(r=0;r<=e.length;r++)n[0][r]=r;for(i=1;i<=t.length;i++)for(r=1;r<=e.length;r++)t.charAt(i-1)===e.charAt(r-1)?n[i][r]=n[i-1][r-1]:i>1&&r>1&&t.charAt(i-2)===e.charAt(r-1)&&t.charAt(i-1)===e.charAt(r-2)?n[i][r]=n[i-2][r-2]+1:n[i][r]=Math.min(n[i-1][r-1]+1,Math.min(n[i][r-1]+1,n[i-1][r]+1));return n[t.length][e.length]}var $r=["$0","--","_"];function Ur(e,t,n){let i=n.y18n.__,r=n.y18n.__n,s={};s.nonOptionCount=function(c){let p=e.getDemandedCommands(),b=c._.length+(c["--"]?c["--"].length:0)-e.getInternalMethods().getContext().commands.length;p._&&(b<p._.min||b>p._.max)&&(b<p._.min?p._.minMsg!==void 0?t.fail(p._.minMsg?p._.minMsg.replace(/\$0/g,b.toString()).replace(/\$1/,p._.min.toString()):null):t.fail(r("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",b,b.toString(),p._.min.toString())):b>p._.max&&(p._.maxMsg!==void 0?t.fail(p._.maxMsg?p._.maxMsg.replace(/\$0/g,b.toString()).replace(/\$1/,p._.max.toString()):null):t.fail(r("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",b,b.toString(),p._.max.toString()))))},s.positionalCount=function(c,p){p<c&&t.fail(r("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",p,p+"",c+""))},s.requiredArguments=function(c,p){let h=null;for(let b of Object.keys(p))(!Object.prototype.hasOwnProperty.call(c,b)||typeof c[b]=="undefined")&&(h=h||{},h[b]=p[b]);if(h){let b=[];for(let m of Object.keys(h)){let v=h[m];v&&b.indexOf(v)<0&&b.push(v)}let g=b.length?`
58
58
  ${b.join(`
59
- `)}`:"";t.fail(r("Missing required argument: %s","Missing required arguments: %s",Object.keys(h).length,Object.keys(h).join(", ")+g))}},s.unknownArguments=function(c,p,h,b,g=!0){var m;let x=e.getInternalMethods().getCommandInstance().getCommands(),O=[],$=e.getInternalMethods().getContext();if(Object.keys(c).forEach(z=>{!$r.includes(z)&&!Object.prototype.hasOwnProperty.call(h,z)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),z)&&!s.isValidAndSomeAliasIsNotNew(z,p)&&O.push(z)}),g&&($.commands.length>0||x.length>0||b)&&c._.slice($.commands.length).forEach(z=>{x.includes(""+z)||O.push(""+z)}),g){let V=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,Y=$.commands.length+V;Y<c._.length&&c._.slice(Y).forEach(N=>{N=String(N),!$.commands.includes(N)&&!O.includes(N)&&O.push(N)})}O.length&&t.fail(r("Unknown argument: %s","Unknown arguments: %s",O.length,O.join(", ")))},s.unknownCommands=function(c){let p=e.getInternalMethods().getCommandInstance().getCommands(),h=[],b=e.getInternalMethods().getContext();return(b.commands.length>0||p.length>0)&&c._.slice(b.commands.length).forEach(g=>{p.includes(""+g)||h.push(""+g)}),h.length>0?(t.fail(r("Unknown command: %s","Unknown commands: %s",h.length,h.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(c,p){if(!Object.prototype.hasOwnProperty.call(p,c))return!1;let h=e.parsed.newAliases;return[c,...p[c]].some(b=>!Object.prototype.hasOwnProperty.call(h,b)||!h[c])},s.limitedChoices=function(c){let p=e.getOptions(),h={};if(!Object.keys(p.choices).length)return;Object.keys(c).forEach(m=>{$r.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(p.choices,m)&&[].concat(c[m]).forEach(x=>{p.choices[m].indexOf(x)===-1&&x!==void 0&&(h[m]=(h[m]||[]).concat(x))})});let b=Object.keys(h);if(!b.length)return;let g=i("Invalid values:");b.forEach(m=>{g+=`
60
- ${i("Argument: %s, Given: %s, Choices: %s",m,t.stringifiedValues(h[m]),t.stringifiedValues(p.choices[m]))}`}),t.fail(g)};let o={};s.implies=function(c,p){j("<string|object> [array|number|string]",[c,p],arguments.length),typeof c=="object"?Object.keys(c).forEach(h=>{s.implies(h,c[h])}):(e.global(c),o[c]||(o[c]=[]),Array.isArray(p)?p.forEach(h=>s.implies(c,h)):(Oe(p,void 0,n),o[c].push(p)))},s.getImplied=function(){return o};function a(u,c){let p=Number(c);return c=isNaN(p)?c:p,typeof c=="number"?c=u._.length>=c:c.match(/^--no-.+/)?(c=c.match(/^--no-(.+)/)[1],c=!Object.prototype.hasOwnProperty.call(u,c)):c=Object.prototype.hasOwnProperty.call(u,c),c}s.implications=function(c){let p=[];if(Object.keys(o).forEach(h=>{let b=h;(o[h]||[]).forEach(g=>{let m=b,x=g;m=a(c,m),g=a(c,g),m&&!g&&p.push(` ${b} -> ${x}`)})}),p.length){let h=`${i("Implications failed:")}
61
- `;p.forEach(b=>{h+=b}),t.fail(h)}};let l={};s.conflicts=function(c,p){j("<string|object> [array|string]",[c,p],arguments.length),typeof c=="object"?Object.keys(c).forEach(h=>{s.conflicts(h,c[h])}):(e.global(c),l[c]||(l[c]=[]),Array.isArray(p)?p.forEach(h=>s.conflicts(c,h)):l[c].push(p))},s.getConflicting=()=>l,s.conflicting=function(c){Object.keys(c).forEach(p=>{l[p]&&l[p].forEach(h=>{h&&c[p]!==void 0&&c[h]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,h))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(p=>{l[p].forEach(h=>{h&&c[n.Parser.camelCase(p)]!==void 0&&c[n.Parser.camelCase(h)]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,h))})})},s.recommendCommands=function(c,p){p=p.sort((m,x)=>x.length-m.length);let b=null,g=1/0;for(let m=0,x;(x=p[m])!==void 0;m++){let O=Rr(c,x);O<=3&&O<g&&(g=O,b=x)}b&&t.fail(i("Did you mean %s?",b))},s.reset=function(c){return o=Xe(o,p=>!c[p]),l=Xe(l,p=>!c[p]),s};let f=[];return s.freeze=function(){f.push({implied:o,conflicting:l})},s.unfreeze=function(){let c=f.pop();Oe(c,void 0,n),{implied:o,conflicting:l}=c},s}A();var di=[],an;function Sn(e,t,n,i){an=i;let r={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return r;let s=/\.json|\..*rc$/.test(e.extends),o=null;if(s)o=Ja(t,e.extends);else try{o=Ce.resolve(e.extends)}catch(a){return e}Va(o),di.push(o),r=s?JSON.parse(an.readFileSync(o,"utf8")):Ce(e.extends),delete e.extends,r=Sn(r,an.path.dirname(o),n,an)}return di=[],n?Hr(r,e):Object.assign({},r,e)}function Va(e){if(di.indexOf(e)>-1)throw new ee(`Circular extended configurations: '${e}'.`)}function Ja(e,t){return an.path.resolve(e,t)}function Hr(e,t){let n={};function i(r){return r&&typeof r=="object"&&!Array.isArray(r)}Object.assign(n,e);for(let r of Object.keys(t))i(t[r])&&i(n[r])?n[r]=Hr(e[r],t[r]):n[r]=t[r];return n}var P=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},d=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},de,It,ln,Fe,Ie,In,tt,jt,jn,Le,Pn,De,Ue,je,Ne,zt,ye,L,Mn,Fn,Pe,Pt,qt,Mt,nt,Ln,W,Ft,Lt,Dt,G,He,fe;function ro(e){return(t=[],n=e.process.cwd(),i)=>{let r=new oo(t,n,i,e);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Br=Symbol("copyDoubleDash"),Wr=Symbol("copyDoubleDash"),hi=Symbol("deleteFromParserHintObject"),Yr=Symbol("emitWarning"),kr=Symbol("freeze"),zr=Symbol("getDollarZero"),Nt=Symbol("getParserConfiguration"),mi=Symbol("guessLocale"),qr=Symbol("guessVersion"),Gr=Symbol("parsePositionalNumbers"),gi=Symbol("pkgUp"),it=Symbol("populateParserHintArray"),Gt=Symbol("populateParserHintSingleValueDictionary"),bi=Symbol("populateParserHintArrayDictionary"),yi=Symbol("populateParserHintDictionary"),wi=Symbol("sanitizeKey"),Ci=Symbol("setKey"),Ai=Symbol("unfreeze"),Kr=Symbol("validateAsync"),Vr=Symbol("getCommandInstance"),Jr=Symbol("getContext"),Qr=Symbol("getHasOutput"),Zr=Symbol("getLoggerInstance"),Xr=Symbol("getParseContext"),eo=Symbol("getUsageInstance"),to=Symbol("getValidationInstance"),Dn=Symbol("hasParseCallback"),Tt=Symbol("postProcess"),no=Symbol("rebase"),vi=Symbol("reset"),cn=Symbol("runYargsParserAndExecuteCommands"),xi=Symbol("runValidation"),io=Symbol("setHasOutput"),Rt=Symbol("kTrackManuallySetKeys"),oo=class{constructor(t=[],n,i,r){this.customScriptName=!1,this.parsed=!1,de.set(this,void 0),It.set(this,void 0),ln.set(this,{commands:[],fullCommands:[]}),Fe.set(this,null),Ie.set(this,null),In.set(this,"show-hidden"),tt.set(this,null),jt.set(this,!0),jn.set(this,{}),Le.set(this,!0),Pn.set(this,[]),De.set(this,void 0),Ue.set(this,{}),je.set(this,!1),Ne.set(this,null),zt.set(this,void 0),ye.set(this,""),L.set(this,void 0),Mn.set(this,void 0),Fn.set(this,{}),Pe.set(this,null),Pt.set(this,null),qt.set(this,{}),Mt.set(this,{}),nt.set(this,void 0),Ln.set(this,!1),W.set(this,void 0),Ft.set(this,!1),Lt.set(this,!1),Dt.set(this,!1),G.set(this,void 0),He.set(this,null),fe.set(this,void 0),P(this,W,r,"f"),P(this,nt,t,"f"),P(this,It,n,"f"),P(this,Mn,i,"f"),P(this,De,new fi(this),"f"),this.$0=this[zr](),this[vi](),P(this,de,d(this,de,"f"),"f"),P(this,G,d(this,G,"f"),"f"),P(this,fe,d(this,fe,"f"),"f"),P(this,L,d(this,L,"f"),"f"),d(this,L,"f").showHiddenOpt=d(this,In,"f"),P(this,zt,this[Wr](),"f")}addHelpOpt(t,n){let i="help";return j("[string|boolean] [string]",[t,n],arguments.length),d(this,Ne,"f")&&(this[hi](d(this,Ne,"f")),P(this,Ne,null,"f")),t===!1&&n===void 0?this:(P(this,Ne,typeof t=="string"?t:i,"f"),this.boolean(d(this,Ne,"f")),this.describe(d(this,Ne,"f"),n||d(this,G,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(j("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let i=typeof t=="string"?t:d(this,In,"f");return this.boolean(i),this.describe(i,n||d(this,G,"f").deferY18nLookup("Show hidden options")),d(this,L,"f").showHiddenOpt=i,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return j("<object|string|array> [string|array]",[t,n],arguments.length),this[bi](this.alias.bind(this),"alias",t,n),this}array(t){return j("<array|string>",[t],arguments.length),this[it]("array",t),this[Rt](t),this}boolean(t){return j("<array|string>",[t],arguments.length),this[it]("boolean",t),this[Rt](t),this}check(t,n){return j("<function> [boolean]",[t,n],arguments.length),this.middleware((i,r)=>St(()=>t(i,r.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&d(this,G,"f").fail(s.toString(),s):d(this,G,"f").fail(d(this,W,"f").y18n.__("Argument check failed: %s",t.toString())),i),s=>(d(this,G,"f").fail(s.message?s.message:s.toString(),s),i)),!1,n),this}choices(t,n){return j("<object|string|array> [string|array]",[t,n],arguments.length),this[bi](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(j("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new ee("coerce callback must be provided");for(let i of t)this.coerce(i,n);return this}else if(typeof t=="object"){for(let i of Object.keys(t))this.coerce(i,t[i]);return this}if(!n)throw new ee("coerce callback must be provided");return d(this,L,"f").key[t]=!0,d(this,De,"f").addCoerceMiddleware((i,r)=>{let s;return St(()=>(s=r.getAliases(),n(i[t])),o=>{if(i[t]=o,s[t])for(let a of s[t])i[a]=o;return i},o=>{throw new ee(o.message)})},t),this}conflicts(t,n){return j("<string|object> [string|array]",[t,n],arguments.length),d(this,fe,"f").conflicts(t,n),this}config(t="config",n,i){return j("[object|string] [string|function] [function]",[t,n,i],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=Sn(t,d(this,It,"f"),this[Nt]()["deep-merge-config"]||!1,d(this,W,"f")),d(this,L,"f").configObjects=(d(this,L,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(i=n,n=void 0),this.describe(t,n||d(this,G,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(r=>{d(this,L,"f").config[r]=i||!0}),this)}completion(t,n,i){return j("[string] [string|boolean|function] [function]",[t,n,i],arguments.length),typeof n=="function"&&(i=n,n=void 0),P(this,Ie,t||d(this,Ie,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(d(this,Ie,"f"),n),i&&d(this,Fe,"f").registerFunction(i),this}command(t,n,i,r,s,o){return j("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,i,r,s,o],arguments.length),d(this,de,"f").addHandler(t,n,i,r,s,o),this}commands(t,n,i,r,s,o){return this.command(t,n,i,r,s,o)}commandDir(t,n){j("<string> [object]",[t,n],arguments.length);let i=d(this,Mn,"f")||d(this,W,"f").require;return d(this,de,"f").addDirectory(t,i,d(this,W,"f").getCallerFile(),n),this}count(t){return j("<array|string>",[t],arguments.length),this[it]("count",t),this[Rt](t),this}default(t,n,i){return j("<object|string|array> [*] [string]",[t,n,i],arguments.length),i&&(ci(t,d(this,W,"f")),d(this,L,"f").defaultDescription[t]=i),typeof n=="function"&&(ci(t,d(this,W,"f")),d(this,L,"f").defaultDescription[t]||(d(this,L,"f").defaultDescription[t]=d(this,G,"f").functionDescription(n)),n=n.call()),this[Gt](this.default.bind(this),"default",t,n),this}defaults(t,n,i){return this.default(t,n,i)}demandCommand(t=1,n,i,r){return j("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,n,i,r],arguments.length),typeof n!="number"&&(i=n,n=1/0),this.global("_",!1),d(this,L,"f").demandedCommands._={min:t,max:n,minMsg:i,maxMsg:r},this}demand(t,n,i){return Array.isArray(n)?(n.forEach(r=>{Oe(i,!0,d(this,W,"f")),this.demandOption(r,i)}),n=1/0):typeof n!="number"&&(i=n,n=1/0),typeof t=="number"?(Oe(i,!0,d(this,W,"f")),this.demandCommand(t,n,i,i)):Array.isArray(t)?t.forEach(r=>{Oe(i,!0,d(this,W,"f")),this.demandOption(r,i)}):typeof i=="string"?this.demandOption(t,i):(i===!0||typeof i=="undefined")&&this.demandOption(t),this}demandOption(t,n){return j("<object|string|array> [string]",[t,n],arguments.length),this[Gt](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return j("<string> [string|boolean]",[t,n],arguments.length),d(this,L,"f").deprecatedOptions[t]=n,this}describe(t,n){return j("<object|string|array> [string]",[t,n],arguments.length),this[Ci](t,!0),d(this,G,"f").describe(t,n),this}detectLocale(t){return j("<boolean>",[t],arguments.length),P(this,jt,t,"f"),this}env(t){return j("[string|boolean]",[t],arguments.length),t===!1?delete d(this,L,"f").envPrefix:d(this,L,"f").envPrefix=t||"",this}epilogue(t){return j("<string>",[t],arguments.length),d(this,G,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return j("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(i=>this.example(...i)):d(this,G,"f").example(t,n),this}exit(t,n){P(this,je,!0,"f"),P(this,tt,n,"f"),d(this,Le,"f")&&d(this,W,"f").process.exit(t)}exitProcess(t=!0){return j("[boolean]",[t],arguments.length),P(this,Le,t,"f"),this}fail(t){if(j("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new ee("Invalid first argument. Expected function or boolean 'false'");return d(this,G,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return j("<array> [function]",[t,n],arguments.length),n?d(this,Fe,"f").getCompletion(t,n):new Promise((i,r)=>{d(this,Fe,"f").getCompletion(t,(s,o)=>{s?r(s):i(o)})})}getDemandedOptions(){return j([],0),d(this,L,"f").demandedOptions}getDemandedCommands(){return j([],0),d(this,L,"f").demandedCommands}getDeprecatedOptions(){return j([],0),d(this,L,"f").deprecatedOptions}getDetectLocale(){return d(this,jt,"f")}getExitProcess(){return d(this,Le,"f")}getGroups(){return Object.assign({},d(this,Ue,"f"),d(this,Mt,"f"))}getHelp(){if(P(this,je,!0,"f"),!d(this,G,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[cn](d(this,nt,"f"),void 0,void 0,0,!0);if(re(n))return n.then(()=>d(this,G,"f").help())}let t=d(this,de,"f").runDefaultBuilderOn(this);if(re(t))return t.then(()=>d(this,G,"f").help())}return Promise.resolve(d(this,G,"f").help())}getOptions(){return d(this,L,"f")}getStrict(){return d(this,Ft,"f")}getStrictCommands(){return d(this,Lt,"f")}getStrictOptions(){return d(this,Dt,"f")}global(t,n){return j("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?d(this,L,"f").local=d(this,L,"f").local.filter(i=>t.indexOf(i)===-1):t.forEach(i=>{d(this,L,"f").local.includes(i)||d(this,L,"f").local.push(i)}),this}group(t,n){j("<string|array> <string>",[t,n],arguments.length);let i=d(this,Mt,"f")[n]||d(this,Ue,"f")[n];d(this,Mt,"f")[n]&&delete d(this,Mt,"f")[n];let r={};return d(this,Ue,"f")[n]=(i||[]).concat(t).filter(s=>r[s]?!1:r[s]=!0),this}hide(t){return j("<string>",[t],arguments.length),d(this,L,"f").hiddenOptions.push(t),this}implies(t,n){return j("<string|object> [number|string|array]",[t,n],arguments.length),d(this,fe,"f").implies(t,n),this}locale(t){return j("[string]",[t],arguments.length),t?(P(this,jt,!1,"f"),d(this,W,"f").y18n.setLocale(t),this):(this[mi](),d(this,W,"f").y18n.getLocale())}middleware(t,n,i){return d(this,De,"f").addMiddleware(t,!!n,i)}nargs(t,n){return j("<string|object|array> [number]",[t,n],arguments.length),this[Gt](this.nargs.bind(this),"narg",t,n),this}normalize(t){return j("<array|string>",[t],arguments.length),this[it]("normalize",t),this}number(t){return j("<array|string>",[t],arguments.length),this[it]("number",t),this[Rt](t),this}option(t,n){if(j("<string|object> [object]",[t,n],arguments.length),typeof t=="object")Object.keys(t).forEach(i=>{this.options(i,t[i])});else{typeof n!="object"&&(n={}),this[Rt](t),d(this,He,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[Yr](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
62
- `),void 0,"versionWarning"),d(this,L,"f").key[t]=!0,n.alias&&this.alias(t,n.alias);let i=n.deprecate||n.deprecated;i&&this.deprecateOption(t,i);let r=n.demand||n.required||n.require;r&&this.demand(t,r),n.demandOption&&this.demandOption(t,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),"default"in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(t),typeof n.global=="boolean"&&this.global(t,n.global),n.defaultDescription&&(d(this,L,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let s=n.describe||n.description||n.desc;this.describe(t,s),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,i){j("[string|array] [function|boolean|object] [function]",[t,n,i],arguments.length),this[kr](),typeof t=="undefined"&&(t=d(this,nt,"f")),typeof n=="object"&&(P(this,Pt,n,"f"),n=i),typeof n=="function"&&(P(this,Pe,n,"f"),n=!1),n||P(this,nt,t,"f"),d(this,Pe,"f")&&P(this,Le,!1,"f");let r=this[cn](t,!!n),s=this.parsed;return d(this,Fe,"f").setParsed(this.parsed),re(r)?r.then(o=>(d(this,Pe,"f")&&d(this,Pe,"f").call(this,d(this,tt,"f"),o,d(this,ye,"f")),o)).catch(o=>{throw d(this,Pe,"f")&&d(this,Pe,"f")(o,this.parsed.argv,d(this,ye,"f")),o}).finally(()=>{this[Ai](),this.parsed=s}):(d(this,Pe,"f")&&d(this,Pe,"f").call(this,d(this,tt,"f"),r,d(this,ye,"f")),this[Ai](),this.parsed=s,r)}parseAsync(t,n,i){let r=this.parse(t,n,i);return re(r)?r:Promise.resolve(r)}parseSync(t,n,i){let r=this.parse(t,n,i);if(re(r))throw new ee(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(t){return j("<object>",[t],arguments.length),P(this,Fn,t,"f"),this}pkgConf(t,n){j("<string> [string]",[t,n],arguments.length);let i=null,r=this[gi](n||d(this,It,"f"));return r[t]&&typeof r[t]=="object"&&(i=Sn(r[t],n||d(this,It,"f"),this[Nt]()["deep-merge-config"]||!1,d(this,W,"f")),d(this,L,"f").configObjects=(d(this,L,"f").configObjects||[]).concat(i)),this}positional(t,n){j("<string> <object>",[t,n],arguments.length);let i=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=Xe(n,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:i.includes(o));let r=d(this,ln,"f").fullCommands[d(this,ln,"f").fullCommands.length-1],s=r?d(this,de,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return Yt(s).forEach(o=>{let a=s[o];Array.isArray(a)?a.indexOf(t)!==-1&&(n[o]=!0):a[t]&&!(o in n)&&(n[o]=a[t])}),this.group(t,d(this,G,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return j("[boolean]",[t],arguments.length),P(this,Ln,t,"f"),this}required(t,n,i){return this.demand(t,n,i)}require(t,n,i){return this.demand(t,n,i)}requiresArg(t){return j("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&d(this,L,"f").narg[t]?this:(this[Gt](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return j("[string] [string]",[t,n],arguments.length),t=t||this.$0,d(this,zt,"f").log(d(this,Fe,"f").generateCompletionScript(t,n||d(this,Ie,"f")||"completion")),this}showHelp(t){if(j("[string|function]",[t],arguments.length),P(this,je,!0,"f"),!d(this,G,"f").hasCachedHelpMessage()){if(!this.parsed){let i=this[cn](d(this,nt,"f"),void 0,void 0,0,!0);if(re(i))return i.then(()=>{d(this,G,"f").showHelp(t)}),this}let n=d(this,de,"f").runDefaultBuilderOn(this);if(re(n))return n.then(()=>{d(this,G,"f").showHelp(t)}),this}return d(this,G,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return j("[boolean|string] [string]",[t,n],arguments.length),d(this,G,"f").showHelpOnFail(t,n),this}showVersion(t){return j("[string|function]",[t],arguments.length),d(this,G,"f").showVersion(t),this}skipValidation(t){return j("<array|string>",[t],arguments.length),this[it]("skipValidation",t),this}strict(t){return j("[boolean]",[t],arguments.length),P(this,Ft,t!==!1,"f"),this}strictCommands(t){return j("[boolean]",[t],arguments.length),P(this,Lt,t!==!1,"f"),this}strictOptions(t){return j("[boolean]",[t],arguments.length),P(this,Dt,t!==!1,"f"),this}string(t){return j("<array|string>",[t],arguments.length),this[it]("string",t),this[Rt](t),this}terminalWidth(){return j([],0),d(this,W,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return j("<object>",[t],arguments.length),P(this,jt,!1,"f"),d(this,W,"f").y18n.updateLocale(t),this}usage(t,n,i,r){if(j("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,i,r],arguments.length),n!==void 0){if(Oe(t,null,d(this,W,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,i,r);throw new ee(".usage() description must start with $0 if being used as alias for .command()")}else return d(this,G,"f").usage(t),this}version(t,n,i){let r="version";if(j("[boolean|string] [string] [string]",[t,n,i],arguments.length),d(this,He,"f")&&(this[hi](d(this,He,"f")),d(this,G,"f").version(void 0),P(this,He,null,"f")),arguments.length===0)i=this[qr](),t=r;else if(arguments.length===1){if(t===!1)return this;i=t,t=r}else arguments.length===2&&(i=n,n=void 0);return P(this,He,typeof t=="string"?t:r,"f"),n=n||d(this,G,"f").deferY18nLookup("Show version number"),d(this,G,"f").version(i||void 0),this.boolean(d(this,He,"f")),this.describe(d(this,He,"f"),n),this}wrap(t){return j("<number|null|undefined>",[t],arguments.length),d(this,G,"f").wrap(t),this}[(de=new WeakMap,It=new WeakMap,ln=new WeakMap,Fe=new WeakMap,Ie=new WeakMap,In=new WeakMap,tt=new WeakMap,jt=new WeakMap,jn=new WeakMap,Le=new WeakMap,Pn=new WeakMap,De=new WeakMap,Ue=new WeakMap,je=new WeakMap,Ne=new WeakMap,zt=new WeakMap,ye=new WeakMap,L=new WeakMap,Mn=new WeakMap,Fn=new WeakMap,Pe=new WeakMap,Pt=new WeakMap,qt=new WeakMap,Mt=new WeakMap,nt=new WeakMap,Ln=new WeakMap,W=new WeakMap,Ft=new WeakMap,Lt=new WeakMap,Dt=new WeakMap,G=new WeakMap,He=new WeakMap,fe=new WeakMap,Br)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[Wr](){return{log:(...t)=>{this[Dn]()||console.log(...t),P(this,je,!0,"f"),d(this,ye,"f").length&&P(this,ye,d(this,ye,"f")+`
63
- `,"f"),P(this,ye,d(this,ye,"f")+t.join(" "),"f")},error:(...t)=>{this[Dn]()||console.error(...t),P(this,je,!0,"f"),d(this,ye,"f").length&&P(this,ye,d(this,ye,"f")+`
64
- `,"f"),P(this,ye,d(this,ye,"f")+t.join(" "),"f")}}}[hi](t){Yt(d(this,L,"f")).forEach(n=>{if((r=>r==="configObjects")(n))return;let i=d(this,L,"f")[n];Array.isArray(i)?i.includes(t)&&i.splice(i.indexOf(t),1):typeof i=="object"&&delete i[t]}),delete d(this,G,"f").getDescriptions()[t]}[Yr](t,n,i){d(this,jn,"f")[i]||(d(this,W,"f").process.emitWarning(t,n),d(this,jn,"f")[i]=!0)}[kr](){d(this,Pn,"f").push({options:d(this,L,"f"),configObjects:d(this,L,"f").configObjects.slice(0),exitProcess:d(this,Le,"f"),groups:d(this,Ue,"f"),strict:d(this,Ft,"f"),strictCommands:d(this,Lt,"f"),strictOptions:d(this,Dt,"f"),completionCommand:d(this,Ie,"f"),output:d(this,ye,"f"),exitError:d(this,tt,"f"),hasOutput:d(this,je,"f"),parsed:this.parsed,parseFn:d(this,Pe,"f"),parseContext:d(this,Pt,"f")}),d(this,G,"f").freeze(),d(this,fe,"f").freeze(),d(this,de,"f").freeze(),d(this,De,"f").freeze()}[zr](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(d(this,W,"f").process.argv()[0])?n=d(this,W,"f").process.argv().slice(1,2):n=d(this,W,"f").process.argv().slice(0,1),t=n.map(i=>{let r=this[no](d(this,It,"f"),i);return i.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<i.length?r:i}).join(" ").trim(),d(this,W,"f").getEnv("_")&&d(this,W,"f").getProcessArgvBin()===d(this,W,"f").getEnv("_")&&(t=d(this,W,"f").getEnv("_").replace(`${d(this,W,"f").path.dirname(d(this,W,"f").process.execPath())}/`,"")),t}[Nt](){return d(this,Fn,"f")}[mi](){if(!d(this,jt,"f"))return;let t=d(this,W,"f").getEnv("LC_ALL")||d(this,W,"f").getEnv("LC_MESSAGES")||d(this,W,"f").getEnv("LANG")||d(this,W,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[qr](){return this[gi]().version||"unknown"}[Gr](t){let n=t["--"]?t["--"]:t._;for(let i=0,r;(r=n[i])!==void 0;i++)d(this,W,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(n[i]=Number(r));return t}[gi](t){let n=t||"*";if(d(this,qt,"f")[n])return d(this,qt,"f")[n];let i={};try{let r=t||d(this,W,"f").mainFilename;!t&&d(this,W,"f").path.extname(r)&&(r=d(this,W,"f").path.dirname(r));let s=d(this,W,"f").findUp(r,(o,a)=>{if(a.includes("package.json"))return"package.json"});Oe(s,void 0,d(this,W,"f")),i=JSON.parse(d(this,W,"f").readFileSync(s,"utf8"))}catch(r){}return d(this,qt,"f")[n]=i||{},d(this,qt,"f")[n]}[it](t,n){n=[].concat(n),n.forEach(i=>{i=this[wi](i),d(this,L,"f")[t].push(i)})}[Gt](t,n,i,r){this[yi](t,n,i,r,(s,o,a)=>{d(this,L,"f")[s][o]=a})}[bi](t,n,i,r){this[yi](t,n,i,r,(s,o,a)=>{d(this,L,"f")[s][o]=(d(this,L,"f")[s][o]||[]).concat(a)})}[yi](t,n,i,r,s){if(Array.isArray(i))i.forEach(o=>{t(o,r)});else if((o=>typeof o=="object")(i))for(let o of Yt(i))t(o,i[o]);else s(n,this[wi](i),r)}[wi](t){return t==="__proto__"?"___proto___":t}[Ci](t,n){return this[Gt](this[Ci].bind(this),"key",t,n),this}[Ai](){var t,n,i,r,s,o,a,l,f,u,c,p;let h=d(this,Pn,"f").pop();Oe(h,void 0,d(this,W,"f"));let b;t=this,n=this,i=this,r=this,s=this,o=this,a=this,l=this,f=this,u=this,c=this,p=this,{options:{set value(g){P(t,L,g,"f")}}.value,configObjects:b,exitProcess:{set value(g){P(n,Le,g,"f")}}.value,groups:{set value(g){P(i,Ue,g,"f")}}.value,output:{set value(g){P(r,ye,g,"f")}}.value,exitError:{set value(g){P(s,tt,g,"f")}}.value,hasOutput:{set value(g){P(o,je,g,"f")}}.value,parsed:this.parsed,strict:{set value(g){P(a,Ft,g,"f")}}.value,strictCommands:{set value(g){P(l,Lt,g,"f")}}.value,strictOptions:{set value(g){P(f,Dt,g,"f")}}.value,completionCommand:{set value(g){P(u,Ie,g,"f")}}.value,parseFn:{set value(g){P(c,Pe,g,"f")}}.value,parseContext:{set value(g){P(p,Pt,g,"f")}}.value}=h,d(this,L,"f").configObjects=b,d(this,G,"f").unfreeze(),d(this,fe,"f").unfreeze(),d(this,de,"f").unfreeze(),d(this,De,"f").unfreeze()}[Kr](t,n){return St(n,i=>(t(i),i))}getInternalMethods(){return{getCommandInstance:this[Vr].bind(this),getContext:this[Jr].bind(this),getHasOutput:this[Qr].bind(this),getLoggerInstance:this[Zr].bind(this),getParseContext:this[Xr].bind(this),getParserConfiguration:this[Nt].bind(this),getUsageInstance:this[eo].bind(this),getValidationInstance:this[to].bind(this),hasParseCallback:this[Dn].bind(this),postProcess:this[Tt].bind(this),reset:this[vi].bind(this),runValidation:this[xi].bind(this),runYargsParserAndExecuteCommands:this[cn].bind(this),setHasOutput:this[io].bind(this)}}[Vr](){return d(this,de,"f")}[Jr](){return d(this,ln,"f")}[Qr](){return d(this,je,"f")}[Zr](){return d(this,zt,"f")}[Xr](){return d(this,Pt,"f")||{}}[eo](){return d(this,G,"f")}[to](){return d(this,fe,"f")}[Dn](){return!!d(this,Pe,"f")}[Tt](t,n,i,r){return i||re(t)||(n||(t=this[Br](t)),(this[Nt]()["parse-positional-numbers"]||this[Nt]()["parse-positional-numbers"]===void 0)&&(t=this[Gr](t)),r&&(t=Et(t,this,d(this,De,"f").getMiddleware(),!1))),t}[vi](t={}){P(this,L,d(this,L,"f")||{},"f");let n={};n.local=d(this,L,"f").local||[],n.configObjects=d(this,L,"f").configObjects||[];let i={};n.local.forEach(o=>{i[o]=!0,(t[o]||[]).forEach(a=>{i[a]=!0})}),Object.assign(d(this,Mt,"f"),Object.keys(d(this,Ue,"f")).reduce((o,a)=>{let l=d(this,Ue,"f")[a].filter(f=>!(f in i));return l.length>0&&(o[a]=l),o},{})),P(this,Ue,{},"f");let r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return r.forEach(o=>{n[o]=(d(this,L,"f")[o]||[]).filter(a=>!i[a])}),s.forEach(o=>{n[o]=Xe(d(this,L,"f")[o],a=>!i[a])}),n.envPrefix=d(this,L,"f").envPrefix,P(this,L,n,"f"),P(this,G,d(this,G,"f")?d(this,G,"f").reset(i):Fr(this,d(this,W,"f")),"f"),P(this,fe,d(this,fe,"f")?d(this,fe,"f").reset(i):Ur(this,d(this,G,"f"),d(this,W,"f")),"f"),P(this,de,d(this,de,"f")?d(this,de,"f").reset():jr(d(this,G,"f"),d(this,fe,"f"),d(this,De,"f"),d(this,W,"f")),"f"),d(this,Fe,"f")||P(this,Fe,Tr(this,d(this,G,"f"),d(this,de,"f"),d(this,W,"f")),"f"),d(this,De,"f").reset(),P(this,Ie,null,"f"),P(this,ye,"","f"),P(this,tt,null,"f"),P(this,je,!1,"f"),this.parsed=!1,this}[no](t,n){return d(this,W,"f").path.relative(t,n)}[cn](t,n,i,r=0,s=!1){let o=!!i||s;t=t||d(this,nt,"f"),d(this,L,"f").__=d(this,W,"f").y18n.__,d(this,L,"f").configuration=this[Nt]();let a=!!d(this,L,"f").configuration["populate--"],l=Object.assign({},d(this,L,"f").configuration,{"populate--":!0}),f=d(this,W,"f").Parser.detailed(t,Object.assign({},d(this,L,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),u=Object.assign(f.argv,d(this,Pt,"f")),c,p=f.aliases,h=!1,b=!1;Object.keys(u).forEach(g=>{g===d(this,Ne,"f")&&u[g]?h=!0:g===d(this,He,"f")&&u[g]&&(b=!0)}),u.$0=this.$0,this.parsed=f,r===0&&d(this,G,"f").clearCachedHelpMessage();try{if(this[mi](),n)return this[Tt](u,a,!!i,!1);d(this,Ne,"f")&&[d(this,Ne,"f")].concat(p[d(this,Ne,"f")]||[]).filter($=>$.length>1).includes(""+u._[u._.length-1])&&(u._.pop(),h=!0);let g=d(this,de,"f").getCommands(),m=d(this,Fe,"f").completionKey in u,x=h||m||s;if(u._.length){if(g.length){let O;for(let $=r||0,z;u._[$]!==void 0;$++)if(z=String(u._[$]),g.includes(z)&&z!==d(this,Ie,"f")){let V=d(this,de,"f").runCommand(z,this,f,$+1,s,h||b||s);return this[Tt](V,a,!!i,!1)}else if(!O&&z!==d(this,Ie,"f")){O=z;break}!d(this,de,"f").hasDefaultCommand()&&d(this,Ln,"f")&&O&&!x&&d(this,fe,"f").recommendCommands(O,g)}d(this,Ie,"f")&&u._.includes(d(this,Ie,"f"))&&!m&&(d(this,Le,"f")&&et(!0),this.showCompletionScript(),this.exit(0))}if(d(this,de,"f").hasDefaultCommand()&&!x){let O=d(this,de,"f").runCommand(null,this,f,0,s,h||b||s);return this[Tt](O,a,!!i,!1)}if(m){d(this,Le,"f")&&et(!0),t=[].concat(t);let O=t.slice(t.indexOf(`--${d(this,Fe,"f").completionKey}`)+1);return d(this,Fe,"f").getCompletion(O,($,z)=>{if($)throw new ee($.message);(z||[]).forEach(V=>{d(this,zt,"f").log(V)}),this.exit(0)}),this[Tt](u,!a,!!i,!1)}if(d(this,je,"f")||(h?(d(this,Le,"f")&&et(!0),o=!0,this.showHelp("log"),this.exit(0)):b&&(d(this,Le,"f")&&et(!0),o=!0,d(this,G,"f").showVersion("log"),this.exit(0))),!o&&d(this,L,"f").skipValidation.length>0&&(o=Object.keys(u).some(O=>d(this,L,"f").skipValidation.indexOf(O)>=0&&u[O]===!0)),!o){if(f.error)throw new ee(f.error.message);if(!m){let O=this[xi](p,{},f.error);i||(c=Et(u,this,d(this,De,"f").getMiddleware(),!0)),c=this[Kr](O,c!=null?c:u),re(c)&&!i&&(c=c.then(()=>Et(u,this,d(this,De,"f").getMiddleware(),!1)))}}}catch(g){if(g instanceof ee)d(this,G,"f").fail(g.message,g);else throw g}return this[Tt](c!=null?c:u,a,!!i,!0)}[xi](t,n,i,r){let s={...this.getDemandedOptions()};return o=>{if(i)throw new ee(i.message);d(this,fe,"f").nonOptionCount(o),d(this,fe,"f").requiredArguments(o,s);let a=!1;d(this,Lt,"f")&&(a=d(this,fe,"f").unknownCommands(o)),d(this,Ft,"f")&&!a?d(this,fe,"f").unknownArguments(o,t,n,!!r):d(this,Dt,"f")&&d(this,fe,"f").unknownArguments(o,t,{},!1,!1),d(this,fe,"f").limitedChoices(o),d(this,fe,"f").implications(o),d(this,fe,"f").conflicting(o)}}[io](){P(this,je,!0,"f")}[Rt](t){if(typeof t=="string")d(this,L,"f").key[t]=!0;else for(let n of t)d(this,L,"f").key[n]=!0}};function Pr(e){return!!e&&typeof e.getInternalMethods=="function"}var Qa=ro(xr),Kt=Qa;A();A();import Cp from"isomorphic-unfetch";A();A();var Za=Object.create,Nn=Object.defineProperty,Xa=Object.defineProperties,el=Object.getOwnPropertyDescriptor,tl=Object.getOwnPropertyDescriptors,nl=Object.getOwnPropertyNames,so=Object.getOwnPropertySymbols,il=Object.getPrototypeOf,co=Object.prototype.hasOwnProperty,rl=Object.prototype.propertyIsEnumerable,ao=(e,t,n)=>t in e?Nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ol=(e,t)=>{for(var n in t||(t={}))co.call(t,n)&&ao(e,n,t[n]);if(so)for(var n of so(t))rl.call(t,n)&&ao(e,n,t[n]);return e},sl=(e,t)=>Xa(e,tl(t)),al=e=>Nn(e,"__esModule",{value:!0}),lo=(e=>typeof Ce!="undefined"?Ce:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof Ce!="undefined"?Ce:t)[n]}):e)(function(e){if(typeof Ce!="undefined")return Ce.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),ll=(e,t)=>()=>(e&&(t=e(e=0)),t),Be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),cl=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of nl(t))!co.call(e,r)&&(n||r!=="default")&&Nn(e,r,{get:()=>t[r],enumerable:!(i=el(t,r))||i.enumerable});return e},Oi=(e,t)=>cl(al(Nn(e!=null?Za(il(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),we=ll(()=>{}),fl=Be((e,t)=>{"use strict";we(),t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),fo=Be((e,t)=>{we();var n=fl(),i={};for(let o of Object.keys(n))i[n[o]]=o;var r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};t.exports=r;for(let o of Object.keys(r)){if(!("channels"in r[o]))throw new Error("missing channels property: "+o);if(!("labels"in r[o]))throw new Error("missing channel labels property: "+o);if(r[o].labels.length!==r[o].channels)throw new Error("channel and label counts mismatch: "+o);let{channels:a,labels:l}=r[o];delete r[o].channels,delete r[o].labels,Object.defineProperty(r[o],"channels",{value:a}),Object.defineProperty(r[o],"labels",{value:l})}r.rgb.hsl=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255,u=Math.min(a,l,f),c=Math.max(a,l,f),p=c-u,h,b;c===u?h=0:a===c?h=(l-f)/p:l===c?h=2+(f-a)/p:f===c&&(h=4+(a-l)/p),h=Math.min(h*60,360),h<0&&(h+=360);let g=(u+c)/2;return c===u?b=0:g<=.5?b=p/(c+u):b=p/(2-c-u),[h,b*100,g*100]},r.rgb.hsv=function(o){let a,l,f,u,c,p=o[0]/255,h=o[1]/255,b=o[2]/255,g=Math.max(p,h,b),m=g-Math.min(p,h,b),x=function(O){return(g-O)/6/m+1/2};return m===0?(u=0,c=0):(c=m/g,a=x(p),l=x(h),f=x(b),p===g?u=f-l:h===g?u=1/3+a-f:b===g&&(u=2/3+l-a),u<0?u+=1:u>1&&(u-=1)),[u*360,c*100,g*100]},r.rgb.hwb=function(o){let a=o[0],l=o[1],f=o[2],u=r.rgb.hsl(o)[0],c=1/255*Math.min(a,Math.min(l,f));return f=1-1/255*Math.max(a,Math.max(l,f)),[u,c*100,f*100]},r.rgb.cmyk=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255,u=Math.min(1-a,1-l,1-f),c=(1-a-u)/(1-u)||0,p=(1-l-u)/(1-u)||0,h=(1-f-u)/(1-u)||0;return[c*100,p*100,h*100,u*100]};function s(o,a){return(o[0]-a[0])**2+(o[1]-a[1])**2+(o[2]-a[2])**2}r.rgb.keyword=function(o){let a=i[o];if(a)return a;let l=1/0,f;for(let u of Object.keys(n)){let c=n[u],p=s(o,c);p<l&&(l=p,f=u)}return f},r.keyword.rgb=function(o){return n[o]},r.rgb.xyz=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255;a=a>.04045?((a+.055)/1.055)**2.4:a/12.92,l=l>.04045?((l+.055)/1.055)**2.4:l/12.92,f=f>.04045?((f+.055)/1.055)**2.4:f/12.92;let u=a*.4124+l*.3576+f*.1805,c=a*.2126+l*.7152+f*.0722,p=a*.0193+l*.1192+f*.9505;return[u*100,c*100,p*100]},r.rgb.lab=function(o){let a=r.rgb.xyz(o),l=a[0],f=a[1],u=a[2];l/=95.047,f/=100,u/=108.883,l=l>.008856?l**(1/3):7.787*l+16/116,f=f>.008856?f**(1/3):7.787*f+16/116,u=u>.008856?u**(1/3):7.787*u+16/116;let c=116*f-16,p=500*(l-f),h=200*(f-u);return[c,p,h]},r.hsl.rgb=function(o){let a=o[0]/360,l=o[1]/100,f=o[2]/100,u,c,p;if(l===0)return p=f*255,[p,p,p];f<.5?u=f*(1+l):u=f+l-f*l;let h=2*f-u,b=[0,0,0];for(let g=0;g<3;g++)c=a+1/3*-(g-1),c<0&&c++,c>1&&c--,6*c<1?p=h+(u-h)*6*c:2*c<1?p=u:3*c<2?p=h+(u-h)*(2/3-c)*6:p=h,b[g]=p*255;return b},r.hsl.hsv=function(o){let a=o[0],l=o[1]/100,f=o[2]/100,u=l,c=Math.max(f,.01);f*=2,l*=f<=1?f:2-f,u*=c<=1?c:2-c;let p=(f+l)/2,h=f===0?2*u/(c+u):2*l/(f+l);return[a,h*100,p*100]},r.hsv.rgb=function(o){let a=o[0]/60,l=o[1]/100,f=o[2]/100,u=Math.floor(a)%6,c=a-Math.floor(a),p=255*f*(1-l),h=255*f*(1-l*c),b=255*f*(1-l*(1-c));switch(f*=255,u){case 0:return[f,b,p];case 1:return[h,f,p];case 2:return[p,f,b];case 3:return[p,h,f];case 4:return[b,p,f];case 5:return[f,p,h]}},r.hsv.hsl=function(o){let a=o[0],l=o[1]/100,f=o[2]/100,u=Math.max(f,.01),c,p;p=(2-l)*f;let h=(2-l)*u;return c=l*u,c/=h<=1?h:2-h,c=c||0,p/=2,[a,c*100,p*100]},r.hwb.rgb=function(o){let a=o[0]/360,l=o[1]/100,f=o[2]/100,u=l+f,c;u>1&&(l/=u,f/=u);let p=Math.floor(6*a),h=1-f;c=6*a-p,(p&1)!==0&&(c=1-c);let b=l+c*(h-l),g,m,x;switch(p){default:case 6:case 0:g=h,m=b,x=l;break;case 1:g=b,m=h,x=l;break;case 2:g=l,m=h,x=b;break;case 3:g=l,m=b,x=h;break;case 4:g=b,m=l,x=h;break;case 5:g=h,m=l,x=b;break}return[g*255,m*255,x*255]},r.cmyk.rgb=function(o){let a=o[0]/100,l=o[1]/100,f=o[2]/100,u=o[3]/100,c=1-Math.min(1,a*(1-u)+u),p=1-Math.min(1,l*(1-u)+u),h=1-Math.min(1,f*(1-u)+u);return[c*255,p*255,h*255]},r.xyz.rgb=function(o){let a=o[0]/100,l=o[1]/100,f=o[2]/100,u,c,p;return u=a*3.2406+l*-1.5372+f*-.4986,c=a*-.9689+l*1.8758+f*.0415,p=a*.0557+l*-.204+f*1.057,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,p=p>.0031308?1.055*p**(1/2.4)-.055:p*12.92,u=Math.min(Math.max(0,u),1),c=Math.min(Math.max(0,c),1),p=Math.min(Math.max(0,p),1),[u*255,c*255,p*255]},r.xyz.lab=function(o){let a=o[0],l=o[1],f=o[2];a/=95.047,l/=100,f/=108.883,a=a>.008856?a**(1/3):7.787*a+16/116,l=l>.008856?l**(1/3):7.787*l+16/116,f=f>.008856?f**(1/3):7.787*f+16/116;let u=116*l-16,c=500*(a-l),p=200*(l-f);return[u,c,p]},r.lab.xyz=function(o){let a=o[0],l=o[1],f=o[2],u,c,p;c=(a+16)/116,u=l/500+c,p=c-f/200;let h=c**3,b=u**3,g=p**3;return c=h>.008856?h:(c-16/116)/7.787,u=b>.008856?b:(u-16/116)/7.787,p=g>.008856?g:(p-16/116)/7.787,u*=95.047,c*=100,p*=108.883,[u,c,p]},r.lab.lch=function(o){let a=o[0],l=o[1],f=o[2],u;u=Math.atan2(f,l)*360/2/Math.PI,u<0&&(u+=360);let c=Math.sqrt(l*l+f*f);return[a,c,u]},r.lch.lab=function(o){let a=o[0],l=o[1],f=o[2]/360*2*Math.PI,u=l*Math.cos(f),c=l*Math.sin(f);return[a,u,c]},r.rgb.ansi16=function(o,a=null){let[l,f,u]=o,c=a===null?r.rgb.hsv(o)[2]:a;if(c=Math.round(c/50),c===0)return 30;let p=30+(Math.round(u/255)<<2|Math.round(f/255)<<1|Math.round(l/255));return c===2&&(p+=60),p},r.hsv.ansi16=function(o){return r.rgb.ansi16(r.hsv.rgb(o),o[2])},r.rgb.ansi256=function(o){let a=o[0],l=o[1],f=o[2];return a===l&&l===f?a<8?16:a>248?231:Math.round((a-8)/247*24)+232:16+36*Math.round(a/255*5)+6*Math.round(l/255*5)+Math.round(f/255*5)},r.ansi16.rgb=function(o){let a=o%10;if(a===0||a===7)return o>50&&(a+=3.5),a=a/10.5*255,[a,a,a];let l=(~~(o>50)+1)*.5,f=(a&1)*l*255,u=(a>>1&1)*l*255,c=(a>>2&1)*l*255;return[f,u,c]},r.ansi256.rgb=function(o){if(o>=232){let c=(o-232)*10+8;return[c,c,c]}o-=16;let a,l=Math.floor(o/36)/5*255,f=Math.floor((a=o%36)/6)/5*255,u=a%6/5*255;return[l,f,u]},r.rgb.hex=function(o){let a=(((Math.round(o[0])&255)<<16)+((Math.round(o[1])&255)<<8)+(Math.round(o[2])&255)).toString(16).toUpperCase();return"000000".substring(a.length)+a},r.hex.rgb=function(o){let a=o.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!a)return[0,0,0];let l=a[0];a[0].length===3&&(l=l.split("").map(h=>h+h).join(""));let f=parseInt(l,16),u=f>>16&255,c=f>>8&255,p=f&255;return[u,c,p]},r.rgb.hcg=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255,u=Math.max(Math.max(a,l),f),c=Math.min(Math.min(a,l),f),p=u-c,h,b;return p<1?h=c/(1-p):h=0,p<=0?b=0:u===a?b=(l-f)/p%6:u===l?b=2+(f-a)/p:b=4+(a-l)/p,b/=6,b%=1,[b*360,p*100,h*100]},r.hsl.hcg=function(o){let a=o[1]/100,l=o[2]/100,f=l<.5?2*a*l:2*a*(1-l),u=0;return f<1&&(u=(l-.5*f)/(1-f)),[o[0],f*100,u*100]},r.hsv.hcg=function(o){let a=o[1]/100,l=o[2]/100,f=a*l,u=0;return f<1&&(u=(l-f)/(1-f)),[o[0],f*100,u*100]},r.hcg.rgb=function(o){let a=o[0]/360,l=o[1]/100,f=o[2]/100;if(l===0)return[f*255,f*255,f*255];let u=[0,0,0],c=a%1*6,p=c%1,h=1-p,b=0;switch(Math.floor(c)){case 0:u[0]=1,u[1]=p,u[2]=0;break;case 1:u[0]=h,u[1]=1,u[2]=0;break;case 2:u[0]=0,u[1]=1,u[2]=p;break;case 3:u[0]=0,u[1]=h,u[2]=1;break;case 4:u[0]=p,u[1]=0,u[2]=1;break;default:u[0]=1,u[1]=0,u[2]=h}return b=(1-l)*f,[(l*u[0]+b)*255,(l*u[1]+b)*255,(l*u[2]+b)*255]},r.hcg.hsv=function(o){let a=o[1]/100,l=o[2]/100,f=a+l*(1-a),u=0;return f>0&&(u=a/f),[o[0],u*100,f*100]},r.hcg.hsl=function(o){let a=o[1]/100,l=o[2]/100*(1-a)+.5*a,f=0;return l>0&&l<.5?f=a/(2*l):l>=.5&&l<1&&(f=a/(2*(1-l))),[o[0],f*100,l*100]},r.hcg.hwb=function(o){let a=o[1]/100,l=o[2]/100,f=a+l*(1-a);return[o[0],(f-a)*100,(1-f)*100]},r.hwb.hcg=function(o){let a=o[1]/100,l=o[2]/100,f=1-l,u=f-a,c=0;return u<1&&(c=(f-u)/(1-u)),[o[0],u*100,c*100]},r.apple.rgb=function(o){return[o[0]/65535*255,o[1]/65535*255,o[2]/65535*255]},r.rgb.apple=function(o){return[o[0]/255*65535,o[1]/255*65535,o[2]/255*65535]},r.gray.rgb=function(o){return[o[0]/100*255,o[0]/100*255,o[0]/100*255]},r.gray.hsl=function(o){return[0,0,o[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(o){return[0,100,o[0]]},r.gray.cmyk=function(o){return[0,0,0,o[0]]},r.gray.lab=function(o){return[o[0],0,0]},r.gray.hex=function(o){let a=Math.round(o[0]/100*255)&255,l=((a<<16)+(a<<8)+a).toString(16).toUpperCase();return"000000".substring(l.length)+l},r.rgb.gray=function(o){return[(o[0]+o[1]+o[2])/3/255*100]}}),ul=Be((e,t)=>{we();var n=fo();function i(){let a={},l=Object.keys(n);for(let f=l.length,u=0;u<f;u++)a[l[u]]={distance:-1,parent:null};return a}function r(a){let l=i(),f=[a];for(l[a].distance=0;f.length;){let u=f.pop(),c=Object.keys(n[u]);for(let p=c.length,h=0;h<p;h++){let b=c[h],g=l[b];g.distance===-1&&(g.distance=l[u].distance+1,g.parent=u,f.unshift(b))}}return l}function s(a,l){return function(f){return l(a(f))}}function o(a,l){let f=[l[a].parent,a],u=n[l[a].parent][a],c=l[a].parent;for(;l[c].parent;)f.unshift(l[c].parent),u=s(n[l[c].parent][c],u),c=l[c].parent;return u.conversion=f,u}t.exports=function(a){let l=r(a),f={},u=Object.keys(l);for(let c=u.length,p=0;p<c;p++){let h=u[p];l[h].parent!==null&&(f[h]=o(h,l))}return f}}),pl=Be((e,t)=>{we();var n=fo(),i=ul(),r={},s=Object.keys(n);function o(l){let f=function(...u){let c=u[0];return c==null?c:(c.length>1&&(u=c),l(u))};return"conversion"in l&&(f.conversion=l.conversion),f}function a(l){let f=function(...u){let c=u[0];if(c==null)return c;c.length>1&&(u=c);let p=l(u);if(typeof p=="object")for(let h=p.length,b=0;b<h;b++)p[b]=Math.round(p[b]);return p};return"conversion"in l&&(f.conversion=l.conversion),f}s.forEach(l=>{r[l]={},Object.defineProperty(r[l],"channels",{value:n[l].channels}),Object.defineProperty(r[l],"labels",{value:n[l].labels});let f=i(l);Object.keys(f).forEach(u=>{let c=f[u];r[l][u]=a(c),r[l][u].raw=o(c)})}),t.exports=r}),dl=Be((e,t)=>{"use strict";we();var n=(c,p)=>(...h)=>`\x1B[${c(...h)+p}m`,i=(c,p)=>(...h)=>{let b=c(...h);return`\x1B[${38+p};5;${b}m`},r=(c,p)=>(...h)=>{let b=c(...h);return`\x1B[${38+p};2;${b[0]};${b[1]};${b[2]}m`},s=c=>c,o=(c,p,h)=>[c,p,h],a=(c,p,h)=>{Object.defineProperty(c,p,{get:()=>{let b=h();return Object.defineProperty(c,p,{value:b,enumerable:!0,configurable:!0}),b},enumerable:!0,configurable:!0})},l,f=(c,p,h,b)=>{l===void 0&&(l=pl());let g=b?10:0,m={};for(let[x,O]of Object.entries(l)){let $=x==="ansi16"?"ansi":x;x===p?m[$]=c(h,g):typeof O=="object"&&(m[$]=c(O[p],g))}return m};function u(){let c=new Map,p={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};p.color.gray=p.color.blackBright,p.bgColor.bgGray=p.bgColor.bgBlackBright,p.color.grey=p.color.blackBright,p.bgColor.bgGrey=p.bgColor.bgBlackBright;for(let[h,b]of Object.entries(p)){for(let[g,m]of Object.entries(b))p[g]={open:`\x1B[${m[0]}m`,close:`\x1B[${m[1]}m`},b[g]=p[g],c.set(m[0],m[1]);Object.defineProperty(p,h,{value:b,enumerable:!1})}return Object.defineProperty(p,"codes",{value:c,enumerable:!1}),p.color.close="\x1B[39m",p.bgColor.close="\x1B[49m",a(p.color,"ansi",()=>f(n,"ansi16",s,!1)),a(p.color,"ansi256",()=>f(i,"ansi256",s,!1)),a(p.color,"ansi16m",()=>f(r,"rgb",o,!1)),a(p.bgColor,"ansi",()=>f(n,"ansi16",s,!0)),a(p.bgColor,"ansi256",()=>f(i,"ansi256",s,!0)),a(p.bgColor,"ansi16m",()=>f(r,"rgb",o,!0)),p}Object.defineProperty(t,"exports",{enumerable:!0,get:u})}),hl=Be((e,t)=>{"use strict";we(),t.exports=(n,i=process.argv)=>{let r=n.startsWith("-")?"":n.length===1?"-":"--",s=i.indexOf(r+n),o=i.indexOf("--");return s!==-1&&(o===-1||s<o)}}),ml=Be((e,t)=>{"use strict";we();var n=lo("os"),i=lo("tty"),r=hl(),{env:s}=process,o;r("no-color")||r("no-colors")||r("color=false")||r("color=never")?o=0:(r("color")||r("colors")||r("color=true")||r("color=always"))&&(o=1),"FORCE_COLOR"in s&&(s.FORCE_COLOR==="true"?o=1:s.FORCE_COLOR==="false"?o=0:o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3));function a(u){return u===0?!1:{level:u,hasBasic:!0,has256:u>=2,has16m:u>=3}}function l(u,c){if(o===0)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(u&&!c&&o===void 0)return 0;let p=o||0;if(s.TERM==="dumb")return p;if(process.platform==="win32"){let h=n.release().split(".");return Number(h[0])>=10&&Number(h[2])>=10586?Number(h[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(h=>h in s)||s.CI_NAME==="codeship"?1:p;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if(s.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in s){let h=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return h>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:p}function f(u){let c=l(u,u&&u.isTTY);return a(c)}t.exports={supportsColor:f,stdout:a(l(!0,i.isatty(1))),stderr:a(l(!0,i.isatty(2)))}}),gl=Be((e,t)=>{"use strict";we();var n=(r,s,o)=>{let a=r.indexOf(s);if(a===-1)return r;let l=s.length,f=0,u="";do u+=r.substr(f,a-f)+s+o,f=a+l,a=r.indexOf(s,f);while(a!==-1);return u+=r.substr(f),u},i=(r,s,o,a)=>{let l=0,f="";do{let u=r[a-1]==="\r";f+=r.substr(l,(u?a-1:a)-l)+s+(u?`\r
59
+ `)}`:"";t.fail(r("Missing required argument: %s","Missing required arguments: %s",Object.keys(h).length,Object.keys(h).join(", ")+g))}},s.unknownArguments=function(c,p,h,b,g=!0){var m;let v=e.getInternalMethods().getCommandInstance().getCommands(),O=[],U=e.getInternalMethods().getContext();if(Object.keys(c).forEach(B=>{!$r.includes(B)&&!Object.prototype.hasOwnProperty.call(h,B)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),B)&&!s.isValidAndSomeAliasIsNotNew(B,p)&&O.push(B)}),g&&(U.commands.length>0||v.length>0||b)&&c._.slice(U.commands.length).forEach(B=>{v.includes(""+B)||O.push(""+B)}),g){let V=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,k=U.commands.length+V;k<c._.length&&c._.slice(k).forEach(T=>{T=String(T),!U.commands.includes(T)&&!O.includes(T)&&O.push(T)})}O.length&&t.fail(r("Unknown argument: %s","Unknown arguments: %s",O.length,O.map(B=>B.trim()?B:`"${B}"`).join(", ")))},s.unknownCommands=function(c){let p=e.getInternalMethods().getCommandInstance().getCommands(),h=[],b=e.getInternalMethods().getContext();return(b.commands.length>0||p.length>0)&&c._.slice(b.commands.length).forEach(g=>{p.includes(""+g)||h.push(""+g)}),h.length>0?(t.fail(r("Unknown command: %s","Unknown commands: %s",h.length,h.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(c,p){if(!Object.prototype.hasOwnProperty.call(p,c))return!1;let h=e.parsed.newAliases;return[c,...p[c]].some(b=>!Object.prototype.hasOwnProperty.call(h,b)||!h[c])},s.limitedChoices=function(c){let p=e.getOptions(),h={};if(!Object.keys(p.choices).length)return;Object.keys(c).forEach(m=>{$r.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(p.choices,m)&&[].concat(c[m]).forEach(v=>{p.choices[m].indexOf(v)===-1&&v!==void 0&&(h[m]=(h[m]||[]).concat(v))})});let b=Object.keys(h);if(!b.length)return;let g=i("Invalid values:");b.forEach(m=>{g+=`
60
+ ${i("Argument: %s, Given: %s, Choices: %s",m,t.stringifiedValues(h[m]),t.stringifiedValues(p.choices[m]))}`}),t.fail(g)};let o={};s.implies=function(c,p){j("<string|object> [array|number|string]",[c,p],arguments.length),typeof c=="object"?Object.keys(c).forEach(h=>{s.implies(h,c[h])}):(e.global(c),o[c]||(o[c]=[]),Array.isArray(p)?p.forEach(h=>s.implies(c,h)):(Oe(p,void 0,n),o[c].push(p)))},s.getImplied=function(){return o};function a(u,c){let p=Number(c);return c=isNaN(p)?c:p,typeof c=="number"?c=u._.length>=c:c.match(/^--no-.+/)?(c=c.match(/^--no-(.+)/)[1],c=!Object.prototype.hasOwnProperty.call(u,c)):c=Object.prototype.hasOwnProperty.call(u,c),c}s.implications=function(c){let p=[];if(Object.keys(o).forEach(h=>{let b=h;(o[h]||[]).forEach(g=>{let m=b,v=g;m=a(c,m),g=a(c,g),m&&!g&&p.push(` ${b} -> ${v}`)})}),p.length){let h=`${i("Implications failed:")}
61
+ `;p.forEach(b=>{h+=b}),t.fail(h)}};let l={};s.conflicts=function(c,p){j("<string|object> [array|string]",[c,p],arguments.length),typeof c=="object"?Object.keys(c).forEach(h=>{s.conflicts(h,c[h])}):(e.global(c),l[c]||(l[c]=[]),Array.isArray(p)?p.forEach(h=>s.conflicts(c,h)):l[c].push(p))},s.getConflicting=()=>l,s.conflicting=function(c){Object.keys(c).forEach(p=>{l[p]&&l[p].forEach(h=>{h&&c[p]!==void 0&&c[h]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,h))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(p=>{l[p].forEach(h=>{h&&c[n.Parser.camelCase(p)]!==void 0&&c[n.Parser.camelCase(h)]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,h))})})},s.recommendCommands=function(c,p){p=p.sort((m,v)=>v.length-m.length);let b=null,g=1/0;for(let m=0,v;(v=p[m])!==void 0;m++){let O=Rr(c,v);O<=3&&O<g&&(g=O,b=v)}b&&t.fail(i("Did you mean %s?",b))},s.reset=function(c){return o=Xe(o,p=>!c[p]),l=Xe(l,p=>!c[p]),s};let f=[];return s.freeze=function(){f.push({implied:o,conflicting:l})},s.unfreeze=function(){let c=f.pop();Oe(c,void 0,n),{implied:o,conflicting:l}=c},s}A();var di=[],an;function Sn(e,t,n,i){an=i;let r={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return r;let s=/\.json|\..*rc$/.test(e.extends),o=null;if(s)o=Ja(t,e.extends);else try{o=Ce.resolve(e.extends)}catch(a){return e}Va(o),di.push(o),r=s?JSON.parse(an.readFileSync(o,"utf8")):Ce(e.extends),delete e.extends,r=Sn(r,an.path.dirname(o),n,an)}return di=[],n?Hr(r,e):Object.assign({},r,e)}function Va(e){if(di.indexOf(e)>-1)throw new ee(`Circular extended configurations: '${e}'.`)}function Ja(e,t){return an.path.resolve(e,t)}function Hr(e,t){let n={};function i(r){return r&&typeof r=="object"&&!Array.isArray(r)}Object.assign(n,e);for(let r of Object.keys(t))i(t[r])&&i(n[r])?n[r]=Hr(e[r],t[r]):n[r]=t[r];return n}var M=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},d=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},de,It,ln,Fe,Ie,In,tt,jt,jn,Le,Pn,De,Ue,je,Ne,zt,ye,D,Mn,Fn,Pe,Pt,qt,Mt,nt,Ln,Y,Ft,Lt,Dt,G,He,fe;function ro(e){return(t=[],n=e.process.cwd(),i)=>{let r=new oo(t,n,i,e);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Br=Symbol("copyDoubleDash"),Wr=Symbol("copyDoubleDash"),hi=Symbol("deleteFromParserHintObject"),Yr=Symbol("emitWarning"),kr=Symbol("freeze"),zr=Symbol("getDollarZero"),Nt=Symbol("getParserConfiguration"),mi=Symbol("guessLocale"),qr=Symbol("guessVersion"),Gr=Symbol("parsePositionalNumbers"),gi=Symbol("pkgUp"),it=Symbol("populateParserHintArray"),Gt=Symbol("populateParserHintSingleValueDictionary"),bi=Symbol("populateParserHintArrayDictionary"),yi=Symbol("populateParserHintDictionary"),wi=Symbol("sanitizeKey"),Ci=Symbol("setKey"),Ai=Symbol("unfreeze"),Kr=Symbol("validateAsync"),Vr=Symbol("getCommandInstance"),Jr=Symbol("getContext"),Qr=Symbol("getHasOutput"),Zr=Symbol("getLoggerInstance"),Xr=Symbol("getParseContext"),eo=Symbol("getUsageInstance"),to=Symbol("getValidationInstance"),Dn=Symbol("hasParseCallback"),Tt=Symbol("postProcess"),no=Symbol("rebase"),xi=Symbol("reset"),cn=Symbol("runYargsParserAndExecuteCommands"),vi=Symbol("runValidation"),io=Symbol("setHasOutput"),Rt=Symbol("kTrackManuallySetKeys"),oo=class{constructor(t=[],n,i,r){this.customScriptName=!1,this.parsed=!1,de.set(this,void 0),It.set(this,void 0),ln.set(this,{commands:[],fullCommands:[]}),Fe.set(this,null),Ie.set(this,null),In.set(this,"show-hidden"),tt.set(this,null),jt.set(this,!0),jn.set(this,{}),Le.set(this,!0),Pn.set(this,[]),De.set(this,void 0),Ue.set(this,{}),je.set(this,!1),Ne.set(this,null),zt.set(this,void 0),ye.set(this,""),D.set(this,void 0),Mn.set(this,void 0),Fn.set(this,{}),Pe.set(this,null),Pt.set(this,null),qt.set(this,{}),Mt.set(this,{}),nt.set(this,void 0),Ln.set(this,!1),Y.set(this,void 0),Ft.set(this,!1),Lt.set(this,!1),Dt.set(this,!1),G.set(this,void 0),He.set(this,null),fe.set(this,void 0),M(this,Y,r,"f"),M(this,nt,t,"f"),M(this,It,n,"f"),M(this,Mn,i,"f"),M(this,De,new fi(this),"f"),this.$0=this[zr](),this[xi](),M(this,de,d(this,de,"f"),"f"),M(this,G,d(this,G,"f"),"f"),M(this,fe,d(this,fe,"f"),"f"),M(this,D,d(this,D,"f"),"f"),d(this,D,"f").showHiddenOpt=d(this,In,"f"),M(this,zt,this[Wr](),"f")}addHelpOpt(t,n){let i="help";return j("[string|boolean] [string]",[t,n],arguments.length),d(this,Ne,"f")&&(this[hi](d(this,Ne,"f")),M(this,Ne,null,"f")),t===!1&&n===void 0?this:(M(this,Ne,typeof t=="string"?t:i,"f"),this.boolean(d(this,Ne,"f")),this.describe(d(this,Ne,"f"),n||d(this,G,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(j("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let i=typeof t=="string"?t:d(this,In,"f");return this.boolean(i),this.describe(i,n||d(this,G,"f").deferY18nLookup("Show hidden options")),d(this,D,"f").showHiddenOpt=i,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return j("<object|string|array> [string|array]",[t,n],arguments.length),this[bi](this.alias.bind(this),"alias",t,n),this}array(t){return j("<array|string>",[t],arguments.length),this[it]("array",t),this[Rt](t),this}boolean(t){return j("<array|string>",[t],arguments.length),this[it]("boolean",t),this[Rt](t),this}check(t,n){return j("<function> [boolean]",[t,n],arguments.length),this.middleware((i,r)=>St(()=>t(i,r.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&d(this,G,"f").fail(s.toString(),s):d(this,G,"f").fail(d(this,Y,"f").y18n.__("Argument check failed: %s",t.toString())),i),s=>(d(this,G,"f").fail(s.message?s.message:s.toString(),s),i)),!1,n),this}choices(t,n){return j("<object|string|array> [string|array]",[t,n],arguments.length),this[bi](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(j("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new ee("coerce callback must be provided");for(let i of t)this.coerce(i,n);return this}else if(typeof t=="object"){for(let i of Object.keys(t))this.coerce(i,t[i]);return this}if(!n)throw new ee("coerce callback must be provided");return d(this,D,"f").key[t]=!0,d(this,De,"f").addCoerceMiddleware((i,r)=>{let s;return St(()=>(s=r.getAliases(),n(i[t])),o=>{if(i[t]=o,s[t])for(let a of s[t])i[a]=o;return i},o=>{throw new ee(o.message)})},t),this}conflicts(t,n){return j("<string|object> [string|array]",[t,n],arguments.length),d(this,fe,"f").conflicts(t,n),this}config(t="config",n,i){return j("[object|string] [string|function] [function]",[t,n,i],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=Sn(t,d(this,It,"f"),this[Nt]()["deep-merge-config"]||!1,d(this,Y,"f")),d(this,D,"f").configObjects=(d(this,D,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(i=n,n=void 0),this.describe(t,n||d(this,G,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(r=>{d(this,D,"f").config[r]=i||!0}),this)}completion(t,n,i){return j("[string] [string|boolean|function] [function]",[t,n,i],arguments.length),typeof n=="function"&&(i=n,n=void 0),M(this,Ie,t||d(this,Ie,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(d(this,Ie,"f"),n),i&&d(this,Fe,"f").registerFunction(i),this}command(t,n,i,r,s,o){return j("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,i,r,s,o],arguments.length),d(this,de,"f").addHandler(t,n,i,r,s,o),this}commands(t,n,i,r,s,o){return this.command(t,n,i,r,s,o)}commandDir(t,n){j("<string> [object]",[t,n],arguments.length);let i=d(this,Mn,"f")||d(this,Y,"f").require;return d(this,de,"f").addDirectory(t,i,d(this,Y,"f").getCallerFile(),n),this}count(t){return j("<array|string>",[t],arguments.length),this[it]("count",t),this[Rt](t),this}default(t,n,i){return j("<object|string|array> [*] [string]",[t,n,i],arguments.length),i&&(ci(t,d(this,Y,"f")),d(this,D,"f").defaultDescription[t]=i),typeof n=="function"&&(ci(t,d(this,Y,"f")),d(this,D,"f").defaultDescription[t]||(d(this,D,"f").defaultDescription[t]=d(this,G,"f").functionDescription(n)),n=n.call()),this[Gt](this.default.bind(this),"default",t,n),this}defaults(t,n,i){return this.default(t,n,i)}demandCommand(t=1,n,i,r){return j("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,n,i,r],arguments.length),typeof n!="number"&&(i=n,n=1/0),this.global("_",!1),d(this,D,"f").demandedCommands._={min:t,max:n,minMsg:i,maxMsg:r},this}demand(t,n,i){return Array.isArray(n)?(n.forEach(r=>{Oe(i,!0,d(this,Y,"f")),this.demandOption(r,i)}),n=1/0):typeof n!="number"&&(i=n,n=1/0),typeof t=="number"?(Oe(i,!0,d(this,Y,"f")),this.demandCommand(t,n,i,i)):Array.isArray(t)?t.forEach(r=>{Oe(i,!0,d(this,Y,"f")),this.demandOption(r,i)}):typeof i=="string"?this.demandOption(t,i):(i===!0||typeof i=="undefined")&&this.demandOption(t),this}demandOption(t,n){return j("<object|string|array> [string]",[t,n],arguments.length),this[Gt](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return j("<string> [string|boolean]",[t,n],arguments.length),d(this,D,"f").deprecatedOptions[t]=n,this}describe(t,n){return j("<object|string|array> [string]",[t,n],arguments.length),this[Ci](t,!0),d(this,G,"f").describe(t,n),this}detectLocale(t){return j("<boolean>",[t],arguments.length),M(this,jt,t,"f"),this}env(t){return j("[string|boolean]",[t],arguments.length),t===!1?delete d(this,D,"f").envPrefix:d(this,D,"f").envPrefix=t||"",this}epilogue(t){return j("<string>",[t],arguments.length),d(this,G,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return j("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(i=>this.example(...i)):d(this,G,"f").example(t,n),this}exit(t,n){M(this,je,!0,"f"),M(this,tt,n,"f"),d(this,Le,"f")&&d(this,Y,"f").process.exit(t)}exitProcess(t=!0){return j("[boolean]",[t],arguments.length),M(this,Le,t,"f"),this}fail(t){if(j("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new ee("Invalid first argument. Expected function or boolean 'false'");return d(this,G,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return j("<array> [function]",[t,n],arguments.length),n?d(this,Fe,"f").getCompletion(t,n):new Promise((i,r)=>{d(this,Fe,"f").getCompletion(t,(s,o)=>{s?r(s):i(o)})})}getDemandedOptions(){return j([],0),d(this,D,"f").demandedOptions}getDemandedCommands(){return j([],0),d(this,D,"f").demandedCommands}getDeprecatedOptions(){return j([],0),d(this,D,"f").deprecatedOptions}getDetectLocale(){return d(this,jt,"f")}getExitProcess(){return d(this,Le,"f")}getGroups(){return Object.assign({},d(this,Ue,"f"),d(this,Mt,"f"))}getHelp(){if(M(this,je,!0,"f"),!d(this,G,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[cn](d(this,nt,"f"),void 0,void 0,0,!0);if(re(n))return n.then(()=>d(this,G,"f").help())}let t=d(this,de,"f").runDefaultBuilderOn(this);if(re(t))return t.then(()=>d(this,G,"f").help())}return Promise.resolve(d(this,G,"f").help())}getOptions(){return d(this,D,"f")}getStrict(){return d(this,Ft,"f")}getStrictCommands(){return d(this,Lt,"f")}getStrictOptions(){return d(this,Dt,"f")}global(t,n){return j("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?d(this,D,"f").local=d(this,D,"f").local.filter(i=>t.indexOf(i)===-1):t.forEach(i=>{d(this,D,"f").local.includes(i)||d(this,D,"f").local.push(i)}),this}group(t,n){j("<string|array> <string>",[t,n],arguments.length);let i=d(this,Mt,"f")[n]||d(this,Ue,"f")[n];d(this,Mt,"f")[n]&&delete d(this,Mt,"f")[n];let r={};return d(this,Ue,"f")[n]=(i||[]).concat(t).filter(s=>r[s]?!1:r[s]=!0),this}hide(t){return j("<string>",[t],arguments.length),d(this,D,"f").hiddenOptions.push(t),this}implies(t,n){return j("<string|object> [number|string|array]",[t,n],arguments.length),d(this,fe,"f").implies(t,n),this}locale(t){return j("[string]",[t],arguments.length),t?(M(this,jt,!1,"f"),d(this,Y,"f").y18n.setLocale(t),this):(this[mi](),d(this,Y,"f").y18n.getLocale())}middleware(t,n,i){return d(this,De,"f").addMiddleware(t,!!n,i)}nargs(t,n){return j("<string|object|array> [number]",[t,n],arguments.length),this[Gt](this.nargs.bind(this),"narg",t,n),this}normalize(t){return j("<array|string>",[t],arguments.length),this[it]("normalize",t),this}number(t){return j("<array|string>",[t],arguments.length),this[it]("number",t),this[Rt](t),this}option(t,n){if(j("<string|object> [object]",[t,n],arguments.length),typeof t=="object")Object.keys(t).forEach(i=>{this.options(i,t[i])});else{typeof n!="object"&&(n={}),this[Rt](t),d(this,He,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[Yr](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
62
+ `),void 0,"versionWarning"),d(this,D,"f").key[t]=!0,n.alias&&this.alias(t,n.alias);let i=n.deprecate||n.deprecated;i&&this.deprecateOption(t,i);let r=n.demand||n.required||n.require;r&&this.demand(t,r),n.demandOption&&this.demandOption(t,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),"default"in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(t),typeof n.global=="boolean"&&this.global(t,n.global),n.defaultDescription&&(d(this,D,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let s=n.describe||n.description||n.desc;this.describe(t,s),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,i){j("[string|array] [function|boolean|object] [function]",[t,n,i],arguments.length),this[kr](),typeof t=="undefined"&&(t=d(this,nt,"f")),typeof n=="object"&&(M(this,Pt,n,"f"),n=i),typeof n=="function"&&(M(this,Pe,n,"f"),n=!1),n||M(this,nt,t,"f"),d(this,Pe,"f")&&M(this,Le,!1,"f");let r=this[cn](t,!!n),s=this.parsed;return d(this,Fe,"f").setParsed(this.parsed),re(r)?r.then(o=>(d(this,Pe,"f")&&d(this,Pe,"f").call(this,d(this,tt,"f"),o,d(this,ye,"f")),o)).catch(o=>{throw d(this,Pe,"f")&&d(this,Pe,"f")(o,this.parsed.argv,d(this,ye,"f")),o}).finally(()=>{this[Ai](),this.parsed=s}):(d(this,Pe,"f")&&d(this,Pe,"f").call(this,d(this,tt,"f"),r,d(this,ye,"f")),this[Ai](),this.parsed=s,r)}parseAsync(t,n,i){let r=this.parse(t,n,i);return re(r)?r:Promise.resolve(r)}parseSync(t,n,i){let r=this.parse(t,n,i);if(re(r))throw new ee(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(t){return j("<object>",[t],arguments.length),M(this,Fn,t,"f"),this}pkgConf(t,n){j("<string> [string]",[t,n],arguments.length);let i=null,r=this[gi](n||d(this,It,"f"));return r[t]&&typeof r[t]=="object"&&(i=Sn(r[t],n||d(this,It,"f"),this[Nt]()["deep-merge-config"]||!1,d(this,Y,"f")),d(this,D,"f").configObjects=(d(this,D,"f").configObjects||[]).concat(i)),this}positional(t,n){j("<string> <object>",[t,n],arguments.length);let i=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=Xe(n,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:i.includes(o));let r=d(this,ln,"f").fullCommands[d(this,ln,"f").fullCommands.length-1],s=r?d(this,de,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return Yt(s).forEach(o=>{let a=s[o];Array.isArray(a)?a.indexOf(t)!==-1&&(n[o]=!0):a[t]&&!(o in n)&&(n[o]=a[t])}),this.group(t,d(this,G,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return j("[boolean]",[t],arguments.length),M(this,Ln,t,"f"),this}required(t,n,i){return this.demand(t,n,i)}require(t,n,i){return this.demand(t,n,i)}requiresArg(t){return j("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&d(this,D,"f").narg[t]?this:(this[Gt](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return j("[string] [string]",[t,n],arguments.length),t=t||this.$0,d(this,zt,"f").log(d(this,Fe,"f").generateCompletionScript(t,n||d(this,Ie,"f")||"completion")),this}showHelp(t){if(j("[string|function]",[t],arguments.length),M(this,je,!0,"f"),!d(this,G,"f").hasCachedHelpMessage()){if(!this.parsed){let i=this[cn](d(this,nt,"f"),void 0,void 0,0,!0);if(re(i))return i.then(()=>{d(this,G,"f").showHelp(t)}),this}let n=d(this,de,"f").runDefaultBuilderOn(this);if(re(n))return n.then(()=>{d(this,G,"f").showHelp(t)}),this}return d(this,G,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return j("[boolean|string] [string]",[t,n],arguments.length),d(this,G,"f").showHelpOnFail(t,n),this}showVersion(t){return j("[string|function]",[t],arguments.length),d(this,G,"f").showVersion(t),this}skipValidation(t){return j("<array|string>",[t],arguments.length),this[it]("skipValidation",t),this}strict(t){return j("[boolean]",[t],arguments.length),M(this,Ft,t!==!1,"f"),this}strictCommands(t){return j("[boolean]",[t],arguments.length),M(this,Lt,t!==!1,"f"),this}strictOptions(t){return j("[boolean]",[t],arguments.length),M(this,Dt,t!==!1,"f"),this}string(t){return j("<array|string>",[t],arguments.length),this[it]("string",t),this[Rt](t),this}terminalWidth(){return j([],0),d(this,Y,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return j("<object>",[t],arguments.length),M(this,jt,!1,"f"),d(this,Y,"f").y18n.updateLocale(t),this}usage(t,n,i,r){if(j("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,i,r],arguments.length),n!==void 0){if(Oe(t,null,d(this,Y,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,i,r);throw new ee(".usage() description must start with $0 if being used as alias for .command()")}else return d(this,G,"f").usage(t),this}version(t,n,i){let r="version";if(j("[boolean|string] [string] [string]",[t,n,i],arguments.length),d(this,He,"f")&&(this[hi](d(this,He,"f")),d(this,G,"f").version(void 0),M(this,He,null,"f")),arguments.length===0)i=this[qr](),t=r;else if(arguments.length===1){if(t===!1)return this;i=t,t=r}else arguments.length===2&&(i=n,n=void 0);return M(this,He,typeof t=="string"?t:r,"f"),n=n||d(this,G,"f").deferY18nLookup("Show version number"),d(this,G,"f").version(i||void 0),this.boolean(d(this,He,"f")),this.describe(d(this,He,"f"),n),this}wrap(t){return j("<number|null|undefined>",[t],arguments.length),d(this,G,"f").wrap(t),this}[(de=new WeakMap,It=new WeakMap,ln=new WeakMap,Fe=new WeakMap,Ie=new WeakMap,In=new WeakMap,tt=new WeakMap,jt=new WeakMap,jn=new WeakMap,Le=new WeakMap,Pn=new WeakMap,De=new WeakMap,Ue=new WeakMap,je=new WeakMap,Ne=new WeakMap,zt=new WeakMap,ye=new WeakMap,D=new WeakMap,Mn=new WeakMap,Fn=new WeakMap,Pe=new WeakMap,Pt=new WeakMap,qt=new WeakMap,Mt=new WeakMap,nt=new WeakMap,Ln=new WeakMap,Y=new WeakMap,Ft=new WeakMap,Lt=new WeakMap,Dt=new WeakMap,G=new WeakMap,He=new WeakMap,fe=new WeakMap,Br)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[Wr](){return{log:(...t)=>{this[Dn]()||console.log(...t),M(this,je,!0,"f"),d(this,ye,"f").length&&M(this,ye,d(this,ye,"f")+`
63
+ `,"f"),M(this,ye,d(this,ye,"f")+t.join(" "),"f")},error:(...t)=>{this[Dn]()||console.error(...t),M(this,je,!0,"f"),d(this,ye,"f").length&&M(this,ye,d(this,ye,"f")+`
64
+ `,"f"),M(this,ye,d(this,ye,"f")+t.join(" "),"f")}}}[hi](t){Yt(d(this,D,"f")).forEach(n=>{if((r=>r==="configObjects")(n))return;let i=d(this,D,"f")[n];Array.isArray(i)?i.includes(t)&&i.splice(i.indexOf(t),1):typeof i=="object"&&delete i[t]}),delete d(this,G,"f").getDescriptions()[t]}[Yr](t,n,i){d(this,jn,"f")[i]||(d(this,Y,"f").process.emitWarning(t,n),d(this,jn,"f")[i]=!0)}[kr](){d(this,Pn,"f").push({options:d(this,D,"f"),configObjects:d(this,D,"f").configObjects.slice(0),exitProcess:d(this,Le,"f"),groups:d(this,Ue,"f"),strict:d(this,Ft,"f"),strictCommands:d(this,Lt,"f"),strictOptions:d(this,Dt,"f"),completionCommand:d(this,Ie,"f"),output:d(this,ye,"f"),exitError:d(this,tt,"f"),hasOutput:d(this,je,"f"),parsed:this.parsed,parseFn:d(this,Pe,"f"),parseContext:d(this,Pt,"f")}),d(this,G,"f").freeze(),d(this,fe,"f").freeze(),d(this,de,"f").freeze(),d(this,De,"f").freeze()}[zr](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(d(this,Y,"f").process.argv()[0])?n=d(this,Y,"f").process.argv().slice(1,2):n=d(this,Y,"f").process.argv().slice(0,1),t=n.map(i=>{let r=this[no](d(this,It,"f"),i);return i.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<i.length?r:i}).join(" ").trim(),d(this,Y,"f").getEnv("_")&&d(this,Y,"f").getProcessArgvBin()===d(this,Y,"f").getEnv("_")&&(t=d(this,Y,"f").getEnv("_").replace(`${d(this,Y,"f").path.dirname(d(this,Y,"f").process.execPath())}/`,"")),t}[Nt](){return d(this,Fn,"f")}[mi](){if(!d(this,jt,"f"))return;let t=d(this,Y,"f").getEnv("LC_ALL")||d(this,Y,"f").getEnv("LC_MESSAGES")||d(this,Y,"f").getEnv("LANG")||d(this,Y,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[qr](){return this[gi]().version||"unknown"}[Gr](t){let n=t["--"]?t["--"]:t._;for(let i=0,r;(r=n[i])!==void 0;i++)d(this,Y,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(n[i]=Number(r));return t}[gi](t){let n=t||"*";if(d(this,qt,"f")[n])return d(this,qt,"f")[n];let i={};try{let r=t||d(this,Y,"f").mainFilename;!t&&d(this,Y,"f").path.extname(r)&&(r=d(this,Y,"f").path.dirname(r));let s=d(this,Y,"f").findUp(r,(o,a)=>{if(a.includes("package.json"))return"package.json"});Oe(s,void 0,d(this,Y,"f")),i=JSON.parse(d(this,Y,"f").readFileSync(s,"utf8"))}catch(r){}return d(this,qt,"f")[n]=i||{},d(this,qt,"f")[n]}[it](t,n){n=[].concat(n),n.forEach(i=>{i=this[wi](i),d(this,D,"f")[t].push(i)})}[Gt](t,n,i,r){this[yi](t,n,i,r,(s,o,a)=>{d(this,D,"f")[s][o]=a})}[bi](t,n,i,r){this[yi](t,n,i,r,(s,o,a)=>{d(this,D,"f")[s][o]=(d(this,D,"f")[s][o]||[]).concat(a)})}[yi](t,n,i,r,s){if(Array.isArray(i))i.forEach(o=>{t(o,r)});else if((o=>typeof o=="object")(i))for(let o of Yt(i))t(o,i[o]);else s(n,this[wi](i),r)}[wi](t){return t==="__proto__"?"___proto___":t}[Ci](t,n){return this[Gt](this[Ci].bind(this),"key",t,n),this}[Ai](){var t,n,i,r,s,o,a,l,f,u,c,p;let h=d(this,Pn,"f").pop();Oe(h,void 0,d(this,Y,"f"));let b;t=this,n=this,i=this,r=this,s=this,o=this,a=this,l=this,f=this,u=this,c=this,p=this,{options:{set value(g){M(t,D,g,"f")}}.value,configObjects:b,exitProcess:{set value(g){M(n,Le,g,"f")}}.value,groups:{set value(g){M(i,Ue,g,"f")}}.value,output:{set value(g){M(r,ye,g,"f")}}.value,exitError:{set value(g){M(s,tt,g,"f")}}.value,hasOutput:{set value(g){M(o,je,g,"f")}}.value,parsed:this.parsed,strict:{set value(g){M(a,Ft,g,"f")}}.value,strictCommands:{set value(g){M(l,Lt,g,"f")}}.value,strictOptions:{set value(g){M(f,Dt,g,"f")}}.value,completionCommand:{set value(g){M(u,Ie,g,"f")}}.value,parseFn:{set value(g){M(c,Pe,g,"f")}}.value,parseContext:{set value(g){M(p,Pt,g,"f")}}.value}=h,d(this,D,"f").configObjects=b,d(this,G,"f").unfreeze(),d(this,fe,"f").unfreeze(),d(this,de,"f").unfreeze(),d(this,De,"f").unfreeze()}[Kr](t,n){return St(n,i=>(t(i),i))}getInternalMethods(){return{getCommandInstance:this[Vr].bind(this),getContext:this[Jr].bind(this),getHasOutput:this[Qr].bind(this),getLoggerInstance:this[Zr].bind(this),getParseContext:this[Xr].bind(this),getParserConfiguration:this[Nt].bind(this),getUsageInstance:this[eo].bind(this),getValidationInstance:this[to].bind(this),hasParseCallback:this[Dn].bind(this),postProcess:this[Tt].bind(this),reset:this[xi].bind(this),runValidation:this[vi].bind(this),runYargsParserAndExecuteCommands:this[cn].bind(this),setHasOutput:this[io].bind(this)}}[Vr](){return d(this,de,"f")}[Jr](){return d(this,ln,"f")}[Qr](){return d(this,je,"f")}[Zr](){return d(this,zt,"f")}[Xr](){return d(this,Pt,"f")||{}}[eo](){return d(this,G,"f")}[to](){return d(this,fe,"f")}[Dn](){return!!d(this,Pe,"f")}[Tt](t,n,i,r){return i||re(t)||(n||(t=this[Br](t)),(this[Nt]()["parse-positional-numbers"]||this[Nt]()["parse-positional-numbers"]===void 0)&&(t=this[Gr](t)),r&&(t=Et(t,this,d(this,De,"f").getMiddleware(),!1))),t}[xi](t={}){M(this,D,d(this,D,"f")||{},"f");let n={};n.local=d(this,D,"f").local||[],n.configObjects=d(this,D,"f").configObjects||[];let i={};n.local.forEach(o=>{i[o]=!0,(t[o]||[]).forEach(a=>{i[a]=!0})}),Object.assign(d(this,Mt,"f"),Object.keys(d(this,Ue,"f")).reduce((o,a)=>{let l=d(this,Ue,"f")[a].filter(f=>!(f in i));return l.length>0&&(o[a]=l),o},{})),M(this,Ue,{},"f");let r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return r.forEach(o=>{n[o]=(d(this,D,"f")[o]||[]).filter(a=>!i[a])}),s.forEach(o=>{n[o]=Xe(d(this,D,"f")[o],a=>!i[a])}),n.envPrefix=d(this,D,"f").envPrefix,M(this,D,n,"f"),M(this,G,d(this,G,"f")?d(this,G,"f").reset(i):Fr(this,d(this,Y,"f")),"f"),M(this,fe,d(this,fe,"f")?d(this,fe,"f").reset(i):Ur(this,d(this,G,"f"),d(this,Y,"f")),"f"),M(this,de,d(this,de,"f")?d(this,de,"f").reset():jr(d(this,G,"f"),d(this,fe,"f"),d(this,De,"f"),d(this,Y,"f")),"f"),d(this,Fe,"f")||M(this,Fe,Tr(this,d(this,G,"f"),d(this,de,"f"),d(this,Y,"f")),"f"),d(this,De,"f").reset(),M(this,Ie,null,"f"),M(this,ye,"","f"),M(this,tt,null,"f"),M(this,je,!1,"f"),this.parsed=!1,this}[no](t,n){return d(this,Y,"f").path.relative(t,n)}[cn](t,n,i,r=0,s=!1){let o=!!i||s;t=t||d(this,nt,"f"),d(this,D,"f").__=d(this,Y,"f").y18n.__,d(this,D,"f").configuration=this[Nt]();let a=!!d(this,D,"f").configuration["populate--"],l=Object.assign({},d(this,D,"f").configuration,{"populate--":!0}),f=d(this,Y,"f").Parser.detailed(t,Object.assign({},d(this,D,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),u=Object.assign(f.argv,d(this,Pt,"f")),c,p=f.aliases,h=!1,b=!1;Object.keys(u).forEach(g=>{g===d(this,Ne,"f")&&u[g]?h=!0:g===d(this,He,"f")&&u[g]&&(b=!0)}),u.$0=this.$0,this.parsed=f,r===0&&d(this,G,"f").clearCachedHelpMessage();try{if(this[mi](),n)return this[Tt](u,a,!!i,!1);d(this,Ne,"f")&&[d(this,Ne,"f")].concat(p[d(this,Ne,"f")]||[]).filter(U=>U.length>1).includes(""+u._[u._.length-1])&&(u._.pop(),h=!0);let g=d(this,de,"f").getCommands(),m=d(this,Fe,"f").completionKey in u,v=h||m||s;if(u._.length){if(g.length){let O;for(let U=r||0,B;u._[U]!==void 0;U++)if(B=String(u._[U]),g.includes(B)&&B!==d(this,Ie,"f")){let V=d(this,de,"f").runCommand(B,this,f,U+1,s,h||b||s);return this[Tt](V,a,!!i,!1)}else if(!O&&B!==d(this,Ie,"f")){O=B;break}!d(this,de,"f").hasDefaultCommand()&&d(this,Ln,"f")&&O&&!v&&d(this,fe,"f").recommendCommands(O,g)}d(this,Ie,"f")&&u._.includes(d(this,Ie,"f"))&&!m&&(d(this,Le,"f")&&et(!0),this.showCompletionScript(),this.exit(0))}if(d(this,de,"f").hasDefaultCommand()&&!v){let O=d(this,de,"f").runCommand(null,this,f,0,s,h||b||s);return this[Tt](O,a,!!i,!1)}if(m){d(this,Le,"f")&&et(!0),t=[].concat(t);let O=t.slice(t.indexOf(`--${d(this,Fe,"f").completionKey}`)+1);return d(this,Fe,"f").getCompletion(O,(U,B)=>{if(U)throw new ee(U.message);(B||[]).forEach(V=>{d(this,zt,"f").log(V)}),this.exit(0)}),this[Tt](u,!a,!!i,!1)}if(d(this,je,"f")||(h?(d(this,Le,"f")&&et(!0),o=!0,this.showHelp("log"),this.exit(0)):b&&(d(this,Le,"f")&&et(!0),o=!0,d(this,G,"f").showVersion("log"),this.exit(0))),!o&&d(this,D,"f").skipValidation.length>0&&(o=Object.keys(u).some(O=>d(this,D,"f").skipValidation.indexOf(O)>=0&&u[O]===!0)),!o){if(f.error)throw new ee(f.error.message);if(!m){let O=this[vi](p,{},f.error);i||(c=Et(u,this,d(this,De,"f").getMiddleware(),!0)),c=this[Kr](O,c!=null?c:u),re(c)&&!i&&(c=c.then(()=>Et(u,this,d(this,De,"f").getMiddleware(),!1)))}}}catch(g){if(g instanceof ee)d(this,G,"f").fail(g.message,g);else throw g}return this[Tt](c!=null?c:u,a,!!i,!0)}[vi](t,n,i,r){let s={...this.getDemandedOptions()};return o=>{if(i)throw new ee(i.message);d(this,fe,"f").nonOptionCount(o),d(this,fe,"f").requiredArguments(o,s);let a=!1;d(this,Lt,"f")&&(a=d(this,fe,"f").unknownCommands(o)),d(this,Ft,"f")&&!a?d(this,fe,"f").unknownArguments(o,t,n,!!r):d(this,Dt,"f")&&d(this,fe,"f").unknownArguments(o,t,{},!1,!1),d(this,fe,"f").limitedChoices(o),d(this,fe,"f").implications(o),d(this,fe,"f").conflicting(o)}}[io](){M(this,je,!0,"f")}[Rt](t){if(typeof t=="string")d(this,D,"f").key[t]=!0;else for(let n of t)d(this,D,"f").key[n]=!0}};function Pr(e){return!!e&&typeof e.getInternalMethods=="function"}var Qa=ro(vr),Kt=Qa;A();A();import Cp from"isomorphic-unfetch";A();A();var Za=Object.create,Nn=Object.defineProperty,Xa=Object.defineProperties,el=Object.getOwnPropertyDescriptor,tl=Object.getOwnPropertyDescriptors,nl=Object.getOwnPropertyNames,so=Object.getOwnPropertySymbols,il=Object.getPrototypeOf,co=Object.prototype.hasOwnProperty,rl=Object.prototype.propertyIsEnumerable,ao=(e,t,n)=>t in e?Nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ol=(e,t)=>{for(var n in t||(t={}))co.call(t,n)&&ao(e,n,t[n]);if(so)for(var n of so(t))rl.call(t,n)&&ao(e,n,t[n]);return e},sl=(e,t)=>Xa(e,tl(t)),al=e=>Nn(e,"__esModule",{value:!0}),lo=(e=>typeof Ce!="undefined"?Ce:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof Ce!="undefined"?Ce:t)[n]}):e)(function(e){if(typeof Ce!="undefined")return Ce.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),ll=(e,t)=>()=>(e&&(t=e(e=0)),t),Be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),cl=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of nl(t))!co.call(e,r)&&(n||r!=="default")&&Nn(e,r,{get:()=>t[r],enumerable:!(i=el(t,r))||i.enumerable});return e},Oi=(e,t)=>cl(al(Nn(e!=null?Za(il(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),we=ll(()=>{}),fl=Be((e,t)=>{"use strict";we(),t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),fo=Be((e,t)=>{we();var n=fl(),i={};for(let o of Object.keys(n))i[n[o]]=o;var r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};t.exports=r;for(let o of Object.keys(r)){if(!("channels"in r[o]))throw new Error("missing channels property: "+o);if(!("labels"in r[o]))throw new Error("missing channel labels property: "+o);if(r[o].labels.length!==r[o].channels)throw new Error("channel and label counts mismatch: "+o);let{channels:a,labels:l}=r[o];delete r[o].channels,delete r[o].labels,Object.defineProperty(r[o],"channels",{value:a}),Object.defineProperty(r[o],"labels",{value:l})}r.rgb.hsl=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255,u=Math.min(a,l,f),c=Math.max(a,l,f),p=c-u,h,b;c===u?h=0:a===c?h=(l-f)/p:l===c?h=2+(f-a)/p:f===c&&(h=4+(a-l)/p),h=Math.min(h*60,360),h<0&&(h+=360);let g=(u+c)/2;return c===u?b=0:g<=.5?b=p/(c+u):b=p/(2-c-u),[h,b*100,g*100]},r.rgb.hsv=function(o){let a,l,f,u,c,p=o[0]/255,h=o[1]/255,b=o[2]/255,g=Math.max(p,h,b),m=g-Math.min(p,h,b),v=function(O){return(g-O)/6/m+1/2};return m===0?(u=0,c=0):(c=m/g,a=v(p),l=v(h),f=v(b),p===g?u=f-l:h===g?u=1/3+a-f:b===g&&(u=2/3+l-a),u<0?u+=1:u>1&&(u-=1)),[u*360,c*100,g*100]},r.rgb.hwb=function(o){let a=o[0],l=o[1],f=o[2],u=r.rgb.hsl(o)[0],c=1/255*Math.min(a,Math.min(l,f));return f=1-1/255*Math.max(a,Math.max(l,f)),[u,c*100,f*100]},r.rgb.cmyk=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255,u=Math.min(1-a,1-l,1-f),c=(1-a-u)/(1-u)||0,p=(1-l-u)/(1-u)||0,h=(1-f-u)/(1-u)||0;return[c*100,p*100,h*100,u*100]};function s(o,a){return(o[0]-a[0])**2+(o[1]-a[1])**2+(o[2]-a[2])**2}r.rgb.keyword=function(o){let a=i[o];if(a)return a;let l=1/0,f;for(let u of Object.keys(n)){let c=n[u],p=s(o,c);p<l&&(l=p,f=u)}return f},r.keyword.rgb=function(o){return n[o]},r.rgb.xyz=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255;a=a>.04045?((a+.055)/1.055)**2.4:a/12.92,l=l>.04045?((l+.055)/1.055)**2.4:l/12.92,f=f>.04045?((f+.055)/1.055)**2.4:f/12.92;let u=a*.4124+l*.3576+f*.1805,c=a*.2126+l*.7152+f*.0722,p=a*.0193+l*.1192+f*.9505;return[u*100,c*100,p*100]},r.rgb.lab=function(o){let a=r.rgb.xyz(o),l=a[0],f=a[1],u=a[2];l/=95.047,f/=100,u/=108.883,l=l>.008856?l**(1/3):7.787*l+16/116,f=f>.008856?f**(1/3):7.787*f+16/116,u=u>.008856?u**(1/3):7.787*u+16/116;let c=116*f-16,p=500*(l-f),h=200*(f-u);return[c,p,h]},r.hsl.rgb=function(o){let a=o[0]/360,l=o[1]/100,f=o[2]/100,u,c,p;if(l===0)return p=f*255,[p,p,p];f<.5?u=f*(1+l):u=f+l-f*l;let h=2*f-u,b=[0,0,0];for(let g=0;g<3;g++)c=a+1/3*-(g-1),c<0&&c++,c>1&&c--,6*c<1?p=h+(u-h)*6*c:2*c<1?p=u:3*c<2?p=h+(u-h)*(2/3-c)*6:p=h,b[g]=p*255;return b},r.hsl.hsv=function(o){let a=o[0],l=o[1]/100,f=o[2]/100,u=l,c=Math.max(f,.01);f*=2,l*=f<=1?f:2-f,u*=c<=1?c:2-c;let p=(f+l)/2,h=f===0?2*u/(c+u):2*l/(f+l);return[a,h*100,p*100]},r.hsv.rgb=function(o){let a=o[0]/60,l=o[1]/100,f=o[2]/100,u=Math.floor(a)%6,c=a-Math.floor(a),p=255*f*(1-l),h=255*f*(1-l*c),b=255*f*(1-l*(1-c));switch(f*=255,u){case 0:return[f,b,p];case 1:return[h,f,p];case 2:return[p,f,b];case 3:return[p,h,f];case 4:return[b,p,f];case 5:return[f,p,h]}},r.hsv.hsl=function(o){let a=o[0],l=o[1]/100,f=o[2]/100,u=Math.max(f,.01),c,p;p=(2-l)*f;let h=(2-l)*u;return c=l*u,c/=h<=1?h:2-h,c=c||0,p/=2,[a,c*100,p*100]},r.hwb.rgb=function(o){let a=o[0]/360,l=o[1]/100,f=o[2]/100,u=l+f,c;u>1&&(l/=u,f/=u);let p=Math.floor(6*a),h=1-f;c=6*a-p,(p&1)!==0&&(c=1-c);let b=l+c*(h-l),g,m,v;switch(p){default:case 6:case 0:g=h,m=b,v=l;break;case 1:g=b,m=h,v=l;break;case 2:g=l,m=h,v=b;break;case 3:g=l,m=b,v=h;break;case 4:g=b,m=l,v=h;break;case 5:g=h,m=l,v=b;break}return[g*255,m*255,v*255]},r.cmyk.rgb=function(o){let a=o[0]/100,l=o[1]/100,f=o[2]/100,u=o[3]/100,c=1-Math.min(1,a*(1-u)+u),p=1-Math.min(1,l*(1-u)+u),h=1-Math.min(1,f*(1-u)+u);return[c*255,p*255,h*255]},r.xyz.rgb=function(o){let a=o[0]/100,l=o[1]/100,f=o[2]/100,u,c,p;return u=a*3.2406+l*-1.5372+f*-.4986,c=a*-.9689+l*1.8758+f*.0415,p=a*.0557+l*-.204+f*1.057,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,p=p>.0031308?1.055*p**(1/2.4)-.055:p*12.92,u=Math.min(Math.max(0,u),1),c=Math.min(Math.max(0,c),1),p=Math.min(Math.max(0,p),1),[u*255,c*255,p*255]},r.xyz.lab=function(o){let a=o[0],l=o[1],f=o[2];a/=95.047,l/=100,f/=108.883,a=a>.008856?a**(1/3):7.787*a+16/116,l=l>.008856?l**(1/3):7.787*l+16/116,f=f>.008856?f**(1/3):7.787*f+16/116;let u=116*l-16,c=500*(a-l),p=200*(l-f);return[u,c,p]},r.lab.xyz=function(o){let a=o[0],l=o[1],f=o[2],u,c,p;c=(a+16)/116,u=l/500+c,p=c-f/200;let h=c**3,b=u**3,g=p**3;return c=h>.008856?h:(c-16/116)/7.787,u=b>.008856?b:(u-16/116)/7.787,p=g>.008856?g:(p-16/116)/7.787,u*=95.047,c*=100,p*=108.883,[u,c,p]},r.lab.lch=function(o){let a=o[0],l=o[1],f=o[2],u;u=Math.atan2(f,l)*360/2/Math.PI,u<0&&(u+=360);let c=Math.sqrt(l*l+f*f);return[a,c,u]},r.lch.lab=function(o){let a=o[0],l=o[1],f=o[2]/360*2*Math.PI,u=l*Math.cos(f),c=l*Math.sin(f);return[a,u,c]},r.rgb.ansi16=function(o,a=null){let[l,f,u]=o,c=a===null?r.rgb.hsv(o)[2]:a;if(c=Math.round(c/50),c===0)return 30;let p=30+(Math.round(u/255)<<2|Math.round(f/255)<<1|Math.round(l/255));return c===2&&(p+=60),p},r.hsv.ansi16=function(o){return r.rgb.ansi16(r.hsv.rgb(o),o[2])},r.rgb.ansi256=function(o){let a=o[0],l=o[1],f=o[2];return a===l&&l===f?a<8?16:a>248?231:Math.round((a-8)/247*24)+232:16+36*Math.round(a/255*5)+6*Math.round(l/255*5)+Math.round(f/255*5)},r.ansi16.rgb=function(o){let a=o%10;if(a===0||a===7)return o>50&&(a+=3.5),a=a/10.5*255,[a,a,a];let l=(~~(o>50)+1)*.5,f=(a&1)*l*255,u=(a>>1&1)*l*255,c=(a>>2&1)*l*255;return[f,u,c]},r.ansi256.rgb=function(o){if(o>=232){let c=(o-232)*10+8;return[c,c,c]}o-=16;let a,l=Math.floor(o/36)/5*255,f=Math.floor((a=o%36)/6)/5*255,u=a%6/5*255;return[l,f,u]},r.rgb.hex=function(o){let a=(((Math.round(o[0])&255)<<16)+((Math.round(o[1])&255)<<8)+(Math.round(o[2])&255)).toString(16).toUpperCase();return"000000".substring(a.length)+a},r.hex.rgb=function(o){let a=o.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!a)return[0,0,0];let l=a[0];a[0].length===3&&(l=l.split("").map(h=>h+h).join(""));let f=parseInt(l,16),u=f>>16&255,c=f>>8&255,p=f&255;return[u,c,p]},r.rgb.hcg=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255,u=Math.max(Math.max(a,l),f),c=Math.min(Math.min(a,l),f),p=u-c,h,b;return p<1?h=c/(1-p):h=0,p<=0?b=0:u===a?b=(l-f)/p%6:u===l?b=2+(f-a)/p:b=4+(a-l)/p,b/=6,b%=1,[b*360,p*100,h*100]},r.hsl.hcg=function(o){let a=o[1]/100,l=o[2]/100,f=l<.5?2*a*l:2*a*(1-l),u=0;return f<1&&(u=(l-.5*f)/(1-f)),[o[0],f*100,u*100]},r.hsv.hcg=function(o){let a=o[1]/100,l=o[2]/100,f=a*l,u=0;return f<1&&(u=(l-f)/(1-f)),[o[0],f*100,u*100]},r.hcg.rgb=function(o){let a=o[0]/360,l=o[1]/100,f=o[2]/100;if(l===0)return[f*255,f*255,f*255];let u=[0,0,0],c=a%1*6,p=c%1,h=1-p,b=0;switch(Math.floor(c)){case 0:u[0]=1,u[1]=p,u[2]=0;break;case 1:u[0]=h,u[1]=1,u[2]=0;break;case 2:u[0]=0,u[1]=1,u[2]=p;break;case 3:u[0]=0,u[1]=h,u[2]=1;break;case 4:u[0]=p,u[1]=0,u[2]=1;break;default:u[0]=1,u[1]=0,u[2]=h}return b=(1-l)*f,[(l*u[0]+b)*255,(l*u[1]+b)*255,(l*u[2]+b)*255]},r.hcg.hsv=function(o){let a=o[1]/100,l=o[2]/100,f=a+l*(1-a),u=0;return f>0&&(u=a/f),[o[0],u*100,f*100]},r.hcg.hsl=function(o){let a=o[1]/100,l=o[2]/100*(1-a)+.5*a,f=0;return l>0&&l<.5?f=a/(2*l):l>=.5&&l<1&&(f=a/(2*(1-l))),[o[0],f*100,l*100]},r.hcg.hwb=function(o){let a=o[1]/100,l=o[2]/100,f=a+l*(1-a);return[o[0],(f-a)*100,(1-f)*100]},r.hwb.hcg=function(o){let a=o[1]/100,l=o[2]/100,f=1-l,u=f-a,c=0;return u<1&&(c=(f-u)/(1-u)),[o[0],u*100,c*100]},r.apple.rgb=function(o){return[o[0]/65535*255,o[1]/65535*255,o[2]/65535*255]},r.rgb.apple=function(o){return[o[0]/255*65535,o[1]/255*65535,o[2]/255*65535]},r.gray.rgb=function(o){return[o[0]/100*255,o[0]/100*255,o[0]/100*255]},r.gray.hsl=function(o){return[0,0,o[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(o){return[0,100,o[0]]},r.gray.cmyk=function(o){return[0,0,0,o[0]]},r.gray.lab=function(o){return[o[0],0,0]},r.gray.hex=function(o){let a=Math.round(o[0]/100*255)&255,l=((a<<16)+(a<<8)+a).toString(16).toUpperCase();return"000000".substring(l.length)+l},r.rgb.gray=function(o){return[(o[0]+o[1]+o[2])/3/255*100]}}),ul=Be((e,t)=>{we();var n=fo();function i(){let a={},l=Object.keys(n);for(let f=l.length,u=0;u<f;u++)a[l[u]]={distance:-1,parent:null};return a}function r(a){let l=i(),f=[a];for(l[a].distance=0;f.length;){let u=f.pop(),c=Object.keys(n[u]);for(let p=c.length,h=0;h<p;h++){let b=c[h],g=l[b];g.distance===-1&&(g.distance=l[u].distance+1,g.parent=u,f.unshift(b))}}return l}function s(a,l){return function(f){return l(a(f))}}function o(a,l){let f=[l[a].parent,a],u=n[l[a].parent][a],c=l[a].parent;for(;l[c].parent;)f.unshift(l[c].parent),u=s(n[l[c].parent][c],u),c=l[c].parent;return u.conversion=f,u}t.exports=function(a){let l=r(a),f={},u=Object.keys(l);for(let c=u.length,p=0;p<c;p++){let h=u[p];l[h].parent!==null&&(f[h]=o(h,l))}return f}}),pl=Be((e,t)=>{we();var n=fo(),i=ul(),r={},s=Object.keys(n);function o(l){let f=function(...u){let c=u[0];return c==null?c:(c.length>1&&(u=c),l(u))};return"conversion"in l&&(f.conversion=l.conversion),f}function a(l){let f=function(...u){let c=u[0];if(c==null)return c;c.length>1&&(u=c);let p=l(u);if(typeof p=="object")for(let h=p.length,b=0;b<h;b++)p[b]=Math.round(p[b]);return p};return"conversion"in l&&(f.conversion=l.conversion),f}s.forEach(l=>{r[l]={},Object.defineProperty(r[l],"channels",{value:n[l].channels}),Object.defineProperty(r[l],"labels",{value:n[l].labels});let f=i(l);Object.keys(f).forEach(u=>{let c=f[u];r[l][u]=a(c),r[l][u].raw=o(c)})}),t.exports=r}),dl=Be((e,t)=>{"use strict";we();var n=(c,p)=>(...h)=>`\x1B[${c(...h)+p}m`,i=(c,p)=>(...h)=>{let b=c(...h);return`\x1B[${38+p};5;${b}m`},r=(c,p)=>(...h)=>{let b=c(...h);return`\x1B[${38+p};2;${b[0]};${b[1]};${b[2]}m`},s=c=>c,o=(c,p,h)=>[c,p,h],a=(c,p,h)=>{Object.defineProperty(c,p,{get:()=>{let b=h();return Object.defineProperty(c,p,{value:b,enumerable:!0,configurable:!0}),b},enumerable:!0,configurable:!0})},l,f=(c,p,h,b)=>{l===void 0&&(l=pl());let g=b?10:0,m={};for(let[v,O]of Object.entries(l)){let U=v==="ansi16"?"ansi":v;v===p?m[U]=c(h,g):typeof O=="object"&&(m[U]=c(O[p],g))}return m};function u(){let c=new Map,p={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};p.color.gray=p.color.blackBright,p.bgColor.bgGray=p.bgColor.bgBlackBright,p.color.grey=p.color.blackBright,p.bgColor.bgGrey=p.bgColor.bgBlackBright;for(let[h,b]of Object.entries(p)){for(let[g,m]of Object.entries(b))p[g]={open:`\x1B[${m[0]}m`,close:`\x1B[${m[1]}m`},b[g]=p[g],c.set(m[0],m[1]);Object.defineProperty(p,h,{value:b,enumerable:!1})}return Object.defineProperty(p,"codes",{value:c,enumerable:!1}),p.color.close="\x1B[39m",p.bgColor.close="\x1B[49m",a(p.color,"ansi",()=>f(n,"ansi16",s,!1)),a(p.color,"ansi256",()=>f(i,"ansi256",s,!1)),a(p.color,"ansi16m",()=>f(r,"rgb",o,!1)),a(p.bgColor,"ansi",()=>f(n,"ansi16",s,!0)),a(p.bgColor,"ansi256",()=>f(i,"ansi256",s,!0)),a(p.bgColor,"ansi16m",()=>f(r,"rgb",o,!0)),p}Object.defineProperty(t,"exports",{enumerable:!0,get:u})}),hl=Be((e,t)=>{"use strict";we(),t.exports=(n,i=process.argv)=>{let r=n.startsWith("-")?"":n.length===1?"-":"--",s=i.indexOf(r+n),o=i.indexOf("--");return s!==-1&&(o===-1||s<o)}}),ml=Be((e,t)=>{"use strict";we();var n=lo("os"),i=lo("tty"),r=hl(),{env:s}=process,o;r("no-color")||r("no-colors")||r("color=false")||r("color=never")?o=0:(r("color")||r("colors")||r("color=true")||r("color=always"))&&(o=1),"FORCE_COLOR"in s&&(s.FORCE_COLOR==="true"?o=1:s.FORCE_COLOR==="false"?o=0:o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3));function a(u){return u===0?!1:{level:u,hasBasic:!0,has256:u>=2,has16m:u>=3}}function l(u,c){if(o===0)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(u&&!c&&o===void 0)return 0;let p=o||0;if(s.TERM==="dumb")return p;if(process.platform==="win32"){let h=n.release().split(".");return Number(h[0])>=10&&Number(h[2])>=10586?Number(h[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(h=>h in s)||s.CI_NAME==="codeship"?1:p;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if(s.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in s){let h=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return h>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:p}function f(u){let c=l(u,u&&u.isTTY);return a(c)}t.exports={supportsColor:f,stdout:a(l(!0,i.isatty(1))),stderr:a(l(!0,i.isatty(2)))}}),gl=Be((e,t)=>{"use strict";we();var n=(r,s,o)=>{let a=r.indexOf(s);if(a===-1)return r;let l=s.length,f=0,u="";do u+=r.substr(f,a-f)+s+o,f=a+l,a=r.indexOf(s,f);while(a!==-1);return u+=r.substr(f),u},i=(r,s,o,a)=>{let l=0,f="";do{let u=r[a-1]==="\r";f+=r.substr(l,(u?a-1:a)-l)+s+(u?`\r
65
65
  `:`
66
66
  `)+o,l=a+1,a=r.indexOf(`
67
67
  `,l)}while(a!==-1);return f+=r.substr(l),f};t.exports={stringReplaceAll:n,stringEncaseCRLFWithFirstIndex:i}}),bl=Be((e,t)=>{"use strict";we();var n=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,i=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,s=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,o=new Map([["n",`
68
- `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function a(c){let p=c[0]==="u",h=c[1]==="{";return p&&!h&&c.length===5||c[0]==="x"&&c.length===3?String.fromCharCode(parseInt(c.slice(1),16)):p&&h?String.fromCodePoint(parseInt(c.slice(2,-1),16)):o.get(c)||c}function l(c,p){let h=[],b=p.trim().split(/\s*,\s*/g),g;for(let m of b){let x=Number(m);if(!Number.isNaN(x))h.push(x);else if(g=m.match(r))h.push(g[2].replace(s,(O,$,z)=>$?a($):z));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${c}')`)}return h}function f(c){i.lastIndex=0;let p=[],h;for(;(h=i.exec(c))!==null;){let b=h[1];if(h[2]){let g=l(b,h[2]);p.push([b].concat(g))}else p.push([b])}return p}function u(c,p){let h={};for(let g of p)for(let m of g.styles)h[m[0]]=g.inverse?null:m.slice(1);let b=c;for(let[g,m]of Object.entries(h))if(Array.isArray(m)){if(!(g in b))throw new Error(`Unknown Chalk style: ${g}`);b=m.length>0?b[g](...m):b[g]}return b}t.exports=(c,p)=>{let h=[],b=[],g=[];if(p.replace(n,(m,x,O,$,z,V)=>{if(x)g.push(a(x));else if($){let Y=g.join("");g=[],b.push(h.length===0?Y:u(c,h)(Y)),h.push({inverse:O,styles:f($)})}else if(z){if(h.length===0)throw new Error("Found extraneous } in Chalk template literal");b.push(u(c,h)(g.join(""))),g=[],h.pop()}else g.push(V)}),b.push(g.join("")),h.length>0){let m=`Chalk template literal is missing ${h.length} closing bracket${h.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return b.join("")}}),_i=Be((e,t)=>{"use strict";we();var n=dl(),{stdout:i,stderr:r}=ml(),{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:o}=gl(),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],f=Object.create(null),u=(Y,N={})=>{if(N.level&&!(Number.isInteger(N.level)&&N.level>=0&&N.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let K=i?i.level:0;Y.level=N.level===void 0?K:N.level},c=class{constructor(Y){return p(Y)}},p=Y=>{let N={};return u(N,Y),N.template=(...K)=>z(N.template,...K),Object.setPrototypeOf(N,h.prototype),Object.setPrototypeOf(N.template,N),N.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},N.template.Instance=c,N.template};function h(Y){return p(Y)}for(let[Y,N]of Object.entries(n))f[Y]={get(){let K=x(this,m(N.open,N.close,this._styler),this._isEmpty);return Object.defineProperty(this,Y,{value:K}),K}};f.visible={get(){let Y=x(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:Y}),Y}};var b=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let Y of b)f[Y]={get(){let{level:N}=this;return function(...K){let Z=m(n.color[l[N]][Y](...K),n.color.close,this._styler);return x(this,Z,this._isEmpty)}}};for(let Y of b){let N="bg"+Y[0].toUpperCase()+Y.slice(1);f[N]={get(){let{level:K}=this;return function(...Z){let k=m(n.bgColor[l[K]][Y](...Z),n.bgColor.close,this._styler);return x(this,k,this._isEmpty)}}}}var g=Object.defineProperties(()=>{},sl(ol({},f),{level:{enumerable:!0,get(){return this._generator.level},set(Y){this._generator.level=Y}}})),m=(Y,N,K)=>{let Z,k;return K===void 0?(Z=Y,k=N):(Z=K.openAll+Y,k=N+K.closeAll),{open:Y,close:N,openAll:Z,closeAll:k,parent:K}},x=(Y,N,K)=>{let Z=(...k)=>a(k[0])&&a(k[0].raw)?O(Z,z(Z,...k)):O(Z,k.length===1?""+k[0]:k.join(" "));return Object.setPrototypeOf(Z,g),Z._generator=Y,Z._styler=N,Z._isEmpty=K,Z},O=(Y,N)=>{if(Y.level<=0||!N)return Y._isEmpty?"":N;let K=Y._styler;if(K===void 0)return N;let{openAll:Z,closeAll:k}=K;if(N.indexOf("\x1B")!==-1)for(;K!==void 0;)N=s(N,K.close,K.open),K=K.parent;let I=N.indexOf(`
69
- `);return I!==-1&&(N=o(N,k,Z,I)),Z+N+k},$,z=(Y,...N)=>{let[K]=N;if(!a(K)||!a(K.raw))return N.join(" ");let Z=N.slice(1),k=[K.raw[0]];for(let I=1;I<K.length;I++)k.push(String(Z[I-1]).replace(/[{}\\]/g,"\\$&"),String(K.raw[I]));return $===void 0&&($=bl()),$(Y,k.join(""))};Object.defineProperties(h.prototype,f);var V=h();V.supportsColor=i,V.stderr=h({level:r?r.level:0}),V.stderr.supportsColor=r,t.exports=V});import{existsSync as pp,mkdirSync as dp}from"fs";import{readdir as hp,unlink as mp}from"fs/promises";import{extname as gp,join as Ds}from"path";A();function So(e){return typeof e=="undefined"||e===null}function yl(e){return typeof e=="object"&&e!==null}function wl(e){return Array.isArray(e)?e:So(e)?[]:[e]}function Cl(e,t){var n,i,r,s;if(t)for(s=Object.keys(t),n=0,i=s.length;n<i;n+=1)r=s[n],e[r]=t[r];return e}function Al(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function vl(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var xl=So,Ol=yl,_l=wl,El=Al,Sl=vl,Il=Cl,ge={isNothing:xl,isObject:Ol,toArray:_l,repeat:El,isNegativeZero:Sl,extend:Il};function Io(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
68
+ `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function a(c){let p=c[0]==="u",h=c[1]==="{";return p&&!h&&c.length===5||c[0]==="x"&&c.length===3?String.fromCharCode(parseInt(c.slice(1),16)):p&&h?String.fromCodePoint(parseInt(c.slice(2,-1),16)):o.get(c)||c}function l(c,p){let h=[],b=p.trim().split(/\s*,\s*/g),g;for(let m of b){let v=Number(m);if(!Number.isNaN(v))h.push(v);else if(g=m.match(r))h.push(g[2].replace(s,(O,U,B)=>U?a(U):B));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${c}')`)}return h}function f(c){i.lastIndex=0;let p=[],h;for(;(h=i.exec(c))!==null;){let b=h[1];if(h[2]){let g=l(b,h[2]);p.push([b].concat(g))}else p.push([b])}return p}function u(c,p){let h={};for(let g of p)for(let m of g.styles)h[m[0]]=g.inverse?null:m.slice(1);let b=c;for(let[g,m]of Object.entries(h))if(Array.isArray(m)){if(!(g in b))throw new Error(`Unknown Chalk style: ${g}`);b=m.length>0?b[g](...m):b[g]}return b}t.exports=(c,p)=>{let h=[],b=[],g=[];if(p.replace(n,(m,v,O,U,B,V)=>{if(v)g.push(a(v));else if(U){let k=g.join("");g=[],b.push(h.length===0?k:u(c,h)(k)),h.push({inverse:O,styles:f(U)})}else if(B){if(h.length===0)throw new Error("Found extraneous } in Chalk template literal");b.push(u(c,h)(g.join(""))),g=[],h.pop()}else g.push(V)}),b.push(g.join("")),h.length>0){let m=`Chalk template literal is missing ${h.length} closing bracket${h.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return b.join("")}}),_i=Be((e,t)=>{"use strict";we();var n=dl(),{stdout:i,stderr:r}=ml(),{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:o}=gl(),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],f=Object.create(null),u=(k,T={})=>{if(T.level&&!(Number.isInteger(T.level)&&T.level>=0&&T.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let K=i?i.level:0;k.level=T.level===void 0?K:T.level},c=class{constructor(k){return p(k)}},p=k=>{let T={};return u(T,k),T.template=(...K)=>B(T.template,...K),Object.setPrototypeOf(T,h.prototype),Object.setPrototypeOf(T.template,T),T.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},T.template.Instance=c,T.template};function h(k){return p(k)}for(let[k,T]of Object.entries(n))f[k]={get(){let K=v(this,m(T.open,T.close,this._styler),this._isEmpty);return Object.defineProperty(this,k,{value:K}),K}};f.visible={get(){let k=v(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:k}),k}};var b=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let k of b)f[k]={get(){let{level:T}=this;return function(...K){let Z=m(n.color[l[T]][k](...K),n.color.close,this._styler);return v(this,Z,this._isEmpty)}}};for(let k of b){let T="bg"+k[0].toUpperCase()+k.slice(1);f[T]={get(){let{level:K}=this;return function(...Z){let z=m(n.bgColor[l[K]][k](...Z),n.bgColor.close,this._styler);return v(this,z,this._isEmpty)}}}}var g=Object.defineProperties(()=>{},sl(ol({},f),{level:{enumerable:!0,get(){return this._generator.level},set(k){this._generator.level=k}}})),m=(k,T,K)=>{let Z,z;return K===void 0?(Z=k,z=T):(Z=K.openAll+k,z=T+K.closeAll),{open:k,close:T,openAll:Z,closeAll:z,parent:K}},v=(k,T,K)=>{let Z=(...z)=>a(z[0])&&a(z[0].raw)?O(Z,B(Z,...z)):O(Z,z.length===1?""+z[0]:z.join(" "));return Object.setPrototypeOf(Z,g),Z._generator=k,Z._styler=T,Z._isEmpty=K,Z},O=(k,T)=>{if(k.level<=0||!T)return k._isEmpty?"":T;let K=k._styler;if(K===void 0)return T;let{openAll:Z,closeAll:z}=K;if(T.indexOf("\x1B")!==-1)for(;K!==void 0;)T=s(T,K.close,K.open),K=K.parent;let I=T.indexOf(`
69
+ `);return I!==-1&&(T=o(T,z,Z,I)),Z+T+z},U,B=(k,...T)=>{let[K]=T;if(!a(K)||!a(K.raw))return T.join(" ");let Z=T.slice(1),z=[K.raw[0]];for(let I=1;I<K.length;I++)z.push(String(Z[I-1]).replace(/[{}\\]/g,"\\$&"),String(K.raw[I]));return U===void 0&&(U=bl()),U(k,z.join(""))};Object.defineProperties(h.prototype,f);var V=h();V.supportsColor=i,V.stderr=h({level:r?r.level:0}),V.stderr.supportsColor=r,t.exports=V});import{existsSync as pp,mkdirSync as dp}from"fs";import{readdir as hp,unlink as mp}from"fs/promises";import{extname as gp,join as Ds}from"path";A();function So(e){return typeof e=="undefined"||e===null}function yl(e){return typeof e=="object"&&e!==null}function wl(e){return Array.isArray(e)?e:So(e)?[]:[e]}function Cl(e,t){var n,i,r,s;if(t)for(s=Object.keys(t),n=0,i=s.length;n<i;n+=1)r=s[n],e[r]=t[r];return e}function Al(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function xl(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var vl=So,Ol=yl,_l=wl,El=Al,Sl=xl,Il=Cl,ge={isNothing:vl,isObject:Ol,toArray:_l,repeat:El,isNegativeZero:Sl,extend:Il};function Io(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
70
70
 
71
71
  `+e.mark.snippet),i+" "+n):i}function un(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Io(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}un.prototype=Object.create(Error.prototype);un.prototype.constructor=un;un.prototype.toString=function(t){return this.name+": "+Io(this,t)};var _e=un;function Ei(e,t,n,i,r){var s="",o="",a=Math.floor(r/2)-1;return i-t>a&&(s=" ... ",t=i-a+s.length),n-i>a&&(o=" ...",n=i+a-o.length),{str:s+e.slice(t,n).replace(/\t/g,"\u2192")+o,pos:i-t+s.length}}function Si(e,t){return ge.repeat(" ",t-e.length)+e}function jl(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,i=[0],r=[],s,o=-1;s=n.exec(e.buffer);)r.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var a="",l,f,u=Math.min(e.line+t.linesAfter,r.length).toString().length,c=t.maxLength-(t.indent+u+3);for(l=1;l<=t.linesBefore&&!(o-l<0);l++)f=Ei(e.buffer,i[o-l],r[o-l],e.position-(i[o]-i[o-l]),c),a=ge.repeat(" ",t.indent)+Si((e.line-l+1).toString(),u)+" | "+f.str+`
72
72
  `+a;for(f=Ei(e.buffer,i[o],r[o],e.position,c),a+=ge.repeat(" ",t.indent)+Si((e.line+1).toString(),u)+" | "+f.str+`
73
73
  `,a+=ge.repeat("-",t.indent+u+3+f.pos)+`^
74
74
  `,l=1;l<=t.linesAfter&&!(o+l>=r.length);l++)f=Ei(e.buffer,i[o+l],r[o+l],e.position-(i[o]-i[o+l]),c),a+=ge.repeat(" ",t.indent)+Si((e.line+l+1).toString(),u)+" | "+f.str+`
75
75
  `;return a.replace(/\n$/,"")}var Pl=jl,Ml=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Fl=["scalar","sequence","mapping"];function Ll(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function Dl(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Ml.indexOf(n)===-1)throw new _e('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Ll(t.styleAliases||null),Fl.indexOf(this.kind)===-1)throw new _e('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Ae=Dl;function uo(e,t){var n=[];return e[t].forEach(function(i){var r=n.length;n.forEach(function(s,o){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(r=o)}),n[r]=i}),n}function Nl(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function i(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(i);return e}function ji(e){return this.extend(e)}ji.prototype.extend=function(t){var n=[],i=[];if(t instanceof Ae)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new _e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof Ae))throw new _e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new _e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new _e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(s){if(!(s instanceof Ae))throw new _e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(ji.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=uo(r,"implicit"),r.compiledExplicit=uo(r,"explicit"),r.compiledTypeMap=Nl(r.compiledImplicit,r.compiledExplicit),r};var Tl=ji,Rl=new Ae("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),$l=new Ae("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Ul=new Ae("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Hl=new Tl({explicit:[Rl,$l,Ul]});function Bl(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Wl(){return null}function Yl(e){return e===null}var kl=new Ae("tag:yaml.org,2002:null",{kind:"scalar",resolve:Bl,construct:Wl,predicate:Yl,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function zl(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function ql(e){return e==="true"||e==="True"||e==="TRUE"}function Gl(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Kl=new Ae("tag:yaml.org,2002:bool",{kind:"scalar",resolve:zl,construct:ql,predicate:Gl,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Vl(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Jl(e){return 48<=e&&e<=55}function Ql(e){return 48<=e&&e<=57}function Zl(e){if(e===null)return!1;var t=e.length,n=0,i=!1,r;if(!t)return!1;if(r=e[n],(r==="-"||r==="+")&&(r=e[++n]),r==="0"){if(n+1===t)return!0;if(r=e[++n],r==="b"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(r!=="0"&&r!=="1")return!1;i=!0}return i&&r!=="_"}if(r==="x"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Vl(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Jl(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<t;n++)if(r=e[n],r!=="_"){if(!Ql(e.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function Xl(e){var t=e,n=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(n=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function ec(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ge.isNegativeZero(e)}var tc=new Ae("tag:yaml.org,2002:int",{kind:"scalar",resolve:Zl,construct:Xl,predicate:ec,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),nc=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ic(e){return!(e===null||!nc.test(e)||e[e.length-1]==="_")}function rc(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var oc=/^[-+]?[0-9]+e/;function sc(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ge.isNegativeZero(e))return"-0.0";return n=e.toString(10),oc.test(n)?n.replace("e",".e"):n}function ac(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ge.isNegativeZero(e))}var lc=new Ae("tag:yaml.org,2002:float",{kind:"scalar",resolve:ic,construct:rc,predicate:ac,represent:sc,defaultStyle:"lowercase"}),cc=Hl.extend({implicit:[kl,Kl,tc,lc]}),fc=cc,jo=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Po=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function uc(e){return e===null?!1:jo.exec(e)!==null||Po.exec(e)!==null}function pc(e){var t,n,i,r,s,o,a,l=0,f=null,u,c,p;if(t=jo.exec(e),t===null&&(t=Po.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(s=+t[4],o=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=+t[10],c=+(t[11]||0),f=(u*60+c)*6e4,t[9]==="-"&&(f=-f)),p=new Date(Date.UTC(n,i,r,s,o,a,l)),f&&p.setTime(p.getTime()-f),p}function dc(e){return e.toISOString()}var hc=new Ae("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:uc,construct:pc,instanceOf:Date,represent:dc});function mc(e){return e==="<<"||e===null}var gc=new Ae("tag:yaml.org,2002:merge",{kind:"scalar",resolve:mc}),Di=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
76
- \r`;function bc(e){if(e===null)return!1;var t,n,i=0,r=e.length,s=Di;for(n=0;n<r;n++)if(t=s.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function yc(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,s=Di,o=0,a=[];for(t=0;t<r;t++)t%4===0&&t&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(i.charAt(t));return n=r%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),new Uint8Array(a)}function wc(e){var t="",n=0,i,r,s=e.length,o=Di;for(i=0;i<s;i++)i%3===0&&i&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[i];return r=s%3,r===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):r===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):r===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function Cc(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Ac=new Ae("tag:yaml.org,2002:binary",{kind:"scalar",resolve:bc,construct:yc,predicate:Cc,represent:wc}),vc=Object.prototype.hasOwnProperty,xc=Object.prototype.toString;function Oc(e){if(e===null)return!0;var t=[],n,i,r,s,o,a=e;for(n=0,i=a.length;n<i;n+=1){if(r=a[n],o=!1,xc.call(r)!=="[object Object]")return!1;for(s in r)if(vc.call(r,s))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function _c(e){return e!==null?e:[]}var Ec=new Ae("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Oc,construct:_c}),Sc=Object.prototype.toString;function Ic(e){if(e===null)return!0;var t,n,i,r,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(i=o[t],Sc.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;s[t]=[r[0],i[r[0]]]}return!0}function jc(e){if(e===null)return[];var t,n,i,r,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1)i=o[t],r=Object.keys(i),s[t]=[r[0],i[r[0]]];return s}var Pc=new Ae("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Ic,construct:jc}),Mc=Object.prototype.hasOwnProperty;function Fc(e){if(e===null)return!0;var t,n=e;for(t in n)if(Mc.call(n,t)&&n[t]!==null)return!1;return!0}function Lc(e){return e!==null?e:{}}var Dc=new Ae("tag:yaml.org,2002:set",{kind:"mapping",resolve:Fc,construct:Lc}),Mo=fc.extend({implicit:[hc,gc],explicit:[Ac,Ec,Pc,Dc]}),ot=Object.prototype.hasOwnProperty,Tn=1,Fo=2,Lo=3,Rn=4,Ii=1,Nc=2,po=3,Tc=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Rc=/[\x85\u2028\u2029]/,$c=/[,\[\]\{\}]/,Do=/^(?:!|!!|![a-z\-]+!)$/i,No=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ho(e){return Object.prototype.toString.call(e)}function We(e){return e===10||e===13}function Ut(e){return e===9||e===32}function Ee(e){return e===9||e===32||e===10||e===13}function Jt(e){return e===44||e===91||e===93||e===123||e===125}function Uc(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Hc(e){return e===120?2:e===117?4:e===85?8:0}function Bc(e){return 48<=e&&e<=57?e-48:-1}function mo(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
77
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Wc(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var To=new Array(256),Ro=new Array(256);for($t=0;$t<256;$t++)To[$t]=mo($t)?1:0,Ro[$t]=mo($t);var $t;function Yc(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Mo,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function $o(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=Pl(n),new _e(t,n)}function R(e,t){throw $o(e,t)}function $n(e,t){e.onWarning&&e.onWarning.call(null,$o(e,t))}var go={YAML:function(t,n,i){var r,s,o;t.version!==null&&R(t,"duplication of %YAML directive"),i.length!==1&&R(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&R(t,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),o=parseInt(r[2],10),s!==1&&R(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&$n(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,s;i.length!==2&&R(t,"TAG directive accepts exactly two arguments"),r=i[0],s=i[1],Do.test(r)||R(t,"ill-formed tag handle (first argument) of the TAG directive"),ot.call(t.tagMap,r)&&R(t,'there is a previously declared suffix for "'+r+'" tag handle'),No.test(s)||R(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(o){R(t,"tag prefix is malformed: "+s)}t.tagMap[r]=s}};function rt(e,t,n,i){var r,s,o,a;if(t<n){if(a=e.input.slice(t,n),i)for(r=0,s=a.length;r<s;r+=1)o=a.charCodeAt(r),o===9||32<=o&&o<=1114111||R(e,"expected valid JSON character");else Tc.test(a)&&R(e,"the stream contains non-printable characters");e.result+=a}}function bo(e,t,n,i){var r,s,o,a;for(ge.isObject(n)||R(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),o=0,a=r.length;o<a;o+=1)s=r[o],ot.call(t,s)||(t[s]=n[s],i[s]=!0)}function Qt(e,t,n,i,r,s,o,a,l){var f,u;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),f=0,u=r.length;f<u;f+=1)Array.isArray(r[f])&&R(e,"nested arrays are not supported inside keys"),typeof r=="object"&&ho(r[f])==="[object Object]"&&(r[f]="[object Object]");if(typeof r=="object"&&ho(r)==="[object Object]"&&(r="[object Object]"),r=String(r),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(f=0,u=s.length;f<u;f+=1)bo(e,t,s[f],n);else bo(e,t,s,n);else!e.json&&!ot.call(n,r)&&ot.call(t,r)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,R(e,"duplicated mapping key")),r==="__proto__"?Object.defineProperty(t,r,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[r]=s,delete n[r];return t}function Ni(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):R(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function he(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);r!==0;){for(;Ut(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(We(r))for(Ni(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return n!==-1&&i!==0&&e.lineIndent<n&&$n(e,"deficient indentation"),i}function Bn(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Ee(n)))}function Ti(e,t){t===1?e.result+=" ":t>1&&(e.result+=ge.repeat(`
78
- `,t-1))}function kc(e,t,n){var i,r,s,o,a,l,f,u,c=e.kind,p=e.result,h;if(h=e.input.charCodeAt(e.position),Ee(h)||Jt(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(r=e.input.charCodeAt(e.position+1),Ee(r)||n&&Jt(r)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,a=!1;h!==0;){if(h===58){if(r=e.input.charCodeAt(e.position+1),Ee(r)||n&&Jt(r))break}else if(h===35){if(i=e.input.charCodeAt(e.position-1),Ee(i))break}else{if(e.position===e.lineStart&&Bn(e)||n&&Jt(h))break;if(We(h))if(l=e.line,f=e.lineStart,u=e.lineIndent,he(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=f,e.lineIndent=u;break}}a&&(rt(e,s,o,!1),Ti(e,e.line-l),s=o=e.position,a=!1),Ut(h)||(o=e.position+1),h=e.input.charCodeAt(++e.position)}return rt(e,s,o,!1),e.result?!0:(e.kind=c,e.result=p,!1)}function zc(e,t){var n,i,r;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(rt(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)i=e.position,e.position++,r=e.position;else return!0;else We(n)?(rt(e,i,r,!0),Ti(e,he(e,!1,t)),i=r=e.position):e.position===e.lineStart&&Bn(e)?R(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);R(e,"unexpected end of the stream within a single quoted scalar")}function qc(e,t){var n,i,r,s,o,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return rt(e,n,e.position,!0),e.position++,!0;if(a===92){if(rt(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),We(a))he(e,!1,t);else if(a<256&&To[a])e.result+=Ro[a],e.position++;else if((o=Hc(a))>0){for(r=o,s=0;r>0;r--)a=e.input.charCodeAt(++e.position),(o=Uc(a))>=0?s=(s<<4)+o:R(e,"expected hexadecimal character");e.result+=Wc(s),e.position++}else R(e,"unknown escape sequence");n=i=e.position}else We(a)?(rt(e,n,i,!0),Ti(e,he(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Bn(e)?R(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}R(e,"unexpected end of the stream within a double quoted scalar")}function Gc(e,t){var n=!0,i,r,s,o=e.tag,a,l=e.anchor,f,u,c,p,h,b=Object.create(null),g,m,x,O;if(O=e.input.charCodeAt(e.position),O===91)u=93,h=!1,a=[];else if(O===123)u=125,h=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),O=e.input.charCodeAt(++e.position);O!==0;){if(he(e,!0,t),O=e.input.charCodeAt(e.position),O===u)return e.position++,e.tag=o,e.anchor=l,e.kind=h?"mapping":"sequence",e.result=a,!0;n?O===44&&R(e,"expected the node content, but found ','"):R(e,"missed comma between flow collection entries"),m=g=x=null,c=p=!1,O===63&&(f=e.input.charCodeAt(e.position+1),Ee(f)&&(c=p=!0,e.position++,he(e,!0,t))),i=e.line,r=e.lineStart,s=e.position,Zt(e,t,Tn,!1,!0),m=e.tag,g=e.result,he(e,!0,t),O=e.input.charCodeAt(e.position),(p||e.line===i)&&O===58&&(c=!0,O=e.input.charCodeAt(++e.position),he(e,!0,t),Zt(e,t,Tn,!1,!0),x=e.result),h?Qt(e,a,b,m,g,x,i,r,s):c?a.push(Qt(e,null,b,m,g,x,i,r,s)):a.push(g),he(e,!0,t),O=e.input.charCodeAt(e.position),O===44?(n=!0,O=e.input.charCodeAt(++e.position)):n=!1}R(e,"unexpected end of the stream within a flow collection")}function Kc(e,t){var n,i,r=Ii,s=!1,o=!1,a=t,l=0,f=!1,u,c;if(c=e.input.charCodeAt(e.position),c===124)i=!1;else if(c===62)i=!0;else return!1;for(e.kind="scalar",e.result="";c!==0;)if(c=e.input.charCodeAt(++e.position),c===43||c===45)Ii===r?r=c===43?po:Nc:R(e,"repeat of a chomping mode identifier");else if((u=Bc(c))>=0)u===0?R(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?R(e,"repeat of an indentation width identifier"):(a=t+u-1,o=!0);else break;if(Ut(c)){do c=e.input.charCodeAt(++e.position);while(Ut(c));if(c===35)do c=e.input.charCodeAt(++e.position);while(!We(c)&&c!==0)}for(;c!==0;){for(Ni(e),e.lineIndent=0,c=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&c===32;)e.lineIndent++,c=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),We(c)){l++;continue}if(e.lineIndent<a){r===po?e.result+=ge.repeat(`
76
+ \r`;function bc(e){if(e===null)return!1;var t,n,i=0,r=e.length,s=Di;for(n=0;n<r;n++)if(t=s.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function yc(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,s=Di,o=0,a=[];for(t=0;t<r;t++)t%4===0&&t&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(i.charAt(t));return n=r%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),new Uint8Array(a)}function wc(e){var t="",n=0,i,r,s=e.length,o=Di;for(i=0;i<s;i++)i%3===0&&i&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[i];return r=s%3,r===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):r===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):r===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function Cc(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Ac=new Ae("tag:yaml.org,2002:binary",{kind:"scalar",resolve:bc,construct:yc,predicate:Cc,represent:wc}),xc=Object.prototype.hasOwnProperty,vc=Object.prototype.toString;function Oc(e){if(e===null)return!0;var t=[],n,i,r,s,o,a=e;for(n=0,i=a.length;n<i;n+=1){if(r=a[n],o=!1,vc.call(r)!=="[object Object]")return!1;for(s in r)if(xc.call(r,s))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function _c(e){return e!==null?e:[]}var Ec=new Ae("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Oc,construct:_c}),Sc=Object.prototype.toString;function Ic(e){if(e===null)return!0;var t,n,i,r,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(i=o[t],Sc.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;s[t]=[r[0],i[r[0]]]}return!0}function jc(e){if(e===null)return[];var t,n,i,r,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1)i=o[t],r=Object.keys(i),s[t]=[r[0],i[r[0]]];return s}var Pc=new Ae("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Ic,construct:jc}),Mc=Object.prototype.hasOwnProperty;function Fc(e){if(e===null)return!0;var t,n=e;for(t in n)if(Mc.call(n,t)&&n[t]!==null)return!1;return!0}function Lc(e){return e!==null?e:{}}var Dc=new Ae("tag:yaml.org,2002:set",{kind:"mapping",resolve:Fc,construct:Lc}),Mo=fc.extend({implicit:[hc,gc],explicit:[Ac,Ec,Pc,Dc]}),ot=Object.prototype.hasOwnProperty,Tn=1,Fo=2,Lo=3,Rn=4,Ii=1,Nc=2,po=3,Tc=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Rc=/[\x85\u2028\u2029]/,$c=/[,\[\]\{\}]/,Do=/^(?:!|!!|![a-z\-]+!)$/i,No=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ho(e){return Object.prototype.toString.call(e)}function We(e){return e===10||e===13}function Ut(e){return e===9||e===32}function Ee(e){return e===9||e===32||e===10||e===13}function Jt(e){return e===44||e===91||e===93||e===123||e===125}function Uc(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Hc(e){return e===120?2:e===117?4:e===85?8:0}function Bc(e){return 48<=e&&e<=57?e-48:-1}function mo(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
77
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Wc(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var To=new Array(256),Ro=new Array(256);for($t=0;$t<256;$t++)To[$t]=mo($t)?1:0,Ro[$t]=mo($t);var $t;function Yc(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Mo,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function $o(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=Pl(n),new _e(t,n)}function $(e,t){throw $o(e,t)}function $n(e,t){e.onWarning&&e.onWarning.call(null,$o(e,t))}var go={YAML:function(t,n,i){var r,s,o;t.version!==null&&$(t,"duplication of %YAML directive"),i.length!==1&&$(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&$(t,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),o=parseInt(r[2],10),s!==1&&$(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&$n(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,s;i.length!==2&&$(t,"TAG directive accepts exactly two arguments"),r=i[0],s=i[1],Do.test(r)||$(t,"ill-formed tag handle (first argument) of the TAG directive"),ot.call(t.tagMap,r)&&$(t,'there is a previously declared suffix for "'+r+'" tag handle'),No.test(s)||$(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(o){$(t,"tag prefix is malformed: "+s)}t.tagMap[r]=s}};function rt(e,t,n,i){var r,s,o,a;if(t<n){if(a=e.input.slice(t,n),i)for(r=0,s=a.length;r<s;r+=1)o=a.charCodeAt(r),o===9||32<=o&&o<=1114111||$(e,"expected valid JSON character");else Tc.test(a)&&$(e,"the stream contains non-printable characters");e.result+=a}}function bo(e,t,n,i){var r,s,o,a;for(ge.isObject(n)||$(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),o=0,a=r.length;o<a;o+=1)s=r[o],ot.call(t,s)||(t[s]=n[s],i[s]=!0)}function Qt(e,t,n,i,r,s,o,a,l){var f,u;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),f=0,u=r.length;f<u;f+=1)Array.isArray(r[f])&&$(e,"nested arrays are not supported inside keys"),typeof r=="object"&&ho(r[f])==="[object Object]"&&(r[f]="[object Object]");if(typeof r=="object"&&ho(r)==="[object Object]"&&(r="[object Object]"),r=String(r),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(f=0,u=s.length;f<u;f+=1)bo(e,t,s[f],n);else bo(e,t,s,n);else!e.json&&!ot.call(n,r)&&ot.call(t,r)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,$(e,"duplicated mapping key")),r==="__proto__"?Object.defineProperty(t,r,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[r]=s,delete n[r];return t}function Ni(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):$(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function he(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);r!==0;){for(;Ut(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(We(r))for(Ni(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return n!==-1&&i!==0&&e.lineIndent<n&&$n(e,"deficient indentation"),i}function Bn(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Ee(n)))}function Ti(e,t){t===1?e.result+=" ":t>1&&(e.result+=ge.repeat(`
78
+ `,t-1))}function kc(e,t,n){var i,r,s,o,a,l,f,u,c=e.kind,p=e.result,h;if(h=e.input.charCodeAt(e.position),Ee(h)||Jt(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(r=e.input.charCodeAt(e.position+1),Ee(r)||n&&Jt(r)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,a=!1;h!==0;){if(h===58){if(r=e.input.charCodeAt(e.position+1),Ee(r)||n&&Jt(r))break}else if(h===35){if(i=e.input.charCodeAt(e.position-1),Ee(i))break}else{if(e.position===e.lineStart&&Bn(e)||n&&Jt(h))break;if(We(h))if(l=e.line,f=e.lineStart,u=e.lineIndent,he(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=f,e.lineIndent=u;break}}a&&(rt(e,s,o,!1),Ti(e,e.line-l),s=o=e.position,a=!1),Ut(h)||(o=e.position+1),h=e.input.charCodeAt(++e.position)}return rt(e,s,o,!1),e.result?!0:(e.kind=c,e.result=p,!1)}function zc(e,t){var n,i,r;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(rt(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)i=e.position,e.position++,r=e.position;else return!0;else We(n)?(rt(e,i,r,!0),Ti(e,he(e,!1,t)),i=r=e.position):e.position===e.lineStart&&Bn(e)?$(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);$(e,"unexpected end of the stream within a single quoted scalar")}function qc(e,t){var n,i,r,s,o,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return rt(e,n,e.position,!0),e.position++,!0;if(a===92){if(rt(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),We(a))he(e,!1,t);else if(a<256&&To[a])e.result+=Ro[a],e.position++;else if((o=Hc(a))>0){for(r=o,s=0;r>0;r--)a=e.input.charCodeAt(++e.position),(o=Uc(a))>=0?s=(s<<4)+o:$(e,"expected hexadecimal character");e.result+=Wc(s),e.position++}else $(e,"unknown escape sequence");n=i=e.position}else We(a)?(rt(e,n,i,!0),Ti(e,he(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Bn(e)?$(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}$(e,"unexpected end of the stream within a double quoted scalar")}function Gc(e,t){var n=!0,i,r,s,o=e.tag,a,l=e.anchor,f,u,c,p,h,b=Object.create(null),g,m,v,O;if(O=e.input.charCodeAt(e.position),O===91)u=93,h=!1,a=[];else if(O===123)u=125,h=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),O=e.input.charCodeAt(++e.position);O!==0;){if(he(e,!0,t),O=e.input.charCodeAt(e.position),O===u)return e.position++,e.tag=o,e.anchor=l,e.kind=h?"mapping":"sequence",e.result=a,!0;n?O===44&&$(e,"expected the node content, but found ','"):$(e,"missed comma between flow collection entries"),m=g=v=null,c=p=!1,O===63&&(f=e.input.charCodeAt(e.position+1),Ee(f)&&(c=p=!0,e.position++,he(e,!0,t))),i=e.line,r=e.lineStart,s=e.position,Zt(e,t,Tn,!1,!0),m=e.tag,g=e.result,he(e,!0,t),O=e.input.charCodeAt(e.position),(p||e.line===i)&&O===58&&(c=!0,O=e.input.charCodeAt(++e.position),he(e,!0,t),Zt(e,t,Tn,!1,!0),v=e.result),h?Qt(e,a,b,m,g,v,i,r,s):c?a.push(Qt(e,null,b,m,g,v,i,r,s)):a.push(g),he(e,!0,t),O=e.input.charCodeAt(e.position),O===44?(n=!0,O=e.input.charCodeAt(++e.position)):n=!1}$(e,"unexpected end of the stream within a flow collection")}function Kc(e,t){var n,i,r=Ii,s=!1,o=!1,a=t,l=0,f=!1,u,c;if(c=e.input.charCodeAt(e.position),c===124)i=!1;else if(c===62)i=!0;else return!1;for(e.kind="scalar",e.result="";c!==0;)if(c=e.input.charCodeAt(++e.position),c===43||c===45)Ii===r?r=c===43?po:Nc:$(e,"repeat of a chomping mode identifier");else if((u=Bc(c))>=0)u===0?$(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?$(e,"repeat of an indentation width identifier"):(a=t+u-1,o=!0);else break;if(Ut(c)){do c=e.input.charCodeAt(++e.position);while(Ut(c));if(c===35)do c=e.input.charCodeAt(++e.position);while(!We(c)&&c!==0)}for(;c!==0;){for(Ni(e),e.lineIndent=0,c=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&c===32;)e.lineIndent++,c=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),We(c)){l++;continue}if(e.lineIndent<a){r===po?e.result+=ge.repeat(`
79
79
  `,s?1+l:l):r===Ii&&s&&(e.result+=`
80
80
  `);break}for(i?Ut(c)?(f=!0,e.result+=ge.repeat(`
81
81
  `,s?1+l:l)):f?(f=!1,e.result+=ge.repeat(`
82
82
  `,l+1)):l===0?s&&(e.result+=" "):e.result+=ge.repeat(`
83
83
  `,l):e.result+=ge.repeat(`
84
- `,s?1+l:l),s=!0,o=!0,l=0,n=e.position;!We(c)&&c!==0;)c=e.input.charCodeAt(++e.position);rt(e,n,e.position,!1)}return!0}function yo(e,t){var n,i=e.tag,r=e.anchor,s=[],o,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,R(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!Ee(o))));){if(a=!0,e.position++,he(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,Zt(e,t,Lo,!1,!0),s.push(e.result),he(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)R(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=i,e.anchor=r,e.kind="sequence",e.result=s,!0):!1}function Vc(e,t,n){var i,r,s,o,a,l,f=e.tag,u=e.anchor,c={},p=Object.create(null),h=null,b=null,g=null,m=!1,x=!1,O;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),O=e.input.charCodeAt(e.position);O!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,R(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(O===63||O===58)&&Ee(i))O===63?(m&&(Qt(e,c,p,h,b,null,o,a,l),h=b=g=null),x=!0,m=!0,r=!0):m?(m=!1,r=!0):R(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,O=i;else{if(o=e.line,a=e.lineStart,l=e.position,!Zt(e,n,Fo,!1,!0))break;if(e.line===s){for(O=e.input.charCodeAt(e.position);Ut(O);)O=e.input.charCodeAt(++e.position);if(O===58)O=e.input.charCodeAt(++e.position),Ee(O)||R(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(Qt(e,c,p,h,b,null,o,a,l),h=b=g=null),x=!0,m=!1,r=!1,h=e.tag,b=e.result;else if(x)R(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=u,!0}else if(x)R(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=u,!0}if((e.line===s||e.lineIndent>t)&&(m&&(o=e.line,a=e.lineStart,l=e.position),Zt(e,t,Rn,!0,r)&&(m?b=e.result:g=e.result),m||(Qt(e,c,p,h,b,g,o,a,l),h=b=g=null),he(e,!0,-1),O=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&O!==0)R(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&Qt(e,c,p,h,b,null,o,a,l),x&&(e.tag=f,e.anchor=u,e.kind="mapping",e.result=c),x}function Jc(e){var t,n=!1,i=!1,r,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&R(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(i=!0,r="!!",o=e.input.charCodeAt(++e.position)):r="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(s=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):R(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Ee(o);)o===33&&(i?R(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),Do.test(r)||R(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),$c.test(s)&&R(e,"tag suffix cannot contain flow indicator characters")}s&&!No.test(s)&&R(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch(a){R(e,"tag name is malformed: "+s)}return n?e.tag=s:ot.call(e.tagMap,r)?e.tag=e.tagMap[r]+s:r==="!"?e.tag="!"+s:r==="!!"?e.tag="tag:yaml.org,2002:"+s:R(e,'undeclared tag handle "'+r+'"'),!0}function Qc(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&R(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Ee(n)&&!Jt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&R(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Zc(e){var t,n,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!Ee(i)&&!Jt(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&R(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),ot.call(e.anchorMap,n)||R(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],he(e,!0,-1),!0}function Zt(e,t,n,i,r){var s,o,a,l=1,f=!1,u=!1,c,p,h,b,g,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=a=Rn===n||Lo===n,i&&he(e,!0,-1)&&(f=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Jc(e)||Qc(e);)he(e,!0,-1)?(f=!0,a=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=f||r),(l===1||Rn===n)&&(Tn===n||Fo===n?g=t:g=t+1,m=e.position-e.lineStart,l===1?a&&(yo(e,m)||Vc(e,m,g))||Gc(e,g)?u=!0:(o&&Kc(e,g)||zc(e,g)||qc(e,g)?u=!0:Zc(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&R(e,"alias node should not have any properties")):kc(e,g,Tn===n)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=a&&yo(e,m))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&R(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,p=e.implicitTypes.length;c<p;c+=1)if(b=e.implicitTypes[c],b.resolve(e.result)){e.result=b.construct(e.result),e.tag=b.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(ot.call(e.typeMap[e.kind||"fallback"],e.tag))b=e.typeMap[e.kind||"fallback"][e.tag];else for(b=null,h=e.typeMap.multi[e.kind||"fallback"],c=0,p=h.length;c<p;c+=1)if(e.tag.slice(0,h[c].tag.length)===h[c].tag){b=h[c];break}b||R(e,"unknown tag !<"+e.tag+">"),e.result!==null&&b.kind!==e.kind&&R(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result,e.tag)?(e.result=b.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):R(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function Xc(e){var t=e.position,n,i,r,s=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(he(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(s=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!Ee(o);)o=e.input.charCodeAt(++e.position);for(i=e.input.slice(n,e.position),r=[],i.length<1&&R(e,"directive name must not be less than one character in length");o!==0;){for(;Ut(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!We(o));break}if(We(o))break;for(n=e.position;o!==0&&!Ee(o);)o=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}o!==0&&Ni(e),ot.call(go,i)?go[i](e,i,r):$n(e,'unknown document directive "'+i+'"')}if(he(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,he(e,!0,-1)):s&&R(e,"directives end mark is expected"),Zt(e,e.lineIndent-1,Rn,!1,!0),he(e,!0,-1),e.checkLineBreaks&&Rc.test(e.input.slice(t,e.position))&&$n(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Bn(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,he(e,!0,-1));return}if(e.position<e.length-1)R(e,"end of the stream or a document separator is expected");else return}function Uo(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
85
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Yc(e,t),i=e.indexOf("\0");for(i!==-1&&(n.position=i,R(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Xc(n);return n.documents}function ef(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var i=Uo(e,n);if(typeof t!="function")return i;for(var r=0,s=i.length;r<s;r+=1)t(i[r])}function tf(e,t){var n=Uo(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new _e("expected a single document in the stream, but found more")}}var nf=ef,rf=tf,Ho={loadAll:nf,load:rf},Bo=Object.prototype.toString,Wo=Object.prototype.hasOwnProperty,Ri=65279,of=9,pn=10,sf=13,af=32,lf=33,cf=34,Pi=35,ff=37,uf=38,pf=39,df=42,Yo=44,hf=45,Un=58,mf=61,gf=62,bf=63,yf=64,ko=91,zo=93,wf=96,qo=123,Cf=124,Go=125,ve={};ve[0]="\\0";ve[7]="\\a";ve[8]="\\b";ve[9]="\\t";ve[10]="\\n";ve[11]="\\v";ve[12]="\\f";ve[13]="\\r";ve[27]="\\e";ve[34]='\\"';ve[92]="\\\\";ve[133]="\\N";ve[160]="\\_";ve[8232]="\\L";ve[8233]="\\P";var Af=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],vf=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function xf(e,t){var n,i,r,s,o,a,l;if(t===null)return{};for(n={},i=Object.keys(t),r=0,s=i.length;r<s;r+=1)o=i[r],a=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=e.compiledTypeMap.fallback[o],l&&Wo.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function Of(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else if(e<=4294967295)n="U",i=8;else throw new _e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+ge.repeat("0",i-t.length)+t}var _f=1,dn=2;function Ef(e){this.schema=e.schema||Mo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ge.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=xf(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?dn:_f,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function wo(e,t){for(var n=ge.repeat(" ",t),i=0,r=-1,s="",o,a=e.length;i<a;)r=e.indexOf(`
84
+ `,s?1+l:l),s=!0,o=!0,l=0,n=e.position;!We(c)&&c!==0;)c=e.input.charCodeAt(++e.position);rt(e,n,e.position,!1)}return!0}function yo(e,t){var n,i=e.tag,r=e.anchor,s=[],o,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,$(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!Ee(o))));){if(a=!0,e.position++,he(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,Zt(e,t,Lo,!1,!0),s.push(e.result),he(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)$(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=i,e.anchor=r,e.kind="sequence",e.result=s,!0):!1}function Vc(e,t,n){var i,r,s,o,a,l,f=e.tag,u=e.anchor,c={},p=Object.create(null),h=null,b=null,g=null,m=!1,v=!1,O;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),O=e.input.charCodeAt(e.position);O!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,$(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(O===63||O===58)&&Ee(i))O===63?(m&&(Qt(e,c,p,h,b,null,o,a,l),h=b=g=null),v=!0,m=!0,r=!0):m?(m=!1,r=!0):$(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,O=i;else{if(o=e.line,a=e.lineStart,l=e.position,!Zt(e,n,Fo,!1,!0))break;if(e.line===s){for(O=e.input.charCodeAt(e.position);Ut(O);)O=e.input.charCodeAt(++e.position);if(O===58)O=e.input.charCodeAt(++e.position),Ee(O)||$(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(Qt(e,c,p,h,b,null,o,a,l),h=b=g=null),v=!0,m=!1,r=!1,h=e.tag,b=e.result;else if(v)$(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=u,!0}else if(v)$(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=u,!0}if((e.line===s||e.lineIndent>t)&&(m&&(o=e.line,a=e.lineStart,l=e.position),Zt(e,t,Rn,!0,r)&&(m?b=e.result:g=e.result),m||(Qt(e,c,p,h,b,g,o,a,l),h=b=g=null),he(e,!0,-1),O=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&O!==0)$(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&Qt(e,c,p,h,b,null,o,a,l),v&&(e.tag=f,e.anchor=u,e.kind="mapping",e.result=c),v}function Jc(e){var t,n=!1,i=!1,r,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&$(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(i=!0,r="!!",o=e.input.charCodeAt(++e.position)):r="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(s=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):$(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Ee(o);)o===33&&(i?$(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),Do.test(r)||$(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),$c.test(s)&&$(e,"tag suffix cannot contain flow indicator characters")}s&&!No.test(s)&&$(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch(a){$(e,"tag name is malformed: "+s)}return n?e.tag=s:ot.call(e.tagMap,r)?e.tag=e.tagMap[r]+s:r==="!"?e.tag="!"+s:r==="!!"?e.tag="tag:yaml.org,2002:"+s:$(e,'undeclared tag handle "'+r+'"'),!0}function Qc(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&$(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Ee(n)&&!Jt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&$(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Zc(e){var t,n,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!Ee(i)&&!Jt(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&$(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),ot.call(e.anchorMap,n)||$(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],he(e,!0,-1),!0}function Zt(e,t,n,i,r){var s,o,a,l=1,f=!1,u=!1,c,p,h,b,g,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=a=Rn===n||Lo===n,i&&he(e,!0,-1)&&(f=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Jc(e)||Qc(e);)he(e,!0,-1)?(f=!0,a=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=f||r),(l===1||Rn===n)&&(Tn===n||Fo===n?g=t:g=t+1,m=e.position-e.lineStart,l===1?a&&(yo(e,m)||Vc(e,m,g))||Gc(e,g)?u=!0:(o&&Kc(e,g)||zc(e,g)||qc(e,g)?u=!0:Zc(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&$(e,"alias node should not have any properties")):kc(e,g,Tn===n)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=a&&yo(e,m))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&$(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,p=e.implicitTypes.length;c<p;c+=1)if(b=e.implicitTypes[c],b.resolve(e.result)){e.result=b.construct(e.result),e.tag=b.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(ot.call(e.typeMap[e.kind||"fallback"],e.tag))b=e.typeMap[e.kind||"fallback"][e.tag];else for(b=null,h=e.typeMap.multi[e.kind||"fallback"],c=0,p=h.length;c<p;c+=1)if(e.tag.slice(0,h[c].tag.length)===h[c].tag){b=h[c];break}b||$(e,"unknown tag !<"+e.tag+">"),e.result!==null&&b.kind!==e.kind&&$(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result,e.tag)?(e.result=b.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):$(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function Xc(e){var t=e.position,n,i,r,s=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(he(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(s=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!Ee(o);)o=e.input.charCodeAt(++e.position);for(i=e.input.slice(n,e.position),r=[],i.length<1&&$(e,"directive name must not be less than one character in length");o!==0;){for(;Ut(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!We(o));break}if(We(o))break;for(n=e.position;o!==0&&!Ee(o);)o=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}o!==0&&Ni(e),ot.call(go,i)?go[i](e,i,r):$n(e,'unknown document directive "'+i+'"')}if(he(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,he(e,!0,-1)):s&&$(e,"directives end mark is expected"),Zt(e,e.lineIndent-1,Rn,!1,!0),he(e,!0,-1),e.checkLineBreaks&&Rc.test(e.input.slice(t,e.position))&&$n(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Bn(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,he(e,!0,-1));return}if(e.position<e.length-1)$(e,"end of the stream or a document separator is expected");else return}function Uo(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
85
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Yc(e,t),i=e.indexOf("\0");for(i!==-1&&(n.position=i,$(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Xc(n);return n.documents}function ef(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var i=Uo(e,n);if(typeof t!="function")return i;for(var r=0,s=i.length;r<s;r+=1)t(i[r])}function tf(e,t){var n=Uo(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new _e("expected a single document in the stream, but found more")}}var nf=ef,rf=tf,Ho={loadAll:nf,load:rf},Bo=Object.prototype.toString,Wo=Object.prototype.hasOwnProperty,Ri=65279,of=9,pn=10,sf=13,af=32,lf=33,cf=34,Pi=35,ff=37,uf=38,pf=39,df=42,Yo=44,hf=45,Un=58,mf=61,gf=62,bf=63,yf=64,ko=91,zo=93,wf=96,qo=123,Cf=124,Go=125,xe={};xe[0]="\\0";xe[7]="\\a";xe[8]="\\b";xe[9]="\\t";xe[10]="\\n";xe[11]="\\v";xe[12]="\\f";xe[13]="\\r";xe[27]="\\e";xe[34]='\\"';xe[92]="\\\\";xe[133]="\\N";xe[160]="\\_";xe[8232]="\\L";xe[8233]="\\P";var Af=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],xf=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function vf(e,t){var n,i,r,s,o,a,l;if(t===null)return{};for(n={},i=Object.keys(t),r=0,s=i.length;r<s;r+=1)o=i[r],a=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=e.compiledTypeMap.fallback[o],l&&Wo.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function Of(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else if(e<=4294967295)n="U",i=8;else throw new _e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+ge.repeat("0",i-t.length)+t}var _f=1,dn=2;function Ef(e){this.schema=e.schema||Mo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ge.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=vf(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?dn:_f,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function wo(e,t){for(var n=ge.repeat(" ",t),i=0,r=-1,s="",o,a=e.length;i<a;)r=e.indexOf(`
86
86
  `,i),r===-1?(o=e.slice(i),i=a):(o=e.slice(i,r+1),i=r+1),o.length&&o!==`
87
87
  `&&(s+=n),s+=o;return s}function Mi(e,t){return`
88
- `+ge.repeat(" ",e.indent*t)}function Sf(e,t){var n,i,r;for(n=0,i=e.implicitTypes.length;n<i;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function Hn(e){return e===af||e===of}function hn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ri||65536<=e&&e<=1114111}function Co(e){return hn(e)&&e!==Ri&&e!==sf&&e!==pn}function Ao(e,t,n){var i=Co(e),r=i&&!Hn(e);return(n?i:i&&e!==Yo&&e!==ko&&e!==zo&&e!==qo&&e!==Go)&&e!==Pi&&!(t===Un&&!r)||Co(t)&&!Hn(t)&&e===Pi||t===Un&&r}function If(e){return hn(e)&&e!==Ri&&!Hn(e)&&e!==hf&&e!==bf&&e!==Un&&e!==Yo&&e!==ko&&e!==zo&&e!==qo&&e!==Go&&e!==Pi&&e!==uf&&e!==df&&e!==lf&&e!==Cf&&e!==mf&&e!==gf&&e!==pf&&e!==cf&&e!==ff&&e!==yf&&e!==wf}function jf(e){return!Hn(e)&&e!==Un}function fn(e,t){var n=e.charCodeAt(t),i;return n>=55296&&n<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function Ko(e){var t=/^\n* /;return t.test(e)}var Vo=1,Fi=2,Jo=3,Qo=4,Vt=5;function Pf(e,t,n,i,r,s,o,a){var l,f=0,u=null,c=!1,p=!1,h=i!==-1,b=-1,g=If(fn(e,0))&&jf(fn(e,e.length-1));if(t||o)for(l=0;l<e.length;f>=65536?l+=2:l++){if(f=fn(e,l),!hn(f))return Vt;g=g&&Ao(f,u,a),u=f}else{for(l=0;l<e.length;f>=65536?l+=2:l++){if(f=fn(e,l),f===pn)c=!0,h&&(p=p||l-b-1>i&&e[b+1]!==" ",b=l);else if(!hn(f))return Vt;g=g&&Ao(f,u,a),u=f}p=p||h&&l-b-1>i&&e[b+1]!==" "}return!c&&!p?g&&!o&&!r(e)?Vo:s===dn?Vt:Fi:n>9&&Ko(e)?Vt:o?s===dn?Vt:Fi:p?Qo:Jo}function Mf(e,t,n,i,r){e.dump=function(){if(t.length===0)return e.quotingType===dn?'""':"''";if(!e.noCompatMode&&(Af.indexOf(t)!==-1||vf.test(t)))return e.quotingType===dn?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),a=i||e.flowLevel>-1&&n>=e.flowLevel;function l(f){return Sf(e,f)}switch(Pf(t,a,e.indent,o,l,e.quotingType,e.forceQuotes&&!i,r)){case Vo:return t;case Fi:return"'"+t.replace(/'/g,"''")+"'";case Jo:return"|"+vo(t,e.indent)+xo(wo(t,s));case Qo:return">"+vo(t,e.indent)+xo(wo(Ff(t,o),s));case Vt:return'"'+Lf(t)+'"';default:throw new _e("impossible error: invalid scalar style")}}()}function vo(e,t){var n=Ko(e)?String(t):"",i=e[e.length-1]===`
88
+ `+ge.repeat(" ",e.indent*t)}function Sf(e,t){var n,i,r;for(n=0,i=e.implicitTypes.length;n<i;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function Hn(e){return e===af||e===of}function hn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ri||65536<=e&&e<=1114111}function Co(e){return hn(e)&&e!==Ri&&e!==sf&&e!==pn}function Ao(e,t,n){var i=Co(e),r=i&&!Hn(e);return(n?i:i&&e!==Yo&&e!==ko&&e!==zo&&e!==qo&&e!==Go)&&e!==Pi&&!(t===Un&&!r)||Co(t)&&!Hn(t)&&e===Pi||t===Un&&r}function If(e){return hn(e)&&e!==Ri&&!Hn(e)&&e!==hf&&e!==bf&&e!==Un&&e!==Yo&&e!==ko&&e!==zo&&e!==qo&&e!==Go&&e!==Pi&&e!==uf&&e!==df&&e!==lf&&e!==Cf&&e!==mf&&e!==gf&&e!==pf&&e!==cf&&e!==ff&&e!==yf&&e!==wf}function jf(e){return!Hn(e)&&e!==Un}function fn(e,t){var n=e.charCodeAt(t),i;return n>=55296&&n<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function Ko(e){var t=/^\n* /;return t.test(e)}var Vo=1,Fi=2,Jo=3,Qo=4,Vt=5;function Pf(e,t,n,i,r,s,o,a){var l,f=0,u=null,c=!1,p=!1,h=i!==-1,b=-1,g=If(fn(e,0))&&jf(fn(e,e.length-1));if(t||o)for(l=0;l<e.length;f>=65536?l+=2:l++){if(f=fn(e,l),!hn(f))return Vt;g=g&&Ao(f,u,a),u=f}else{for(l=0;l<e.length;f>=65536?l+=2:l++){if(f=fn(e,l),f===pn)c=!0,h&&(p=p||l-b-1>i&&e[b+1]!==" ",b=l);else if(!hn(f))return Vt;g=g&&Ao(f,u,a),u=f}p=p||h&&l-b-1>i&&e[b+1]!==" "}return!c&&!p?g&&!o&&!r(e)?Vo:s===dn?Vt:Fi:n>9&&Ko(e)?Vt:o?s===dn?Vt:Fi:p?Qo:Jo}function Mf(e,t,n,i,r){e.dump=function(){if(t.length===0)return e.quotingType===dn?'""':"''";if(!e.noCompatMode&&(Af.indexOf(t)!==-1||xf.test(t)))return e.quotingType===dn?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),a=i||e.flowLevel>-1&&n>=e.flowLevel;function l(f){return Sf(e,f)}switch(Pf(t,a,e.indent,o,l,e.quotingType,e.forceQuotes&&!i,r)){case Vo:return t;case Fi:return"'"+t.replace(/'/g,"''")+"'";case Jo:return"|"+xo(t,e.indent)+vo(wo(t,s));case Qo:return">"+xo(t,e.indent)+vo(wo(Ff(t,o),s));case Vt:return'"'+Lf(t)+'"';default:throw new _e("impossible error: invalid scalar style")}}()}function xo(e,t){var n=Ko(e)?String(t):"",i=e[e.length-1]===`
89
89
  `,r=i&&(e[e.length-2]===`
90
90
  `||e===`
91
91
  `),s=r?"+":i?"":"-";return n+s+`
92
- `}function xo(e){return e[e.length-1]===`
92
+ `}function vo(e){return e[e.length-1]===`
93
93
  `?e.slice(0,-1):e}function Ff(e,t){for(var n=/(\n+)([^\n]*)/g,i=function(){var f=e.indexOf(`
94
94
  `);return f=f!==-1?f:e.length,n.lastIndex=f,Oo(e.slice(0,f),t)}(),r=e[0]===`
95
95
  `||e[0]===" ",s,o;o=n.exec(e);){var a=o[1],l=o[2];s=l[0]===" ",i+=a+(!r&&!s&&l!==""?`
96
96
  `:"")+Oo(l,t),r=s}return i}function Oo(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,i,r=0,s,o=0,a=0,l="";i=n.exec(e);)a=i.index,a-r>t&&(s=o>r?o:a,l+=`
97
97
  `+e.slice(r,s),r=s+1),o=a;return l+=`
98
98
  `,e.length-r>t&&o>r?l+=e.slice(r,o)+`
99
- `+e.slice(o+1):l+=e.slice(r),l.slice(1)}function Lf(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=fn(e,r),i=ve[n],!i&&hn(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||Of(n);return t}function Df(e,t,n){var i="",r=e.tag,s,o,a;for(s=0,o=n.length;s<o;s+=1)a=n[s],e.replacer&&(a=e.replacer.call(n,String(s),a)),(Ke(e,t,a,!1,!1)||typeof a=="undefined"&&Ke(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function _o(e,t,n,i){var r="",s=e.tag,o,a,l;for(o=0,a=n.length;o<a;o+=1)l=n[o],e.replacer&&(l=e.replacer.call(n,String(o),l)),(Ke(e,t+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&Ke(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=Mi(e,t)),e.dump&&pn===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=s,e.dump=r||"[]"}function Nf(e,t,n){var i="",r=e.tag,s=Object.keys(n),o,a,l,f,u;for(o=0,a=s.length;o<a;o+=1)u="",i!==""&&(u+=", "),e.condenseFlow&&(u+='"'),l=s[o],f=n[l],e.replacer&&(f=e.replacer.call(n,l,f)),!!Ke(e,t,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),!!Ke(e,t,f,!1,!1)&&(u+=e.dump,i+=u));e.tag=r,e.dump="{"+i+"}"}function Tf(e,t,n,i){var r="",s=e.tag,o=Object.keys(n),a,l,f,u,c,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new _e("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)p="",(!i||r!=="")&&(p+=Mi(e,t)),f=o[a],u=n[f],e.replacer&&(u=e.replacer.call(n,f,u)),!!Ke(e,t+1,f,!0,!0,!0)&&(c=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,c&&(e.dump&&pn===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,c&&(p+=Mi(e,t)),!!Ke(e,t+1,u,!0,c)&&(e.dump&&pn===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,r+=p));e.tag=s,e.dump=r||"{}"}function Eo(e,t,n){var i,r,s,o,a,l;for(r=n?e.explicitTypes:e.implicitTypes,s=0,o=r.length;s<o;s+=1)if(a=r[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(l=e.styleMap[a.tag]||a.defaultStyle,Bo.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(Wo.call(a.represent,l))i=a.represent[l](t,l);else throw new _e("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function Ke(e,t,n,i,r,s,o){e.tag=null,e.dump=n,Eo(e,n,!1)||Eo(e,n,!0);var a=Bo.call(e.dump),l=i,f;i&&(i=e.flowLevel<0||e.flowLevel>t);var u=a==="[object Object]"||a==="[object Array]",c,p;if(u&&(c=e.duplicates.indexOf(n),p=c!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(r=!1),p&&e.usedDuplicates[c])e.dump="*ref_"+c;else{if(u&&p&&!e.usedDuplicates[c]&&(e.usedDuplicates[c]=!0),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(Tf(e,t,e.dump,r),p&&(e.dump="&ref_"+c+e.dump)):(Nf(e,t,e.dump),p&&(e.dump="&ref_"+c+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?_o(e,t-1,e.dump,r):_o(e,t,e.dump,r),p&&(e.dump="&ref_"+c+e.dump)):(Df(e,t,e.dump),p&&(e.dump="&ref_"+c+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Mf(e,e.dump,t,s,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new _e("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(f=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?f="!"+f:f.slice(0,18)==="tag:yaml.org,2002:"?f="!!"+f.slice(18):f="!<"+f+">",e.dump=f+" "+e.dump)}return!0}function Rf(e,t){var n=[],i=[],r,s;for(Li(e,n,i),r=0,s=i.length;r<s;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(s)}function Li(e,t,n){var i,r,s;if(e!==null&&typeof e=="object")if(r=t.indexOf(e),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,s=e.length;r<s;r+=1)Li(e[r],t,n);else for(i=Object.keys(e),r=0,s=i.length;r<s;r+=1)Li(e[i[r]],t,n)}function $f(e,t){t=t||{};var n=new Ef(t);n.noRefs||Rf(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),Ke(n,0,i,!0,!0)?n.dump+`
100
- `:""}var Uf=$f,Hf={dump:Uf};function $i(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var Zo=Ho.load,Eh=Ho.loadAll,Xo=Hf.dump;var Sh=$i("safeLoad","load"),Ih=$i("safeLoadAll","loadAll"),jh=$i("safeDump","dump");import{writeFileSync as bp}from"fs";import{extname as Ns}from"path";import{readFileSync as yp}from"fs";import wp from"fs";A();function Ve(){}Ve.prototype={diff:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=i.callback;typeof i=="function"&&(r=i,i={}),this.options=i;var s=this;function o(g){return r?(setTimeout(function(){r(void 0,g)},0),!0):g}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var a=n.length,l=t.length,f=1,u=a+l,c=[{newPos:-1,components:[]}],p=this.extractCommon(c[0],n,t,0);if(c[0].newPos+1>=a&&p+1>=l)return o([{value:this.join(n),count:n.length}]);function h(){for(var g=-1*f;g<=f;g+=2){var m=void 0,x=c[g-1],O=c[g+1],$=(O?O.newPos:0)-g;x&&(c[g-1]=void 0);var z=x&&x.newPos+1<a,V=O&&0<=$&&$<l;if(!z&&!V){c[g]=void 0;continue}if(!z||V&&x.newPos<O.newPos?(m=Wf(O),s.pushComponent(m.components,void 0,!0)):(m=x,m.newPos++,s.pushComponent(m.components,!0,void 0)),$=s.extractCommon(m,n,t,g),m.newPos+1>=a&&$+1>=l)return o(Bf(s,m.components,n,t,s.useLongestToken));c[g]=m}f++}if(r)(function g(){setTimeout(function(){if(f>u)return r();h()||g()},0)})();else for(;f<=u;){var b=h();if(b)return b}},pushComponent:function(t,n,i){var r=t[t.length-1];r&&r.added===n&&r.removed===i?t[t.length-1]={count:r.count+1,added:n,removed:i}:t.push({count:1,added:n,removed:i})},extractCommon:function(t,n,i,r){for(var s=n.length,o=i.length,a=t.newPos,l=a-r,f=0;a+1<s&&l+1<o&&this.equals(n[a+1],i[l+1]);)a++,l++,f++;return f&&t.components.push({count:f}),t.newPos=a,l},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function Bf(e,t,n,i,r){for(var s=0,o=t.length,a=0,l=0;s<o;s++){var f=t[s];if(f.removed){if(f.value=e.join(i.slice(l,l+f.count)),l+=f.count,s&&t[s-1].added){var c=t[s-1];t[s-1]=t[s],t[s]=c}}else{if(!f.added&&r){var u=n.slice(a,a+f.count);u=u.map(function(h,b){var g=i[l+b];return g.length>h.length?g:h}),f.value=e.join(u)}else f.value=e.join(n.slice(a,a+f.count));a+=f.count,f.added||(l+=f.count)}}var p=t[o-1];return o>1&&typeof p.value=="string"&&(p.added||p.removed)&&e.equals("",p.value)&&(t[o-2].value+=p.value,t.pop()),t}function Wf(e){return{newPos:e.newPos,components:e.components.slice(0)}}var Mh=new Ve;var es=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,ts=/\S/,ns=new Ve;ns.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!ts.test(e)&&!ts.test(t)};ns.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&es.test(t[n])&&es.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Bi=new Ve;Bi.tokenize=function(e){var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var i=0;i<n.length;i++){var r=n[i];i%2&&!this.options.newlineIsToken?t[t.length-1]+=r:(this.options.ignoreWhitespace&&(r=r.trim()),t.push(r))}return t};function Wi(e,t,n){return Bi.diff(e,t,n)}var Yf=new Ve;Yf.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var kf=new Ve;kf.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Wn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Wn=function(t){return typeof t}:Wn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wn(e)}var zf=Object.prototype.toString,Xt=new Ve;Xt.useLongestToken=!0;Xt.tokenize=Bi.tokenize;Xt.castInput=function(e){var t=this.options,n=t.undefinedReplacement,i=t.stringifyReplacer,r=i===void 0?function(s,o){return typeof o=="undefined"?n:o}:i;return typeof e=="string"?e:JSON.stringify(Ui(e,null,null,r),r," ")};Xt.equals=function(e,t){return Ve.prototype.equals.call(Xt,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function is(e,t,n){return Xt.diff(e,t,n)}function Ui(e,t,n,i,r){t=t||[],n=n||[],i&&(e=i(r,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];var o;if(zf.call(e)==="[object Array]"){for(t.push(e),o=new Array(e.length),n.push(o),s=0;s<e.length;s+=1)o[s]=Ui(e[s],t,n,i,r);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Wn(e)==="object"&&e!==null){t.push(e),o={},n.push(o);var a=[],l;for(l in e)e.hasOwnProperty(l)&&a.push(l);for(a.sort(),s=0;s<a.length;s+=1)l=a[s],o[l]=Ui(e[l],t,n,i,l);t.pop(),n.pop()}else o=e;return o}var Hi=new Ve;Hi.tokenize=function(e){return e.slice()};Hi.join=Hi.removeEmpty=function(e){return e};var $s=ea(Ls(),1);we();we();async function ct({objects:e,selectIdentifier:t,selectDisplayName:n=t,onSyncComplete:i}){let r=e.reduce((a,l)=>{let f=t(l);if(a[f])throw new Error(`Identifier ${f} was not unique.`);return a[f]={id:f,object:l,providerId:f,displayName:n(l)},a},{});async function*s(){for(let a of Object.values(r))yield a}function o(){return Object.entries(r).sort((a,l)=>a[0].localeCompare(l[0])).map(a=>a[1].object)}return{objects:s(),deleteObject:async a=>{delete r[a]},writeObject:async a=>{let l=t(a.object);r[l]=a},extractCurrent:o,onSyncComplete:i?a=>i(a,o()):void 0}}we();var up=Oi(_i());we();function oe(e){var t,n;return e.option("apiKey",{describe:"Uniform API key. Defaults to CANVAS_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",default:(n=(t=process.env.CANVAS_CLI_API_KEY)!=null?t:process.env.UPM_CLI_API_KEY)!=null?n:process.env.UNIFORM_API_KEY,demandOption:!0,type:"string"}).option("apiHost",{describe:"Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or https://uniform.app. Supports dotenv.",default:process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app",demandOption:!0,type:"string"})}function se(e){var t,n,i;return e.option("project",{describe:"Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",default:(i=(n=(t=process.env.UNIFORM_CLI_PROJECT_ID)!=null?t:process.env.CANVAS_CLI_PROJECT_ID)!=null?n:process.env.UPM_CLI_PROJECT_ID)!=null?i:process.env.UNIFORM_PROJECT_ID,demandOption:!0,type:"string",alias:["p"]})}function ft(e){return e.option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("filename",{alias:["o"],describe:"Output filename. If not specified, write to stdout.",type:"string"})}function ut(e){var t;return e.option("diff",{describe:"Whether to show diffs in stdout. off = no diffs; update = on for updates; on = updates, creates, deletes. Can be set by UNIFORM_CLI_DIFF_MODE environment variable.",default:(t=process.env.UNIFORM_CLI_DIFF_MODE)!=null?t:"off",type:"string",choices:["off","update","on"],alias:["d"]})}function pt(e){let t=Ns(e);return t===".yaml"||t===".yml"||t===".json"}function Ye(e,t,n){let i;if(n&&!t){let r=Ns(n);r===".yaml"||r===".yml"?t="yaml":r===".json"&&(t="json")}else if(!t)throw new Error("Format must be specified when no filename is passed");switch(t){case"json":i=JSON.stringify(e,null,2);break;case"yaml":i=Xo(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?bp(n,i,"utf8"):console.log(i)}function on(e){let t=yp(e,"utf8");return Zo(t,{filename:e,json:!0})}async function*Xn(e,t){let n=t.pageSize||100,i=0,r=[];do{r=await e(i,n);for(let s of r)yield s;i+=n}while(r.length===n)}async function dt({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:i=n}){pp(e)||dp(e,{recursive:!0});let r=await hp(e,"utf-8"),s=new Set(r.filter(l=>{let f=gp(l);return f===".json"||f===".yaml"||f===".yml"})),o=l=>Ds(e,`${l}.${t}`);async function*a(){for(let l of s){let f=Ds(e,l);try{let u=await on(f);yield{id:n(u),displayName:i(u),providerId:f,object:u}}catch(u){throw console.error(up.default.red(`Failed to read ${f}, data is likely invalid.
101
- ${u==null?void 0:u.message}`)),u}}}return{objects:a(),deleteObject:async l=>{await mp(l)},writeObject:async l=>{Ye(l.object,t,o(l.id))}}}we();function Ts(e,t){if(!t&&!wp.existsSync(e))return{};let n=on(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function Rs(e,t){Ye(t,void 0,e)}we();async function ht({source:e,target:t,compareContents:n=(a,l)=>(0,$s.default)(a.object,l.object,(f,u,c)=>c==="created"||c==="modified"?!0:void 0),mode:i,allowEmptySource:r=!1,whatIf:s=!1,log:o=()=>{}}){var a,l;let f=new Map;for await(let p of t.objects)f.set(p.id,p);let u=[],c=!1;for await(let p of e.objects){c=!0;let h=p.id,b=f.get(h);if(b){if(!n(p,b)&&(i==="createOrUpdate"||i==="mirror")){let g=async(m,x)=>{var O;if(!s)try{await t.writeObject(m,x)}catch($){throw new Zn($,m)}o({action:"update",id:h,providerId:m.providerId,displayName:(O=m.displayName)!=null?O:m.providerId,whatIf:s,diff:is(x.object,m.object)})};u.push(g(p,b))}f.delete(h)}else{let g=async(m,x)=>{var O;if(!s)try{await t.writeObject(m)}catch($){throw new Zn($,m)}o({action:"create",id:x,providerId:x,displayName:(O=m.displayName)!=null?O:m.providerId,whatIf:s,diff:Wi("",JSON.stringify(m.object,null,2))})};u.push(g(p,h))}}if(await Promise.all(u),i==="mirror"){if(!c&&!r)throw new Error("Source is empty and mode is mirror. This would cause deletion of everything in the target, and most likely indicates an error in source definition.");let p=[];f.forEach(async h=>{let b=async g=>{var m;if(!s)try{await t.deleteObject(g.providerId)}catch(x){throw new Zn(x,g)}o({action:"delete",id:g.id,providerId:g.providerId,displayName:(m=g.displayName)!=null?m:g.providerId,whatIf:s,diff:Wi(JSON.stringify(g.object,null,2),"")})};p.push(b(h))}),await Promise.all(p)}await Promise.all([(a=e.onSyncComplete)==null?void 0:a.call(e,!1),(l=t.onSyncComplete)==null?void 0:l.call(t,!0)])}var Zn=class extends Error{constructor(e,t){super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
99
+ `+e.slice(o+1):l+=e.slice(r),l.slice(1)}function Lf(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=fn(e,r),i=xe[n],!i&&hn(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||Of(n);return t}function Df(e,t,n){var i="",r=e.tag,s,o,a;for(s=0,o=n.length;s<o;s+=1)a=n[s],e.replacer&&(a=e.replacer.call(n,String(s),a)),(Ke(e,t,a,!1,!1)||typeof a=="undefined"&&Ke(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function _o(e,t,n,i){var r="",s=e.tag,o,a,l;for(o=0,a=n.length;o<a;o+=1)l=n[o],e.replacer&&(l=e.replacer.call(n,String(o),l)),(Ke(e,t+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&Ke(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=Mi(e,t)),e.dump&&pn===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=s,e.dump=r||"[]"}function Nf(e,t,n){var i="",r=e.tag,s=Object.keys(n),o,a,l,f,u;for(o=0,a=s.length;o<a;o+=1)u="",i!==""&&(u+=", "),e.condenseFlow&&(u+='"'),l=s[o],f=n[l],e.replacer&&(f=e.replacer.call(n,l,f)),Ke(e,t,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ke(e,t,f,!1,!1)&&(u+=e.dump,i+=u));e.tag=r,e.dump="{"+i+"}"}function Tf(e,t,n,i){var r="",s=e.tag,o=Object.keys(n),a,l,f,u,c,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new _e("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)p="",(!i||r!=="")&&(p+=Mi(e,t)),f=o[a],u=n[f],e.replacer&&(u=e.replacer.call(n,f,u)),Ke(e,t+1,f,!0,!0,!0)&&(c=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,c&&(e.dump&&pn===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,c&&(p+=Mi(e,t)),Ke(e,t+1,u,!0,c)&&(e.dump&&pn===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,r+=p));e.tag=s,e.dump=r||"{}"}function Eo(e,t,n){var i,r,s,o,a,l;for(r=n?e.explicitTypes:e.implicitTypes,s=0,o=r.length;s<o;s+=1)if(a=r[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(l=e.styleMap[a.tag]||a.defaultStyle,Bo.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(Wo.call(a.represent,l))i=a.represent[l](t,l);else throw new _e("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function Ke(e,t,n,i,r,s,o){e.tag=null,e.dump=n,Eo(e,n,!1)||Eo(e,n,!0);var a=Bo.call(e.dump),l=i,f;i&&(i=e.flowLevel<0||e.flowLevel>t);var u=a==="[object Object]"||a==="[object Array]",c,p;if(u&&(c=e.duplicates.indexOf(n),p=c!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(r=!1),p&&e.usedDuplicates[c])e.dump="*ref_"+c;else{if(u&&p&&!e.usedDuplicates[c]&&(e.usedDuplicates[c]=!0),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(Tf(e,t,e.dump,r),p&&(e.dump="&ref_"+c+e.dump)):(Nf(e,t,e.dump),p&&(e.dump="&ref_"+c+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?_o(e,t-1,e.dump,r):_o(e,t,e.dump,r),p&&(e.dump="&ref_"+c+e.dump)):(Df(e,t,e.dump),p&&(e.dump="&ref_"+c+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Mf(e,e.dump,t,s,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new _e("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(f=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?f="!"+f:f.slice(0,18)==="tag:yaml.org,2002:"?f="!!"+f.slice(18):f="!<"+f+">",e.dump=f+" "+e.dump)}return!0}function Rf(e,t){var n=[],i=[],r,s;for(Li(e,n,i),r=0,s=i.length;r<s;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(s)}function Li(e,t,n){var i,r,s;if(e!==null&&typeof e=="object")if(r=t.indexOf(e),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,s=e.length;r<s;r+=1)Li(e[r],t,n);else for(i=Object.keys(e),r=0,s=i.length;r<s;r+=1)Li(e[i[r]],t,n)}function $f(e,t){t=t||{};var n=new Ef(t);n.noRefs||Rf(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),Ke(n,0,i,!0,!0)?n.dump+`
100
+ `:""}var Uf=$f,Hf={dump:Uf};function $i(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var Zo=Ho.load,Eh=Ho.loadAll,Xo=Hf.dump;var Sh=$i("safeLoad","load"),Ih=$i("safeLoadAll","loadAll"),jh=$i("safeDump","dump");import{writeFileSync as bp}from"fs";import{extname as Ns}from"path";import{readFileSync as yp}from"fs";import wp from"fs";A();function Ve(){}Ve.prototype={diff:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=i.callback;typeof i=="function"&&(r=i,i={}),this.options=i;var s=this;function o(g){return r?(setTimeout(function(){r(void 0,g)},0),!0):g}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var a=n.length,l=t.length,f=1,u=a+l,c=[{newPos:-1,components:[]}],p=this.extractCommon(c[0],n,t,0);if(c[0].newPos+1>=a&&p+1>=l)return o([{value:this.join(n),count:n.length}]);function h(){for(var g=-1*f;g<=f;g+=2){var m=void 0,v=c[g-1],O=c[g+1],U=(O?O.newPos:0)-g;v&&(c[g-1]=void 0);var B=v&&v.newPos+1<a,V=O&&0<=U&&U<l;if(!B&&!V){c[g]=void 0;continue}if(!B||V&&v.newPos<O.newPos?(m=Wf(O),s.pushComponent(m.components,void 0,!0)):(m=v,m.newPos++,s.pushComponent(m.components,!0,void 0)),U=s.extractCommon(m,n,t,g),m.newPos+1>=a&&U+1>=l)return o(Bf(s,m.components,n,t,s.useLongestToken));c[g]=m}f++}if(r)(function g(){setTimeout(function(){if(f>u)return r();h()||g()},0)})();else for(;f<=u;){var b=h();if(b)return b}},pushComponent:function(t,n,i){var r=t[t.length-1];r&&r.added===n&&r.removed===i?t[t.length-1]={count:r.count+1,added:n,removed:i}:t.push({count:1,added:n,removed:i})},extractCommon:function(t,n,i,r){for(var s=n.length,o=i.length,a=t.newPos,l=a-r,f=0;a+1<s&&l+1<o&&this.equals(n[a+1],i[l+1]);)a++,l++,f++;return f&&t.components.push({count:f}),t.newPos=a,l},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function Bf(e,t,n,i,r){for(var s=0,o=t.length,a=0,l=0;s<o;s++){var f=t[s];if(f.removed){if(f.value=e.join(i.slice(l,l+f.count)),l+=f.count,s&&t[s-1].added){var c=t[s-1];t[s-1]=t[s],t[s]=c}}else{if(!f.added&&r){var u=n.slice(a,a+f.count);u=u.map(function(h,b){var g=i[l+b];return g.length>h.length?g:h}),f.value=e.join(u)}else f.value=e.join(n.slice(a,a+f.count));a+=f.count,f.added||(l+=f.count)}}var p=t[o-1];return o>1&&typeof p.value=="string"&&(p.added||p.removed)&&e.equals("",p.value)&&(t[o-2].value+=p.value,t.pop()),t}function Wf(e){return{newPos:e.newPos,components:e.components.slice(0)}}var Mh=new Ve;var es=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,ts=/\S/,ns=new Ve;ns.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!ts.test(e)&&!ts.test(t)};ns.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&es.test(t[n])&&es.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Bi=new Ve;Bi.tokenize=function(e){var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var i=0;i<n.length;i++){var r=n[i];i%2&&!this.options.newlineIsToken?t[t.length-1]+=r:(this.options.ignoreWhitespace&&(r=r.trim()),t.push(r))}return t};function Wi(e,t,n){return Bi.diff(e,t,n)}var Yf=new Ve;Yf.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var kf=new Ve;kf.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Wn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Wn=function(t){return typeof t}:Wn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wn(e)}var zf=Object.prototype.toString,Xt=new Ve;Xt.useLongestToken=!0;Xt.tokenize=Bi.tokenize;Xt.castInput=function(e){var t=this.options,n=t.undefinedReplacement,i=t.stringifyReplacer,r=i===void 0?function(s,o){return typeof o=="undefined"?n:o}:i;return typeof e=="string"?e:JSON.stringify(Ui(e,null,null,r),r," ")};Xt.equals=function(e,t){return Ve.prototype.equals.call(Xt,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function is(e,t,n){return Xt.diff(e,t,n)}function Ui(e,t,n,i,r){t=t||[],n=n||[],i&&(e=i(r,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];var o;if(zf.call(e)==="[object Array]"){for(t.push(e),o=new Array(e.length),n.push(o),s=0;s<e.length;s+=1)o[s]=Ui(e[s],t,n,i,r);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Wn(e)==="object"&&e!==null){t.push(e),o={},n.push(o);var a=[],l;for(l in e)e.hasOwnProperty(l)&&a.push(l);for(a.sort(),s=0;s<a.length;s+=1)l=a[s],o[l]=Ui(e[l],t,n,i,l);t.pop(),n.pop()}else o=e;return o}var Hi=new Ve;Hi.tokenize=function(e){return e.slice()};Hi.join=Hi.removeEmpty=function(e){return e};var $s=ea(Ls(),1);we();we();async function ct({objects:e,selectIdentifier:t,selectDisplayName:n=t,onSyncComplete:i}){let r=e.reduce((a,l)=>{let f=t(l);if(a[f])throw new Error(`Identifier ${f} was not unique.`);return a[f]={id:f,object:l,providerId:f,displayName:n(l)},a},{});async function*s(){for(let a of Object.values(r))yield a}function o(){return Object.entries(r).sort((a,l)=>a[0].localeCompare(l[0])).map(a=>a[1].object)}return{objects:s(),deleteObject:async a=>{delete r[a]},writeObject:async a=>{let l=t(a.object);r[l]=a},extractCurrent:o,onSyncComplete:i?a=>i(a,o()):void 0}}we();var up=Oi(_i());we();function oe(e){var t,n;return e.option("apiKey",{describe:"Uniform API key. Defaults to CANVAS_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",default:(n=(t=process.env.CANVAS_CLI_API_KEY)!=null?t:process.env.UPM_CLI_API_KEY)!=null?n:process.env.UNIFORM_API_KEY,demandOption:!0,type:"string"}).option("apiHost",{describe:"Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or https://uniform.app. Supports dotenv.",default:process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app",demandOption:!0,type:"string"})}function se(e){var t,n,i;return e.option("project",{describe:"Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",default:(i=(n=(t=process.env.UNIFORM_CLI_PROJECT_ID)!=null?t:process.env.CANVAS_CLI_PROJECT_ID)!=null?n:process.env.UPM_CLI_PROJECT_ID)!=null?i:process.env.UNIFORM_PROJECT_ID,demandOption:!0,type:"string",alias:["p"]})}function ft(e){return e.option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("filename",{alias:["o"],describe:"Output filename. If not specified, write to stdout.",type:"string"})}function ut(e){var t;return e.option("diff",{describe:"Whether to show diffs in stdout. off = no diffs; update = on for updates; on = updates, creates, deletes. Can be set by UNIFORM_CLI_DIFF_MODE environment variable.",default:(t=process.env.UNIFORM_CLI_DIFF_MODE)!=null?t:"off",type:"string",choices:["off","update","on"],alias:["d"]})}function pt(e){let t=Ns(e);return t===".yaml"||t===".yml"||t===".json"}function Ye(e,t,n){let i;if(n&&!t){let r=Ns(n);r===".yaml"||r===".yml"?t="yaml":r===".json"&&(t="json")}else if(!t)throw new Error("Format must be specified when no filename is passed");switch(t){case"json":i=JSON.stringify(e,null,2);break;case"yaml":i=Xo(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?bp(n,i,"utf8"):console.log(i)}function on(e){let t=yp(e,"utf8");return Zo(t,{filename:e,json:!0})}async function*Xn(e,t){let n=t.pageSize||100,i=0,r=[];do{r=await e(i,n);for(let s of r)yield s;i+=n}while(r.length===n)}async function dt({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:i=n}){pp(e)||dp(e,{recursive:!0});let r=await hp(e,"utf-8"),s=new Set(r.filter(l=>{let f=gp(l);return f===".json"||f===".yaml"||f===".yml"})),o=l=>Ds(e,`${l}.${t}`);async function*a(){for(let l of s){let f=Ds(e,l);try{let u=await on(f);yield{id:n(u),displayName:i(u),providerId:f,object:u}}catch(u){throw console.error(up.default.red(`Failed to read ${f}, data is likely invalid.
101
+ ${u==null?void 0:u.message}`)),u}}}return{objects:a(),deleteObject:async l=>{await mp(l)},writeObject:async l=>{Ye(l.object,t,o(l.id))}}}we();function Ts(e,t){if(!t&&!wp.existsSync(e))return{};let n=on(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function Rs(e,t){Ye(t,void 0,e)}we();async function ht({source:e,target:t,compareContents:n=(a,l)=>(0,$s.default)(a.object,l.object,(f,u,c)=>c==="created"||c==="modified"?!0:void 0),mode:i,allowEmptySource:r=!1,whatIf:s=!1,log:o=()=>{}}){var a,l;let f=new Map;for await(let p of t.objects)f.set(p.id,p);let u=[],c=!1;for await(let p of e.objects){c=!0;let h=p.id,b=f.get(h);if(b){if(!n(p,b)&&(i==="createOrUpdate"||i==="mirror")){let g=async(m,v)=>{var O;if(!s)try{await t.writeObject(m,v)}catch(U){throw new Zn(U,m)}o({action:"update",id:h,providerId:m.providerId,displayName:(O=m.displayName)!=null?O:m.providerId,whatIf:s,diff:is(v.object,m.object)})};u.push(g(p,b))}f.delete(h)}else{let g=async(m,v)=>{var O;if(!s)try{await t.writeObject(m)}catch(U){throw new Zn(U,m)}o({action:"create",id:v,providerId:v,displayName:(O=m.displayName)!=null?O:m.providerId,whatIf:s,diff:Wi("",JSON.stringify(m.object,null,2))})};u.push(g(p,h))}}if(await Promise.all(u),i==="mirror"){if(!c&&!r)throw new Error("Source is empty and mode is mirror. This would cause deletion of everything in the target, and most likely indicates an error in source definition.");let p=[];f.forEach(async h=>{let b=async g=>{var m;if(!s)try{await t.deleteObject(g.providerId)}catch(v){throw new Zn(v,g)}o({action:"delete",id:g.id,providerId:g.providerId,displayName:(m=g.displayName)!=null?m:g.providerId,whatIf:s,diff:Wi(JSON.stringify(g.object,null,2),"")})};p.push(b(h))}),await Promise.all(p)}await Promise.all([(a=e.onSyncComplete)==null?void 0:a.call(e,!1),(l=t.onSyncComplete)==null?void 0:l.call(t,!0)])}var Zn=class extends Error{constructor(e,t){super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
102
102
  ${e}`);var n;this.stack=void 0,Object.setPrototypeOf(this,Zn.prototype)}};we();var rn=Oi(_i());function mt(e){let{diffMode:t="off",indent:n,prefix:i}=e!=null?e:{};return function({action:r,displayName:s,whatIf:o,diff:a}){let l="";switch(r){case"create":l=rn.default.green("[A]");break;case"update":l=rn.default.white("[U]");break;case"delete":l=rn.default.yellow("[D]");break}let f="";(t==="on"||t==="update"&&r==="update")&&(f=`
103
- `+a.map(u=>u.added?rn.default.green(u.value):u.removed?rn.default.red(u.value):u.value).join("")),console.log(`${n!=null?n:""}${o?rn.default.gray("[WHATIF]"):""}${l}${i!=null?i:""} ${s}${f}`)}}var Us={command:"get <id>",describe:"Fetch a component definition",builder:e=>ft(oe(se(e.positional("id",{demandOption:!0,describe:"Component definition public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:s})=>{let a=await new ie({apiKey:t,apiHost:e,fetch:Cp,projectId:r}).getComponentDefinitions({componentId:n,limit:1});a.componentDefinitions.length===0?(console.error("Component did not exist"),process.exit(1)):Ye(a.componentDefinitions[0],i,s)}};A();import Ap from"isomorphic-unfetch";var Hs={command:"list",describe:"List component definitions",aliases:["ls"],builder:e=>ft(oe(se(e.options({offset:{describe:"Number of rows to skip before fetching",type:"number",default:0},limit:{describe:"Number of rows to fetch",type:"number",default:20}})))),handler:async({apiHost:e,apiKey:t,limit:n,offset:i,format:r,filename:s,project:o})=>{let l=await new ie({apiKey:t,apiHost:e,fetch:Ap,projectId:o}).getComponentDefinitions({limit:n,offset:i});Ye(l.componentDefinitions,r,s)}};A();A();import vp from"p-limit";function ei(e){let t={...e};return delete t.projectId,delete t.state,t}function ke(e){return e.option("state",{type:"string",describe:"Composition state to fetch.",choices:["preview","published"],default:"preview"})}function gt(e){let t=Number(e);if(!isNaN(t))return t;if(!e)return 64;if(typeof e!="string")throw new Error('state must be "published", "preview", or a number');return e==="preview"?0:64}var bt=vp(8);import xp from"isomorphic-unfetch";A();A();var yt=e=>e.id,wt=e=>`${e.name} (pid: ${e.id})`;function ti({client:e}){async function*t(){let n=Xn(async(i,r)=>(await e.getComponentDefinitions({limit:r,offset:i})).componentDefinitions,{pageSize:100});for await(let i of n)yield{id:yt(i),displayName:wt(i),providerId:i.id,object:i}}return{objects:t(),deleteObject:async n=>{await e.removeComponentDefinition({componentId:n})},writeObject:async n=>{await e.updateComponentDefinition({componentDefinition:n.object})}}}A();function Ct(e,t){return Ts(e,t)}function ni(e,t){Rs(e,t)}var Bs={command:"pull <directory>",describe:"Pulls all component definitions to local files in a directory",builder:e=>oe(se(ut(e.positional("directory",{describe:"Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:s,project:o,diff:a})=>{var p;let l=new ie({apiKey:t,apiHost:e,fetch:xp,projectId:o,limitPolicy:bt}),f=ti({client:l}),u;if(pt(n)){let h=Ct(n,!1);u=await ct({objects:(p=h.components)!=null?p:[],selectIdentifier:yt,selectDisplayName:wt,onSyncComplete:async(b,g)=>{h.components=g,ni(n,h)}})}else u=await dt({directory:n,selectIdentifier:yt,selectDisplayName:wt,format:i});await ht({source:f,target:u,mode:r,whatIf:s,log:mt({diffMode:a})})}};A();import Op from"isomorphic-unfetch";var Ws={command:"push <directory>",describe:"Pushes all component definitions from files in a directory to Uniform Optimize",builder:e=>oe(se(ut(e.positional("directory",{describe:"Directory to read the component definitions from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,project:s,diff:o})=>{var c;let a=new ie({apiKey:t,apiHost:e,fetch:Op,projectId:s,limitPolicy:bt}),l;if(pt(n)){let p=Ct(n,!0);l=await ct({objects:(c=p.components)!=null?c:[],selectIdentifier:yt,selectDisplayName:wt})}else l=await dt({directory:n,selectIdentifier:yt,selectDisplayName:wt});let u=ti({client:a});await ht({source:l,target:u,mode:i,whatIf:r,log:mt({diffMode:o})})}};A();import _p from"isomorphic-unfetch";var Ys={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a component definition",builder:e=>oe(se(e.positional("id",{demandOption:!0,describe:"Component definition public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new ie({apiKey:t,apiHost:e,fetch:_p,projectId:i}).removeComponentDefinition({componentId:n})}};A();import Ep from"isomorphic-unfetch";var ks={command:"update <filename>",aliases:["put"],describe:"Insert or update a component definition",builder:e=>oe(se(e.positional("filename",{demandOption:!0,describe:"Component definition file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new ie({apiKey:t,apiHost:e,fetch:Ep,projectId:i}),s=on(n);await r.updateComponentDefinition({componentDefinition:s})}};var zs={command:"component <command>",aliases:["def"],describe:"Commands for Canvas component definitions",builder:e=>e.command(Bs).command(Ws).command(Us).command(Ys).command(Hs).command(ks).demandCommand(),handler:()=>{Kt.help()}};A();A();import Sp from"isomorphic-unfetch";var qs={command:"get <id>",describe:"Fetch a composition",builder:e=>ft(oe(se(ke(e.positional("id",{demandOption:!0,describe:"Composition public ID to fetch"}).option({resolvePatterns:{type:"boolean",default:!1,describe:"Resolve pattern references in the composition"}}))))),handler:async({apiHost:e,apiKey:t,id:n,format:i,filename:r,state:s,project:o,resolvePatterns:a})=>{let l=new ie({apiKey:t,apiHost:e,fetch:Sp,projectId:o}),f=ei(await l.getCompositionById({compositionId:n,state:gt(s),skipPatternResolution:!a}));Ye(f,i,r)}};A();import Ip from"isomorphic-unfetch";var Gs={command:"list",describe:"List compositions",aliases:["ls"],builder:e=>ft(oe(se(ke(e.options({offset:{describe:"Number of rows to skip before fetching",type:"number",default:0},limit:{describe:"Number of rows to fetch",type:"number",default:20},resolvePatterns:{type:"boolean",default:!1,describe:"Resolve pattern references in the composition"}}))))),handler:async({apiHost:e,apiKey:t,limit:n,offset:i,format:r,filename:s,project:o,state:a,resolvePatterns:l})=>{let u=await new ie({apiKey:t,apiHost:e,fetch:Ip,projectId:o}).getCompositionList({limit:n,offset:i,state:gt(a),skipPatternResolution:!l});Ye(u.compositions,r,s)}};A();import jp from"isomorphic-unfetch";A();A();var At=e=>e.composition._id,vt=e=>{var t,n;return`${(n=(t=e.composition._name)!=null?t:e.composition._slug)!=null?n:e.composition._id} (pid: ${e.composition._id})`};function ii({client:e,state:t}){let n=gt(t);async function*i(){let r=Xn(async(s,o)=>(await e.getCompositionList({limit:o,offset:s,state:n,skipPatternResolution:!0})).compositions,{pageSize:100});for await(let s of r)yield{id:At(s),displayName:vt(s),providerId:s.composition._id,object:ei(s)}}return{objects:i(),deleteObject:async r=>{await e.removeComposition({compositionId:r})},writeObject:async r=>{await e.updateComposition({...r.object,state:n})}}}var Ks={command:"pull <directory>",describe:"Pulls all compositions to local files in a directory",builder:e=>oe(se(ke(ut(e.positional("directory",{describe:"Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"}))))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:s,state:o,project:a,diff:l})=>{var h;let f=new ie({apiKey:t,apiHost:e,fetch:jp,projectId:a,limitPolicy:bt}),u=ii({client:f,state:o}),c=pt(n),p;if(c){let b=Ct(n,!1);p=await ct({objects:(h=b==null?void 0:b.compositions)!=null?h:[],selectIdentifier:At,selectDisplayName:vt,onSyncComplete:async(g,m)=>{b.compositions=m,ni(n,b)}})}else p=await dt({directory:n,selectIdentifier:At,selectDisplayName:vt,format:i});await ht({source:u,target:p,mode:r,whatIf:s,log:mt({diffMode:l})})}};A();import Pp from"isomorphic-unfetch";var Vs={command:"push <directory>",describe:"Pushes all compositions from files in a directory to Uniform Optimize",builder:e=>oe(se(ke(ut(e.positional("directory",{describe:"Directory to read the component definitions from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"}))))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,state:s,project:o,diff:a})=>{var p;let l=new ie({apiKey:t,apiHost:e,fetch:Pp,projectId:o,limitPolicy:bt}),f;if(pt(n)){let h=Ct(n,!0);f=await ct({objects:(p=h.compositions)!=null?p:[],selectIdentifier:At,selectDisplayName:vt})}else f=await dt({directory:n,selectIdentifier:At,selectDisplayName:vt});let c=ii({client:l,state:s});await ht({source:f,target:c,mode:i,whatIf:r,log:mt({diffMode:a})})}};A();import Mp from"isomorphic-unfetch";var Js={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a composition",builder:e=>oe(se(e.positional("id",{demandOption:!0,describe:"Composition public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new ie({apiKey:t,apiHost:e,fetch:Mp,projectId:i}).removeComposition({compositionId:n})}};A();import Fp from"isomorphic-unfetch";var Qs={command:"update <filename>",aliases:["put"],describe:"Insert or update a composition",builder:e=>oe(se(ke(e.positional("filename",{demandOption:!0,describe:"Composition file to put"})))),handler:async({apiHost:e,apiKey:t,filename:n,project:i,state:r})=>{let s=new ie({apiKey:t,apiHost:e,fetch:Fp,projectId:i}),o=on(n);await s.updateComposition({...o,state:gt(r)})}};var Zs={command:"composition <command>",describe:"Commands for Canvas compositions",aliases:["comp"],builder:e=>e.command(Ks).command(Vs).command(qs).command(Js).command(Gs).command(Qs).demandCommand(),handler:()=>{Kt.help()}};var P0={commands:[{command:"canvas <command>",aliases:["cv","pm","presentation"],describe:"Uniform Canvas commands",builder:e=>e.command(Zs).command(zs).demandCommand(),handler:()=>{Kt.showHelp()}}]};export{Ct as readCanvasPackage,P0 as uniformCLI,ni as writeCanvasPackage};
103
+ `+a.map(u=>u.added?rn.default.green(u.value):u.removed?rn.default.red(u.value):u.value).join("")),console.log(`${n!=null?n:""}${o?rn.default.gray("[WHATIF]"):""}${l}${i!=null?i:""} ${s}${f}`)}}var Us={command:"get <id>",describe:"Fetch a component definition",builder:e=>ft(oe(se(e.positional("id",{demandOption:!0,describe:"Component definition public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:s})=>{let a=await new ie({apiKey:t,apiHost:e,fetch:Cp,projectId:r}).getComponentDefinitions({componentId:n,limit:1});a.componentDefinitions.length===0?(console.error("Component did not exist"),process.exit(1)):Ye(a.componentDefinitions[0],i,s)}};A();import Ap from"isomorphic-unfetch";var Hs={command:"list",describe:"List component definitions",aliases:["ls"],builder:e=>ft(oe(se(e.options({offset:{describe:"Number of rows to skip before fetching",type:"number",default:0},limit:{describe:"Number of rows to fetch",type:"number",default:20}})))),handler:async({apiHost:e,apiKey:t,limit:n,offset:i,format:r,filename:s,project:o})=>{let l=await new ie({apiKey:t,apiHost:e,fetch:Ap,projectId:o}).getComponentDefinitions({limit:n,offset:i});Ye(l.componentDefinitions,r,s)}};A();A();import xp from"p-limit";function ei(e){let t={...e};return delete t.projectId,delete t.state,t}function ke(e){return e.option("state",{type:"string",describe:"Composition state to fetch.",choices:["preview","published"],default:"preview"})}function gt(e){let t=Number(e);if(!isNaN(t))return t;if(!e)return 64;if(typeof e!="string")throw new Error('state must be "published", "preview", or a number');return e==="preview"?0:64}var bt=xp(8);import vp from"isomorphic-unfetch";A();A();var yt=e=>e.id,wt=e=>`${e.name} (pid: ${e.id})`;function ti({client:e}){async function*t(){let n=Xn(async(i,r)=>(await e.getComponentDefinitions({limit:r,offset:i})).componentDefinitions,{pageSize:100});for await(let i of n)yield{id:yt(i),displayName:wt(i),providerId:i.id,object:i}}return{objects:t(),deleteObject:async n=>{await e.removeComponentDefinition({componentId:n})},writeObject:async n=>{await e.updateComponentDefinition({componentDefinition:n.object})}}}A();function Ct(e,t){return Ts(e,t)}function ni(e,t){Rs(e,t)}var Bs={command:"pull <directory>",describe:"Pulls all component definitions to local files in a directory",builder:e=>oe(se(ut(e.positional("directory",{describe:"Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:s,project:o,diff:a})=>{var p;let l=new ie({apiKey:t,apiHost:e,fetch:vp,projectId:o,limitPolicy:bt}),f=ti({client:l}),u;if(pt(n)){let h=Ct(n,!1);u=await ct({objects:(p=h.components)!=null?p:[],selectIdentifier:yt,selectDisplayName:wt,onSyncComplete:async(b,g)=>{h.components=g,ni(n,h)}})}else u=await dt({directory:n,selectIdentifier:yt,selectDisplayName:wt,format:i});await ht({source:f,target:u,mode:r,whatIf:s,log:mt({diffMode:a})})}};A();import Op from"isomorphic-unfetch";var Ws={command:"push <directory>",describe:"Pushes all component definitions from files in a directory to Uniform Optimize",builder:e=>oe(se(ut(e.positional("directory",{describe:"Directory to read the component definitions from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,project:s,diff:o})=>{var c;let a=new ie({apiKey:t,apiHost:e,fetch:Op,projectId:s,limitPolicy:bt}),l;if(pt(n)){let p=Ct(n,!0);l=await ct({objects:(c=p.components)!=null?c:[],selectIdentifier:yt,selectDisplayName:wt})}else l=await dt({directory:n,selectIdentifier:yt,selectDisplayName:wt});let u=ti({client:a});await ht({source:l,target:u,mode:i,whatIf:r,log:mt({diffMode:o})})}};A();import _p from"isomorphic-unfetch";var Ys={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a component definition",builder:e=>oe(se(e.positional("id",{demandOption:!0,describe:"Component definition public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new ie({apiKey:t,apiHost:e,fetch:_p,projectId:i}).removeComponentDefinition({componentId:n})}};A();import Ep from"isomorphic-unfetch";var ks={command:"update <filename>",aliases:["put"],describe:"Insert or update a component definition",builder:e=>oe(se(e.positional("filename",{demandOption:!0,describe:"Component definition file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new ie({apiKey:t,apiHost:e,fetch:Ep,projectId:i}),s=on(n);await r.updateComponentDefinition({componentDefinition:s})}};var zs={command:"component <command>",aliases:["def"],describe:"Commands for Canvas component definitions",builder:e=>e.command(Bs).command(Ws).command(Us).command(Ys).command(Hs).command(ks).demandCommand(),handler:()=>{Kt.help()}};A();A();import Sp from"isomorphic-unfetch";var qs={command:"get <id>",describe:"Fetch a composition",builder:e=>ft(oe(se(ke(e.positional("id",{demandOption:!0,describe:"Composition public ID to fetch"}).option({resolvePatterns:{type:"boolean",default:!1,describe:"Resolve pattern references in the composition"}}))))),handler:async({apiHost:e,apiKey:t,id:n,format:i,filename:r,state:s,project:o,resolvePatterns:a})=>{let l=new ie({apiKey:t,apiHost:e,fetch:Sp,projectId:o}),f=ei(await l.getCompositionById({compositionId:n,state:gt(s),skipPatternResolution:!a}));Ye(f,i,r)}};A();import Ip from"isomorphic-unfetch";var Gs={command:"list",describe:"List compositions",aliases:["ls"],builder:e=>ft(oe(se(ke(e.options({offset:{describe:"Number of rows to skip before fetching",type:"number",default:0},limit:{describe:"Number of rows to fetch",type:"number",default:20},resolvePatterns:{type:"boolean",default:!1,describe:"Resolve pattern references in the composition"}}))))),handler:async({apiHost:e,apiKey:t,limit:n,offset:i,format:r,filename:s,project:o,state:a,resolvePatterns:l})=>{let u=await new ie({apiKey:t,apiHost:e,fetch:Ip,projectId:o}).getCompositionList({limit:n,offset:i,state:gt(a),skipPatternResolution:!l});Ye(u.compositions,r,s)}};A();import jp from"isomorphic-unfetch";A();A();var At=e=>e.composition._id,xt=e=>{var t,n;return`${(n=(t=e.composition._name)!=null?t:e.composition._slug)!=null?n:e.composition._id} (pid: ${e.composition._id})`};function ii({client:e,state:t}){let n=gt(t);async function*i(){let r=Xn(async(s,o)=>(await e.getCompositionList({limit:o,offset:s,state:n,skipPatternResolution:!0})).compositions,{pageSize:100});for await(let s of r)yield{id:At(s),displayName:xt(s),providerId:s.composition._id,object:ei(s)}}return{objects:i(),deleteObject:async r=>{await e.removeComposition({compositionId:r})},writeObject:async r=>{await e.updateComposition({...r.object,state:n})}}}var Ks={command:"pull <directory>",describe:"Pulls all compositions to local files in a directory",builder:e=>oe(se(ke(ut(e.positional("directory",{describe:"Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"}))))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:s,state:o,project:a,diff:l})=>{var h;let f=new ie({apiKey:t,apiHost:e,fetch:jp,projectId:a,limitPolicy:bt}),u=ii({client:f,state:o}),c=pt(n),p;if(c){let b=Ct(n,!1);p=await ct({objects:(h=b==null?void 0:b.compositions)!=null?h:[],selectIdentifier:At,selectDisplayName:xt,onSyncComplete:async(g,m)=>{b.compositions=m,ni(n,b)}})}else p=await dt({directory:n,selectIdentifier:At,selectDisplayName:xt,format:i});await ht({source:u,target:p,mode:r,whatIf:s,log:mt({diffMode:l})})}};A();import Pp from"isomorphic-unfetch";var Vs={command:"push <directory>",describe:"Pushes all compositions from files in a directory to Uniform Optimize",builder:e=>oe(se(ke(ut(e.positional("directory",{describe:"Directory to read the component definitions from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"}))))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,state:s,project:o,diff:a})=>{var p;let l=new ie({apiKey:t,apiHost:e,fetch:Pp,projectId:o,limitPolicy:bt}),f;if(pt(n)){let h=Ct(n,!0);f=await ct({objects:(p=h.compositions)!=null?p:[],selectIdentifier:At,selectDisplayName:xt})}else f=await dt({directory:n,selectIdentifier:At,selectDisplayName:xt});let c=ii({client:l,state:s});await ht({source:f,target:c,mode:i,whatIf:r,log:mt({diffMode:a})})}};A();import Mp from"isomorphic-unfetch";var Js={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a composition",builder:e=>oe(se(e.positional("id",{demandOption:!0,describe:"Composition public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new ie({apiKey:t,apiHost:e,fetch:Mp,projectId:i}).removeComposition({compositionId:n})}};A();import Fp from"isomorphic-unfetch";var Qs={command:"update <filename>",aliases:["put"],describe:"Insert or update a composition",builder:e=>oe(se(ke(e.positional("filename",{demandOption:!0,describe:"Composition file to put"})))),handler:async({apiHost:e,apiKey:t,filename:n,project:i,state:r})=>{let s=new ie({apiKey:t,apiHost:e,fetch:Fp,projectId:i}),o=on(n);await s.updateComposition({...o,state:gt(r)})}};var Zs={command:"composition <command>",describe:"Commands for Canvas compositions",aliases:["comp"],builder:e=>e.command(Ks).command(Vs).command(qs).command(Js).command(Gs).command(Qs).demandCommand(),handler:()=>{Kt.help()}};var P0={commands:[{command:"canvas <command>",aliases:["cv","pm","presentation"],describe:"Uniform Canvas commands",builder:e=>e.command(Zs).command(zs).demandCommand(),handler:()=>{Kt.showHelp()}}]};export{Ct as readCanvasPackage,P0 as uniformCLI,ni as writeCanvasPackage};
104
104
  /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
105
105
  /**
106
106
  * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js