@uniformdev/canvas 16.1.0 → 16.1.1-alpha.139

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 Ae,b as ta,c as na,d as A,h as oe,q as ia,r as lr}from"../chunk-5UNLBVAN.mjs";var Ns=ta((gn,en)=>{A();var qf=200,rr="__lodash_hash_undefined__",gs=1,Vn=2,bs=9007199254740991,kn="[object Arguments]",Ji="[object Array]",ys="[object Boolean]",ws="[object Date]",Cs="[object Error]",As="[object Function]",Kf="[object GeneratorFunction]",zn="[object Map]",xs="[object Number]",Xt="[object Object]",ss="[object Promise]",vs="[object RegExp]",Gn="[object Set]",Os="[object String]",Vf="[object Symbol]",Qi="[object WeakMap]",_s="[object ArrayBuffer]",qn="[object DataView]",Jf="[object Float32Array]",Qf="[object Float64Array]",Zf="[object Int8Array]",Xf="[object Int16Array]",eu="[object Int32Array]",tu="[object Uint8Array]",nu="[object Uint8ClampedArray]",iu="[object Uint16Array]",ru="[object Uint32Array]",ou=/[\\^$.*+?()[\]{}|]/g,su=/^\[object .+?Constructor\]$/,au=/^(?:0|[1-9]\d*)$/,re={};re[Jf]=re[Qf]=re[Zf]=re[Xf]=re[eu]=re[tu]=re[nu]=re[iu]=re[ru]=!0;re[kn]=re[Ji]=re[_s]=re[ys]=re[qn]=re[ws]=re[Cs]=re[As]=re[zn]=re[xs]=re[Xt]=re[vs]=re[Gn]=re[Os]=re[Qi]=!1;var Es=typeof global=="object"&&global&&global.Object===Object&&global,lu=typeof self=="object"&&self&&self.Object===Object&&self,lt=Es||lu||Function("return this")(),Ss=typeof gn=="object"&&gn&&!gn.nodeType&&gn,as=Ss&&typeof en=="object"&&en&&!en.nodeType&&en,cu=as&&as.exports===Ss,ls=cu&&Es.process,cs=function(){try{return ls&&ls.binding("util")}catch(e){}}(),fs=cs&&cs.isTypedArray;function fu(e,t){for(var n=-1,i=e?e.length:0;++n<i;)if(t(e[n],n,e))return!0;return!1}function uu(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function pu(e){return function(t){return e(t)}}function du(e,t){return e==null?void 0:e[t]}function Zi(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function hu(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function mu(e,t){return function(n){return e(t(n))}}function gu(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var bu=Array.prototype,yu=Function.prototype,Jn=Object.prototype,Ki=lt["__core-js_shared__"],us=function(){var e=/[^.]+$/.exec(Ki&&Ki.keys&&Ki.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Is=yu.toString,Ve=Jn.hasOwnProperty,wn=Jn.toString,wu=RegExp("^"+Is.call(Ve).replace(ou,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ps=lt.Symbol,ds=lt.Uint8Array,Cu=Jn.propertyIsEnumerable,Au=bu.splice,xu=mu(Object.keys,Object),Xi=tn(lt,"DataView"),bn=tn(lt,"Map"),er=tn(lt,"Promise"),tr=tn(lt,"Set"),nr=tn(lt,"WeakMap"),yn=tn(Object,"create"),vu=Ht(Xi),Ou=Ht(bn),_u=Ht(er),Eu=Ht(tr),Su=Ht(nr),hs=ps?ps.prototype:void 0,Vi=hs?hs.valueOf:void 0;function $t(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 Iu(){this.__data__=yn?yn(null):{}}function ju(e){return this.has(e)&&delete this.__data__[e]}function Pu(e){var t=this.__data__;if(yn){var n=t[e];return n===rr?void 0:n}return Ve.call(t,e)?t[e]:void 0}function Mu(e){var t=this.__data__;return yn?t[e]!==void 0:Ve.call(t,e)}function Fu(e,t){var n=this.__data__;return n[e]=yn&&t===void 0?rr:t,this}$t.prototype.clear=Iu;$t.prototype.delete=ju;$t.prototype.get=Pu;$t.prototype.has=Mu;$t.prototype.set=Fu;function Je(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 Lu(){this.__data__=[]}function Du(e){var t=this.__data__,n=Qn(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():Au.call(t,n,1),!0}function Nu(e){var t=this.__data__,n=Qn(t,e);return n<0?void 0:t[n][1]}function Tu(e){return Qn(this.__data__,e)>-1}function Ru(e,t){var n=this.__data__,i=Qn(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}Je.prototype.clear=Lu;Je.prototype.delete=Du;Je.prototype.get=Nu;Je.prototype.has=Tu;Je.prototype.set=Ru;function Ut(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 $u(){this.__data__={hash:new $t,map:new(bn||Je),string:new $t}}function Uu(e){return Zn(this,e).delete(e)}function Hu(e){return Zn(this,e).get(e)}function Bu(e){return Zn(this,e).has(e)}function Wu(e,t){return Zn(this,e).set(e,t),this}Ut.prototype.clear=$u;Ut.prototype.delete=Uu;Ut.prototype.get=Hu;Ut.prototype.has=Bu;Ut.prototype.set=Wu;function Kn(e){var t=-1,n=e?e.length:0;for(this.__data__=new Ut;++t<n;)this.add(e[t])}function Yu(e){return this.__data__.set(e,rr),this}function ku(e){return this.__data__.has(e)}Kn.prototype.add=Kn.prototype.push=Yu;Kn.prototype.has=ku;function at(e){this.__data__=new Je(e)}function zu(){this.__data__=new Je}function Gu(e){return this.__data__.delete(e)}function qu(e){return this.__data__.get(e)}function Ku(e){return this.__data__.has(e)}function Vu(e,t){var n=this.__data__;if(n instanceof Je){var i=n.__data__;if(!bn||i.length<qf-1)return i.push([e,t]),this;n=this.__data__=new Ut(i)}return n.set(e,t),this}at.prototype.clear=zu;at.prototype.delete=Gu;at.prototype.get=qu;at.prototype.has=Ku;at.prototype.set=Vu;function Ju(e,t){var n=ir(e)||lp(e)?uu(e.length,String):[],i=n.length,r=!!i;for(var s in e)(t||Ve.call(e,s))&&!(r&&(s=="length"||rp(s,i)))&&n.push(s);return n}function Qn(e,t){for(var n=e.length;n--;)if(Ms(e[n][0],t))return n;return-1}function Qu(e){return wn.call(e)}function js(e,t,n,i,r){return e===t?!0:e==null||t==null||!or(e)&&!sr(t)?e!==e&&t!==t:Zu(e,t,js,n,i,r)}function Zu(e,t,n,i,r,s){var o=ir(e),a=ir(t),l=Ji,c=Ji;o||(l=st(e),l=l==kn?Xt:l),a||(c=st(t),c=c==kn?Xt:c);var f=l==Xt&&!Zi(e),u=c==Xt&&!Zi(t),p=l==c;if(p&&!f)return s||(s=new at),o||up(e)?Ps(e,t,n,i,r,s):np(e,t,l,n,i,r,s);if(!(r&Vn)){var h=f&&Ve.call(e,"__wrapped__"),g=u&&Ve.call(t,"__wrapped__");if(h||g){var b=h?e.value():e,m=g?t.value():t;return s||(s=new at),n(b,m,i,r,s)}}return p?(s||(s=new at),ip(e,t,n,i,r,s)):!1}function Xu(e){if(!or(e)||sp(e))return!1;var t=Ls(e)||Zi(e)?wu:su;return t.test(Ht(e))}function ep(e){return sr(e)&&Ds(e.length)&&!!re[wn.call(e)]}function tp(e){if(!ap(e))return xu(e);var t=[];for(var n in Object(e))Ve.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ps(e,t,n,i,r,s){var o=r&Vn,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(e);if(c&&s.get(t))return c==t;var f=-1,u=!0,p=r&gs?new Kn:void 0;for(s.set(e,t),s.set(t,e);++f<a;){var h=e[f],g=t[f];if(i)var b=o?i(g,h,f,t,e,s):i(h,g,f,e,t,s);if(b!==void 0){if(b)continue;u=!1;break}if(p){if(!fu(t,function(m,v){if(!p.has(v)&&(h===m||n(h,m,i,r,s)))return p.add(v)})){u=!1;break}}else if(!(h===g||n(h,g,i,r,s))){u=!1;break}}return s.delete(e),s.delete(t),u}function np(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 _s:return!(e.byteLength!=t.byteLength||!i(new ds(e),new ds(t)));case ys:case ws:case xs:return Ms(+e,+t);case Cs:return e.name==t.name&&e.message==t.message;case vs:case Os:return e==t+"";case zn:var a=hu;case Gn:var l=s&Vn;if(a||(a=gu),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;s|=gs,o.set(e,t);var f=Ps(a(e),a(t),i,r,s,o);return o.delete(e),f;case Vf:if(Vi)return Vi.call(e)==Vi.call(t)}return!1}function ip(e,t,n,i,r,s){var o=r&Vn,a=ms(e),l=a.length,c=ms(t),f=c.length;if(l!=f&&!o)return!1;for(var u=l;u--;){var p=a[u];if(!(o?p in t:Ve.call(t,p)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var g=!0;s.set(e,t),s.set(t,e);for(var b=o;++u<l;){p=a[u];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)){g=!1;break}b||(b=p=="constructor")}if(g&&!b){var N=e.constructor,G=t.constructor;N!=G&&"constructor"in e&&"constructor"in t&&!(typeof N=="function"&&N instanceof N&&typeof G=="function"&&G instanceof G)&&(g=!1)}return s.delete(e),s.delete(t),g}function Zn(e,t){var n=e.__data__;return op(t)?n[typeof t=="string"?"string":"hash"]:n.map}function tn(e,t){var n=du(e,t);return Xu(n)?n:void 0}var st=Qu;(Xi&&st(new Xi(new ArrayBuffer(1)))!=qn||bn&&st(new bn)!=zn||er&&st(er.resolve())!=ss||tr&&st(new tr)!=Gn||nr&&st(new nr)!=Qi)&&(st=function(e){var t=wn.call(e),n=t==Xt?e.constructor:void 0,i=n?Ht(n):void 0;if(i)switch(i){case vu:return qn;case Ou:return zn;case _u:return ss;case Eu:return Gn;case Su:return Qi}return t});function rp(e,t){return t=t==null?bs:t,!!t&&(typeof e=="number"||au.test(e))&&e>-1&&e%1==0&&e<t}function op(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function sp(e){return!!us&&us in e}function ap(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Jn;return e===n}function Ht(e){if(e!=null){try{return Is.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ms(e,t){return e===t||e!==e&&t!==t}function lp(e){return cp(e)&&Ve.call(e,"callee")&&(!Cu.call(e,"callee")||wn.call(e)==kn)}var ir=Array.isArray;function Fs(e){return e!=null&&Ds(e.length)&&!Ls(e)}function cp(e){return sr(e)&&Fs(e)}function fp(e,t,n){n=typeof n=="function"?n:void 0;var i=n?n(e,t):void 0;return i===void 0?js(e,t,n):!!i}function Ls(e){var t=or(e)?wn.call(e):"";return t==As||t==Kf}function Ds(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=bs}function or(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function sr(e){return!!e&&typeof e=="object"}var up=fs?pu(fs):ep;function ms(e){return Fs(e)?Ju(e):tp(e)}en.exports=fp});A();A();A();import{notStrictEqual as ja,strictEqual as Pa}from"assert";A();A();var ra={right:ca,center:fa},oa=0,Cn=1,sa=2,An=3,si=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
- `).map(r=>r.split(" ")),i=0;return n.forEach(r=>{r.length>1&&je.stringWidth(r[0])>i&&(i=Math.min(Math.floor(this.width*.5),je.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=je.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
- `)}rowToString(t,n){return this.rasterize(t).forEach((i,r)=>{let s="";i.forEach((o,a)=>{let{width:l}=t[a],c=this.negatePadding(t[a]),f=o;c>je.stringWidth(o)&&(f+=" ".repeat(c-je.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap&&(f=ra[t[a].align](f,c),je.stringWidth(f)<c&&(f+=" ".repeat((l||0)-je.stringWidth(f)-1)));let u=t[a].padding||[0,0,0,0];u[An]&&(s+=" ".repeat(u[An])),s+=cr(t[a],f,"| "),s+=f,s+=cr(t[a],f," |"),u[Cn]&&(s+=" ".repeat(u[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=je.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=je.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
1
+ import{a as be,b as Qs,c as Zs,g as ne,p as Xs,q as rr}from"../chunk-TXMBPWVJ.mjs";var Ms=Qs((pn,Jt)=>{var Wf=200,er="__lodash_hash_undefined__",ps=1,zn=2,ds=9007199254740991,Hn="[object Arguments]",Gi="[object Array]",hs="[object Boolean]",ms="[object Date]",gs="[object Error]",bs="[object Function]",Yf="[object GeneratorFunction]",Bn="[object Map]",ys="[object Number]",Vt="[object Object]",ns="[object Promise]",ws="[object RegExp]",Wn="[object Set]",Cs="[object String]",kf="[object Symbol]",qi="[object WeakMap]",As="[object ArrayBuffer]",Yn="[object DataView]",zf="[object Float32Array]",Gf="[object Float64Array]",qf="[object Int8Array]",Kf="[object Int16Array]",Vf="[object Int32Array]",Jf="[object Uint8Array]",Qf="[object Uint8ClampedArray]",Zf="[object Uint16Array]",Xf="[object Uint32Array]",eu=/[\\^$.*+?()[\]{}|]/g,tu=/^\[object .+?Constructor\]$/,nu=/^(?:0|[1-9]\d*)$/,te={};te[zf]=te[Gf]=te[qf]=te[Kf]=te[Vf]=te[Jf]=te[Qf]=te[Zf]=te[Xf]=!0;te[Hn]=te[Gi]=te[As]=te[hs]=te[Yn]=te[ms]=te[gs]=te[bs]=te[Bn]=te[ys]=te[Vt]=te[ws]=te[Wn]=te[Cs]=te[qi]=!1;var xs=typeof global=="object"&&global&&global.Object===Object&&global,iu=typeof self=="object"&&self&&self.Object===Object&&self,rt=xs||iu||Function("return this")(),vs=typeof pn=="object"&&pn&&!pn.nodeType&&pn,is=vs&&typeof Jt=="object"&&Jt&&!Jt.nodeType&&Jt,ru=is&&is.exports===vs,rs=ru&&xs.process,os=function(){try{return rs&&rs.binding("util")}catch(e){}}(),ss=os&&os.isTypedArray;function ou(e,t){for(var n=-1,i=e?e.length:0;++n<i;)if(t(e[n],n,e))return!0;return!1}function su(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function au(e){return function(t){return e(t)}}function lu(e,t){return e==null?void 0:e[t]}function Ki(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function cu(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function fu(e,t){return function(n){return e(t(n))}}function uu(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var pu=Array.prototype,du=Function.prototype,Gn=Object.prototype,ki=rt["__core-js_shared__"],as=function(){var e=/[^.]+$/.exec(ki&&ki.keys&&ki.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Os=du.toString,ze=Gn.hasOwnProperty,mn=Gn.toString,hu=RegExp("^"+Os.call(ze).replace(eu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ls=rt.Symbol,cs=rt.Uint8Array,mu=Gn.propertyIsEnumerable,gu=pu.splice,bu=fu(Object.keys,Object),Vi=Qt(rt,"DataView"),dn=Qt(rt,"Map"),Ji=Qt(rt,"Promise"),Qi=Qt(rt,"Set"),Zi=Qt(rt,"WeakMap"),hn=Qt(Object,"create"),yu=Tt(Vi),wu=Tt(dn),Cu=Tt(Ji),Au=Tt(Qi),xu=Tt(Zi),fs=ls?ls.prototype:void 0,zi=fs?fs.valueOf:void 0;function Dt(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 vu(){this.__data__=hn?hn(null):{}}function Ou(e){return this.has(e)&&delete this.__data__[e]}function _u(e){var t=this.__data__;if(hn){var n=t[e];return n===er?void 0:n}return ze.call(t,e)?t[e]:void 0}function Eu(e){var t=this.__data__;return hn?t[e]!==void 0:ze.call(t,e)}function Su(e,t){var n=this.__data__;return n[e]=hn&&t===void 0?er:t,this}Dt.prototype.clear=vu;Dt.prototype.delete=Ou;Dt.prototype.get=_u;Dt.prototype.has=Eu;Dt.prototype.set=Su;function Ge(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 Iu(){this.__data__=[]}function ju(e){var t=this.__data__,n=qn(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():gu.call(t,n,1),!0}function Pu(e){var t=this.__data__,n=qn(t,e);return n<0?void 0:t[n][1]}function Mu(e){return qn(this.__data__,e)>-1}function Fu(e,t){var n=this.__data__,i=qn(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}Ge.prototype.clear=Iu;Ge.prototype.delete=ju;Ge.prototype.get=Pu;Ge.prototype.has=Mu;Ge.prototype.set=Fu;function Nt(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 Lu(){this.__data__={hash:new Dt,map:new(dn||Ge),string:new Dt}}function Du(e){return Kn(this,e).delete(e)}function Nu(e){return Kn(this,e).get(e)}function Tu(e){return Kn(this,e).has(e)}function Ru(e,t){return Kn(this,e).set(e,t),this}Nt.prototype.clear=Lu;Nt.prototype.delete=Du;Nt.prototype.get=Nu;Nt.prototype.has=Tu;Nt.prototype.set=Ru;function kn(e){var t=-1,n=e?e.length:0;for(this.__data__=new Nt;++t<n;)this.add(e[t])}function $u(e){return this.__data__.set(e,er),this}function Uu(e){return this.__data__.has(e)}kn.prototype.add=kn.prototype.push=$u;kn.prototype.has=Uu;function it(e){this.__data__=new Ge(e)}function Hu(){this.__data__=new Ge}function Bu(e){return this.__data__.delete(e)}function Wu(e){return this.__data__.get(e)}function Yu(e){return this.__data__.has(e)}function ku(e,t){var n=this.__data__;if(n instanceof Ge){var i=n.__data__;if(!dn||i.length<Wf-1)return i.push([e,t]),this;n=this.__data__=new Nt(i)}return n.set(e,t),this}it.prototype.clear=Hu;it.prototype.delete=Bu;it.prototype.get=Wu;it.prototype.has=Yu;it.prototype.set=ku;function zu(e,t){var n=Xi(e)||ip(e)?su(e.length,String):[],i=n.length,r=!!i;for(var s in e)(t||ze.call(e,s))&&!(r&&(s=="length"||Xu(s,i)))&&n.push(s);return n}function qn(e,t){for(var n=e.length;n--;)if(Ss(e[n][0],t))return n;return-1}function Gu(e){return mn.call(e)}function _s(e,t,n,i,r){return e===t?!0:e==null||t==null||!tr(e)&&!nr(t)?e!==e&&t!==t:qu(e,t,_s,n,i,r)}function qu(e,t,n,i,r,s){var o=Xi(e),a=Xi(t),l=Gi,c=Gi;o||(l=nt(e),l=l==Hn?Vt:l),a||(c=nt(t),c=c==Hn?Vt:c);var f=l==Vt&&!Ki(e),u=c==Vt&&!Ki(t),p=l==c;if(p&&!f)return s||(s=new it),o||sp(e)?Es(e,t,n,i,r,s):Qu(e,t,l,n,i,r,s);if(!(r&zn)){var h=f&&ze.call(e,"__wrapped__"),g=u&&ze.call(t,"__wrapped__");if(h||g){var b=h?e.value():e,m=g?t.value():t;return s||(s=new it),n(b,m,i,r,s)}}return p?(s||(s=new it),Zu(e,t,n,i,r,s)):!1}function Ku(e){if(!tr(e)||tp(e))return!1;var t=js(e)||Ki(e)?hu:tu;return t.test(Tt(e))}function Vu(e){return nr(e)&&Ps(e.length)&&!!te[mn.call(e)]}function Ju(e){if(!np(e))return bu(e);var t=[];for(var n in Object(e))ze.call(e,n)&&n!="constructor"&&t.push(n);return t}function Es(e,t,n,i,r,s){var o=r&zn,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(e);if(c&&s.get(t))return c==t;var f=-1,u=!0,p=r&ps?new kn:void 0;for(s.set(e,t),s.set(t,e);++f<a;){var h=e[f],g=t[f];if(i)var b=o?i(g,h,f,t,e,s):i(h,g,f,e,t,s);if(b!==void 0){if(b)continue;u=!1;break}if(p){if(!ou(t,function(m,x){if(!p.has(x)&&(h===m||n(h,m,i,r,s)))return p.add(x)})){u=!1;break}}else if(!(h===g||n(h,g,i,r,s))){u=!1;break}}return s.delete(e),s.delete(t),u}function Qu(e,t,n,i,r,s,o){switch(n){case Yn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case As:return!(e.byteLength!=t.byteLength||!i(new cs(e),new cs(t)));case hs:case ms:case ys:return Ss(+e,+t);case gs:return e.name==t.name&&e.message==t.message;case ws:case Cs:return e==t+"";case Bn:var a=cu;case Wn:var l=s&zn;if(a||(a=uu),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;s|=ps,o.set(e,t);var f=Es(a(e),a(t),i,r,s,o);return o.delete(e),f;case kf:if(zi)return zi.call(e)==zi.call(t)}return!1}function Zu(e,t,n,i,r,s){var o=r&zn,a=us(e),l=a.length,c=us(t),f=c.length;if(l!=f&&!o)return!1;for(var u=l;u--;){var p=a[u];if(!(o?p in t:ze.call(t,p)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var g=!0;s.set(e,t),s.set(t,e);for(var b=o;++u<l;){p=a[u];var m=e[p],x=t[p];if(i)var v=o?i(x,m,p,t,e,s):i(m,x,p,e,t,s);if(!(v===void 0?m===x||n(m,x,i,r,s):v)){g=!1;break}b||(b=p=="constructor")}if(g&&!b){var L=e.constructor,Y=t.constructor;L!=Y&&"constructor"in e&&"constructor"in t&&!(typeof L=="function"&&L instanceof L&&typeof Y=="function"&&Y instanceof Y)&&(g=!1)}return s.delete(e),s.delete(t),g}function Kn(e,t){var n=e.__data__;return ep(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Qt(e,t){var n=lu(e,t);return Ku(n)?n:void 0}var nt=Gu;(Vi&&nt(new Vi(new ArrayBuffer(1)))!=Yn||dn&&nt(new dn)!=Bn||Ji&&nt(Ji.resolve())!=ns||Qi&&nt(new Qi)!=Wn||Zi&&nt(new Zi)!=qi)&&(nt=function(e){var t=mn.call(e),n=t==Vt?e.constructor:void 0,i=n?Tt(n):void 0;if(i)switch(i){case yu:return Yn;case wu:return Bn;case Cu:return ns;case Au:return Wn;case xu:return qi}return t});function Xu(e,t){return t=t==null?ds:t,!!t&&(typeof e=="number"||nu.test(e))&&e>-1&&e%1==0&&e<t}function ep(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function tp(e){return!!as&&as in e}function np(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Gn;return e===n}function Tt(e){if(e!=null){try{return Os.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ss(e,t){return e===t||e!==e&&t!==t}function ip(e){return rp(e)&&ze.call(e,"callee")&&(!mu.call(e,"callee")||mn.call(e)==Hn)}var Xi=Array.isArray;function Is(e){return e!=null&&Ps(e.length)&&!js(e)}function rp(e){return nr(e)&&Is(e)}function op(e,t,n){n=typeof n=="function"?n:void 0;var i=n?n(e,t):void 0;return i===void 0?_s(e,t,n):!!i}function js(e){var t=tr(e)?mn.call(e):"";return t==bs||t==Yf}function Ps(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ds}function tr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function nr(e){return!!e&&typeof e=="object"}var sp=ss?au(ss):Vu;function us(e){return Is(e)?zu(e):Ju(e)}Jt.exports=op});import{notStrictEqual as _a,strictEqual as Ea}from"assert";var ea={right:oa,center:sa},ta=0,gn=1,na=2,bn=3,ni=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
+ `).map(r=>r.split(" ")),i=0;return n.forEach(r=>{r.length>1&&_e.stringWidth(r[0])>i&&(i=Math.min(Math.floor(this.width*.5),_e.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=_e.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
+ `)}rowToString(t,n){return this.rasterize(t).forEach((i,r)=>{let s="";i.forEach((o,a)=>{let{width:l}=t[a],c=this.negatePadding(t[a]),f=o;c>_e.stringWidth(o)&&(f+=" ".repeat(c-_e.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap&&(f=ea[t[a].align](f,c),_e.stringWidth(f)<c&&(f+=" ".repeat((l||0)-_e.stringWidth(f)-1)));let u=t[a].padding||[0,0,0,0];u[bn]&&(s+=" ".repeat(u[bn])),s+=or(t[a],f,"| "),s+=f,s+=or(t[a],f," |"),u[gn]&&(s+=" ".repeat(u[gn])),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=_e.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=_e.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
4
4
  `):r=s.text.split(`
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[oa]||0).fill("")),r.push(...new Array(s.padding[sa]||0).fill(""))),r.forEach((a,l)=>{n[l]||n.push([]);let c=n[l];for(let f=0;f<o;f++)c[f]===void 0&&c.push("");c.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||je.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,aa(t[a])):o)}};function cr(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function aa(e){let t=e.padding||[],n=1+(t[An]||0)+(t[Cn]||0);return e.border?n+4:n}function la(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function ca(e,t){e=e.trim();let n=je.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function fa(e,t){e=e.trim();let n=je.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var je;function fr(e,t){return je=t,new si({width:(e==null?void 0:e.width)||la(),wrap:e==null?void 0:e.wrap})}A();var ur=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function ai(e){return e.replace(ur,"")}function pr(e,t){let[n,i]=e.match(ur)||["",""];e=ai(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 li(e){return fr(e,{stringWidth:t=>[...t].length,stripAnsi:ai,wrap:pr})}A();import{dirname as dr,resolve as hr}from"path";import{readdirSync as ua,statSync as pa}from"fs";function mr(e,t){let n=hr(".",e),i;for(pa(n).isDirectory()||(n=dr(n));;){if(i=t(n,ua(n)),i)return hr(n,i);if(n=dr(i=n),i===n)break}}import{inspect as Ma}from"util";import{readFileSync as Fa}from"fs";import{fileURLToPath as La}from"url";A();import{format as ma}from"util";import{normalize as ga,resolve as ba}from"path";A();function vt(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 gr(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 Le;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(Le||(Le={}));var Ge,On=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=gr(t),s=typeof t=="string",o=da(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),c=i.configObjects||[],f=i.envPrefix,u=a["populate--"],p=u?"--":"_",h=Object.create(null),g=Object.create(null),b=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)})),on(i.key,o,i.default,m.arrays),Object.keys(l).forEach(function(y){(m.aliases[y]||[]).forEach(function(C){l[C]=l[y]})});let N=null;oi();let G=[],K=Object.assign(Object.create(null),{_:[]}),z={};for(let y=0;y<r.length;y++){let C=r[y],_=C.replace(/^-{3,}/,"---"),x,w,P,S,$,be;if(C!=="--"&&ee(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&&(H(S[1],m.arrays)?y=X(y,S[1],r,S[2]):H(S[1],m.nargs)!==!1?y=J(y,S[1],r,S[2]):Y(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],Y(w,H(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],H(w,m.arrays)?y=X(y,w,r):H(w,m.nargs)!==!1?y=J(y,w,r):($=r[y+1],$!==void 0&&(!$.match(/^-/)||$.match(v))&&!H(w,m.bools)&&!H(w,m.counts)||/^(true|false)$/.test($)?(Y(w,$),y++):Y(w,V(w))));else if(C.match(/^-.\..+=/))S=C.match(/^-([^=]+)=([\s\S]*)$/),S!==null&&Array.isArray(S)&&S.length>=3&&Y(S[1],S[2]);else if(C.match(/^-.\..+/)&&!C.match(v))$=r[y+1],S=C.match(/^-(.\..+)/),S!==null&&Array.isArray(S)&&S.length>=2&&(w=S[1],$!==void 0&&!$.match(/^-/)&&!H(w,m.bools)&&!H(w,m.counts)?(Y(w,$),y++):Y(w,V(w)));else if(C.match(/^-[^-]+/)&&!C.match(v)){P=C.slice(1,-1).split(""),x=!1;for(let Oe=0;Oe<P.length;Oe++){if($=C.slice(Oe+2),P[Oe+1]&&P[Oe+1]==="="){be=C.slice(Oe+3),w=P[Oe],H(w,m.arrays)?y=X(y,w,r,be):H(w,m.nargs)!==!1?y=J(y,w,r,be):Y(w,be),x=!0;break}if($==="-"){Y(P[Oe],$);continue}if(/[A-Za-z]/.test(P[Oe])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test($)&&H($,m.bools)===!1){Y(P[Oe],$),x=!0;break}if(P[Oe+1]&&P[Oe+1].match(/\W/)){Y(P[Oe],$),x=!0;break}else Y(P[Oe],V(P[Oe]))}w=C.slice(-1)[0],!x&&w!=="-"&&(H(w,m.arrays)?y=X(y,w,r):H(w,m.nargs)!==!1?y=J(y,w,r):($=r[y+1],$!==void 0&&(!/^(-|--)[^-]/.test($)||$.match(v))&&!H(w,m.bools)&&!H(w,m.counts)||/^(true|false)$/.test($)?(Y(w,$),y++):Y(w,V(w))))}else if(C.match(/^-[0-9]$/)&&C.match(v)&&H(C.slice(1),m.bools))w=C.slice(1),Y(w,V(w));else if(C==="--"){G=r.slice(y+1);break}else if(a["halt-at-non-option"]){G=r.slice(y);break}else T(C)}ue(K,!0),ue(K,!1),F(K),Z(),Qe(K,m.aliases,l,!0),Q(K),a["set-placeholder-key"]&&de(K),Object.keys(m.counts).forEach(function(y){ne(K,y.split("."))||Y(y,0)}),u&&G.length&&(K[p]=[]),G.forEach(function(y){K[p].push(y)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(K).filter(y=>y!=="--"&&y.includes("-")).forEach(y=>{delete K[y]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(y=>o[y])).forEach(y=>{a["camel-case-expansion"]&&y.includes("-")&&delete K[y.split(".").map(C=>vt(C)).join(".")],delete K[y]});function T(y){let C=E("_",y);(typeof C=="string"||typeof C=="number")&&K._.push(C)}function J(y,C,_,x){let w,P=H(C,m.nargs);if(P=typeof P!="number"||isNaN(P)?1:P,P===0)return me(x)||(N=Error(b("Argument unexpected for: %s",C))),Y(C,V(C)),y;let S=me(x)?0:1;if(a["nargs-eats-options"])_.length-(y+1)+S<P&&(N=Error(b("Not enough arguments following: %s",C))),S=P;else{for(w=y+1;w<_.length&&(!_[w].match(/^-[^0-9]/)||_[w].match(v)||ee(_[w]));w++)S++;S<P&&(N=Error(b("Not enough arguments following: %s",C)))}let $=Math.min(S,P);for(!me(x)&&$>0&&(Y(C,x),$--),w=y+1;w<$+y+1;w++)Y(C,_[w]);return y+$}function X(y,C,_,x){let w=[],P=x||_[y+1],S=H(C,m.nargs);if(H(C,m.bools)&&!/^(true|false)$/.test(P))w.push(!0);else if(me(P)||me(x)&&/^-/.test(P)&&!v.test(P)&&!ee(P)){if(l[C]!==void 0){let $=l[C];w=Array.isArray($)?$:[$]}}else{me(x)||w.push(M(C,x,!0));for(let $=y+1;$<_.length&&!(!a["greedy-arrays"]&&w.length>0||S&&typeof S=="number"&&w.length>=S||(P=_[$],/^-/.test(P)&&!v.test(P)&&!ee(P)));$++)y=$,w.push(M(C,P,s))}return typeof S=="number"&&(S&&w.length<S||isNaN(S)&&w.length===0)&&(N=Error(b("Not enough arguments following: %s",C))),Y(C,w),y}function Y(y,C,_=s){if(/-/.test(y)&&a["camel-case-expansion"]){let P=y.split(".").map(function(S){return vt(S)}).join(".");Ie(y,P)}let x=M(y,C,_),w=y.split(".");ze(K,w,x),m.aliases[y]&&m.aliases[y].forEach(function(P){let S=P.split(".");ze(K,S,x)}),w.length>1&&a["dot-notation"]&&(m.aliases[w[0]]||[]).forEach(function(P){let S=P.split("."),$=[].concat(w);$.shift(),S=S.concat($),(m.aliases[y]||[]).includes(S.join("."))||ze(K,S,x)}),H(y,m.normalize)&&!H(y,m.arrays)&&[y].concat(m.aliases[y]||[]).forEach(function(S){Object.defineProperty(z,S,{enumerable:!0,get(){return C},set($){C=typeof $=="string"?Ge.normalize($):$}})})}function Ie(y,C){m.aliases[y]&&m.aliases[y].length||(m.aliases[y]=[C],h[C]=!0),m.aliases[C]&&m.aliases[C].length||Ie(C,y)}function M(y,C,_){_&&(C=ha(C)),(H(y,m.bools)||H(y,m.counts))&&typeof C=="string"&&(C=C==="true");let x=Array.isArray(C)?C.map(function(w){return E(y,w)}):E(y,C);return H(y,m.counts)&&(me(x)||typeof x=="boolean")&&(x=ci()),H(y,m.normalize)&&H(y,m.arrays)&&(Array.isArray(C)?x=C.map(w=>Ge.normalize(w)):x=Ge.normalize(C)),x}function E(y,C){return!a["parse-positional-numbers"]&&y==="_"||!H(y,m.strings)&&!H(y,m.bools)&&!Array.isArray(C)&&(vn(C)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${C}`)))||!me(C)&&H(y,m.numbers))&&(C=Number(C)),C}function F(y){let C=Object.create(null);Qe(C,m.aliases,l),Object.keys(m.configs).forEach(function(_){let x=y[_]||C[_];if(x)try{let w=null,P=Ge.resolve(Ge.cwd(),x),S=m.configs[_];if(typeof S=="function"){try{w=S(P)}catch($){w=$}if(w instanceof Error){N=w;return}}else w=Ge.require(P);k(w)}catch(w){w.name==="PermissionDenied"?N=w:y[_]&&(N=Error(b("Invalid JSON config file: %s",x)))}})}function k(y,C){Object.keys(y).forEach(function(_){let x=y[_],w=C?C+"."+_:_;typeof x=="object"&&x!==null&&!Array.isArray(x)&&a["dot-notation"]?k(x,w):(!ne(K,w.split("."))||H(w,m.arrays)&&a["combine-arrays"])&&Y(w,x)})}function Z(){typeof c!="undefined"&&c.forEach(function(y){k(y)})}function ue(y,C){if(typeof f=="undefined")return;let _=typeof f=="string"?f:"",x=Ge.env();Object.keys(x).forEach(function(w){if(_===""||w.lastIndexOf(_,0)===0){let P=w.split("__").map(function(S,$){return $===0&&(S=S.substring(_.length)),vt(S)});(C&&m.configs[P.join(".")]||!C)&&!ne(y,P)&&Y(P.join("."),x[w])}})}function Q(y){let C,_=new Set;Object.keys(y).forEach(function(x){if(!_.has(x)&&(C=H(x,m.coercions),typeof C=="function"))try{let w=E(x,C(y[x]));[].concat(m.aliases[x]||[],x).forEach(P=>{_.add(P),y[P]=w})}catch(w){N=w}})}function de(y){return m.keys.forEach(C=>{~C.indexOf(".")||typeof y[C]=="undefined"&&(y[C]=void 0)}),y}function Qe(y,C,_,x=!1){Object.keys(_).forEach(function(w){ne(y,w.split("."))||(ze(y,w.split("."),_[w]),x&&(g[w]=!0),(C[w]||[]).forEach(function(P){ne(y,P.split("."))||ze(y,P.split("."),_[w])}))})}function ne(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 ze(y,C,_){let x=y;a["dot-notation"]||(C=[C.join(".")]),C.slice(0,-1).forEach(function(be){be=br(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=br(C[C.length-1]),P=H(C.join("."),m.arrays),S=Array.isArray(_),$=a["duplicate-arguments-array"];!$&&H(w,m.nargs)&&($=!0,(!me(x[w])&&m.nargs[w]===1||Array.isArray(x[w])&&x[w].length===m.nargs[w])&&(x[w]=void 0)),_===ci()?x[w]=ci(x[w]):Array.isArray(x[w])?$&&P&&S?x[w]=a["flatten-duplicate-arrays"]?x[w].concat(_):(Array.isArray(x[w][0])?x[w]:[x[w]]).concat([_]):!$&&Boolean(P)===Boolean(S)?x[w]=_:x[w]=x[w].concat([_]):x[w]===void 0&&P?x[w]=S?_:[_]:$&&!(x[w]===void 0||H(w,m.counts)||H(w,m.bools))?x[w]=[x[w],_]:x[w]=_}function on(...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=vt(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 H(y,C){let _=[].concat(m.aliases[y]||[],y),x=Object.keys(C),w=_.find(P=>x.includes(P));return w?C[w]:!1}function Bt(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 ar(y,...C){return[].concat(...C).some(function(x){let w=y.match(x);return w&&Bt(w[1])})}function B(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),!Bt(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 ee(y){return a["unknown-options-as-args"]&&he(y)}function he(y){return y=y.replace(/^-{3,}/,"--"),y.match(v)||B(y)?!1:!ar(y,/^-+([^=]+?)=[\s\S]*$/,O,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function V(y){return!H(y,m.bools)&&!H(y,m.counts)&&`${y}`in l?l[y]:Ce(ce(y))}function Ce(y){return{[Le.BOOLEAN]:!0,[Le.STRING]:"",[Le.NUMBER]:void 0,[Le.ARRAY]:[]}[y]}function ce(y){let C=Le.BOOLEAN;return H(y,m.strings)?C=Le.STRING:H(y,m.numbers)?C=Le.NUMBER:H(y,m.bools)?C=Le.BOOLEAN:H(y,m.arrays)&&(C=Le.ARRAY),C}function me(y){return y===void 0}function oi(){Object.keys(m.counts).find(y=>H(y,m.arrays)?(N=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",y)),!0):H(y,m.nargs)?(N=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",y)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(z,K),configuration:a,defaulted:Object.assign({},g),error:N,newAliases:Object.assign({},h)}}};function da(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 ci(e){return e!==void 0?e+1:1}function br(e){return e==="__proto__"?"___proto___":e}function ha(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 ya}from"fs";var yr=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])<yr)throw Error(`yargs parser supports a minimum Node.js version of ${yr}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var wa=process?process.env:{},wr=new On({cwd:process.cwd,env:()=>wa,format:ma,normalize:ga,resolve:ba,require:e=>{if(typeof Ae!="undefined")return Ae(e);if(e.match(/\.json$/))return JSON.parse(ya(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),sn=function(t,n){return wr.parse(t.slice(),n).argv};sn.detailed=function(e,t){return wr.parse(e.slice(),t)};sn.camelCase=vt;sn.decamelize=xn;sn.looksLikeNumber=vn;var Cr=sn;import{basename as Da,dirname as Na,extname as Ta,relative as Ra,resolve as _r}from"path";A();function Ca(){return Aa()?0:1}function Aa(){return xa()&&!process.defaultApp}function xa(){return!!process.versions.electron}function Ar(){return process.argv[Ca()]}A();var te=class extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,te)}};A();A();import{readFileSync as va,statSync as Oa,writeFile as _a}from"fs";import{format as Ea}from"util";import{resolve as Sa}from"path";var xr={fs:{readFileSync:va,writeFile:_a},format:Ea,resolve:Sa,exists:e=>{try{return Oa(e).isFile()}catch(t){return!1}}};A();var $e,fi=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 vr(e,t){$e=t;let n=new fi(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 Ia=e=>vr(e,xr),Or=Ia;var Ha={},$a="require is not supported by ESM",Er="loading a directory of commands is not supported yet for ESM",an;try{an=La(Ha.url)}catch(e){an=process.cwd()}var Ua=an.substring(0,an.lastIndexOf("node_modules")),Sr={assert:{notStrictEqual:ja,strictEqual:Pa},cliui:li,findUp:mr,getEnv:e=>process.env[e],inspect:Ma,getCallerFile:()=>{throw new te(Er)},getProcessArgvBin:Ar,mainFilename:Ua||process.cwd(),Parser:Cr,path:{basename:Da,dirname:Na,extname:Ta,relative:Ra,resolve:_r},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:Fa,require:()=>{throw new te($a)},requireDirectory:()=>{throw new te(Er)},stringWidth:e=>[...e].length,y18n:Or({directory:_r(an,"../../../locales"),updateFiles:!1})};A();A();A();function _e(e,t,n,i){n.assert.notStrictEqual(e,t,i)}function ui(e,t){t.assert.strictEqual(typeof e,"string")}function Wt(e){return Object.keys(e)}A();function ie(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 Ba=["first","second","third","fourth","fifth","sixth"];function I(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 c=a||l.length;if(c<s.demanded.length)throw new te(`Not enough arguments provided. Expected ${s.demanded.length} but received ${l.length}.`);let f=s.demanded.length+s.optional.length;if(c>f)throw new te(`Too many arguments provided. Expected max ${f} but received ${c}.`);s.demanded.forEach(u=>{let p=l.shift(),h=Ir(p);u.cmd.filter(b=>b===h||b==="*").length===0&&jr(h,u.cmd,r),r+=1}),s.optional.forEach(u=>{if(l.length===0)return;let p=l.shift(),h=Ir(p);u.cmd.filter(b=>b===h||b==="*").length===0&&jr(h,u.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function Ir(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function jr(e,t,n){throw new te(`Invalid ${Ba[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var _n=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,i=!0,r=!1){if(I("<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 Pr(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function Ot(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(ie(r))return r.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(r,t);return ie(o)?o.then(a=>Object.assign(r,a)):Object.assign(r,o)}},e)}A();function _t(e,t,n=i=>{throw i}){try{let i=Wa(e)?e():e;return ie(i)?i.then(r=>t(r)):t(i)}catch(i){return n(i)}}function Wa(e){return typeof e=="function"}A();function pi(e){if(typeof Ae=="undefined")return null;for(let t=0,n=Object.keys(Ae.cache),i;t<n.length;t++)if(i=Ae.cache[n[t]],i.exports===e)return i;return null}var Yt=/(^\*)|(^\$0)/,di=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 c=s(o,a,l);if(c){if(this.requireCache.has(a))return c;this.requireCache.add(a),this.addHandler(c)}return c},this.shim.requireDirectory({require:n,filename:i},t,r)}addHandler(t,n,i,r,s,o){let a=[],l=Pr(s);if(r=r||(()=>{}),Array.isArray(t))if(Ya(t))[t,...a]=t;else for(let c of t)this.addHandler(c);else if(za(t)){let c=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(c=[].concat(c).concat(t.aliases)),this.addHandler(c,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(Mr(i)){this.addHandler([t].concat(a),n,i.builder,i.handler,i.middlewares,i.deprecated);return}if(typeof t=="string"){let c=Ze(t);a=a.map(p=>Ze(p).cmd);let f=!1,u=[c.cmd].concat(a).filter(p=>Yt.test(p)?(f=!0,!1):!0);u.length===0&&f&&u.push("$0"),f&&(c.cmd=u[0],a=u.slice(1),t=t.replace(Yt,c.cmd)),a.forEach(p=>{this.aliasMap[p]=c.cmd}),n!==!1&&this.usage.command(t,n,f,a,o),this.handlers[c.cmd]={original:t,description:n,handler:r,builder:i||{},middlewares:l,deprecated:o,demanded:c.demanded,optional:c.optional},f&&(this.defaultCommand=this.handlers[c.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(),c=l.commands.slice(),f=!t;t&&(l.commands.push(t),l.fullCommands.push(a.original));let u=this.applyBuilderUpdateUsageAndParse(f,a,n,i.aliases,c,r,s,o);return ie(u)?u.then(p=>this.applyMiddlewareAndGetResult(f,a,p.innerArgv,l,s,p.aliases,n)):this.applyMiddlewareAndGetResult(f,a,u.innerArgv,l,s,u.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,i,r,s,o,a,l){let c=n.builder,f=i;if(En(c)){let u=c(i.getInternalMethods().reset(r),l);if(ie(u))return u.then(p=>(f=Lr(p)?p:i,this.parseAndUpdateUsage(t,n,f,s,o,a)))}else ka(c)&&(f=i.getInternalMethods().reset(r),Object.keys(n.builder).forEach(u=>{f.option(u,c[u])}));return this.parseAndUpdateUsage(t,n,f,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 ie(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=Yt.test(n.original)?n.original.replace(Yt,"").trim():n.original,r=t.filter(s=>!Yt.test(s));return r.push(i),`$0 ${r.join(" ")}`}handleValidationAndGetResult(t,n,i,r,s,o,a,l){if(!o.getInternalMethods().getHasOutput()){let c=o.getInternalMethods().runValidation(s,l,o.parsed.error,t);i=_t(i,f=>(c(f),f))}if(n.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();let c=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(i,c,!1,!1),i=Ot(i,o,a,!1),i=_t(i,f=>{let u=n.handler(f);return ie(u)?u.then(()=>f):f}),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),ie(i)&&!o.getInternalMethods().hasParseCallback()&&i.catch(f=>{try{o.getInternalMethods().getUsageInstance().fail(null,f)}catch(u){}})}return t||(r.commands.pop(),r.fullCommands.pop()),i}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 c=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares),f=Ot(i,a,c,!0);return ie(f)?f.then(u=>this.handleValidationAndGetResult(t,n,u,r,o,a,c,l)):this.handleValidationAndGetResult(t,n,f,r,o,a,c,l)}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 c of Object.keys(i.alias))s.alias[c]=(s.alias[c]||[]).concat(i.alias[c]);s.array=s.array.concat(i.array),s.config={};let o=[];if(Object.keys(n).forEach(c=>{n[c].map(f=>{s.configuration["unknown-options-as-args"]&&(s.key[c]=!0),o.push(`--${c}`),o.push(f)})}),!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 c=Object.keys(n);Object.keys(n).forEach(f=>{c.push(...l.aliases[f])}),Object.keys(l.argv).forEach(f=>{c.includes(f)&&(n[f]||(n[f]=l.argv[f]),!this.isInConfigs(r,f)&&!this.isDefaulted(r,f)&&Object.prototype.hasOwnProperty.call(t,f)&&Object.prototype.hasOwnProperty.call(l.argv,f)&&(Array.isArray(t[f])||Array.isArray(l.argv[f]))?t[f]=[].concat(t[f],l.argv[f]):t[f]=l.argv[f])})}}isDefaulted(t,n){let{default:i}=t.getOptions();return Object.prototype.hasOwnProperty.call(i,n)||Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(n))}isInConfigs(t,n){let{configObjects:i}=t.getOptions();return i.some(r=>Object.prototype.hasOwnProperty.call(r,n))||i.some(r=>Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(n)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let i=Yt.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(En(n))return n(t,!0);Mr(n)||Object.keys(n).forEach(i=>{t.option(i,n[i])})}moduleName(t){let n=pi(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;_e(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();_e(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 Fr(e,t,n,i){return new di(e,t,n,i)}function Mr(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function Ya(e){return e.every(t=>typeof t=="string")}function En(e){return typeof e=="function"}function ka(e){return typeof e=="object"}function za(e){return typeof e=="object"&&!Array.isArray(e)}A();A();function Xe(e={},t=()=>!0){let n={};return Wt(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 Ga(e){return typeof e=="boolean"}function Nr(e,t){let n=t.y18n.__,i={},r=[];i.failFn=function(E){r.push(E)};let s=null,o=null,a=!0;i.showHelpOnFail=function(E=!0,F){let[k,Z]=typeof E=="string"?[!0,E]:[E,F];return e.getInternalMethods().isGlobalContext()&&(o=Z),s=Z,a=k,i};let l=!1;i.fail=function(E,F){let k=e.getInternalMethods().getLoggerInstance();if(r.length)for(let Z=r.length-1;Z>=0;--Z){let ue=r[Z];if(Ga(ue)){if(F)throw F;if(E)throw Error(E)}else ue(E,F,i)}else{if(e.getExitProcess()&&et(!0),!l){l=!0,a&&(e.showHelp("error"),k.error()),(E||F)&&k.error(E||F);let Z=s||o;Z&&((E||F)&&k.error(""),k.error(Z))}if(F=F||new te(E),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,F);throw F}};let c=[],f=!1;i.usage=(M,E)=>M===null?(f=!0,c=[],i):(f=!1,c.push([M,E||""]),i),i.getUsage=()=>c,i.getUsageDisabled=()=>f,i.getPositionalGroupName=()=>n("Positionals:");let u=[];i.example=(M,E)=>{u.push([M,E||""])};let p=[];i.command=function(E,F,k,Z,ue=!1){k&&(p=p.map(Q=>(Q[2]=!1,Q))),p.push([E,F||"",k,Z,ue])},i.getCommands=()=>p;let h={};i.describe=function(E,F){Array.isArray(E)?E.forEach(k=>{i.describe(k,F)}):typeof E=="object"?Object.keys(E).forEach(k=>{i.describe(k,E[k])}):h[E]=F},i.getDescriptions=()=>h;let g=[];i.epilog=M=>{g.push(M)};let b=!1,m;i.wrap=M=>{b=!0,m=M};function v(){return b||(m=X(),b=!0),m}let O="__yargsString__:";i.deferY18nLookup=M=>O+M,i.help=function(){if(K)return K;G();let E=e.customScriptName?e.$0:t.path.basename(e.$0),F=e.getDemandedOptions(),k=e.getDemandedCommands(),Z=e.getDeprecatedOptions(),ue=e.getGroups(),Q=e.getOptions(),de=[];de=de.concat(Object.keys(h)),de=de.concat(Object.keys(F)),de=de.concat(Object.keys(k)),de=de.concat(Object.keys(Q.default)),de=de.filter(T),de=Object.keys(de.reduce((B,ee)=>(ee!=="_"&&(B[ee]=!0),B),{}));let Qe=v(),ne=t.cliui({width:Qe,wrap:!!Qe});if(!f){if(c.length)c.forEach(B=>{ne.div({text:`${B[0].replace(/\$0/g,E)}`}),B[1]&&ne.div({text:`${B[1]}`,padding:[1,0,0,0]})}),ne.div();else if(p.length){let B=null;k._?B=`${E} <${n("command")}>
7
- `:B=`${E} [${n("command")}]
8
- `,ne.div(`${B}`)}}if(p.length>1||p.length===1&&!p[0][2]){ne.div(n("Commands:"));let B=e.getInternalMethods().getContext(),ee=B.commands.length?`${B.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(p=p.sort((V,Ce)=>V[0].localeCompare(Ce[0])));let he=E?`${E} `:"";p.forEach(V=>{let Ce=`${he}${ee}${V[0].replace(/^\$0 ?/,"")}`;ne.span({text:Ce,padding:[0,2,0,2],width:N(p,Qe,`${E}${ee}`)+4},{text:V[1]});let ce=[];V[2]&&ce.push(`[${n("default")}]`),V[3]&&V[3].length&&ce.push(`[${n("aliases:")} ${V[3].join(", ")}]`),V[4]&&(typeof V[4]=="string"?ce.push(`[${n("deprecated: %s",V[4])}]`):ce.push(`[${n("deprecated")}]`)),ce.length?ne.div({text:ce.join(" "),padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}let ze=(Object.keys(Q.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);de=de.filter(B=>!e.parsed.newAliases[B]&&ze.every(ee=>(Q.alias[ee]||[]).indexOf(B)===-1));let on=n("Options:");ue[on]||(ue[on]=[]),z(de,Q.alias,ue,on);let H=B=>/^--/.test(Sn(B)),Bt=Object.keys(ue).filter(B=>ue[B].length>0).map(B=>{let ee=ue[B].filter(T).map(he=>{if(ze.includes(he))return he;for(let V=0,Ce;(Ce=ze[V])!==void 0;V++)if((Q.alias[Ce]||[]).includes(he))return Ce;return he});return{groupName:B,normalizedKeys:ee}}).filter(({normalizedKeys:B})=>B.length>0).map(({groupName:B,normalizedKeys:ee})=>{let he=ee.reduce((V,Ce)=>(V[Ce]=[Ce].concat(Q.alias[Ce]||[]).map(ce=>B===i.getPositionalGroupName()?ce:(/^[0-9]$/.test(ce)?Q.boolean.includes(Ce)?"-":"--":ce.length>1?"--":"-")+ce).sort((ce,me)=>H(ce)===H(me)?0:H(ce)?1:-1).join(", "),V),{});return{groupName:B,normalizedKeys:ee,switches:he}});if(Bt.filter(({groupName:B})=>B!==i.getPositionalGroupName()).some(({normalizedKeys:B,switches:ee})=>!B.every(he=>H(ee[he])))&&Bt.filter(({groupName:B})=>B!==i.getPositionalGroupName()).forEach(({normalizedKeys:B,switches:ee})=>{B.forEach(he=>{H(ee[he])&&(ee[he]=qa(ee[he],4))})}),Bt.forEach(({groupName:B,normalizedKeys:ee,switches:he})=>{ne.div(B),ee.forEach(V=>{let Ce=he[V],ce=h[V]||"",me=null;ce.includes(O)&&(ce=n(ce.substring(O.length))),Q.boolean.includes(V)&&(me=`[${n("boolean")}]`),Q.count.includes(V)&&(me=`[${n("count")}]`),Q.string.includes(V)&&(me=`[${n("string")}]`),Q.normalize.includes(V)&&(me=`[${n("string")}]`),Q.array.includes(V)&&(me=`[${n("array")}]`),Q.number.includes(V)&&(me=`[${n("number")}]`);let oi=C=>typeof C=="string"?`[${n("deprecated: %s",C)}]`:`[${n("deprecated")}]`,y=[V in Z?oi(Z[V]):null,me,V in F?`[${n("required")}]`:null,Q.choices&&Q.choices[V]?`[${n("choices:")} ${i.stringifiedValues(Q.choices[V])}]`:null,J(Q.default[V],Q.defaultDescription[V])].filter(Boolean).join(" ");ne.span({text:Sn(Ce),padding:[0,2,0,2+Dr(Ce)],width:N(he,Qe)+4},ce),y?ne.div({text:y,padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}),u.length&&(ne.div(n("Examples:")),u.forEach(B=>{B[0]=B[0].replace(/\$0/g,E)}),u.forEach(B=>{B[1]===""?ne.div({text:B[0],padding:[0,2,0,2]}):ne.div({text:B[0],padding:[0,2,0,2],width:N(u,Qe)+4},{text:B[1]})}),ne.div()),g.length>0){let B=g.map(ee=>ee.replace(/\$0/g,E)).join(`
9
- `);ne.div(`${B}
10
- `)}return ne.toString().replace(/\s*$/,"")};function N(M,E,F){let k=0;return Array.isArray(M)||(M=Object.values(M).map(Z=>[Z])),M.forEach(Z=>{k=Math.max(t.stringWidth(F?`${F} ${Sn(Z[0])}`:Sn(Z[0]))+Dr(Z[0]),k)}),E&&(k=Math.min(k,parseInt((E*.5).toString(),10))),k}function G(){let M=e.getDemandedOptions(),E=e.getOptions();(Object.keys(E.alias)||[]).forEach(F=>{E.alias[F].forEach(k=>{h[k]&&i.describe(F,h[k]),k in M&&e.demandOption(F,M[k]),E.boolean.includes(k)&&e.boolean(F),E.count.includes(k)&&e.count(F),E.string.includes(k)&&e.string(F),E.normalize.includes(k)&&e.normalize(F),E.array.includes(k)&&e.array(F),E.number.includes(k)&&e.number(F)})})}let K;i.cacheHelpMessage=function(){K=this.help()},i.clearCachedHelpMessage=function(){K=void 0},i.hasCachedHelpMessage=function(){return!!K};function z(M,E,F,k){let Z=[],ue=null;return Object.keys(F).forEach(Q=>{Z=Z.concat(F[Q])}),M.forEach(Q=>{ue=[Q].concat(E[Q]),ue.some(de=>Z.indexOf(de)!==-1)||F[k].push(Q)}),Z}function T(M){return e.getOptions().hiddenOptions.indexOf(M)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}i.showHelp=M=>{let E=e.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:E[M])(i.help())},i.functionDescription=M=>{let E=M.name?t.Parser.decamelize(M.name,"-"):n("generated-value");return["(",E,")"].join("")},i.stringifiedValues=function(E,F){let k="",Z=F||", ",ue=[].concat(E);return!E||!ue.length||ue.forEach(Q=>{k.length&&(k+=Z),k+=JSON.stringify(Q)}),k};function J(M,E){let F=`[${n("default:")} `;if(M===void 0&&!E)return null;if(E)F+=E;else switch(typeof M){case"string":F+=`"${M}"`;break;case"object":F+=JSON.stringify(M);break;default:F+=M}return`${F}]`}function X(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let Y=null;i.version=M=>{Y=M},i.showVersion=M=>{let E=e.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:E[M])(Y)},i.reset=function(E){return s=null,l=!1,c=[],f=!1,g=[],u=[],p=[],h=Xe(h,F=>!E[F]),i};let Ie=[];return i.freeze=function(){Ie.push({failMessage:s,failureOutput:l,usages:c,usageDisabled:f,epilogs:g,examples:u,commands:p,descriptions:h})},i.unfreeze=function(E=!1){let F=Ie.pop();!F||(E?(h={...F.descriptions,...h},p=[...F.commands,...p],c=[...F.usages,...c],u=[...F.examples,...u],g=[...F.epilogs,...g]):{failMessage:s,failureOutput:l,usages:c,usageDisabled:f,epilogs:g,examples:u,commands:p,descriptions:h}=F)},i}function hi(e){return typeof e=="object"}function qa(e,t){return hi(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function Dr(e){return hi(e)?e.indentation:0}function Sn(e){return hi(e)?e.text:e}A();A();var Tr=`###-begin-{{app_name}}-completions-###
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[ta]||0).fill("")),r.push(...new Array(s.padding[na]||0).fill(""))),r.forEach((a,l)=>{n[l]||n.push([]);let c=n[l];for(let f=0;f<o;f++)c[f]===void 0&&c.push("");c.push(a)})}),n}negatePadding(t){let n=t.width||0;return t.padding&&(n-=(t.padding[bn]||0)+(t.padding[gn]||0)),t.border&&(n-=4),n}columnWidths(t){if(!this.wrap)return t.map(o=>o.width||_e.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,ia(t[a])):o)}};function or(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function ia(e){let t=e.padding||[],n=1+(t[bn]||0)+(t[gn]||0);return e.border?n+4:n}function ra(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function oa(e,t){e=e.trim();let n=_e.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function sa(e,t){e=e.trim();let n=_e.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var _e;function sr(e,t){return _e=t,new ni({width:(e==null?void 0:e.width)||ra(),wrap:e==null?void 0:e.wrap})}var ar=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function ii(e){return e.replace(ar,"")}function lr(e,t){let[n,i]=e.match(ar)||["",""];e=ii(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 ri(e){return sr(e,{stringWidth:t=>[...t].length,stripAnsi:ii,wrap:lr})}import{dirname as cr,resolve as fr}from"path";import{readdirSync as aa,statSync as la}from"fs";function ur(e,t){let n=fr(".",e),i;for(la(n).isDirectory()||(n=cr(n));;){if(i=t(n,aa(n)),i)return fr(n,i);if(n=cr(i=n),i===n)break}}import{inspect as Sa}from"util";import{readFileSync as Ia}from"fs";import{fileURLToPath as ja}from"url";import{format as ua}from"util";import{normalize as pa,resolve as da}from"path";function wt(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 yn(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 wn(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)}function pr(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}var je;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(je||(je={}));var We,Cn=class{constructor(t){We=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=pr(t),s=typeof t=="string",o=ca(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),c=i.configObjects||[],f=i.envPrefix,u=a["populate--"],p=u?"--":"_",h=Object.create(null),g=Object.create(null),b=i.__||We.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]+)$/,v=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(i.array||[]).filter(Boolean).forEach(function(y){let C=typeof y=="object"?y.key:y,O=Object.keys(y).map(function(A){return{boolean:"bools",string:"strings",number:"numbers"}[A]}).filter(Boolean).pop();O&&(m[O][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)})),en(i.key,o,i.default,m.arrays),Object.keys(l).forEach(function(y){(m.aliases[y]||[]).forEach(function(C){l[C]=l[y]})});let L=null;ti();let Y=[],z=Object.assign(Object.create(null),{_:[]}),W={};for(let y=0;y<r.length;y++){let C=r[y],O=C.replace(/^-{3,}/,"---"),A,w,j,E,N,he;if(C!=="--"&&Q(C))D(C);else if(O.match(/---+(=|$)/)){D(C);continue}else if(C.match(/^--.+=/)||!a["short-option-groups"]&&C.match(/^-.+=/))E=C.match(/^--?([^=]+)=([\s\S]*)$/),E!==null&&Array.isArray(E)&&E.length>=3&&(R(E[1],m.arrays)?y=J(y,E[1],r,E[2]):R(E[1],m.nargs)!==!1?y=q(y,E[1],r,E[2]):H(E[1],E[2],!0));else if(C.match(v)&&a["boolean-negation"])E=C.match(v),E!==null&&Array.isArray(E)&&E.length>=2&&(w=E[1],H(w,R(w,m.arrays)?[!1]:!1));else if(C.match(/^--.+/)||!a["short-option-groups"]&&C.match(/^-[^-]+/))E=C.match(/^--?(.+)/),E!==null&&Array.isArray(E)&&E.length>=2&&(w=E[1],R(w,m.arrays)?y=J(y,w,r):R(w,m.nargs)!==!1?y=q(y,w,r):(N=r[y+1],N!==void 0&&(!N.match(/^-/)||N.match(x))&&!R(w,m.bools)&&!R(w,m.counts)||/^(true|false)$/.test(N)?(H(w,N),y++):H(w,G(w))));else if(C.match(/^-.\..+=/))E=C.match(/^-([^=]+)=([\s\S]*)$/),E!==null&&Array.isArray(E)&&E.length>=3&&H(E[1],E[2]);else if(C.match(/^-.\..+/)&&!C.match(x))N=r[y+1],E=C.match(/^-(.\..+)/),E!==null&&Array.isArray(E)&&E.length>=2&&(w=E[1],N!==void 0&&!N.match(/^-/)&&!R(w,m.bools)&&!R(w,m.counts)?(H(w,N),y++):H(w,G(w)));else if(C.match(/^-[^-]+/)&&!C.match(x)){j=C.slice(1,-1).split(""),A=!1;for(let Ce=0;Ce<j.length;Ce++){if(N=C.slice(Ce+2),j[Ce+1]&&j[Ce+1]==="="){he=C.slice(Ce+3),w=j[Ce],R(w,m.arrays)?y=J(y,w,r,he):R(w,m.nargs)!==!1?y=q(y,w,r,he):H(w,he),A=!0;break}if(N==="-"){H(j[Ce],N);continue}if(/[A-Za-z]/.test(j[Ce])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(N)&&R(N,m.bools)===!1){H(j[Ce],N),A=!0;break}if(j[Ce+1]&&j[Ce+1].match(/\W/)){H(j[Ce],N),A=!0;break}else H(j[Ce],G(j[Ce]))}w=C.slice(-1)[0],!A&&w!=="-"&&(R(w,m.arrays)?y=J(y,w,r):R(w,m.nargs)!==!1?y=q(y,w,r):(N=r[y+1],N!==void 0&&(!/^(-|--)[^-]/.test(N)||N.match(x))&&!R(w,m.bools)&&!R(w,m.counts)||/^(true|false)$/.test(N)?(H(w,N),y++):H(w,G(w))))}else if(C.match(/^-[0-9]$/)&&C.match(x)&&R(C.slice(1),m.bools))w=C.slice(1),H(w,G(w));else if(C==="--"){Y=r.slice(y+1);break}else if(a["halt-at-non-option"]){Y=r.slice(y);break}else D(C)}le(z,!0),le(z,!1),M(z),V(),qe(z,m.aliases,l,!0),K(z),a["set-placeholder-key"]&&fe(z),Object.keys(m.counts).forEach(function(y){X(z,y.split("."))||H(y,0)}),u&&Y.length&&(z[p]=[]),Y.forEach(function(y){z[p].push(y)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(z).filter(y=>y!=="--"&&y.includes("-")).forEach(y=>{delete z[y]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(y=>o[y])).forEach(y=>{a["camel-case-expansion"]&&y.includes("-")&&delete z[y.split(".").map(C=>wt(C)).join(".")],delete z[y]});function D(y){let C=_("_",y);(typeof C=="string"||typeof C=="number")&&z._.push(C)}function q(y,C,O,A){let w,j=R(C,m.nargs);if(j=typeof j!="number"||isNaN(j)?1:j,j===0)return pe(A)||(L=Error(b("Argument unexpected for: %s",C))),H(C,G(C)),y;let E=pe(A)?0:1;if(a["nargs-eats-options"])O.length-(y+1)+E<j&&(L=Error(b("Not enough arguments following: %s",C))),E=j;else{for(w=y+1;w<O.length&&(!O[w].match(/^-[^0-9]/)||O[w].match(x)||Q(O[w]));w++)E++;E<j&&(L=Error(b("Not enough arguments following: %s",C)))}let N=Math.min(E,j);for(!pe(A)&&N>0&&(H(C,A),N--),w=y+1;w<N+y+1;w++)H(C,O[w]);return y+N}function J(y,C,O,A){let w=[],j=A||O[y+1],E=R(C,m.nargs);if(R(C,m.bools)&&!/^(true|false)$/.test(j))w.push(!0);else if(pe(j)||pe(A)&&/^-/.test(j)&&!x.test(j)&&!Q(j)){if(l[C]!==void 0){let N=l[C];w=Array.isArray(N)?N:[N]}}else{pe(A)||w.push(P(C,A,!0));for(let N=y+1;N<O.length&&!(!a["greedy-arrays"]&&w.length>0||E&&typeof E=="number"&&w.length>=E||(j=O[N],/^-/.test(j)&&!x.test(j)&&!Q(j)));N++)y=N,w.push(P(C,j,s))}return typeof E=="number"&&(E&&w.length<E||isNaN(E)&&w.length===0)&&(L=Error(b("Not enough arguments following: %s",C))),H(C,w),y}function H(y,C,O=s){if(/-/.test(y)&&a["camel-case-expansion"]){let j=y.split(".").map(function(E){return wt(E)}).join(".");Oe(y,j)}let A=P(y,C,O),w=y.split(".");Be(z,w,A),m.aliases[y]&&m.aliases[y].forEach(function(j){let E=j.split(".");Be(z,E,A)}),w.length>1&&a["dot-notation"]&&(m.aliases[w[0]]||[]).forEach(function(j){let E=j.split("."),N=[].concat(w);N.shift(),E=E.concat(N),(m.aliases[y]||[]).includes(E.join("."))||Be(z,E,A)}),R(y,m.normalize)&&!R(y,m.arrays)&&[y].concat(m.aliases[y]||[]).forEach(function(E){Object.defineProperty(W,E,{enumerable:!0,get(){return C},set(N){C=typeof N=="string"?We.normalize(N):N}})})}function Oe(y,C){m.aliases[y]&&m.aliases[y].length||(m.aliases[y]=[C],h[C]=!0),m.aliases[C]&&m.aliases[C].length||Oe(C,y)}function P(y,C,O){O&&(C=fa(C)),(R(y,m.bools)||R(y,m.counts))&&typeof C=="string"&&(C=C==="true");let A=Array.isArray(C)?C.map(function(w){return _(y,w)}):_(y,C);return R(y,m.counts)&&(pe(A)||typeof A=="boolean")&&(A=oi()),R(y,m.normalize)&&R(y,m.arrays)&&(Array.isArray(C)?A=C.map(w=>We.normalize(w)):A=We.normalize(C)),A}function _(y,C){return!a["parse-positional-numbers"]&&y==="_"||!R(y,m.strings)&&!R(y,m.bools)&&!Array.isArray(C)&&(wn(C)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${C}`)))||!pe(C)&&R(y,m.numbers))&&(C=Number(C)),C}function M(y){let C=Object.create(null);qe(C,m.aliases,l),Object.keys(m.configs).forEach(function(O){let A=y[O]||C[O];if(A)try{let w=null,j=We.resolve(We.cwd(),A),E=m.configs[O];if(typeof E=="function"){try{w=E(j)}catch(N){w=N}if(w instanceof Error){L=w;return}}else w=We.require(j);B(w)}catch(w){w.name==="PermissionDenied"?L=w:y[O]&&(L=Error(b("Invalid JSON config file: %s",A)))}})}function B(y,C){Object.keys(y).forEach(function(O){let A=y[O],w=C?C+"."+O:O;typeof A=="object"&&A!==null&&!Array.isArray(A)&&a["dot-notation"]?B(A,w):(!X(z,w.split("."))||R(w,m.arrays)&&a["combine-arrays"])&&H(w,A)})}function V(){typeof c!="undefined"&&c.forEach(function(y){B(y)})}function le(y,C){if(typeof f=="undefined")return;let O=typeof f=="string"?f:"",A=We.env();Object.keys(A).forEach(function(w){if(O===""||w.lastIndexOf(O,0)===0){let j=w.split("__").map(function(E,N){return N===0&&(E=E.substring(O.length)),wt(E)});(C&&m.configs[j.join(".")]||!C)&&!X(y,j)&&H(j.join("."),A[w])}})}function K(y){let C,O=new Set;Object.keys(y).forEach(function(A){if(!O.has(A)&&(C=R(A,m.coercions),typeof C=="function"))try{let w=_(A,C(y[A]));[].concat(m.aliases[A]||[],A).forEach(j=>{O.add(j),y[j]=w})}catch(w){L=w}})}function fe(y){return m.keys.forEach(C=>{~C.indexOf(".")||typeof y[C]=="undefined"&&(y[C]=void 0)}),y}function qe(y,C,O,A=!1){Object.keys(O).forEach(function(w){X(y,w.split("."))||(Be(y,w.split("."),O[w]),A&&(g[w]=!0),(C[w]||[]).forEach(function(j){X(y,j.split("."))||Be(y,j.split("."),O[w])}))})}function X(y,C){let O=y;a["dot-notation"]||(C=[C.join(".")]),C.slice(0,-1).forEach(function(w){O=O[w]||{}});let A=C[C.length-1];return typeof O!="object"?!1:A in O}function Be(y,C,O){let A=y;a["dot-notation"]||(C=[C.join(".")]),C.slice(0,-1).forEach(function(he){he=dr(he),typeof A=="object"&&A[he]===void 0&&(A[he]={}),typeof A[he]!="object"||Array.isArray(A[he])?(Array.isArray(A[he])?A[he].push({}):A[he]=[A[he],{}],A=A[he][A[he].length-1]):A=A[he]});let w=dr(C[C.length-1]),j=R(C.join("."),m.arrays),E=Array.isArray(O),N=a["duplicate-arguments-array"];!N&&R(w,m.nargs)&&(N=!0,(!pe(A[w])&&m.nargs[w]===1||Array.isArray(A[w])&&A[w].length===m.nargs[w])&&(A[w]=void 0)),O===oi()?A[w]=oi(A[w]):Array.isArray(A[w])?N&&j&&E?A[w]=a["flatten-duplicate-arrays"]?A[w].concat(O):(Array.isArray(A[w][0])?A[w]:[A[w]]).concat([O]):!N&&Boolean(j)===Boolean(E)?A[w]=O:A[w]=A[w].concat([O]):A[w]===void 0&&j?A[w]=E?O:[O]:N&&!(A[w]===void 0||R(w,m.counts)||R(w,m.bools))?A[w]=[A[w],O]:A[w]=O}function en(...y){y.forEach(function(C){Object.keys(C||{}).forEach(function(O){m.aliases[O]||(m.aliases[O]=[].concat(o[O]||[]),m.aliases[O].concat(O).forEach(function(A){if(/-/.test(A)&&a["camel-case-expansion"]){let w=wt(A);w!==O&&m.aliases[O].indexOf(w)===-1&&(m.aliases[O].push(w),h[w]=!0)}}),m.aliases[O].concat(O).forEach(function(A){if(A.length>1&&/[A-Z]/.test(A)&&a["camel-case-expansion"]){let w=yn(A,"-");w!==O&&m.aliases[O].indexOf(w)===-1&&(m.aliases[O].push(w),h[w]=!0)}}),m.aliases[O].forEach(function(A){m.aliases[A]=[O].concat(m.aliases[O].filter(function(w){return A!==w}))}))})})}function R(y,C){let O=[].concat(m.aliases[y]||[],y),A=Object.keys(C),w=O.find(j=>A.includes(j));return w?C[w]:!1}function Rt(y){let C=Object.keys(m);return[].concat(C.map(A=>m[A])).some(function(A){return Array.isArray(A)?A.includes(y):A[y]})}function ir(y,...C){return[].concat(...C).some(function(A){let w=y.match(A);return w&&Rt(w[1])})}function $(y){if(y.match(x)||!y.match(/^-[^-]+/))return!1;let C=!0,O,A=y.slice(1).split("");for(let w=0;w<A.length;w++){if(O=y.slice(w+2),!Rt(A[w])){C=!1;break}if(A[w+1]&&A[w+1]==="="||O==="-"||/[A-Za-z]/.test(A[w])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(O)||A[w+1]&&A[w+1].match(/\W/))break}return C}function Q(y){return a["unknown-options-as-args"]&&ue(y)}function ue(y){return y=y.replace(/^-{3,}/,"--"),y.match(x)||$(y)?!1:!ir(y,/^-+([^=]+?)=[\s\S]*$/,v,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function G(y){return!R(y,m.bools)&&!R(y,m.counts)&&`${y}`in l?l[y]:ge(se(y))}function ge(y){return{[je.BOOLEAN]:!0,[je.STRING]:"",[je.NUMBER]:void 0,[je.ARRAY]:[]}[y]}function se(y){let C=je.BOOLEAN;return R(y,m.strings)?C=je.STRING:R(y,m.numbers)?C=je.NUMBER:R(y,m.bools)?C=je.BOOLEAN:R(y,m.arrays)&&(C=je.ARRAY),C}function pe(y){return y===void 0}function ti(){Object.keys(m.counts).find(y=>R(y,m.arrays)?(L=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",y)),!0):R(y,m.nargs)?(L=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",y)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(W,z),configuration:a,defaulted:Object.assign({},g),error:L,newAliases:Object.assign({},h)}}};function ca(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 oi(e){return e!==void 0?e+1:1}function dr(e){return e==="__proto__"?"___proto___":e}function fa(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 ha}from"fs";var hr=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])<hr)throw Error(`yargs parser supports a minimum Node.js version of ${hr}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var ma=process?process.env:{},mr=new Cn({cwd:process.cwd,env:()=>ma,format:ua,normalize:pa,resolve:da,require:e=>{if(typeof be!="undefined")return be(e);if(e.match(/\.json$/))return JSON.parse(ha(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),tn=function(t,n){return mr.parse(t.slice(),n).argv};tn.detailed=function(e,t){return mr.parse(e.slice(),t)};tn.camelCase=wt;tn.decamelize=yn;tn.looksLikeNumber=wn;var gr=tn;import{basename as Pa,dirname as Ma,extname as Fa,relative as La,resolve as Ar}from"path";function ga(){return ba()?0:1}function ba(){return ya()&&!process.defaultApp}function ya(){return!!process.versions.electron}function br(){return process.argv[ga()]}var Z=class extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,Z)}};import{readFileSync as wa,statSync as Ca,writeFile as Aa}from"fs";import{format as xa}from"util";import{resolve as va}from"path";var yr={fs:{readFileSync:wa,writeFile:Aa},format:xa,resolve:va,exists:e=>{try{return Ca(e).isFile()}catch(t){return!1}}};var De,si=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(),De.format.apply(De.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),De.format.apply(De.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);De.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{De.fs.readFileSync&&(t=JSON.parse(De.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=De.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(i)&&~n.lastIndexOf("_")){let r=De.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(r)&&(i=r)}return i}_fileExistsSync(t){return De.exists(t)}};function wr(e,t){De=t;let n=new si(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 Oa=e=>wr(e,yr),Cr=Oa;var Ta={},Da="require is not supported by ESM",xr="loading a directory of commands is not supported yet for ESM",nn;try{nn=ja(Ta.url)}catch(e){nn=process.cwd()}var Na=nn.substring(0,nn.lastIndexOf("node_modules")),vr={assert:{notStrictEqual:_a,strictEqual:Ea},cliui:ri,findUp:ur,getEnv:e=>process.env[e],inspect:Sa,getCallerFile:()=>{throw new Z(xr)},getProcessArgvBin:br,mainFilename:Na||process.cwd(),Parser:gr,path:{basename:Pa,dirname:Ma,extname:Fa,relative:La,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:Ia,require:()=>{throw new Z(Da)},requireDirectory:()=>{throw new Z(xr)},stringWidth:e=>[...e].length,y18n:Cr({directory:Ar(nn,"../../../locales"),updateFiles:!1})};function Ae(e,t,n,i){n.assert.notStrictEqual(e,t,i)}function ai(e,t){t.assert.strictEqual(typeof e,"string")}function $t(e){return Object.keys(e)}function ee(e){return!!e&&!!e.then&&typeof e.then=="function"}function Ke(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 Ra=["first","second","third","fourth","fifth","sixth"];function S(e,t,n){function i(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[Ke(`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 c=a||l.length;if(c<s.demanded.length)throw new Z(`Not enough arguments provided. Expected ${s.demanded.length} but received ${l.length}.`);let f=s.demanded.length+s.optional.length;if(c>f)throw new Z(`Too many arguments provided. Expected max ${f} but received ${c}.`);s.demanded.forEach(u=>{let p=l.shift(),h=Or(p);u.cmd.filter(b=>b===h||b==="*").length===0&&_r(h,u.cmd,r),r+=1}),s.optional.forEach(u=>{if(l.length===0)return;let p=l.shift(),h=Or(p);u.cmd.filter(b=>b===h||b==="*").length===0&&_r(h,u.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 Z(`Invalid ${Ra[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var An=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,i=!0,r=!1){if(S("<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 Ct(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(ee(r))return r.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(r,t);return ee(o)?o.then(a=>Object.assign(r,a)):Object.assign(r,o)}},e)}function At(e,t,n=i=>{throw i}){try{let i=$a(e)?e():e;return ee(i)?i.then(r=>t(r)):t(i)}catch(i){return n(i)}}function $a(e){return typeof e=="function"}function li(e){if(typeof be=="undefined")return null;for(let t=0,n=Object.keys(be.cache),i;t<n.length;t++)if(i=be.cache[n[t]],i.exports===e)return i;return null}var Ut=/(^\*)|(^\$0)/,ci=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 c=s(o,a,l);if(c){if(this.requireCache.has(a))return c;this.requireCache.add(a),this.addHandler(c)}return c},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(Ua(t))[t,...a]=t;else for(let c of t)this.addHandler(c);else if(Ba(t)){let c=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(c=[].concat(c).concat(t.aliases)),this.addHandler(c,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 c=Ke(t);a=a.map(p=>Ke(p).cmd);let f=!1,u=[c.cmd].concat(a).filter(p=>Ut.test(p)?(f=!0,!1):!0);u.length===0&&f&&u.push("$0"),f&&(c.cmd=u[0],a=u.slice(1),t=t.replace(Ut,c.cmd)),a.forEach(p=>{this.aliasMap[p]=c.cmd}),n!==!1&&this.usage.command(t,n,f,a,o),this.handlers[c.cmd]={original:t,description:n,handler:r,builder:i||{},middlewares:l,deprecated:o,demanded:c.demanded,optional:c.optional},f&&(this.defaultCommand=this.handlers[c.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(),c=l.commands.slice(),f=!t;t&&(l.commands.push(t),l.fullCommands.push(a.original));let u=this.applyBuilderUpdateUsageAndParse(f,a,n,i.aliases,c,r,s,o);return ee(u)?u.then(p=>this.applyMiddlewareAndGetResult(f,a,p.innerArgv,l,s,p.aliases,n)):this.applyMiddlewareAndGetResult(f,a,u.innerArgv,l,s,u.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,i,r,s,o,a,l){let c=n.builder,f=i;if(xn(c)){let u=c(i.getInternalMethods().reset(r),l);if(ee(u))return u.then(p=>(f=jr(p)?p:i,this.parseAndUpdateUsage(t,n,f,s,o,a)))}else Ha(c)&&(f=i.getInternalMethods().reset(r),Object.keys(n.builder).forEach(u=>{f.option(u,c[u])}));return this.parseAndUpdateUsage(t,n,f,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 ee(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=Ut.test(n.original)?n.original.replace(Ut,"").trim():n.original,r=t.filter(s=>!Ut.test(s));return r.push(i),`$0 ${r.join(" ")}`}handleValidationAndGetResult(t,n,i,r,s,o,a,l){if(!o.getInternalMethods().getHasOutput()){let c=o.getInternalMethods().runValidation(s,l,o.parsed.error,t);i=At(i,f=>(c(f),f))}if(n.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();let c=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(i,c,!1,!1),i=Ct(i,o,a,!1),i=At(i,f=>{let u=n.handler(f);return ee(u)?u.then(()=>f):f}),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),ee(i)&&!o.getInternalMethods().hasParseCallback()&&i.catch(f=>{try{o.getInternalMethods().getUsageInstance().fail(null,f)}catch(u){}})}return t||(r.commands.pop(),r.fullCommands.pop()),i}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 c=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares),f=Ct(i,a,c,!0);return ee(f)?f.then(u=>this.handleValidationAndGetResult(t,n,u,r,o,a,c,l)):this.handleValidationAndGetResult(t,n,f,r,o,a,c,l)}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=Ke(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 c of Object.keys(i.alias))s.alias[c]=(s.alias[c]||[]).concat(i.alias[c]);s.array=s.array.concat(i.array),s.config={};let o=[];if(Object.keys(n).forEach(c=>{n[c].map(f=>{s.configuration["unknown-options-as-args"]&&(s.key[c]=!0),o.push(`--${c}`),o.push(f)})}),!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 c=Object.keys(n);Object.keys(n).forEach(f=>{c.push(...l.aliases[f])}),Object.keys(l.argv).forEach(f=>{c.includes(f)&&(n[f]||(n[f]=l.argv[f]),!this.isInConfigs(r,f)&&!this.isDefaulted(r,f)&&Object.prototype.hasOwnProperty.call(t,f)&&Object.prototype.hasOwnProperty.call(l.argv,f)&&(Array.isArray(t[f])||Array.isArray(l.argv[f]))?t[f]=[].concat(t[f],l.argv[f]):t[f]=l.argv[f])})}}isDefaulted(t,n){let{default:i}=t.getOptions();return Object.prototype.hasOwnProperty.call(i,n)||Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(n))}isInConfigs(t,n){let{configObjects:i}=t.getOptions();return i.some(r=>Object.prototype.hasOwnProperty.call(r,n))||i.some(r=>Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(n)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let i=Ut.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(xn(n))return n(t,!0);Sr(n)||Object.keys(n).forEach(i=>{t.option(i,n[i])})}moduleName(t){let n=li(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;Ae(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();Ae(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 Ir(e,t,n,i){return new ci(e,t,n,i)}function Sr(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function Ua(e){return e.every(t=>typeof t=="string")}function xn(e){return typeof e=="function"}function Ha(e){return typeof e=="object"}function Ba(e){return typeof e=="object"&&!Array.isArray(e)}function Ve(e={},t=()=>!0){let n={};return $t(e).forEach(i=>{t(i,e[i])&&(n[i]=e[i])}),n}function Je(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 Wa(e){return typeof e=="boolean"}function Mr(e,t){let n=t.y18n.__,i={},r=[];i.failFn=function(_){r.push(_)};let s=null,o=null,a=!0;i.showHelpOnFail=function(_=!0,M){let[B,V]=typeof _=="string"?[!0,_]:[_,M];return e.getInternalMethods().isGlobalContext()&&(o=V),s=V,a=B,i};let l=!1;i.fail=function(_,M){let B=e.getInternalMethods().getLoggerInstance();if(r.length)for(let V=r.length-1;V>=0;--V){let le=r[V];if(Wa(le)){if(M)throw M;if(_)throw Error(_)}else le(_,M,i)}else{if(e.getExitProcess()&&Je(!0),!l){l=!0,a&&(e.showHelp("error"),B.error()),(_||M)&&B.error(_||M);let V=s||o;V&&((_||M)&&B.error(""),B.error(V))}if(M=M||new Z(_),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,M);throw M}};let c=[],f=!1;i.usage=(P,_)=>P===null?(f=!0,c=[],i):(f=!1,c.push([P,_||""]),i),i.getUsage=()=>c,i.getUsageDisabled=()=>f,i.getPositionalGroupName=()=>n("Positionals:");let u=[];i.example=(P,_)=>{u.push([P,_||""])};let p=[];i.command=function(_,M,B,V,le=!1){B&&(p=p.map(K=>(K[2]=!1,K))),p.push([_,M||"",B,V,le])},i.getCommands=()=>p;let h={};i.describe=function(_,M){Array.isArray(_)?_.forEach(B=>{i.describe(B,M)}):typeof _=="object"?Object.keys(_).forEach(B=>{i.describe(B,_[B])}):h[_]=M},i.getDescriptions=()=>h;let g=[];i.epilog=P=>{g.push(P)};let b=!1,m;i.wrap=P=>{b=!0,m=P};function x(){return b||(m=J(),b=!0),m}let v="__yargsString__:";i.deferY18nLookup=P=>v+P,i.help=function(){if(z)return z;Y();let _=e.customScriptName?e.$0:t.path.basename(e.$0),M=e.getDemandedOptions(),B=e.getDemandedCommands(),V=e.getDeprecatedOptions(),le=e.getGroups(),K=e.getOptions(),fe=[];fe=fe.concat(Object.keys(h)),fe=fe.concat(Object.keys(M)),fe=fe.concat(Object.keys(B)),fe=fe.concat(Object.keys(K.default)),fe=fe.filter(D),fe=Object.keys(fe.reduce(($,Q)=>(Q!=="_"&&($[Q]=!0),$),{}));let qe=x(),X=t.cliui({width:qe,wrap:!!qe});if(!f){if(c.length)c.forEach($=>{X.div({text:`${$[0].replace(/\$0/g,_)}`}),$[1]&&X.div({text:`${$[1]}`,padding:[1,0,0,0]})}),X.div();else if(p.length){let $=null;B._?$=`${_} <${n("command")}>
7
+ `:$=`${_} [${n("command")}]
8
+ `,X.div(`${$}`)}}if(p.length>1||p.length===1&&!p[0][2]){X.div(n("Commands:"));let $=e.getInternalMethods().getContext(),Q=$.commands.length?`${$.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(p=p.sort((G,ge)=>G[0].localeCompare(ge[0])));let ue=_?`${_} `:"";p.forEach(G=>{let ge=`${ue}${Q}${G[0].replace(/^\$0 ?/,"")}`;X.span({text:ge,padding:[0,2,0,2],width:L(p,qe,`${_}${Q}`)+4},{text:G[1]});let se=[];G[2]&&se.push(`[${n("default")}]`),G[3]&&G[3].length&&se.push(`[${n("aliases:")} ${G[3].join(", ")}]`),G[4]&&(typeof G[4]=="string"?se.push(`[${n("deprecated: %s",G[4])}]`):se.push(`[${n("deprecated")}]`)),se.length?X.div({text:se.join(" "),padding:[0,0,0,2],align:"right"}):X.div()}),X.div()}let Be=(Object.keys(K.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);fe=fe.filter($=>!e.parsed.newAliases[$]&&Be.every(Q=>(K.alias[Q]||[]).indexOf($)===-1));let en=n("Options:");le[en]||(le[en]=[]),W(fe,K.alias,le,en);let R=$=>/^--/.test(vn($)),Rt=Object.keys(le).filter($=>le[$].length>0).map($=>{let Q=le[$].filter(D).map(ue=>{if(Be.includes(ue))return ue;for(let G=0,ge;(ge=Be[G])!==void 0;G++)if((K.alias[ge]||[]).includes(ue))return ge;return ue});return{groupName:$,normalizedKeys:Q}}).filter(({normalizedKeys:$})=>$.length>0).map(({groupName:$,normalizedKeys:Q})=>{let ue=Q.reduce((G,ge)=>(G[ge]=[ge].concat(K.alias[ge]||[]).map(se=>$===i.getPositionalGroupName()?se:(/^[0-9]$/.test(se)?K.boolean.includes(ge)?"-":"--":se.length>1?"--":"-")+se).sort((se,pe)=>R(se)===R(pe)?0:R(se)?1:-1).join(", "),G),{});return{groupName:$,normalizedKeys:Q,switches:ue}});if(Rt.filter(({groupName:$})=>$!==i.getPositionalGroupName()).some(({normalizedKeys:$,switches:Q})=>!$.every(ue=>R(Q[ue])))&&Rt.filter(({groupName:$})=>$!==i.getPositionalGroupName()).forEach(({normalizedKeys:$,switches:Q})=>{$.forEach(ue=>{R(Q[ue])&&(Q[ue]=Ya(Q[ue],4))})}),Rt.forEach(({groupName:$,normalizedKeys:Q,switches:ue})=>{X.div($),Q.forEach(G=>{let ge=ue[G],se=h[G]||"",pe=null;se.includes(v)&&(se=n(se.substring(v.length))),K.boolean.includes(G)&&(pe=`[${n("boolean")}]`),K.count.includes(G)&&(pe=`[${n("count")}]`),K.string.includes(G)&&(pe=`[${n("string")}]`),K.normalize.includes(G)&&(pe=`[${n("string")}]`),K.array.includes(G)&&(pe=`[${n("array")}]`),K.number.includes(G)&&(pe=`[${n("number")}]`);let ti=C=>typeof C=="string"?`[${n("deprecated: %s",C)}]`:`[${n("deprecated")}]`,y=[G in V?ti(V[G]):null,pe,G in M?`[${n("required")}]`:null,K.choices&&K.choices[G]?`[${n("choices:")} ${i.stringifiedValues(K.choices[G])}]`:null,q(K.default[G],K.defaultDescription[G])].filter(Boolean).join(" ");X.span({text:vn(ge),padding:[0,2,0,2+Pr(ge)],width:L(ue,qe)+4},se),y?X.div({text:y,padding:[0,0,0,2],align:"right"}):X.div()}),X.div()}),u.length&&(X.div(n("Examples:")),u.forEach($=>{$[0]=$[0].replace(/\$0/g,_)}),u.forEach($=>{$[1]===""?X.div({text:$[0],padding:[0,2,0,2]}):X.div({text:$[0],padding:[0,2,0,2],width:L(u,qe)+4},{text:$[1]})}),X.div()),g.length>0){let $=g.map(Q=>Q.replace(/\$0/g,_)).join(`
9
+ `);X.div(`${$}
10
+ `)}return X.toString().replace(/\s*$/,"")};function L(P,_,M){let B=0;return Array.isArray(P)||(P=Object.values(P).map(V=>[V])),P.forEach(V=>{B=Math.max(t.stringWidth(M?`${M} ${vn(V[0])}`:vn(V[0]))+Pr(V[0]),B)}),_&&(B=Math.min(B,parseInt((_*.5).toString(),10))),B}function Y(){let P=e.getDemandedOptions(),_=e.getOptions();(Object.keys(_.alias)||[]).forEach(M=>{_.alias[M].forEach(B=>{h[B]&&i.describe(M,h[B]),B in P&&e.demandOption(M,P[B]),_.boolean.includes(B)&&e.boolean(M),_.count.includes(B)&&e.count(M),_.string.includes(B)&&e.string(M),_.normalize.includes(B)&&e.normalize(M),_.array.includes(B)&&e.array(M),_.number.includes(B)&&e.number(M)})})}let z;i.cacheHelpMessage=function(){z=this.help()},i.clearCachedHelpMessage=function(){z=void 0},i.hasCachedHelpMessage=function(){return!!z};function W(P,_,M,B){let V=[],le=null;return Object.keys(M).forEach(K=>{V=V.concat(M[K])}),P.forEach(K=>{le=[K].concat(_[K]),le.some(fe=>V.indexOf(fe)!==-1)||M[B].push(K)}),V}function D(P){return e.getOptions().hiddenOptions.indexOf(P)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}i.showHelp=P=>{let _=e.getInternalMethods().getLoggerInstance();P||(P="error"),(typeof P=="function"?P:_[P])(i.help())},i.functionDescription=P=>{let _=P.name?t.Parser.decamelize(P.name,"-"):n("generated-value");return["(",_,")"].join("")},i.stringifiedValues=function(_,M){let B="",V=M||", ",le=[].concat(_);return!_||!le.length||le.forEach(K=>{B.length&&(B+=V),B+=JSON.stringify(K)}),B};function q(P,_){let M=`[${n("default:")} `;if(P===void 0&&!_)return null;if(_)M+=_;else switch(typeof P){case"string":M+=`"${P}"`;break;case"object":M+=JSON.stringify(P);break;default:M+=P}return`${M}]`}function J(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let H=null;i.version=P=>{H=P},i.showVersion=P=>{let _=e.getInternalMethods().getLoggerInstance();P||(P="error"),(typeof P=="function"?P:_[P])(H)},i.reset=function(_){return s=null,l=!1,c=[],f=!1,g=[],u=[],p=[],h=Ve(h,M=>!_[M]),i};let Oe=[];return i.freeze=function(){Oe.push({failMessage:s,failureOutput:l,usages:c,usageDisabled:f,epilogs:g,examples:u,commands:p,descriptions:h})},i.unfreeze=function(_=!1){let M=Oe.pop();!M||(_?(h={...M.descriptions,...h},p=[...M.commands,...p],c=[...M.usages,...c],u=[...M.examples,...u],g=[...M.epilogs,...g]):{failMessage:s,failureOutput:l,usages:c,usageDisabled:f,epilogs:g,examples:u,commands:p,descriptions:h}=M)},i}function fi(e){return typeof e=="object"}function Ya(e,t){return fi(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function Pr(e){return fi(e)?e.indentation:0}function vn(e){return fi(e)?e.text:e}var Fr=`###-begin-{{app_name}}-completions-###
11
11
  #
12
12
  # yargs command completion script
13
13
  #
@@ -35,7 +35,7 @@ _{{app_name}}_yargs_completions()
35
35
  }
36
36
  complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
37
37
  ###-end-{{app_name}}-completions-###
38
- `,Rr=`#compdef {{app_name}}
38
+ `,Lr=`#compdef {{app_name}}
39
39
  ###-begin-{{app_name}}-completions-###
40
40
  #
41
41
  # yargs command completion script
@@ -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 mi=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 c=s[t[a]].builder;if(En(c)){this.indexAfterLastReset=a+1;let f=this.yargs.getInternalMethods().reset();return c(f,!0),f.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)&&!s.hiddenOptions.includes(a)&&!this.argsContainKey(n,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.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(t,n,i,r){if(r===""&&t.length>0&&this.previousArgHasChoices(n))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=s[i._.length-o-1];if(!a)return;let l=this.yargs.getOptions().choices[a]||[];for(let c of l)c.startsWith(r)&&t.push(c.replace(/:/g,"\\:"))}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){let r=s=>t.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1;if(r(n)||i&&r(`no-${n}`))return!0;if(this.aliases){for(let s of this.aliases[n])if(r(s))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(_e(this.customCompletionFunction,null,this.shim),Va(this.customCompletionFunction)){let s=this.customCompletionFunction(i,n);return ie(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 Ja(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 ie(r)?r.then(s):s(r)}generateCompletionScript(t,n){let i=this.zshShell?Rr:Tr,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 $r(e,t,n,i){return new mi(e,t,n,i)}function Va(e){return e.length<3}function Ja(e){return e.length>3}A();A();function Ur(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 Hr=["$0","--","_"];function Br(e,t,n){let i=n.y18n.__,r=n.y18n.__n,s={};s.nonOptionCount=function(u){let p=e.getDemandedCommands(),g=u._.length+(u["--"]?u["--"].length:0)-e.getInternalMethods().getContext().commands.length;p._&&(g<p._.min||g>p._.max)&&(g<p._.min?p._.minMsg!==void 0?t.fail(p._.minMsg?p._.minMsg.replace(/\$0/g,g.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",g,g.toString(),p._.min.toString())):g>p._.max&&(p._.maxMsg!==void 0?t.fail(p._.maxMsg?p._.maxMsg.replace(/\$0/g,g.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",g,g.toString(),p._.max.toString()))))},s.positionalCount=function(u,p){p<u&&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+"",u+""))},s.requiredArguments=function(u,p){let h=null;for(let g of Object.keys(p))(!Object.prototype.hasOwnProperty.call(u,g)||typeof u[g]=="undefined")&&(h=h||{},h[g]=p[g]);if(h){let g=[];for(let m of Object.keys(h)){let v=h[m];v&&g.indexOf(v)<0&&g.push(v)}let b=g.length?`
57
+ `;var ui=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 c=s[t[a]].builder;if(xn(c)){this.indexAfterLastReset=a+1;let f=this.yargs.getInternalMethods().reset();return c(f,!0),f.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=Ke(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)&&!s.hiddenOptions.includes(a)&&!this.argsContainKey(n,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.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(t,n,i,r){if(r===""&&t.length>0&&this.previousArgHasChoices(n))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=s[i._.length-o-1];if(!a)return;let l=this.yargs.getOptions().choices[a]||[];for(let c of l)c.startsWith(r)&&t.push(c.replace(/:/g,"\\:"))}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){let r=s=>t.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1;if(r(n)||i&&r(`no-${n}`))return!0;if(this.aliases){for(let s of this.aliases[n])if(r(s))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(Ae(this.customCompletionFunction,null,this.shim),za(this.customCompletionFunction)){let s=this.customCompletionFunction(i,n);return ee(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 Ga(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 ee(r)?r.then(s):s(r)}generateCompletionScript(t,n){let i=this.zshShell?Lr:Fr,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 Dr(e,t,n,i){return new ui(e,t,n,i)}function za(e){return e.length<3}function Ga(e){return e.length>3}function Nr(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 Tr=["$0","--","_"];function Rr(e,t,n){let i=n.y18n.__,r=n.y18n.__n,s={};s.nonOptionCount=function(u){let p=e.getDemandedCommands(),g=u._.length+(u["--"]?u["--"].length:0)-e.getInternalMethods().getContext().commands.length;p._&&(g<p._.min||g>p._.max)&&(g<p._.min?p._.minMsg!==void 0?t.fail(p._.minMsg?p._.minMsg.replace(/\$0/g,g.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",g,g.toString(),p._.min.toString())):g>p._.max&&(p._.maxMsg!==void 0?t.fail(p._.maxMsg?p._.maxMsg.replace(/\$0/g,g.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",g,g.toString(),p._.max.toString()))))},s.positionalCount=function(u,p){p<u&&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+"",u+""))},s.requiredArguments=function(u,p){let h=null;for(let g of Object.keys(p))(!Object.prototype.hasOwnProperty.call(u,g)||typeof u[g]=="undefined")&&(h=h||{},h[g]=p[g]);if(h){let g=[];for(let m of Object.keys(h)){let x=h[m];x&&g.indexOf(x)<0&&g.push(x)}let b=g.length?`
58
58
  ${g.join(`
59
- `)}`:"";t.fail(r("Missing required argument: %s","Missing required arguments: %s",Object.keys(h).length,Object.keys(h).join(", ")+b))}},s.unknownArguments=function(u,p,h,g,b=!0){var m;let v=e.getInternalMethods().getCommandInstance().getCommands(),O=[],N=e.getInternalMethods().getContext();if(Object.keys(u).forEach(G=>{!Hr.includes(G)&&!Object.prototype.hasOwnProperty.call(h,G)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),G)&&!s.isValidAndSomeAliasIsNotNew(G,p)&&O.push(G)}),b&&(N.commands.length>0||v.length>0||g)&&u._.slice(N.commands.length).forEach(G=>{v.includes(""+G)||O.push(""+G)}),b){let K=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,z=N.commands.length+K;z<u._.length&&u._.slice(z).forEach(T=>{T=String(T),!N.commands.includes(T)&&!O.includes(T)&&O.push(T)})}O.length&&t.fail(r("Unknown argument: %s","Unknown arguments: %s",O.length,O.map(G=>G.trim()?G:`"${G}"`).join(", ")))},s.unknownCommands=function(u){let p=e.getInternalMethods().getCommandInstance().getCommands(),h=[],g=e.getInternalMethods().getContext();return(g.commands.length>0||p.length>0)&&u._.slice(g.commands.length).forEach(b=>{p.includes(""+b)||h.push(""+b)}),h.length>0?(t.fail(r("Unknown command: %s","Unknown commands: %s",h.length,h.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(u,p){if(!Object.prototype.hasOwnProperty.call(p,u))return!1;let h=e.parsed.newAliases;return[u,...p[u]].some(g=>!Object.prototype.hasOwnProperty.call(h,g)||!h[u])},s.limitedChoices=function(u){let p=e.getOptions(),h={};if(!Object.keys(p.choices).length)return;Object.keys(u).forEach(m=>{Hr.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(p.choices,m)&&[].concat(u[m]).forEach(v=>{p.choices[m].indexOf(v)===-1&&v!==void 0&&(h[m]=(h[m]||[]).concat(v))})});let g=Object.keys(h);if(!g.length)return;let b=i("Invalid values:");g.forEach(m=>{b+=`
60
- ${i("Argument: %s, Given: %s, Choices: %s",m,t.stringifiedValues(h[m]),t.stringifiedValues(p.choices[m]))}`}),t.fail(b)};let o={};s.implies=function(u,p){I("<string|object> [array|number|string]",[u,p],arguments.length),typeof u=="object"?Object.keys(u).forEach(h=>{s.implies(h,u[h])}):(e.global(u),o[u]||(o[u]=[]),Array.isArray(p)?p.forEach(h=>s.implies(u,h)):(_e(p,void 0,n),o[u].push(p)))},s.getImplied=function(){return o};function a(f,u){let p=Number(u);return u=isNaN(p)?u:p,typeof u=="number"?u=f._.length>=u:u.match(/^--no-.+/)?(u=u.match(/^--no-(.+)/)[1],u=!Object.prototype.hasOwnProperty.call(f,u)):u=Object.prototype.hasOwnProperty.call(f,u),u}s.implications=function(u){let p=[];if(Object.keys(o).forEach(h=>{let g=h;(o[h]||[]).forEach(b=>{let m=g,v=b;m=a(u,m),b=a(u,b),m&&!b&&p.push(` ${g} -> ${v}`)})}),p.length){let h=`${i("Implications failed:")}
61
- `;p.forEach(g=>{h+=g}),t.fail(h)}};let l={};s.conflicts=function(u,p){I("<string|object> [array|string]",[u,p],arguments.length),typeof u=="object"?Object.keys(u).forEach(h=>{s.conflicts(h,u[h])}):(e.global(u),l[u]||(l[u]=[]),Array.isArray(p)?p.forEach(h=>s.conflicts(u,h)):l[u].push(p))},s.getConflicting=()=>l,s.conflicting=function(u){Object.keys(u).forEach(p=>{l[p]&&l[p].forEach(h=>{h&&u[p]!==void 0&&u[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&&u[n.Parser.camelCase(p)]!==void 0&&u[n.Parser.camelCase(h)]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,h))})})},s.recommendCommands=function(u,p){p=p.sort((m,v)=>v.length-m.length);let g=null,b=1/0;for(let m=0,v;(v=p[m])!==void 0;m++){let O=Ur(u,v);O<=3&&O<b&&(b=O,g=v)}g&&t.fail(i("Did you mean %s?",g))},s.reset=function(u){return o=Xe(o,p=>!u[p]),l=Xe(l,p=>!u[p]),s};let c=[];return s.freeze=function(){c.push({implied:o,conflicting:l})},s.unfreeze=function(){let u=c.pop();_e(u,void 0,n),{implied:o,conflicting:l}=u},s}A();var gi=[],ln;function In(e,t,n,i){ln=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=Za(t,e.extends);else try{o=Ae.resolve(e.extends)}catch(a){return e}Qa(o),gi.push(o),r=s?JSON.parse(ln.readFileSync(o,"utf8")):Ae(e.extends),delete e.extends,r=In(r,ln.path.dirname(o),n,ln)}return gi=[],n?Wr(r,e):Object.assign({},r,e)}function Qa(e){if(gi.indexOf(e)>-1)throw new te(`Circular extended configurations: '${e}'.`)}function Za(e,t){return ln.path.resolve(e,t)}function Wr(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]=Wr(e[r],t[r]):n[r]=t[r];return n}var j=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)},fe,Et,cn,De,Pe,jn,tt,St,Pn,Ne,Mn,Te,Ue,Me,Re,Fn,kt,ye,D,Ln,Dn,Fe,It,zt,jt,nt,Nn,W,Pt,Mt,Ft,q,He,le;function ao(e){return(t=[],n=e.process.cwd(),i)=>{let r=new Si(t,n,i,e);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Yr=Symbol("copyDoubleDash"),kr=Symbol("copyDoubleDash"),bi=Symbol("deleteFromParserHintObject"),zr=Symbol("emitWarning"),Gr=Symbol("freeze"),qr=Symbol("getDollarZero"),Lt=Symbol("getParserConfiguration"),yi=Symbol("guessLocale"),Kr=Symbol("guessVersion"),Vr=Symbol("parsePositionalNumbers"),wi=Symbol("pkgUp"),it=Symbol("populateParserHintArray"),Gt=Symbol("populateParserHintSingleValueDictionary"),Ci=Symbol("populateParserHintArrayDictionary"),Ai=Symbol("populateParserHintDictionary"),xi=Symbol("sanitizeKey"),vi=Symbol("setKey"),Oi=Symbol("unfreeze"),Jr=Symbol("validateAsync"),Qr=Symbol("getCommandInstance"),Zr=Symbol("getContext"),Xr=Symbol("getHasOutput"),eo=Symbol("getLoggerInstance"),to=Symbol("getParseContext"),no=Symbol("getUsageInstance"),io=Symbol("getValidationInstance"),Tn=Symbol("hasParseCallback"),ro=Symbol("isGlobalContext"),Dt=Symbol("postProcess"),oo=Symbol("rebase"),_i=Symbol("reset"),fn=Symbol("runYargsParserAndExecuteCommands"),Ei=Symbol("runValidation"),so=Symbol("setHasOutput"),Nt=Symbol("kTrackManuallySetKeys"),Si=class{constructor(t=[],n,i,r){this.customScriptName=!1,this.parsed=!1,fe.set(this,void 0),Et.set(this,void 0),cn.set(this,{commands:[],fullCommands:[]}),De.set(this,null),Pe.set(this,null),jn.set(this,"show-hidden"),tt.set(this,null),St.set(this,!0),Pn.set(this,{}),Ne.set(this,!0),Mn.set(this,[]),Te.set(this,void 0),Ue.set(this,{}),Me.set(this,!1),Re.set(this,null),Fn.set(this,!0),kt.set(this,void 0),ye.set(this,""),D.set(this,void 0),Ln.set(this,void 0),Dn.set(this,{}),Fe.set(this,null),It.set(this,null),zt.set(this,{}),jt.set(this,{}),nt.set(this,void 0),Nn.set(this,!1),W.set(this,void 0),Pt.set(this,!1),Mt.set(this,!1),Ft.set(this,!1),q.set(this,void 0),He.set(this,null),le.set(this,void 0),j(this,W,r,"f"),j(this,nt,t,"f"),j(this,Et,n,"f"),j(this,Ln,i,"f"),j(this,Te,new _n(this),"f"),this.$0=this[qr](),this[_i](),j(this,fe,d(this,fe,"f"),"f"),j(this,q,d(this,q,"f"),"f"),j(this,le,d(this,le,"f"),"f"),j(this,D,d(this,D,"f"),"f"),d(this,D,"f").showHiddenOpt=d(this,jn,"f"),j(this,kt,this[kr](),"f")}addHelpOpt(t,n){let i="help";return I("[string|boolean] [string]",[t,n],arguments.length),d(this,Re,"f")&&(this[bi](d(this,Re,"f")),j(this,Re,null,"f")),t===!1&&n===void 0?this:(j(this,Re,typeof t=="string"?t:i,"f"),this.boolean(d(this,Re,"f")),this.describe(d(this,Re,"f"),n||d(this,q,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(I("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let i=typeof t=="string"?t:d(this,jn,"f");return this.boolean(i),this.describe(i,n||d(this,q,"f").deferY18nLookup("Show hidden options")),d(this,D,"f").showHiddenOpt=i,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return I("<object|string|array> [string|array]",[t,n],arguments.length),this[Ci](this.alias.bind(this),"alias",t,n),this}array(t){return I("<array|string>",[t],arguments.length),this[it]("array",t),this[Nt](t),this}boolean(t){return I("<array|string>",[t],arguments.length),this[it]("boolean",t),this[Nt](t),this}check(t,n){return I("<function> [boolean]",[t,n],arguments.length),this.middleware((i,r)=>_t(()=>t(i,r.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&d(this,q,"f").fail(s.toString(),s):d(this,q,"f").fail(d(this,W,"f").y18n.__("Argument check failed: %s",t.toString())),i),s=>(d(this,q,"f").fail(s.message?s.message:s.toString(),s),i)),!1,n),this}choices(t,n){return I("<object|string|array> [string|array]",[t,n],arguments.length),this[Ci](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(I("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new te("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 te("coerce callback must be provided");return d(this,D,"f").key[t]=!0,d(this,Te,"f").addCoerceMiddleware((i,r)=>{let s;return Object.prototype.hasOwnProperty.call(i,t)?_t(()=>(s=r.getAliases(),n(i[t])),a=>{i[t]=a;let l=r.getInternalMethods().getParserConfiguration()["strip-aliased"];if(s[t]&&l!==!0)for(let c of s[t])i[c]=a;return i},a=>{throw new te(a.message)}):i},t),this}conflicts(t,n){return I("<string|object> [string|array]",[t,n],arguments.length),d(this,le,"f").conflicts(t,n),this}config(t="config",n,i){return I("[object|string] [string|function] [function]",[t,n,i],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=In(t,d(this,Et,"f"),this[Lt]()["deep-merge-config"]||!1,d(this,W,"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,q,"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 I("[string] [string|boolean|function] [function]",[t,n,i],arguments.length),typeof n=="function"&&(i=n,n=void 0),j(this,Pe,t||d(this,Pe,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(d(this,Pe,"f"),n),i&&d(this,De,"f").registerFunction(i),this}command(t,n,i,r,s,o){return I("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,i,r,s,o],arguments.length),d(this,fe,"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){I("<string> [object]",[t,n],arguments.length);let i=d(this,Ln,"f")||d(this,W,"f").require;return d(this,fe,"f").addDirectory(t,i,d(this,W,"f").getCallerFile(),n),this}count(t){return I("<array|string>",[t],arguments.length),this[it]("count",t),this[Nt](t),this}default(t,n,i){return I("<object|string|array> [*] [string]",[t,n,i],arguments.length),i&&(ui(t,d(this,W,"f")),d(this,D,"f").defaultDescription[t]=i),typeof n=="function"&&(ui(t,d(this,W,"f")),d(this,D,"f").defaultDescription[t]||(d(this,D,"f").defaultDescription[t]=d(this,q,"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 I("[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=>{_e(i,!0,d(this,W,"f")),this.demandOption(r,i)}),n=1/0):typeof n!="number"&&(i=n,n=1/0),typeof t=="number"?(_e(i,!0,d(this,W,"f")),this.demandCommand(t,n,i,i)):Array.isArray(t)?t.forEach(r=>{_e(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 I("<object|string|array> [string]",[t,n],arguments.length),this[Gt](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return I("<string> [string|boolean]",[t,n],arguments.length),d(this,D,"f").deprecatedOptions[t]=n,this}describe(t,n){return I("<object|string|array> [string]",[t,n],arguments.length),this[vi](t,!0),d(this,q,"f").describe(t,n),this}detectLocale(t){return I("<boolean>",[t],arguments.length),j(this,St,t,"f"),this}env(t){return I("[string|boolean]",[t],arguments.length),t===!1?delete d(this,D,"f").envPrefix:d(this,D,"f").envPrefix=t||"",this}epilogue(t){return I("<string>",[t],arguments.length),d(this,q,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return I("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(i=>this.example(...i)):d(this,q,"f").example(t,n),this}exit(t,n){j(this,Me,!0,"f"),j(this,tt,n,"f"),d(this,Ne,"f")&&d(this,W,"f").process.exit(t)}exitProcess(t=!0){return I("[boolean]",[t],arguments.length),j(this,Ne,t,"f"),this}fail(t){if(I("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new te("Invalid first argument. Expected function or boolean 'false'");return d(this,q,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return I("<array> [function]",[t,n],arguments.length),n?d(this,De,"f").getCompletion(t,n):new Promise((i,r)=>{d(this,De,"f").getCompletion(t,(s,o)=>{s?r(s):i(o)})})}getDemandedOptions(){return I([],0),d(this,D,"f").demandedOptions}getDemandedCommands(){return I([],0),d(this,D,"f").demandedCommands}getDeprecatedOptions(){return I([],0),d(this,D,"f").deprecatedOptions}getDetectLocale(){return d(this,St,"f")}getExitProcess(){return d(this,Ne,"f")}getGroups(){return Object.assign({},d(this,Ue,"f"),d(this,jt,"f"))}getHelp(){if(j(this,Me,!0,"f"),!d(this,q,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[fn](d(this,nt,"f"),void 0,void 0,0,!0);if(ie(n))return n.then(()=>d(this,q,"f").help())}let t=d(this,fe,"f").runDefaultBuilderOn(this);if(ie(t))return t.then(()=>d(this,q,"f").help())}return Promise.resolve(d(this,q,"f").help())}getOptions(){return d(this,D,"f")}getStrict(){return d(this,Pt,"f")}getStrictCommands(){return d(this,Mt,"f")}getStrictOptions(){return d(this,Ft,"f")}global(t,n){return I("<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){I("<string|array> <string>",[t,n],arguments.length);let i=d(this,jt,"f")[n]||d(this,Ue,"f")[n];d(this,jt,"f")[n]&&delete d(this,jt,"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 I("<string>",[t],arguments.length),d(this,D,"f").hiddenOptions.push(t),this}implies(t,n){return I("<string|object> [number|string|array]",[t,n],arguments.length),d(this,le,"f").implies(t,n),this}locale(t){return I("[string]",[t],arguments.length),t===void 0?(this[yi](),d(this,W,"f").y18n.getLocale()):(j(this,St,!1,"f"),d(this,W,"f").y18n.setLocale(t),this)}middleware(t,n,i){return d(this,Te,"f").addMiddleware(t,!!n,i)}nargs(t,n){return I("<string|object|array> [number]",[t,n],arguments.length),this[Gt](this.nargs.bind(this),"narg",t,n),this}normalize(t){return I("<array|string>",[t],arguments.length),this[it]("normalize",t),this}number(t){return I("<array|string>",[t],arguments.length),this[it]("number",t),this[Nt](t),this}option(t,n){if(I("<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[Nt](t),d(this,He,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[zr](['"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){I("[string|array] [function|boolean|object] [function]",[t,n,i],arguments.length),this[Gr](),typeof t=="undefined"&&(t=d(this,nt,"f")),typeof n=="object"&&(j(this,It,n,"f"),n=i),typeof n=="function"&&(j(this,Fe,n,"f"),n=!1),n||j(this,nt,t,"f"),d(this,Fe,"f")&&j(this,Ne,!1,"f");let r=this[fn](t,!!n),s=this.parsed;return d(this,De,"f").setParsed(this.parsed),ie(r)?r.then(o=>(d(this,Fe,"f")&&d(this,Fe,"f").call(this,d(this,tt,"f"),o,d(this,ye,"f")),o)).catch(o=>{throw d(this,Fe,"f")&&d(this,Fe,"f")(o,this.parsed.argv,d(this,ye,"f")),o}).finally(()=>{this[Oi](),this.parsed=s}):(d(this,Fe,"f")&&d(this,Fe,"f").call(this,d(this,tt,"f"),r,d(this,ye,"f")),this[Oi](),this.parsed=s,r)}parseAsync(t,n,i){let r=this.parse(t,n,i);return ie(r)?r:Promise.resolve(r)}parseSync(t,n,i){let r=this.parse(t,n,i);if(ie(r))throw new te(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(t){return I("<object>",[t],arguments.length),j(this,Dn,t,"f"),this}pkgConf(t,n){I("<string> [string]",[t,n],arguments.length);let i=null,r=this[wi](n||d(this,Et,"f"));return r[t]&&typeof r[t]=="object"&&(i=In(r[t],n||d(this,Et,"f"),this[Lt]()["deep-merge-config"]||!1,d(this,W,"f")),d(this,D,"f").configObjects=(d(this,D,"f").configObjects||[]).concat(i)),this}positional(t,n){I("<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,cn,"f").fullCommands[d(this,cn,"f").fullCommands.length-1],s=r?d(this,fe,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return Wt(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,q,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return I("[boolean]",[t],arguments.length),j(this,Nn,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 I("<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 I("[string] [string]",[t,n],arguments.length),t=t||this.$0,d(this,kt,"f").log(d(this,De,"f").generateCompletionScript(t,n||d(this,Pe,"f")||"completion")),this}showHelp(t){if(I("[string|function]",[t],arguments.length),j(this,Me,!0,"f"),!d(this,q,"f").hasCachedHelpMessage()){if(!this.parsed){let i=this[fn](d(this,nt,"f"),void 0,void 0,0,!0);if(ie(i))return i.then(()=>{d(this,q,"f").showHelp(t)}),this}let n=d(this,fe,"f").runDefaultBuilderOn(this);if(ie(n))return n.then(()=>{d(this,q,"f").showHelp(t)}),this}return d(this,q,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return I("[boolean|string] [string]",[t,n],arguments.length),d(this,q,"f").showHelpOnFail(t,n),this}showVersion(t){return I("[string|function]",[t],arguments.length),d(this,q,"f").showVersion(t),this}skipValidation(t){return I("<array|string>",[t],arguments.length),this[it]("skipValidation",t),this}strict(t){return I("[boolean]",[t],arguments.length),j(this,Pt,t!==!1,"f"),this}strictCommands(t){return I("[boolean]",[t],arguments.length),j(this,Mt,t!==!1,"f"),this}strictOptions(t){return I("[boolean]",[t],arguments.length),j(this,Ft,t!==!1,"f"),this}string(t){return I("<array|string>",[t],arguments.length),this[it]("string",t),this[Nt](t),this}terminalWidth(){return I([],0),d(this,W,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return I("<object>",[t],arguments.length),j(this,St,!1,"f"),d(this,W,"f").y18n.updateLocale(t),this}usage(t,n,i,r){if(I("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,i,r],arguments.length),n!==void 0){if(_e(t,null,d(this,W,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,i,r);throw new te(".usage() description must start with $0 if being used as alias for .command()")}else return d(this,q,"f").usage(t),this}version(t,n,i){let r="version";if(I("[boolean|string] [string] [string]",[t,n,i],arguments.length),d(this,He,"f")&&(this[bi](d(this,He,"f")),d(this,q,"f").version(void 0),j(this,He,null,"f")),arguments.length===0)i=this[Kr](),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 j(this,He,typeof t=="string"?t:r,"f"),n=n||d(this,q,"f").deferY18nLookup("Show version number"),d(this,q,"f").version(i||void 0),this.boolean(d(this,He,"f")),this.describe(d(this,He,"f"),n),this}wrap(t){return I("<number|null|undefined>",[t],arguments.length),d(this,q,"f").wrap(t),this}[(fe=new WeakMap,Et=new WeakMap,cn=new WeakMap,De=new WeakMap,Pe=new WeakMap,jn=new WeakMap,tt=new WeakMap,St=new WeakMap,Pn=new WeakMap,Ne=new WeakMap,Mn=new WeakMap,Te=new WeakMap,Ue=new WeakMap,Me=new WeakMap,Re=new WeakMap,Fn=new WeakMap,kt=new WeakMap,ye=new WeakMap,D=new WeakMap,Ln=new WeakMap,Dn=new WeakMap,Fe=new WeakMap,It=new WeakMap,zt=new WeakMap,jt=new WeakMap,nt=new WeakMap,Nn=new WeakMap,W=new WeakMap,Pt=new WeakMap,Mt=new WeakMap,Ft=new WeakMap,q=new WeakMap,He=new WeakMap,le=new WeakMap,Yr)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[kr](){return{log:(...t)=>{this[Tn]()||console.log(...t),j(this,Me,!0,"f"),d(this,ye,"f").length&&j(this,ye,d(this,ye,"f")+`
63
- `,"f"),j(this,ye,d(this,ye,"f")+t.join(" "),"f")},error:(...t)=>{this[Tn]()||console.error(...t),j(this,Me,!0,"f"),d(this,ye,"f").length&&j(this,ye,d(this,ye,"f")+`
64
- `,"f"),j(this,ye,d(this,ye,"f")+t.join(" "),"f")}}}[bi](t){Wt(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,q,"f").getDescriptions()[t]}[zr](t,n,i){d(this,Pn,"f")[i]||(d(this,W,"f").process.emitWarning(t,n),d(this,Pn,"f")[i]=!0)}[Gr](){d(this,Mn,"f").push({options:d(this,D,"f"),configObjects:d(this,D,"f").configObjects.slice(0),exitProcess:d(this,Ne,"f"),groups:d(this,Ue,"f"),strict:d(this,Pt,"f"),strictCommands:d(this,Mt,"f"),strictOptions:d(this,Ft,"f"),completionCommand:d(this,Pe,"f"),output:d(this,ye,"f"),exitError:d(this,tt,"f"),hasOutput:d(this,Me,"f"),parsed:this.parsed,parseFn:d(this,Fe,"f"),parseContext:d(this,It,"f")}),d(this,q,"f").freeze(),d(this,le,"f").freeze(),d(this,fe,"f").freeze(),d(this,Te,"f").freeze()}[qr](){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[oo](d(this,Et,"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}[Lt](){return d(this,Dn,"f")}[yi](){if(!d(this,St,"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(/[.:].*/,""))}[Kr](){return this[wi]().version||"unknown"}[Vr](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}[wi](t){let n=t||"*";if(d(this,zt,"f")[n])return d(this,zt,"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"});_e(s,void 0,d(this,W,"f")),i=JSON.parse(d(this,W,"f").readFileSync(s,"utf8"))}catch(r){}return d(this,zt,"f")[n]=i||{},d(this,zt,"f")[n]}[it](t,n){n=[].concat(n),n.forEach(i=>{i=this[xi](i),d(this,D,"f")[t].push(i)})}[Gt](t,n,i,r){this[Ai](t,n,i,r,(s,o,a)=>{d(this,D,"f")[s][o]=a})}[Ci](t,n,i,r){this[Ai](t,n,i,r,(s,o,a)=>{d(this,D,"f")[s][o]=(d(this,D,"f")[s][o]||[]).concat(a)})}[Ai](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 Wt(i))t(o,i[o]);else s(n,this[xi](i),r)}[xi](t){return t==="__proto__"?"___proto___":t}[vi](t,n){return this[Gt](this[vi].bind(this),"key",t,n),this}[Oi](){var t,n,i,r,s,o,a,l,c,f,u,p;let h=d(this,Mn,"f").pop();_e(h,void 0,d(this,W,"f"));let g;t=this,n=this,i=this,r=this,s=this,o=this,a=this,l=this,c=this,f=this,u=this,p=this,{options:{set value(b){j(t,D,b,"f")}}.value,configObjects:g,exitProcess:{set value(b){j(n,Ne,b,"f")}}.value,groups:{set value(b){j(i,Ue,b,"f")}}.value,output:{set value(b){j(r,ye,b,"f")}}.value,exitError:{set value(b){j(s,tt,b,"f")}}.value,hasOutput:{set value(b){j(o,Me,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){j(a,Pt,b,"f")}}.value,strictCommands:{set value(b){j(l,Mt,b,"f")}}.value,strictOptions:{set value(b){j(c,Ft,b,"f")}}.value,completionCommand:{set value(b){j(f,Pe,b,"f")}}.value,parseFn:{set value(b){j(u,Fe,b,"f")}}.value,parseContext:{set value(b){j(p,It,b,"f")}}.value}=h,d(this,D,"f").configObjects=g,d(this,q,"f").unfreeze(),d(this,le,"f").unfreeze(),d(this,fe,"f").unfreeze(),d(this,Te,"f").unfreeze()}[Jr](t,n){return _t(n,i=>(t(i),i))}getInternalMethods(){return{getCommandInstance:this[Qr].bind(this),getContext:this[Zr].bind(this),getHasOutput:this[Xr].bind(this),getLoggerInstance:this[eo].bind(this),getParseContext:this[to].bind(this),getParserConfiguration:this[Lt].bind(this),getUsageInstance:this[no].bind(this),getValidationInstance:this[io].bind(this),hasParseCallback:this[Tn].bind(this),isGlobalContext:this[ro].bind(this),postProcess:this[Dt].bind(this),reset:this[_i].bind(this),runValidation:this[Ei].bind(this),runYargsParserAndExecuteCommands:this[fn].bind(this),setHasOutput:this[so].bind(this)}}[Qr](){return d(this,fe,"f")}[Zr](){return d(this,cn,"f")}[Xr](){return d(this,Me,"f")}[eo](){return d(this,kt,"f")}[to](){return d(this,It,"f")||{}}[no](){return d(this,q,"f")}[io](){return d(this,le,"f")}[Tn](){return!!d(this,Fe,"f")}[ro](){return d(this,Fn,"f")}[Dt](t,n,i,r){return i||ie(t)||(n||(t=this[Yr](t)),(this[Lt]()["parse-positional-numbers"]||this[Lt]()["parse-positional-numbers"]===void 0)&&(t=this[Vr](t)),r&&(t=Ot(t,this,d(this,Te,"f").getMiddleware(),!1))),t}[_i](t={}){j(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,jt,"f"),Object.keys(d(this,Ue,"f")).reduce((o,a)=>{let l=d(this,Ue,"f")[a].filter(c=>!(c in i));return l.length>0&&(o[a]=l),o},{})),j(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,j(this,D,n,"f"),j(this,q,d(this,q,"f")?d(this,q,"f").reset(i):Nr(this,d(this,W,"f")),"f"),j(this,le,d(this,le,"f")?d(this,le,"f").reset(i):Br(this,d(this,q,"f"),d(this,W,"f")),"f"),j(this,fe,d(this,fe,"f")?d(this,fe,"f").reset():Fr(d(this,q,"f"),d(this,le,"f"),d(this,Te,"f"),d(this,W,"f")),"f"),d(this,De,"f")||j(this,De,$r(this,d(this,q,"f"),d(this,fe,"f"),d(this,W,"f")),"f"),d(this,Te,"f").reset(),j(this,Pe,null,"f"),j(this,ye,"","f"),j(this,tt,null,"f"),j(this,Me,!1,"f"),this.parsed=!1,this}[oo](t,n){return d(this,W,"f").path.relative(t,n)}[fn](t,n,i,r=0,s=!1){let o=!!i||s;t=t||d(this,nt,"f"),d(this,D,"f").__=d(this,W,"f").y18n.__,d(this,D,"f").configuration=this[Lt]();let a=!!d(this,D,"f").configuration["populate--"],l=Object.assign({},d(this,D,"f").configuration,{"populate--":!0}),c=d(this,W,"f").Parser.detailed(t,Object.assign({},d(this,D,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),f=Object.assign(c.argv,d(this,It,"f")),u,p=c.aliases,h=!1,g=!1;Object.keys(f).forEach(b=>{b===d(this,Re,"f")&&f[b]?h=!0:b===d(this,He,"f")&&f[b]&&(g=!0)}),f.$0=this.$0,this.parsed=c,r===0&&d(this,q,"f").clearCachedHelpMessage();try{if(this[yi](),n)return this[Dt](f,a,!!i,!1);d(this,Re,"f")&&[d(this,Re,"f")].concat(p[d(this,Re,"f")]||[]).filter(N=>N.length>1).includes(""+f._[f._.length-1])&&(f._.pop(),h=!0),j(this,Fn,!1,"f");let b=d(this,fe,"f").getCommands(),m=d(this,De,"f").completionKey in f,v=h||m||s;if(f._.length){if(b.length){let O;for(let N=r||0,G;f._[N]!==void 0;N++)if(G=String(f._[N]),b.includes(G)&&G!==d(this,Pe,"f")){let K=d(this,fe,"f").runCommand(G,this,c,N+1,s,h||g||s);return this[Dt](K,a,!!i,!1)}else if(!O&&G!==d(this,Pe,"f")){O=G;break}!d(this,fe,"f").hasDefaultCommand()&&d(this,Nn,"f")&&O&&!v&&d(this,le,"f").recommendCommands(O,b)}d(this,Pe,"f")&&f._.includes(d(this,Pe,"f"))&&!m&&(d(this,Ne,"f")&&et(!0),this.showCompletionScript(),this.exit(0))}if(d(this,fe,"f").hasDefaultCommand()&&!v){let O=d(this,fe,"f").runCommand(null,this,c,0,s,h||g||s);return this[Dt](O,a,!!i,!1)}if(m){d(this,Ne,"f")&&et(!0),t=[].concat(t);let O=t.slice(t.indexOf(`--${d(this,De,"f").completionKey}`)+1);return d(this,De,"f").getCompletion(O,(N,G)=>{if(N)throw new te(N.message);(G||[]).forEach(K=>{d(this,kt,"f").log(K)}),this.exit(0)}),this[Dt](f,!a,!!i,!1)}if(d(this,Me,"f")||(h?(d(this,Ne,"f")&&et(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(d(this,Ne,"f")&&et(!0),o=!0,d(this,q,"f").showVersion("log"),this.exit(0))),!o&&d(this,D,"f").skipValidation.length>0&&(o=Object.keys(f).some(O=>d(this,D,"f").skipValidation.indexOf(O)>=0&&f[O]===!0)),!o){if(c.error)throw new te(c.error.message);if(!m){let O=this[Ei](p,{},c.error);i||(u=Ot(f,this,d(this,Te,"f").getMiddleware(),!0)),u=this[Jr](O,u!=null?u:f),ie(u)&&!i&&(u=u.then(()=>Ot(f,this,d(this,Te,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof te)d(this,q,"f").fail(b.message,b);else throw b}return this[Dt](u!=null?u:f,a,!!i,!0)}[Ei](t,n,i,r){let s={...this.getDemandedOptions()};return o=>{if(i)throw new te(i.message);d(this,le,"f").nonOptionCount(o),d(this,le,"f").requiredArguments(o,s);let a=!1;d(this,Mt,"f")&&(a=d(this,le,"f").unknownCommands(o)),d(this,Pt,"f")&&!a?d(this,le,"f").unknownArguments(o,t,n,!!r):d(this,Ft,"f")&&d(this,le,"f").unknownArguments(o,t,{},!1,!1),d(this,le,"f").limitedChoices(o),d(this,le,"f").implications(o),d(this,le,"f").conflicting(o)}}[so](){j(this,Me,!0,"f")}[Nt](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 Lr(e){return!!e&&typeof e.getInternalMethods=="function"}var Xa=ao(Sr),qt=Xa;A();A();import Ap from"isomorphic-unfetch";A();A();var el=Object.create,Ii=Object.defineProperty,tl=Object.defineProperties,nl=Object.getOwnPropertyDescriptor,il=Object.getOwnPropertyDescriptors,rl=Object.getOwnPropertyNames,lo=Object.getOwnPropertySymbols,ol=Object.getPrototypeOf,uo=Object.prototype.hasOwnProperty,sl=Object.prototype.propertyIsEnumerable,co=(e,t,n)=>t in e?Ii(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,al=(e,t)=>{for(var n in t||(t={}))uo.call(t,n)&&co(e,n,t[n]);if(lo)for(var n of lo(t))sl.call(t,n)&&co(e,n,t[n]);return e},ll=(e,t)=>tl(e,il(t)),fo=(e=>typeof Ae!="undefined"?Ae:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof Ae!="undefined"?Ae:t)[n]}):e)(function(e){if(typeof Ae!="undefined")return Ae.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),cl=(e,t)=>()=>(e&&(t=e(e=0)),t),Be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),fl=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of rl(t))!uo.call(e,r)&&r!==n&&Ii(e,r,{get:()=>t[r],enumerable:!(i=nl(t,r))||i.enumerable});return e},ji=(e,t,n)=>(n=e!=null?el(ol(e)):{},fl(t||!e||!e.__esModule?Ii(n,"default",{value:e,enumerable:!0}):n,e)),we=cl(()=>{}),ul=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]}}),po=Be((e,t)=>{we();var n=ul(),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,c=o[2]/255,f=Math.min(a,l,c),u=Math.max(a,l,c),p=u-f,h,g;u===f?h=0:a===u?h=(l-c)/p:l===u?h=2+(c-a)/p:c===u&&(h=4+(a-l)/p),h=Math.min(h*60,360),h<0&&(h+=360);let b=(f+u)/2;return u===f?g=0:b<=.5?g=p/(u+f):g=p/(2-u-f),[h,g*100,b*100]},r.rgb.hsv=function(o){let a,l,c,f,u,p=o[0]/255,h=o[1]/255,g=o[2]/255,b=Math.max(p,h,g),m=b-Math.min(p,h,g),v=function(O){return(b-O)/6/m+1/2};return m===0?(f=0,u=0):(u=m/b,a=v(p),l=v(h),c=v(g),p===b?f=c-l:h===b?f=1/3+a-c:g===b&&(f=2/3+l-a),f<0?f+=1:f>1&&(f-=1)),[f*360,u*100,b*100]},r.rgb.hwb=function(o){let a=o[0],l=o[1],c=o[2],f=r.rgb.hsl(o)[0],u=1/255*Math.min(a,Math.min(l,c));return c=1-1/255*Math.max(a,Math.max(l,c)),[f,u*100,c*100]},r.rgb.cmyk=function(o){let a=o[0]/255,l=o[1]/255,c=o[2]/255,f=Math.min(1-a,1-l,1-c),u=(1-a-f)/(1-f)||0,p=(1-l-f)/(1-f)||0,h=(1-c-f)/(1-f)||0;return[u*100,p*100,h*100,f*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,c;for(let f of Object.keys(n)){let u=n[f],p=s(o,u);p<l&&(l=p,c=f)}return c},r.keyword.rgb=function(o){return n[o]},r.rgb.xyz=function(o){let a=o[0]/255,l=o[1]/255,c=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,c=c>.04045?((c+.055)/1.055)**2.4:c/12.92;let f=a*.4124+l*.3576+c*.1805,u=a*.2126+l*.7152+c*.0722,p=a*.0193+l*.1192+c*.9505;return[f*100,u*100,p*100]},r.rgb.lab=function(o){let a=r.rgb.xyz(o),l=a[0],c=a[1],f=a[2];l/=95.047,c/=100,f/=108.883,l=l>.008856?l**(1/3):7.787*l+16/116,c=c>.008856?c**(1/3):7.787*c+16/116,f=f>.008856?f**(1/3):7.787*f+16/116;let u=116*c-16,p=500*(l-c),h=200*(c-f);return[u,p,h]},r.hsl.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100,f,u,p;if(l===0)return p=c*255,[p,p,p];c<.5?f=c*(1+l):f=c+l-c*l;let h=2*c-f,g=[0,0,0];for(let b=0;b<3;b++)u=a+1/3*-(b-1),u<0&&u++,u>1&&u--,6*u<1?p=h+(f-h)*6*u:2*u<1?p=f:3*u<2?p=h+(f-h)*(2/3-u)*6:p=h,g[b]=p*255;return g},r.hsl.hsv=function(o){let a=o[0],l=o[1]/100,c=o[2]/100,f=l,u=Math.max(c,.01);c*=2,l*=c<=1?c:2-c,f*=u<=1?u:2-u;let p=(c+l)/2,h=c===0?2*f/(u+f):2*l/(c+l);return[a,h*100,p*100]},r.hsv.rgb=function(o){let a=o[0]/60,l=o[1]/100,c=o[2]/100,f=Math.floor(a)%6,u=a-Math.floor(a),p=255*c*(1-l),h=255*c*(1-l*u),g=255*c*(1-l*(1-u));switch(c*=255,f){case 0:return[c,g,p];case 1:return[h,c,p];case 2:return[p,c,g];case 3:return[p,h,c];case 4:return[g,p,c];case 5:return[c,p,h]}},r.hsv.hsl=function(o){let a=o[0],l=o[1]/100,c=o[2]/100,f=Math.max(c,.01),u,p;p=(2-l)*c;let h=(2-l)*f;return u=l*f,u/=h<=1?h:2-h,u=u||0,p/=2,[a,u*100,p*100]},r.hwb.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100,f=l+c,u;f>1&&(l/=f,c/=f);let p=Math.floor(6*a),h=1-c;u=6*a-p,(p&1)!==0&&(u=1-u);let g=l+u*(h-l),b,m,v;switch(p){default:case 6:case 0:b=h,m=g,v=l;break;case 1:b=g,m=h,v=l;break;case 2:b=l,m=h,v=g;break;case 3:b=l,m=g,v=h;break;case 4:b=g,m=l,v=h;break;case 5:b=h,m=l,v=g;break}return[b*255,m*255,v*255]},r.cmyk.rgb=function(o){let a=o[0]/100,l=o[1]/100,c=o[2]/100,f=o[3]/100,u=1-Math.min(1,a*(1-f)+f),p=1-Math.min(1,l*(1-f)+f),h=1-Math.min(1,c*(1-f)+f);return[u*255,p*255,h*255]},r.xyz.rgb=function(o){let a=o[0]/100,l=o[1]/100,c=o[2]/100,f,u,p;return f=a*3.2406+l*-1.5372+c*-.4986,u=a*-.9689+l*1.8758+c*.0415,p=a*.0557+l*-.204+c*1.057,f=f>.0031308?1.055*f**(1/2.4)-.055:f*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,p=p>.0031308?1.055*p**(1/2.4)-.055:p*12.92,f=Math.min(Math.max(0,f),1),u=Math.min(Math.max(0,u),1),p=Math.min(Math.max(0,p),1),[f*255,u*255,p*255]},r.xyz.lab=function(o){let a=o[0],l=o[1],c=o[2];a/=95.047,l/=100,c/=108.883,a=a>.008856?a**(1/3):7.787*a+16/116,l=l>.008856?l**(1/3):7.787*l+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;let f=116*l-16,u=500*(a-l),p=200*(l-c);return[f,u,p]},r.lab.xyz=function(o){let a=o[0],l=o[1],c=o[2],f,u,p;u=(a+16)/116,f=l/500+u,p=u-c/200;let h=u**3,g=f**3,b=p**3;return u=h>.008856?h:(u-16/116)/7.787,f=g>.008856?g:(f-16/116)/7.787,p=b>.008856?b:(p-16/116)/7.787,f*=95.047,u*=100,p*=108.883,[f,u,p]},r.lab.lch=function(o){let a=o[0],l=o[1],c=o[2],f;f=Math.atan2(c,l)*360/2/Math.PI,f<0&&(f+=360);let u=Math.sqrt(l*l+c*c);return[a,u,f]},r.lch.lab=function(o){let a=o[0],l=o[1],c=o[2]/360*2*Math.PI,f=l*Math.cos(c),u=l*Math.sin(c);return[a,f,u]},r.rgb.ansi16=function(o,a=null){let[l,c,f]=o,u=a===null?r.rgb.hsv(o)[2]:a;if(u=Math.round(u/50),u===0)return 30;let p=30+(Math.round(f/255)<<2|Math.round(c/255)<<1|Math.round(l/255));return u===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],c=o[2];return a===l&&l===c?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(c/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,c=(a&1)*l*255,f=(a>>1&1)*l*255,u=(a>>2&1)*l*255;return[c,f,u]},r.ansi256.rgb=function(o){if(o>=232){let u=(o-232)*10+8;return[u,u,u]}o-=16;let a,l=Math.floor(o/36)/5*255,c=Math.floor((a=o%36)/6)/5*255,f=a%6/5*255;return[l,c,f]},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 c=parseInt(l,16),f=c>>16&255,u=c>>8&255,p=c&255;return[f,u,p]},r.rgb.hcg=function(o){let a=o[0]/255,l=o[1]/255,c=o[2]/255,f=Math.max(Math.max(a,l),c),u=Math.min(Math.min(a,l),c),p=f-u,h,g;return p<1?h=u/(1-p):h=0,p<=0?g=0:f===a?g=(l-c)/p%6:f===l?g=2+(c-a)/p:g=4+(a-l)/p,g/=6,g%=1,[g*360,p*100,h*100]},r.hsl.hcg=function(o){let a=o[1]/100,l=o[2]/100,c=l<.5?2*a*l:2*a*(1-l),f=0;return c<1&&(f=(l-.5*c)/(1-c)),[o[0],c*100,f*100]},r.hsv.hcg=function(o){let a=o[1]/100,l=o[2]/100,c=a*l,f=0;return c<1&&(f=(l-c)/(1-c)),[o[0],c*100,f*100]},r.hcg.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100;if(l===0)return[c*255,c*255,c*255];let f=[0,0,0],u=a%1*6,p=u%1,h=1-p,g=0;switch(Math.floor(u)){case 0:f[0]=1,f[1]=p,f[2]=0;break;case 1:f[0]=h,f[1]=1,f[2]=0;break;case 2:f[0]=0,f[1]=1,f[2]=p;break;case 3:f[0]=0,f[1]=h,f[2]=1;break;case 4:f[0]=p,f[1]=0,f[2]=1;break;default:f[0]=1,f[1]=0,f[2]=h}return g=(1-l)*c,[(l*f[0]+g)*255,(l*f[1]+g)*255,(l*f[2]+g)*255]},r.hcg.hsv=function(o){let a=o[1]/100,l=o[2]/100,c=a+l*(1-a),f=0;return c>0&&(f=a/c),[o[0],f*100,c*100]},r.hcg.hsl=function(o){let a=o[1]/100,l=o[2]/100*(1-a)+.5*a,c=0;return l>0&&l<.5?c=a/(2*l):l>=.5&&l<1&&(c=a/(2*(1-l))),[o[0],c*100,l*100]},r.hcg.hwb=function(o){let a=o[1]/100,l=o[2]/100,c=a+l*(1-a);return[o[0],(c-a)*100,(1-c)*100]},r.hwb.hcg=function(o){let a=o[1]/100,l=o[2]/100,c=1-l,f=c-a,u=0;return f<1&&(u=(c-f)/(1-f)),[o[0],f*100,u*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]}}),pl=Be((e,t)=>{we();var n=po();function i(){let a={},l=Object.keys(n);for(let c=l.length,f=0;f<c;f++)a[l[f]]={distance:-1,parent:null};return a}function r(a){let l=i(),c=[a];for(l[a].distance=0;c.length;){let f=c.pop(),u=Object.keys(n[f]);for(let p=u.length,h=0;h<p;h++){let g=u[h],b=l[g];b.distance===-1&&(b.distance=l[f].distance+1,b.parent=f,c.unshift(g))}}return l}function s(a,l){return function(c){return l(a(c))}}function o(a,l){let c=[l[a].parent,a],f=n[l[a].parent][a],u=l[a].parent;for(;l[u].parent;)c.unshift(l[u].parent),f=s(n[l[u].parent][u],f),u=l[u].parent;return f.conversion=c,f}t.exports=function(a){let l=r(a),c={},f=Object.keys(l);for(let u=f.length,p=0;p<u;p++){let h=f[p];l[h].parent!==null&&(c[h]=o(h,l))}return c}}),dl=Be((e,t)=>{we();var n=po(),i=pl(),r={},s=Object.keys(n);function o(l){let c=function(...f){let u=f[0];return u==null?u:(u.length>1&&(f=u),l(f))};return"conversion"in l&&(c.conversion=l.conversion),c}function a(l){let c=function(...f){let u=f[0];if(u==null)return u;u.length>1&&(f=u);let p=l(f);if(typeof p=="object")for(let h=p.length,g=0;g<h;g++)p[g]=Math.round(p[g]);return p};return"conversion"in l&&(c.conversion=l.conversion),c}s.forEach(l=>{r[l]={},Object.defineProperty(r[l],"channels",{value:n[l].channels}),Object.defineProperty(r[l],"labels",{value:n[l].labels});let c=i(l);Object.keys(c).forEach(f=>{let u=c[f];r[l][f]=a(u),r[l][f].raw=o(u)})}),t.exports=r}),hl=Be((e,t)=>{"use strict";we();var n=(u,p)=>(...h)=>`\x1B[${u(...h)+p}m`,i=(u,p)=>(...h)=>{let g=u(...h);return`\x1B[${38+p};5;${g}m`},r=(u,p)=>(...h)=>{let g=u(...h);return`\x1B[${38+p};2;${g[0]};${g[1]};${g[2]}m`},s=u=>u,o=(u,p,h)=>[u,p,h],a=(u,p,h)=>{Object.defineProperty(u,p,{get:()=>{let g=h();return Object.defineProperty(u,p,{value:g,enumerable:!0,configurable:!0}),g},enumerable:!0,configurable:!0})},l,c=(u,p,h,g)=>{l===void 0&&(l=dl());let b=g?10:0,m={};for(let[v,O]of Object.entries(l)){let N=v==="ansi16"?"ansi":v;v===p?m[N]=u(h,b):typeof O=="object"&&(m[N]=u(O[p],b))}return m};function f(){let u=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,g]of Object.entries(p)){for(let[b,m]of Object.entries(g))p[b]={open:`\x1B[${m[0]}m`,close:`\x1B[${m[1]}m`},g[b]=p[b],u.set(m[0],m[1]);Object.defineProperty(p,h,{value:g,enumerable:!1})}return Object.defineProperty(p,"codes",{value:u,enumerable:!1}),p.color.close="\x1B[39m",p.bgColor.close="\x1B[49m",a(p.color,"ansi",()=>c(n,"ansi16",s,!1)),a(p.color,"ansi256",()=>c(i,"ansi256",s,!1)),a(p.color,"ansi16m",()=>c(r,"rgb",o,!1)),a(p.bgColor,"ansi",()=>c(n,"ansi16",s,!0)),a(p.bgColor,"ansi256",()=>c(i,"ansi256",s,!0)),a(p.bgColor,"ansi16m",()=>c(r,"rgb",o,!0)),p}Object.defineProperty(t,"exports",{enumerable:!0,get:f})}),ml=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)}}),gl=Be((e,t)=>{"use strict";we();var n=fo("os"),i=fo("tty"),r=ml(),{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(f){return f===0?!1:{level:f,hasBasic:!0,has256:f>=2,has16m:f>=3}}function l(f,u){if(o===0)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(f&&!u&&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 c(f){let u=l(f,f&&f.isTTY);return a(u)}t.exports={supportsColor:c,stdout:a(l(!0,i.isatty(1))),stderr:a(l(!0,i.isatty(2)))}}),bl=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,c=0,f="";do f+=r.substr(c,a-c)+s+o,c=a+l,a=r.indexOf(s,c);while(a!==-1);return f+=r.substr(c),f},i=(r,s,o,a)=>{let l=0,c="";do{let f=r[a-1]==="\r";c+=r.substr(l,(f?a-1:a)-l)+s+(f?`\r
59
+ `)}`:"";t.fail(r("Missing required argument: %s","Missing required arguments: %s",Object.keys(h).length,Object.keys(h).join(", ")+b))}},s.unknownArguments=function(u,p,h,g,b=!0){var m;let x=e.getInternalMethods().getCommandInstance().getCommands(),v=[],L=e.getInternalMethods().getContext();if(Object.keys(u).forEach(Y=>{!Tr.includes(Y)&&!Object.prototype.hasOwnProperty.call(h,Y)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),Y)&&!s.isValidAndSomeAliasIsNotNew(Y,p)&&v.push(Y)}),b&&(L.commands.length>0||x.length>0||g)&&u._.slice(L.commands.length).forEach(Y=>{x.includes(""+Y)||v.push(""+Y)}),b){let z=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,W=L.commands.length+z;W<u._.length&&u._.slice(W).forEach(D=>{D=String(D),!L.commands.includes(D)&&!v.includes(D)&&v.push(D)})}v.length&&t.fail(r("Unknown argument: %s","Unknown arguments: %s",v.length,v.map(Y=>Y.trim()?Y:`"${Y}"`).join(", ")))},s.unknownCommands=function(u){let p=e.getInternalMethods().getCommandInstance().getCommands(),h=[],g=e.getInternalMethods().getContext();return(g.commands.length>0||p.length>0)&&u._.slice(g.commands.length).forEach(b=>{p.includes(""+b)||h.push(""+b)}),h.length>0?(t.fail(r("Unknown command: %s","Unknown commands: %s",h.length,h.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(u,p){if(!Object.prototype.hasOwnProperty.call(p,u))return!1;let h=e.parsed.newAliases;return[u,...p[u]].some(g=>!Object.prototype.hasOwnProperty.call(h,g)||!h[u])},s.limitedChoices=function(u){let p=e.getOptions(),h={};if(!Object.keys(p.choices).length)return;Object.keys(u).forEach(m=>{Tr.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(p.choices,m)&&[].concat(u[m]).forEach(x=>{p.choices[m].indexOf(x)===-1&&x!==void 0&&(h[m]=(h[m]||[]).concat(x))})});let g=Object.keys(h);if(!g.length)return;let b=i("Invalid values:");g.forEach(m=>{b+=`
60
+ ${i("Argument: %s, Given: %s, Choices: %s",m,t.stringifiedValues(h[m]),t.stringifiedValues(p.choices[m]))}`}),t.fail(b)};let o={};s.implies=function(u,p){S("<string|object> [array|number|string]",[u,p],arguments.length),typeof u=="object"?Object.keys(u).forEach(h=>{s.implies(h,u[h])}):(e.global(u),o[u]||(o[u]=[]),Array.isArray(p)?p.forEach(h=>s.implies(u,h)):(Ae(p,void 0,n),o[u].push(p)))},s.getImplied=function(){return o};function a(f,u){let p=Number(u);return u=isNaN(p)?u:p,typeof u=="number"?u=f._.length>=u:u.match(/^--no-.+/)?(u=u.match(/^--no-(.+)/)[1],u=!Object.prototype.hasOwnProperty.call(f,u)):u=Object.prototype.hasOwnProperty.call(f,u),u}s.implications=function(u){let p=[];if(Object.keys(o).forEach(h=>{let g=h;(o[h]||[]).forEach(b=>{let m=g,x=b;m=a(u,m),b=a(u,b),m&&!b&&p.push(` ${g} -> ${x}`)})}),p.length){let h=`${i("Implications failed:")}
61
+ `;p.forEach(g=>{h+=g}),t.fail(h)}};let l={};s.conflicts=function(u,p){S("<string|object> [array|string]",[u,p],arguments.length),typeof u=="object"?Object.keys(u).forEach(h=>{s.conflicts(h,u[h])}):(e.global(u),l[u]||(l[u]=[]),Array.isArray(p)?p.forEach(h=>s.conflicts(u,h)):l[u].push(p))},s.getConflicting=()=>l,s.conflicting=function(u){Object.keys(u).forEach(p=>{l[p]&&l[p].forEach(h=>{h&&u[p]!==void 0&&u[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&&u[n.Parser.camelCase(p)]!==void 0&&u[n.Parser.camelCase(h)]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,h))})})},s.recommendCommands=function(u,p){p=p.sort((m,x)=>x.length-m.length);let g=null,b=1/0;for(let m=0,x;(x=p[m])!==void 0;m++){let v=Nr(u,x);v<=3&&v<b&&(b=v,g=x)}g&&t.fail(i("Did you mean %s?",g))},s.reset=function(u){return o=Ve(o,p=>!u[p]),l=Ve(l,p=>!u[p]),s};let c=[];return s.freeze=function(){c.push({implied:o,conflicting:l})},s.unfreeze=function(){let u=c.pop();Ae(u,void 0,n),{implied:o,conflicting:l}=u},s}var pi=[],rn;function On(e,t,n,i){rn=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=Ka(t,e.extends);else try{o=be.resolve(e.extends)}catch(a){return e}qa(o),pi.push(o),r=s?JSON.parse(rn.readFileSync(o,"utf8")):be(e.extends),delete e.extends,r=On(r,rn.path.dirname(o),n,rn)}return pi=[],n?$r(r,e):Object.assign({},r,e)}function qa(e){if(pi.indexOf(e)>-1)throw new Z(`Circular extended configurations: '${e}'.`)}function Ka(e,t){return rn.path.resolve(e,t)}function $r(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]=$r(e[r],t[r]):n[r]=t[r];return n}var I=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)},ae,xt,on,Pe,Ee,_n,Qe,vt,En,Me,Sn,Fe,Ne,Se,Le,In,Ht,me,F,jn,Pn,Ie,Ot,Bt,_t,Ze,Mn,U,Et,St,It,k,Te,oe;function io(e){return(t=[],n=e.process.cwd(),i)=>{let r=new vi(t,n,i,e);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Ur=Symbol("copyDoubleDash"),Hr=Symbol("copyDoubleDash"),di=Symbol("deleteFromParserHintObject"),Br=Symbol("emitWarning"),Wr=Symbol("freeze"),Yr=Symbol("getDollarZero"),jt=Symbol("getParserConfiguration"),hi=Symbol("guessLocale"),kr=Symbol("guessVersion"),zr=Symbol("parsePositionalNumbers"),mi=Symbol("pkgUp"),Xe=Symbol("populateParserHintArray"),Wt=Symbol("populateParserHintSingleValueDictionary"),gi=Symbol("populateParserHintArrayDictionary"),bi=Symbol("populateParserHintDictionary"),yi=Symbol("sanitizeKey"),wi=Symbol("setKey"),Ci=Symbol("unfreeze"),Gr=Symbol("validateAsync"),qr=Symbol("getCommandInstance"),Kr=Symbol("getContext"),Vr=Symbol("getHasOutput"),Jr=Symbol("getLoggerInstance"),Qr=Symbol("getParseContext"),Zr=Symbol("getUsageInstance"),Xr=Symbol("getValidationInstance"),Fn=Symbol("hasParseCallback"),eo=Symbol("isGlobalContext"),Pt=Symbol("postProcess"),to=Symbol("rebase"),Ai=Symbol("reset"),sn=Symbol("runYargsParserAndExecuteCommands"),xi=Symbol("runValidation"),no=Symbol("setHasOutput"),Mt=Symbol("kTrackManuallySetKeys"),vi=class{constructor(t=[],n,i,r){this.customScriptName=!1,this.parsed=!1,ae.set(this,void 0),xt.set(this,void 0),on.set(this,{commands:[],fullCommands:[]}),Pe.set(this,null),Ee.set(this,null),_n.set(this,"show-hidden"),Qe.set(this,null),vt.set(this,!0),En.set(this,{}),Me.set(this,!0),Sn.set(this,[]),Fe.set(this,void 0),Ne.set(this,{}),Se.set(this,!1),Le.set(this,null),In.set(this,!0),Ht.set(this,void 0),me.set(this,""),F.set(this,void 0),jn.set(this,void 0),Pn.set(this,{}),Ie.set(this,null),Ot.set(this,null),Bt.set(this,{}),_t.set(this,{}),Ze.set(this,void 0),Mn.set(this,!1),U.set(this,void 0),Et.set(this,!1),St.set(this,!1),It.set(this,!1),k.set(this,void 0),Te.set(this,null),oe.set(this,void 0),I(this,U,r,"f"),I(this,Ze,t,"f"),I(this,xt,n,"f"),I(this,jn,i,"f"),I(this,Fe,new An(this),"f"),this.$0=this[Yr](),this[Ai](),I(this,ae,d(this,ae,"f"),"f"),I(this,k,d(this,k,"f"),"f"),I(this,oe,d(this,oe,"f"),"f"),I(this,F,d(this,F,"f"),"f"),d(this,F,"f").showHiddenOpt=d(this,_n,"f"),I(this,Ht,this[Hr](),"f")}addHelpOpt(t,n){let i="help";return S("[string|boolean] [string]",[t,n],arguments.length),d(this,Le,"f")&&(this[di](d(this,Le,"f")),I(this,Le,null,"f")),t===!1&&n===void 0?this:(I(this,Le,typeof t=="string"?t:i,"f"),this.boolean(d(this,Le,"f")),this.describe(d(this,Le,"f"),n||d(this,k,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(S("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let i=typeof t=="string"?t:d(this,_n,"f");return this.boolean(i),this.describe(i,n||d(this,k,"f").deferY18nLookup("Show hidden options")),d(this,F,"f").showHiddenOpt=i,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return S("<object|string|array> [string|array]",[t,n],arguments.length),this[gi](this.alias.bind(this),"alias",t,n),this}array(t){return S("<array|string>",[t],arguments.length),this[Xe]("array",t),this[Mt](t),this}boolean(t){return S("<array|string>",[t],arguments.length),this[Xe]("boolean",t),this[Mt](t),this}check(t,n){return S("<function> [boolean]",[t,n],arguments.length),this.middleware((i,r)=>At(()=>t(i,r.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&d(this,k,"f").fail(s.toString(),s):d(this,k,"f").fail(d(this,U,"f").y18n.__("Argument check failed: %s",t.toString())),i),s=>(d(this,k,"f").fail(s.message?s.message:s.toString(),s),i)),!1,n),this}choices(t,n){return S("<object|string|array> [string|array]",[t,n],arguments.length),this[gi](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(S("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new Z("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 Z("coerce callback must be provided");return d(this,F,"f").key[t]=!0,d(this,Fe,"f").addCoerceMiddleware((i,r)=>{let s;return Object.prototype.hasOwnProperty.call(i,t)?At(()=>(s=r.getAliases(),n(i[t])),a=>{i[t]=a;let l=r.getInternalMethods().getParserConfiguration()["strip-aliased"];if(s[t]&&l!==!0)for(let c of s[t])i[c]=a;return i},a=>{throw new Z(a.message)}):i},t),this}conflicts(t,n){return S("<string|object> [string|array]",[t,n],arguments.length),d(this,oe,"f").conflicts(t,n),this}config(t="config",n,i){return S("[object|string] [string|function] [function]",[t,n,i],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=On(t,d(this,xt,"f"),this[jt]()["deep-merge-config"]||!1,d(this,U,"f")),d(this,F,"f").configObjects=(d(this,F,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(i=n,n=void 0),this.describe(t,n||d(this,k,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(r=>{d(this,F,"f").config[r]=i||!0}),this)}completion(t,n,i){return S("[string] [string|boolean|function] [function]",[t,n,i],arguments.length),typeof n=="function"&&(i=n,n=void 0),I(this,Ee,t||d(this,Ee,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(d(this,Ee,"f"),n),i&&d(this,Pe,"f").registerFunction(i),this}command(t,n,i,r,s,o){return S("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,i,r,s,o],arguments.length),d(this,ae,"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){S("<string> [object]",[t,n],arguments.length);let i=d(this,jn,"f")||d(this,U,"f").require;return d(this,ae,"f").addDirectory(t,i,d(this,U,"f").getCallerFile(),n),this}count(t){return S("<array|string>",[t],arguments.length),this[Xe]("count",t),this[Mt](t),this}default(t,n,i){return S("<object|string|array> [*] [string]",[t,n,i],arguments.length),i&&(ai(t,d(this,U,"f")),d(this,F,"f").defaultDescription[t]=i),typeof n=="function"&&(ai(t,d(this,U,"f")),d(this,F,"f").defaultDescription[t]||(d(this,F,"f").defaultDescription[t]=d(this,k,"f").functionDescription(n)),n=n.call()),this[Wt](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 S("[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,F,"f").demandedCommands._={min:t,max:n,minMsg:i,maxMsg:r},this}demand(t,n,i){return Array.isArray(n)?(n.forEach(r=>{Ae(i,!0,d(this,U,"f")),this.demandOption(r,i)}),n=1/0):typeof n!="number"&&(i=n,n=1/0),typeof t=="number"?(Ae(i,!0,d(this,U,"f")),this.demandCommand(t,n,i,i)):Array.isArray(t)?t.forEach(r=>{Ae(i,!0,d(this,U,"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 S("<object|string|array> [string]",[t,n],arguments.length),this[Wt](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return S("<string> [string|boolean]",[t,n],arguments.length),d(this,F,"f").deprecatedOptions[t]=n,this}describe(t,n){return S("<object|string|array> [string]",[t,n],arguments.length),this[wi](t,!0),d(this,k,"f").describe(t,n),this}detectLocale(t){return S("<boolean>",[t],arguments.length),I(this,vt,t,"f"),this}env(t){return S("[string|boolean]",[t],arguments.length),t===!1?delete d(this,F,"f").envPrefix:d(this,F,"f").envPrefix=t||"",this}epilogue(t){return S("<string>",[t],arguments.length),d(this,k,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return S("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(i=>this.example(...i)):d(this,k,"f").example(t,n),this}exit(t,n){I(this,Se,!0,"f"),I(this,Qe,n,"f"),d(this,Me,"f")&&d(this,U,"f").process.exit(t)}exitProcess(t=!0){return S("[boolean]",[t],arguments.length),I(this,Me,t,"f"),this}fail(t){if(S("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new Z("Invalid first argument. Expected function or boolean 'false'");return d(this,k,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return S("<array> [function]",[t,n],arguments.length),n?d(this,Pe,"f").getCompletion(t,n):new Promise((i,r)=>{d(this,Pe,"f").getCompletion(t,(s,o)=>{s?r(s):i(o)})})}getDemandedOptions(){return S([],0),d(this,F,"f").demandedOptions}getDemandedCommands(){return S([],0),d(this,F,"f").demandedCommands}getDeprecatedOptions(){return S([],0),d(this,F,"f").deprecatedOptions}getDetectLocale(){return d(this,vt,"f")}getExitProcess(){return d(this,Me,"f")}getGroups(){return Object.assign({},d(this,Ne,"f"),d(this,_t,"f"))}getHelp(){if(I(this,Se,!0,"f"),!d(this,k,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[sn](d(this,Ze,"f"),void 0,void 0,0,!0);if(ee(n))return n.then(()=>d(this,k,"f").help())}let t=d(this,ae,"f").runDefaultBuilderOn(this);if(ee(t))return t.then(()=>d(this,k,"f").help())}return Promise.resolve(d(this,k,"f").help())}getOptions(){return d(this,F,"f")}getStrict(){return d(this,Et,"f")}getStrictCommands(){return d(this,St,"f")}getStrictOptions(){return d(this,It,"f")}global(t,n){return S("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?d(this,F,"f").local=d(this,F,"f").local.filter(i=>t.indexOf(i)===-1):t.forEach(i=>{d(this,F,"f").local.includes(i)||d(this,F,"f").local.push(i)}),this}group(t,n){S("<string|array> <string>",[t,n],arguments.length);let i=d(this,_t,"f")[n]||d(this,Ne,"f")[n];d(this,_t,"f")[n]&&delete d(this,_t,"f")[n];let r={};return d(this,Ne,"f")[n]=(i||[]).concat(t).filter(s=>r[s]?!1:r[s]=!0),this}hide(t){return S("<string>",[t],arguments.length),d(this,F,"f").hiddenOptions.push(t),this}implies(t,n){return S("<string|object> [number|string|array]",[t,n],arguments.length),d(this,oe,"f").implies(t,n),this}locale(t){return S("[string]",[t],arguments.length),t===void 0?(this[hi](),d(this,U,"f").y18n.getLocale()):(I(this,vt,!1,"f"),d(this,U,"f").y18n.setLocale(t),this)}middleware(t,n,i){return d(this,Fe,"f").addMiddleware(t,!!n,i)}nargs(t,n){return S("<string|object|array> [number]",[t,n],arguments.length),this[Wt](this.nargs.bind(this),"narg",t,n),this}normalize(t){return S("<array|string>",[t],arguments.length),this[Xe]("normalize",t),this}number(t){return S("<array|string>",[t],arguments.length),this[Xe]("number",t),this[Mt](t),this}option(t,n){if(S("<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[Mt](t),d(this,Te,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[Br](['"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,F,"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,F,"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){S("[string|array] [function|boolean|object] [function]",[t,n,i],arguments.length),this[Wr](),typeof t=="undefined"&&(t=d(this,Ze,"f")),typeof n=="object"&&(I(this,Ot,n,"f"),n=i),typeof n=="function"&&(I(this,Ie,n,"f"),n=!1),n||I(this,Ze,t,"f"),d(this,Ie,"f")&&I(this,Me,!1,"f");let r=this[sn](t,!!n),s=this.parsed;return d(this,Pe,"f").setParsed(this.parsed),ee(r)?r.then(o=>(d(this,Ie,"f")&&d(this,Ie,"f").call(this,d(this,Qe,"f"),o,d(this,me,"f")),o)).catch(o=>{throw d(this,Ie,"f")&&d(this,Ie,"f")(o,this.parsed.argv,d(this,me,"f")),o}).finally(()=>{this[Ci](),this.parsed=s}):(d(this,Ie,"f")&&d(this,Ie,"f").call(this,d(this,Qe,"f"),r,d(this,me,"f")),this[Ci](),this.parsed=s,r)}parseAsync(t,n,i){let r=this.parse(t,n,i);return ee(r)?r:Promise.resolve(r)}parseSync(t,n,i){let r=this.parse(t,n,i);if(ee(r))throw new Z(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(t){return S("<object>",[t],arguments.length),I(this,Pn,t,"f"),this}pkgConf(t,n){S("<string> [string]",[t,n],arguments.length);let i=null,r=this[mi](n||d(this,xt,"f"));return r[t]&&typeof r[t]=="object"&&(i=On(r[t],n||d(this,xt,"f"),this[jt]()["deep-merge-config"]||!1,d(this,U,"f")),d(this,F,"f").configObjects=(d(this,F,"f").configObjects||[]).concat(i)),this}positional(t,n){S("<string> <object>",[t,n],arguments.length);let i=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=Ve(n,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:i.includes(o));let r=d(this,on,"f").fullCommands[d(this,on,"f").fullCommands.length-1],s=r?d(this,ae,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return $t(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,k,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return S("[boolean]",[t],arguments.length),I(this,Mn,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 S("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&d(this,F,"f").narg[t]?this:(this[Wt](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return S("[string] [string]",[t,n],arguments.length),t=t||this.$0,d(this,Ht,"f").log(d(this,Pe,"f").generateCompletionScript(t,n||d(this,Ee,"f")||"completion")),this}showHelp(t){if(S("[string|function]",[t],arguments.length),I(this,Se,!0,"f"),!d(this,k,"f").hasCachedHelpMessage()){if(!this.parsed){let i=this[sn](d(this,Ze,"f"),void 0,void 0,0,!0);if(ee(i))return i.then(()=>{d(this,k,"f").showHelp(t)}),this}let n=d(this,ae,"f").runDefaultBuilderOn(this);if(ee(n))return n.then(()=>{d(this,k,"f").showHelp(t)}),this}return d(this,k,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return S("[boolean|string] [string]",[t,n],arguments.length),d(this,k,"f").showHelpOnFail(t,n),this}showVersion(t){return S("[string|function]",[t],arguments.length),d(this,k,"f").showVersion(t),this}skipValidation(t){return S("<array|string>",[t],arguments.length),this[Xe]("skipValidation",t),this}strict(t){return S("[boolean]",[t],arguments.length),I(this,Et,t!==!1,"f"),this}strictCommands(t){return S("[boolean]",[t],arguments.length),I(this,St,t!==!1,"f"),this}strictOptions(t){return S("[boolean]",[t],arguments.length),I(this,It,t!==!1,"f"),this}string(t){return S("<array|string>",[t],arguments.length),this[Xe]("string",t),this[Mt](t),this}terminalWidth(){return S([],0),d(this,U,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return S("<object>",[t],arguments.length),I(this,vt,!1,"f"),d(this,U,"f").y18n.updateLocale(t),this}usage(t,n,i,r){if(S("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,i,r],arguments.length),n!==void 0){if(Ae(t,null,d(this,U,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,i,r);throw new Z(".usage() description must start with $0 if being used as alias for .command()")}else return d(this,k,"f").usage(t),this}version(t,n,i){let r="version";if(S("[boolean|string] [string] [string]",[t,n,i],arguments.length),d(this,Te,"f")&&(this[di](d(this,Te,"f")),d(this,k,"f").version(void 0),I(this,Te,null,"f")),arguments.length===0)i=this[kr](),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 I(this,Te,typeof t=="string"?t:r,"f"),n=n||d(this,k,"f").deferY18nLookup("Show version number"),d(this,k,"f").version(i||void 0),this.boolean(d(this,Te,"f")),this.describe(d(this,Te,"f"),n),this}wrap(t){return S("<number|null|undefined>",[t],arguments.length),d(this,k,"f").wrap(t),this}[(ae=new WeakMap,xt=new WeakMap,on=new WeakMap,Pe=new WeakMap,Ee=new WeakMap,_n=new WeakMap,Qe=new WeakMap,vt=new WeakMap,En=new WeakMap,Me=new WeakMap,Sn=new WeakMap,Fe=new WeakMap,Ne=new WeakMap,Se=new WeakMap,Le=new WeakMap,In=new WeakMap,Ht=new WeakMap,me=new WeakMap,F=new WeakMap,jn=new WeakMap,Pn=new WeakMap,Ie=new WeakMap,Ot=new WeakMap,Bt=new WeakMap,_t=new WeakMap,Ze=new WeakMap,Mn=new WeakMap,U=new WeakMap,Et=new WeakMap,St=new WeakMap,It=new WeakMap,k=new WeakMap,Te=new WeakMap,oe=new WeakMap,Ur)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[Hr](){return{log:(...t)=>{this[Fn]()||console.log(...t),I(this,Se,!0,"f"),d(this,me,"f").length&&I(this,me,d(this,me,"f")+`
63
+ `,"f"),I(this,me,d(this,me,"f")+t.join(" "),"f")},error:(...t)=>{this[Fn]()||console.error(...t),I(this,Se,!0,"f"),d(this,me,"f").length&&I(this,me,d(this,me,"f")+`
64
+ `,"f"),I(this,me,d(this,me,"f")+t.join(" "),"f")}}}[di](t){$t(d(this,F,"f")).forEach(n=>{if((r=>r==="configObjects")(n))return;let i=d(this,F,"f")[n];Array.isArray(i)?i.includes(t)&&i.splice(i.indexOf(t),1):typeof i=="object"&&delete i[t]}),delete d(this,k,"f").getDescriptions()[t]}[Br](t,n,i){d(this,En,"f")[i]||(d(this,U,"f").process.emitWarning(t,n),d(this,En,"f")[i]=!0)}[Wr](){d(this,Sn,"f").push({options:d(this,F,"f"),configObjects:d(this,F,"f").configObjects.slice(0),exitProcess:d(this,Me,"f"),groups:d(this,Ne,"f"),strict:d(this,Et,"f"),strictCommands:d(this,St,"f"),strictOptions:d(this,It,"f"),completionCommand:d(this,Ee,"f"),output:d(this,me,"f"),exitError:d(this,Qe,"f"),hasOutput:d(this,Se,"f"),parsed:this.parsed,parseFn:d(this,Ie,"f"),parseContext:d(this,Ot,"f")}),d(this,k,"f").freeze(),d(this,oe,"f").freeze(),d(this,ae,"f").freeze(),d(this,Fe,"f").freeze()}[Yr](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(d(this,U,"f").process.argv()[0])?n=d(this,U,"f").process.argv().slice(1,2):n=d(this,U,"f").process.argv().slice(0,1),t=n.map(i=>{let r=this[to](d(this,xt,"f"),i);return i.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<i.length?r:i}).join(" ").trim(),d(this,U,"f").getEnv("_")&&d(this,U,"f").getProcessArgvBin()===d(this,U,"f").getEnv("_")&&(t=d(this,U,"f").getEnv("_").replace(`${d(this,U,"f").path.dirname(d(this,U,"f").process.execPath())}/`,"")),t}[jt](){return d(this,Pn,"f")}[hi](){if(!d(this,vt,"f"))return;let t=d(this,U,"f").getEnv("LC_ALL")||d(this,U,"f").getEnv("LC_MESSAGES")||d(this,U,"f").getEnv("LANG")||d(this,U,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[kr](){return this[mi]().version||"unknown"}[zr](t){let n=t["--"]?t["--"]:t._;for(let i=0,r;(r=n[i])!==void 0;i++)d(this,U,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(n[i]=Number(r));return t}[mi](t){let n=t||"*";if(d(this,Bt,"f")[n])return d(this,Bt,"f")[n];let i={};try{let r=t||d(this,U,"f").mainFilename;!t&&d(this,U,"f").path.extname(r)&&(r=d(this,U,"f").path.dirname(r));let s=d(this,U,"f").findUp(r,(o,a)=>{if(a.includes("package.json"))return"package.json"});Ae(s,void 0,d(this,U,"f")),i=JSON.parse(d(this,U,"f").readFileSync(s,"utf8"))}catch(r){}return d(this,Bt,"f")[n]=i||{},d(this,Bt,"f")[n]}[Xe](t,n){n=[].concat(n),n.forEach(i=>{i=this[yi](i),d(this,F,"f")[t].push(i)})}[Wt](t,n,i,r){this[bi](t,n,i,r,(s,o,a)=>{d(this,F,"f")[s][o]=a})}[gi](t,n,i,r){this[bi](t,n,i,r,(s,o,a)=>{d(this,F,"f")[s][o]=(d(this,F,"f")[s][o]||[]).concat(a)})}[bi](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 $t(i))t(o,i[o]);else s(n,this[yi](i),r)}[yi](t){return t==="__proto__"?"___proto___":t}[wi](t,n){return this[Wt](this[wi].bind(this),"key",t,n),this}[Ci](){var t,n,i,r,s,o,a,l,c,f,u,p;let h=d(this,Sn,"f").pop();Ae(h,void 0,d(this,U,"f"));let g;t=this,n=this,i=this,r=this,s=this,o=this,a=this,l=this,c=this,f=this,u=this,p=this,{options:{set value(b){I(t,F,b,"f")}}.value,configObjects:g,exitProcess:{set value(b){I(n,Me,b,"f")}}.value,groups:{set value(b){I(i,Ne,b,"f")}}.value,output:{set value(b){I(r,me,b,"f")}}.value,exitError:{set value(b){I(s,Qe,b,"f")}}.value,hasOutput:{set value(b){I(o,Se,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){I(a,Et,b,"f")}}.value,strictCommands:{set value(b){I(l,St,b,"f")}}.value,strictOptions:{set value(b){I(c,It,b,"f")}}.value,completionCommand:{set value(b){I(f,Ee,b,"f")}}.value,parseFn:{set value(b){I(u,Ie,b,"f")}}.value,parseContext:{set value(b){I(p,Ot,b,"f")}}.value}=h,d(this,F,"f").configObjects=g,d(this,k,"f").unfreeze(),d(this,oe,"f").unfreeze(),d(this,ae,"f").unfreeze(),d(this,Fe,"f").unfreeze()}[Gr](t,n){return At(n,i=>(t(i),i))}getInternalMethods(){return{getCommandInstance:this[qr].bind(this),getContext:this[Kr].bind(this),getHasOutput:this[Vr].bind(this),getLoggerInstance:this[Jr].bind(this),getParseContext:this[Qr].bind(this),getParserConfiguration:this[jt].bind(this),getUsageInstance:this[Zr].bind(this),getValidationInstance:this[Xr].bind(this),hasParseCallback:this[Fn].bind(this),isGlobalContext:this[eo].bind(this),postProcess:this[Pt].bind(this),reset:this[Ai].bind(this),runValidation:this[xi].bind(this),runYargsParserAndExecuteCommands:this[sn].bind(this),setHasOutput:this[no].bind(this)}}[qr](){return d(this,ae,"f")}[Kr](){return d(this,on,"f")}[Vr](){return d(this,Se,"f")}[Jr](){return d(this,Ht,"f")}[Qr](){return d(this,Ot,"f")||{}}[Zr](){return d(this,k,"f")}[Xr](){return d(this,oe,"f")}[Fn](){return!!d(this,Ie,"f")}[eo](){return d(this,In,"f")}[Pt](t,n,i,r){return i||ee(t)||(n||(t=this[Ur](t)),(this[jt]()["parse-positional-numbers"]||this[jt]()["parse-positional-numbers"]===void 0)&&(t=this[zr](t)),r&&(t=Ct(t,this,d(this,Fe,"f").getMiddleware(),!1))),t}[Ai](t={}){I(this,F,d(this,F,"f")||{},"f");let n={};n.local=d(this,F,"f").local||[],n.configObjects=d(this,F,"f").configObjects||[];let i={};n.local.forEach(o=>{i[o]=!0,(t[o]||[]).forEach(a=>{i[a]=!0})}),Object.assign(d(this,_t,"f"),Object.keys(d(this,Ne,"f")).reduce((o,a)=>{let l=d(this,Ne,"f")[a].filter(c=>!(c in i));return l.length>0&&(o[a]=l),o},{})),I(this,Ne,{},"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,F,"f")[o]||[]).filter(a=>!i[a])}),s.forEach(o=>{n[o]=Ve(d(this,F,"f")[o],a=>!i[a])}),n.envPrefix=d(this,F,"f").envPrefix,I(this,F,n,"f"),I(this,k,d(this,k,"f")?d(this,k,"f").reset(i):Mr(this,d(this,U,"f")),"f"),I(this,oe,d(this,oe,"f")?d(this,oe,"f").reset(i):Rr(this,d(this,k,"f"),d(this,U,"f")),"f"),I(this,ae,d(this,ae,"f")?d(this,ae,"f").reset():Ir(d(this,k,"f"),d(this,oe,"f"),d(this,Fe,"f"),d(this,U,"f")),"f"),d(this,Pe,"f")||I(this,Pe,Dr(this,d(this,k,"f"),d(this,ae,"f"),d(this,U,"f")),"f"),d(this,Fe,"f").reset(),I(this,Ee,null,"f"),I(this,me,"","f"),I(this,Qe,null,"f"),I(this,Se,!1,"f"),this.parsed=!1,this}[to](t,n){return d(this,U,"f").path.relative(t,n)}[sn](t,n,i,r=0,s=!1){let o=!!i||s;t=t||d(this,Ze,"f"),d(this,F,"f").__=d(this,U,"f").y18n.__,d(this,F,"f").configuration=this[jt]();let a=!!d(this,F,"f").configuration["populate--"],l=Object.assign({},d(this,F,"f").configuration,{"populate--":!0}),c=d(this,U,"f").Parser.detailed(t,Object.assign({},d(this,F,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),f=Object.assign(c.argv,d(this,Ot,"f")),u,p=c.aliases,h=!1,g=!1;Object.keys(f).forEach(b=>{b===d(this,Le,"f")&&f[b]?h=!0:b===d(this,Te,"f")&&f[b]&&(g=!0)}),f.$0=this.$0,this.parsed=c,r===0&&d(this,k,"f").clearCachedHelpMessage();try{if(this[hi](),n)return this[Pt](f,a,!!i,!1);d(this,Le,"f")&&[d(this,Le,"f")].concat(p[d(this,Le,"f")]||[]).filter(L=>L.length>1).includes(""+f._[f._.length-1])&&(f._.pop(),h=!0),I(this,In,!1,"f");let b=d(this,ae,"f").getCommands(),m=d(this,Pe,"f").completionKey in f,x=h||m||s;if(f._.length){if(b.length){let v;for(let L=r||0,Y;f._[L]!==void 0;L++)if(Y=String(f._[L]),b.includes(Y)&&Y!==d(this,Ee,"f")){let z=d(this,ae,"f").runCommand(Y,this,c,L+1,s,h||g||s);return this[Pt](z,a,!!i,!1)}else if(!v&&Y!==d(this,Ee,"f")){v=Y;break}!d(this,ae,"f").hasDefaultCommand()&&d(this,Mn,"f")&&v&&!x&&d(this,oe,"f").recommendCommands(v,b)}d(this,Ee,"f")&&f._.includes(d(this,Ee,"f"))&&!m&&(d(this,Me,"f")&&Je(!0),this.showCompletionScript(),this.exit(0))}if(d(this,ae,"f").hasDefaultCommand()&&!x){let v=d(this,ae,"f").runCommand(null,this,c,0,s,h||g||s);return this[Pt](v,a,!!i,!1)}if(m){d(this,Me,"f")&&Je(!0),t=[].concat(t);let v=t.slice(t.indexOf(`--${d(this,Pe,"f").completionKey}`)+1);return d(this,Pe,"f").getCompletion(v,(L,Y)=>{if(L)throw new Z(L.message);(Y||[]).forEach(z=>{d(this,Ht,"f").log(z)}),this.exit(0)}),this[Pt](f,!a,!!i,!1)}if(d(this,Se,"f")||(h?(d(this,Me,"f")&&Je(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(d(this,Me,"f")&&Je(!0),o=!0,d(this,k,"f").showVersion("log"),this.exit(0))),!o&&d(this,F,"f").skipValidation.length>0&&(o=Object.keys(f).some(v=>d(this,F,"f").skipValidation.indexOf(v)>=0&&f[v]===!0)),!o){if(c.error)throw new Z(c.error.message);if(!m){let v=this[xi](p,{},c.error);i||(u=Ct(f,this,d(this,Fe,"f").getMiddleware(),!0)),u=this[Gr](v,u!=null?u:f),ee(u)&&!i&&(u=u.then(()=>Ct(f,this,d(this,Fe,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Z)d(this,k,"f").fail(b.message,b);else throw b}return this[Pt](u!=null?u:f,a,!!i,!0)}[xi](t,n,i,r){let s={...this.getDemandedOptions()};return o=>{if(i)throw new Z(i.message);d(this,oe,"f").nonOptionCount(o),d(this,oe,"f").requiredArguments(o,s);let a=!1;d(this,St,"f")&&(a=d(this,oe,"f").unknownCommands(o)),d(this,Et,"f")&&!a?d(this,oe,"f").unknownArguments(o,t,n,!!r):d(this,It,"f")&&d(this,oe,"f").unknownArguments(o,t,{},!1,!1),d(this,oe,"f").limitedChoices(o),d(this,oe,"f").implications(o),d(this,oe,"f").conflicting(o)}}[no](){I(this,Se,!0,"f")}[Mt](t){if(typeof t=="string")d(this,F,"f").key[t]=!0;else for(let n of t)d(this,F,"f").key[n]=!0}};function jr(e){return!!e&&typeof e.getInternalMethods=="function"}var Va=io(vr),Yt=Va;import gp from"isomorphic-unfetch";var Ja=Object.create,Oi=Object.defineProperty,Qa=Object.defineProperties,Za=Object.getOwnPropertyDescriptor,Xa=Object.getOwnPropertyDescriptors,el=Object.getOwnPropertyNames,ro=Object.getOwnPropertySymbols,tl=Object.getPrototypeOf,ao=Object.prototype.hasOwnProperty,nl=Object.prototype.propertyIsEnumerable,oo=(e,t,n)=>t in e?Oi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,il=(e,t)=>{for(var n in t||(t={}))ao.call(t,n)&&oo(e,n,t[n]);if(ro)for(var n of ro(t))nl.call(t,n)&&oo(e,n,t[n]);return e},rl=(e,t)=>Qa(e,Xa(t)),so=(e=>typeof be!="undefined"?be:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof be!="undefined"?be:t)[n]}):e)(function(e){if(typeof be!="undefined")return be.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),Re=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ol=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of el(t))!ao.call(e,r)&&r!==n&&Oi(e,r,{get:()=>t[r],enumerable:!(i=Za(t,r))||i.enumerable});return e},_i=(e,t,n)=>(n=e!=null?Ja(tl(e)):{},ol(t||!e||!e.__esModule?Oi(n,"default",{value:e,enumerable:!0}):n,e)),sl=Re((e,t)=>{"use strict";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]}}),lo=Re((e,t)=>{var n=sl(),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,c=o[2]/255,f=Math.min(a,l,c),u=Math.max(a,l,c),p=u-f,h,g;u===f?h=0:a===u?h=(l-c)/p:l===u?h=2+(c-a)/p:c===u&&(h=4+(a-l)/p),h=Math.min(h*60,360),h<0&&(h+=360);let b=(f+u)/2;return u===f?g=0:b<=.5?g=p/(u+f):g=p/(2-u-f),[h,g*100,b*100]},r.rgb.hsv=function(o){let a,l,c,f,u,p=o[0]/255,h=o[1]/255,g=o[2]/255,b=Math.max(p,h,g),m=b-Math.min(p,h,g),x=function(v){return(b-v)/6/m+1/2};return m===0?(f=0,u=0):(u=m/b,a=x(p),l=x(h),c=x(g),p===b?f=c-l:h===b?f=1/3+a-c:g===b&&(f=2/3+l-a),f<0?f+=1:f>1&&(f-=1)),[f*360,u*100,b*100]},r.rgb.hwb=function(o){let a=o[0],l=o[1],c=o[2],f=r.rgb.hsl(o)[0],u=1/255*Math.min(a,Math.min(l,c));return c=1-1/255*Math.max(a,Math.max(l,c)),[f,u*100,c*100]},r.rgb.cmyk=function(o){let a=o[0]/255,l=o[1]/255,c=o[2]/255,f=Math.min(1-a,1-l,1-c),u=(1-a-f)/(1-f)||0,p=(1-l-f)/(1-f)||0,h=(1-c-f)/(1-f)||0;return[u*100,p*100,h*100,f*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,c;for(let f of Object.keys(n)){let u=n[f],p=s(o,u);p<l&&(l=p,c=f)}return c},r.keyword.rgb=function(o){return n[o]},r.rgb.xyz=function(o){let a=o[0]/255,l=o[1]/255,c=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,c=c>.04045?((c+.055)/1.055)**2.4:c/12.92;let f=a*.4124+l*.3576+c*.1805,u=a*.2126+l*.7152+c*.0722,p=a*.0193+l*.1192+c*.9505;return[f*100,u*100,p*100]},r.rgb.lab=function(o){let a=r.rgb.xyz(o),l=a[0],c=a[1],f=a[2];l/=95.047,c/=100,f/=108.883,l=l>.008856?l**(1/3):7.787*l+16/116,c=c>.008856?c**(1/3):7.787*c+16/116,f=f>.008856?f**(1/3):7.787*f+16/116;let u=116*c-16,p=500*(l-c),h=200*(c-f);return[u,p,h]},r.hsl.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100,f,u,p;if(l===0)return p=c*255,[p,p,p];c<.5?f=c*(1+l):f=c+l-c*l;let h=2*c-f,g=[0,0,0];for(let b=0;b<3;b++)u=a+1/3*-(b-1),u<0&&u++,u>1&&u--,6*u<1?p=h+(f-h)*6*u:2*u<1?p=f:3*u<2?p=h+(f-h)*(2/3-u)*6:p=h,g[b]=p*255;return g},r.hsl.hsv=function(o){let a=o[0],l=o[1]/100,c=o[2]/100,f=l,u=Math.max(c,.01);c*=2,l*=c<=1?c:2-c,f*=u<=1?u:2-u;let p=(c+l)/2,h=c===0?2*f/(u+f):2*l/(c+l);return[a,h*100,p*100]},r.hsv.rgb=function(o){let a=o[0]/60,l=o[1]/100,c=o[2]/100,f=Math.floor(a)%6,u=a-Math.floor(a),p=255*c*(1-l),h=255*c*(1-l*u),g=255*c*(1-l*(1-u));switch(c*=255,f){case 0:return[c,g,p];case 1:return[h,c,p];case 2:return[p,c,g];case 3:return[p,h,c];case 4:return[g,p,c];case 5:return[c,p,h]}},r.hsv.hsl=function(o){let a=o[0],l=o[1]/100,c=o[2]/100,f=Math.max(c,.01),u,p;p=(2-l)*c;let h=(2-l)*f;return u=l*f,u/=h<=1?h:2-h,u=u||0,p/=2,[a,u*100,p*100]},r.hwb.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100,f=l+c,u;f>1&&(l/=f,c/=f);let p=Math.floor(6*a),h=1-c;u=6*a-p,(p&1)!==0&&(u=1-u);let g=l+u*(h-l),b,m,x;switch(p){default:case 6:case 0:b=h,m=g,x=l;break;case 1:b=g,m=h,x=l;break;case 2:b=l,m=h,x=g;break;case 3:b=l,m=g,x=h;break;case 4:b=g,m=l,x=h;break;case 5:b=h,m=l,x=g;break}return[b*255,m*255,x*255]},r.cmyk.rgb=function(o){let a=o[0]/100,l=o[1]/100,c=o[2]/100,f=o[3]/100,u=1-Math.min(1,a*(1-f)+f),p=1-Math.min(1,l*(1-f)+f),h=1-Math.min(1,c*(1-f)+f);return[u*255,p*255,h*255]},r.xyz.rgb=function(o){let a=o[0]/100,l=o[1]/100,c=o[2]/100,f,u,p;return f=a*3.2406+l*-1.5372+c*-.4986,u=a*-.9689+l*1.8758+c*.0415,p=a*.0557+l*-.204+c*1.057,f=f>.0031308?1.055*f**(1/2.4)-.055:f*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,p=p>.0031308?1.055*p**(1/2.4)-.055:p*12.92,f=Math.min(Math.max(0,f),1),u=Math.min(Math.max(0,u),1),p=Math.min(Math.max(0,p),1),[f*255,u*255,p*255]},r.xyz.lab=function(o){let a=o[0],l=o[1],c=o[2];a/=95.047,l/=100,c/=108.883,a=a>.008856?a**(1/3):7.787*a+16/116,l=l>.008856?l**(1/3):7.787*l+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;let f=116*l-16,u=500*(a-l),p=200*(l-c);return[f,u,p]},r.lab.xyz=function(o){let a=o[0],l=o[1],c=o[2],f,u,p;u=(a+16)/116,f=l/500+u,p=u-c/200;let h=u**3,g=f**3,b=p**3;return u=h>.008856?h:(u-16/116)/7.787,f=g>.008856?g:(f-16/116)/7.787,p=b>.008856?b:(p-16/116)/7.787,f*=95.047,u*=100,p*=108.883,[f,u,p]},r.lab.lch=function(o){let a=o[0],l=o[1],c=o[2],f;f=Math.atan2(c,l)*360/2/Math.PI,f<0&&(f+=360);let u=Math.sqrt(l*l+c*c);return[a,u,f]},r.lch.lab=function(o){let a=o[0],l=o[1],c=o[2]/360*2*Math.PI,f=l*Math.cos(c),u=l*Math.sin(c);return[a,f,u]},r.rgb.ansi16=function(o,a=null){let[l,c,f]=o,u=a===null?r.rgb.hsv(o)[2]:a;if(u=Math.round(u/50),u===0)return 30;let p=30+(Math.round(f/255)<<2|Math.round(c/255)<<1|Math.round(l/255));return u===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],c=o[2];return a===l&&l===c?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(c/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,c=(a&1)*l*255,f=(a>>1&1)*l*255,u=(a>>2&1)*l*255;return[c,f,u]},r.ansi256.rgb=function(o){if(o>=232){let u=(o-232)*10+8;return[u,u,u]}o-=16;let a,l=Math.floor(o/36)/5*255,c=Math.floor((a=o%36)/6)/5*255,f=a%6/5*255;return[l,c,f]},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 c=parseInt(l,16),f=c>>16&255,u=c>>8&255,p=c&255;return[f,u,p]},r.rgb.hcg=function(o){let a=o[0]/255,l=o[1]/255,c=o[2]/255,f=Math.max(Math.max(a,l),c),u=Math.min(Math.min(a,l),c),p=f-u,h,g;return p<1?h=u/(1-p):h=0,p<=0?g=0:f===a?g=(l-c)/p%6:f===l?g=2+(c-a)/p:g=4+(a-l)/p,g/=6,g%=1,[g*360,p*100,h*100]},r.hsl.hcg=function(o){let a=o[1]/100,l=o[2]/100,c=l<.5?2*a*l:2*a*(1-l),f=0;return c<1&&(f=(l-.5*c)/(1-c)),[o[0],c*100,f*100]},r.hsv.hcg=function(o){let a=o[1]/100,l=o[2]/100,c=a*l,f=0;return c<1&&(f=(l-c)/(1-c)),[o[0],c*100,f*100]},r.hcg.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100;if(l===0)return[c*255,c*255,c*255];let f=[0,0,0],u=a%1*6,p=u%1,h=1-p,g=0;switch(Math.floor(u)){case 0:f[0]=1,f[1]=p,f[2]=0;break;case 1:f[0]=h,f[1]=1,f[2]=0;break;case 2:f[0]=0,f[1]=1,f[2]=p;break;case 3:f[0]=0,f[1]=h,f[2]=1;break;case 4:f[0]=p,f[1]=0,f[2]=1;break;default:f[0]=1,f[1]=0,f[2]=h}return g=(1-l)*c,[(l*f[0]+g)*255,(l*f[1]+g)*255,(l*f[2]+g)*255]},r.hcg.hsv=function(o){let a=o[1]/100,l=o[2]/100,c=a+l*(1-a),f=0;return c>0&&(f=a/c),[o[0],f*100,c*100]},r.hcg.hsl=function(o){let a=o[1]/100,l=o[2]/100*(1-a)+.5*a,c=0;return l>0&&l<.5?c=a/(2*l):l>=.5&&l<1&&(c=a/(2*(1-l))),[o[0],c*100,l*100]},r.hcg.hwb=function(o){let a=o[1]/100,l=o[2]/100,c=a+l*(1-a);return[o[0],(c-a)*100,(1-c)*100]},r.hwb.hcg=function(o){let a=o[1]/100,l=o[2]/100,c=1-l,f=c-a,u=0;return f<1&&(u=(c-f)/(1-f)),[o[0],f*100,u*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]}}),al=Re((e,t)=>{var n=lo();function i(){let a={},l=Object.keys(n);for(let c=l.length,f=0;f<c;f++)a[l[f]]={distance:-1,parent:null};return a}function r(a){let l=i(),c=[a];for(l[a].distance=0;c.length;){let f=c.pop(),u=Object.keys(n[f]);for(let p=u.length,h=0;h<p;h++){let g=u[h],b=l[g];b.distance===-1&&(b.distance=l[f].distance+1,b.parent=f,c.unshift(g))}}return l}function s(a,l){return function(c){return l(a(c))}}function o(a,l){let c=[l[a].parent,a],f=n[l[a].parent][a],u=l[a].parent;for(;l[u].parent;)c.unshift(l[u].parent),f=s(n[l[u].parent][u],f),u=l[u].parent;return f.conversion=c,f}t.exports=function(a){let l=r(a),c={},f=Object.keys(l);for(let u=f.length,p=0;p<u;p++){let h=f[p];l[h].parent!==null&&(c[h]=o(h,l))}return c}}),ll=Re((e,t)=>{var n=lo(),i=al(),r={},s=Object.keys(n);function o(l){let c=function(...f){let u=f[0];return u==null?u:(u.length>1&&(f=u),l(f))};return"conversion"in l&&(c.conversion=l.conversion),c}function a(l){let c=function(...f){let u=f[0];if(u==null)return u;u.length>1&&(f=u);let p=l(f);if(typeof p=="object")for(let h=p.length,g=0;g<h;g++)p[g]=Math.round(p[g]);return p};return"conversion"in l&&(c.conversion=l.conversion),c}s.forEach(l=>{r[l]={},Object.defineProperty(r[l],"channels",{value:n[l].channels}),Object.defineProperty(r[l],"labels",{value:n[l].labels});let c=i(l);Object.keys(c).forEach(f=>{let u=c[f];r[l][f]=a(u),r[l][f].raw=o(u)})}),t.exports=r}),cl=Re((e,t)=>{"use strict";var n=(u,p)=>(...h)=>`\x1B[${u(...h)+p}m`,i=(u,p)=>(...h)=>{let g=u(...h);return`\x1B[${38+p};5;${g}m`},r=(u,p)=>(...h)=>{let g=u(...h);return`\x1B[${38+p};2;${g[0]};${g[1]};${g[2]}m`},s=u=>u,o=(u,p,h)=>[u,p,h],a=(u,p,h)=>{Object.defineProperty(u,p,{get:()=>{let g=h();return Object.defineProperty(u,p,{value:g,enumerable:!0,configurable:!0}),g},enumerable:!0,configurable:!0})},l,c=(u,p,h,g)=>{l===void 0&&(l=ll());let b=g?10:0,m={};for(let[x,v]of Object.entries(l)){let L=x==="ansi16"?"ansi":x;x===p?m[L]=u(h,b):typeof v=="object"&&(m[L]=u(v[p],b))}return m};function f(){let u=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,g]of Object.entries(p)){for(let[b,m]of Object.entries(g))p[b]={open:`\x1B[${m[0]}m`,close:`\x1B[${m[1]}m`},g[b]=p[b],u.set(m[0],m[1]);Object.defineProperty(p,h,{value:g,enumerable:!1})}return Object.defineProperty(p,"codes",{value:u,enumerable:!1}),p.color.close="\x1B[39m",p.bgColor.close="\x1B[49m",a(p.color,"ansi",()=>c(n,"ansi16",s,!1)),a(p.color,"ansi256",()=>c(i,"ansi256",s,!1)),a(p.color,"ansi16m",()=>c(r,"rgb",o,!1)),a(p.bgColor,"ansi",()=>c(n,"ansi16",s,!0)),a(p.bgColor,"ansi256",()=>c(i,"ansi256",s,!0)),a(p.bgColor,"ansi16m",()=>c(r,"rgb",o,!0)),p}Object.defineProperty(t,"exports",{enumerable:!0,get:f})}),fl=Re((e,t)=>{"use strict";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)}}),ul=Re((e,t)=>{"use strict";var n=so("os"),i=so("tty"),r=fl(),{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(f){return f===0?!1:{level:f,hasBasic:!0,has256:f>=2,has16m:f>=3}}function l(f,u){if(o===0)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(f&&!u&&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 c(f){let u=l(f,f&&f.isTTY);return a(u)}t.exports={supportsColor:c,stdout:a(l(!0,i.isatty(1))),stderr:a(l(!0,i.isatty(2)))}}),pl=Re((e,t)=>{"use strict";var n=(r,s,o)=>{let a=r.indexOf(s);if(a===-1)return r;let l=s.length,c=0,f="";do f+=r.substr(c,a-c)+s+o,c=a+l,a=r.indexOf(s,c);while(a!==-1);return f+=r.substr(c),f},i=(r,s,o,a)=>{let l=0,c="";do{let f=r[a-1]==="\r";c+=r.substr(l,(f?a-1:a)-l)+s+(f?`\r
65
65
  `:`
66
66
  `)+o,l=a+1,a=r.indexOf(`
67
- `,l)}while(a!==-1);return c+=r.substr(l),c};t.exports={stringReplaceAll:n,stringEncaseCRLFWithFirstIndex:i}}),yl=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(u){let p=u[0]==="u",h=u[1]==="{";return p&&!h&&u.length===5||u[0]==="x"&&u.length===3?String.fromCharCode(parseInt(u.slice(1),16)):p&&h?String.fromCodePoint(parseInt(u.slice(2,-1),16)):o.get(u)||u}function l(u,p){let h=[],g=p.trim().split(/\s*,\s*/g),b;for(let m of g){let v=Number(m);if(!Number.isNaN(v))h.push(v);else if(b=m.match(r))h.push(b[2].replace(s,(O,N,G)=>N?a(N):G));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${u}')`)}return h}function c(u){i.lastIndex=0;let p=[],h;for(;(h=i.exec(u))!==null;){let g=h[1];if(h[2]){let b=l(g,h[2]);p.push([g].concat(b))}else p.push([g])}return p}function f(u,p){let h={};for(let b of p)for(let m of b.styles)h[m[0]]=b.inverse?null:m.slice(1);let g=u;for(let[b,m]of Object.entries(h))if(Array.isArray(m)){if(!(b in g))throw new Error(`Unknown Chalk style: ${b}`);g=m.length>0?g[b](...m):g[b]}return g}t.exports=(u,p)=>{let h=[],g=[],b=[];if(p.replace(n,(m,v,O,N,G,K)=>{if(v)b.push(a(v));else if(N){let z=b.join("");b=[],g.push(h.length===0?z:f(u,h)(z)),h.push({inverse:O,styles:c(N)})}else if(G){if(h.length===0)throw new Error("Found extraneous } in Chalk template literal");g.push(f(u,h)(b.join(""))),b=[],h.pop()}else b.push(K)}),g.push(b.join("")),h.length>0){let m=`Chalk template literal is missing ${h.length} closing bracket${h.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return g.join("")}}),Pi=Be((e,t)=>{"use strict";we();var n=hl(),{stdout:i,stderr:r}=gl(),{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:o}=bl(),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],c=Object.create(null),f=(z,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 J=i?i.level:0;z.level=T.level===void 0?J:T.level},u=class{constructor(z){return p(z)}},p=z=>{let T={};return f(T,z),T.template=(...J)=>G(T.template,...J),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=u,T.template};function h(z){return p(z)}for(let[z,T]of Object.entries(n))c[z]={get(){let J=v(this,m(T.open,T.close,this._styler),this._isEmpty);return Object.defineProperty(this,z,{value:J}),J}};c.visible={get(){let z=v(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:z}),z}};var g=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let z of g)c[z]={get(){let{level:T}=this;return function(...J){let X=m(n.color[l[T]][z](...J),n.color.close,this._styler);return v(this,X,this._isEmpty)}}};for(let z of g){let T="bg"+z[0].toUpperCase()+z.slice(1);c[T]={get(){let{level:J}=this;return function(...X){let Y=m(n.bgColor[l[J]][z](...X),n.bgColor.close,this._styler);return v(this,Y,this._isEmpty)}}}}var b=Object.defineProperties(()=>{},ll(al({},c),{level:{enumerable:!0,get(){return this._generator.level},set(z){this._generator.level=z}}})),m=(z,T,J)=>{let X,Y;return J===void 0?(X=z,Y=T):(X=J.openAll+z,Y=T+J.closeAll),{open:z,close:T,openAll:X,closeAll:Y,parent:J}},v=(z,T,J)=>{let X=(...Y)=>a(Y[0])&&a(Y[0].raw)?O(X,G(X,...Y)):O(X,Y.length===1?""+Y[0]:Y.join(" "));return Object.setPrototypeOf(X,b),X._generator=z,X._styler=T,X._isEmpty=J,X},O=(z,T)=>{if(z.level<=0||!T)return z._isEmpty?"":T;let J=z._styler;if(J===void 0)return T;let{openAll:X,closeAll:Y}=J;if(T.indexOf("\x1B")!==-1)for(;J!==void 0;)T=s(T,J.close,J.open),J=J.parent;let Ie=T.indexOf(`
69
- `);return Ie!==-1&&(T=o(T,Y,X,Ie)),X+T+Y},N,G=(z,...T)=>{let[J]=T;if(!a(J)||!a(J.raw))return T.join(" ");let X=T.slice(1),Y=[J.raw[0]];for(let Ie=1;Ie<J.length;Ie++)Y.push(String(X[Ie-1]).replace(/[{}\\]/g,"\\$&"),String(J.raw[Ie]));return N===void 0&&(N=yl()),N(z,Y.join(""))};Object.defineProperties(h.prototype,c);var K=h();K.supportsColor=i,K.stderr=h({level:r?r.level:0}),K.stderr.supportsColor=r,t.exports=K});import{existsSync as dp,mkdirSync as hp}from"fs";import{readdir as mp,unlink as gp}from"fs/promises";import{extname as bp,join as Ts}from"path";A();function jo(e){return typeof e=="undefined"||e===null}function wl(e){return typeof e=="object"&&e!==null}function Cl(e){return Array.isArray(e)?e:jo(e)?[]:[e]}function Al(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 xl(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 Ol=jo,_l=wl,El=Cl,Sl=xl,Il=vl,jl=Al,ge={isNothing:Ol,isObject:_l,toArray:El,repeat:Sl,isNegativeZero:Il,extend:jl};function Po(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+=`
67
+ `,l)}while(a!==-1);return c+=r.substr(l),c};t.exports={stringReplaceAll:n,stringEncaseCRLFWithFirstIndex:i}}),dl=Re((e,t)=>{"use strict";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(u){let p=u[0]==="u",h=u[1]==="{";return p&&!h&&u.length===5||u[0]==="x"&&u.length===3?String.fromCharCode(parseInt(u.slice(1),16)):p&&h?String.fromCodePoint(parseInt(u.slice(2,-1),16)):o.get(u)||u}function l(u,p){let h=[],g=p.trim().split(/\s*,\s*/g),b;for(let m of g){let x=Number(m);if(!Number.isNaN(x))h.push(x);else if(b=m.match(r))h.push(b[2].replace(s,(v,L,Y)=>L?a(L):Y));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${u}')`)}return h}function c(u){i.lastIndex=0;let p=[],h;for(;(h=i.exec(u))!==null;){let g=h[1];if(h[2]){let b=l(g,h[2]);p.push([g].concat(b))}else p.push([g])}return p}function f(u,p){let h={};for(let b of p)for(let m of b.styles)h[m[0]]=b.inverse?null:m.slice(1);let g=u;for(let[b,m]of Object.entries(h))if(Array.isArray(m)){if(!(b in g))throw new Error(`Unknown Chalk style: ${b}`);g=m.length>0?g[b](...m):g[b]}return g}t.exports=(u,p)=>{let h=[],g=[],b=[];if(p.replace(n,(m,x,v,L,Y,z)=>{if(x)b.push(a(x));else if(L){let W=b.join("");b=[],g.push(h.length===0?W:f(u,h)(W)),h.push({inverse:v,styles:c(L)})}else if(Y){if(h.length===0)throw new Error("Found extraneous } in Chalk template literal");g.push(f(u,h)(b.join(""))),b=[],h.pop()}else b.push(z)}),g.push(b.join("")),h.length>0){let m=`Chalk template literal is missing ${h.length} closing bracket${h.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return g.join("")}}),Ei=Re((e,t)=>{"use strict";var n=cl(),{stdout:i,stderr:r}=ul(),{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:o}=pl(),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],c=Object.create(null),f=(W,D={})=>{if(D.level&&!(Number.isInteger(D.level)&&D.level>=0&&D.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let q=i?i.level:0;W.level=D.level===void 0?q:D.level},u=class{constructor(W){return p(W)}},p=W=>{let D={};return f(D,W),D.template=(...q)=>Y(D.template,...q),Object.setPrototypeOf(D,h.prototype),Object.setPrototypeOf(D.template,D),D.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},D.template.Instance=u,D.template};function h(W){return p(W)}for(let[W,D]of Object.entries(n))c[W]={get(){let q=x(this,m(D.open,D.close,this._styler),this._isEmpty);return Object.defineProperty(this,W,{value:q}),q}};c.visible={get(){let W=x(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:W}),W}};var g=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let W of g)c[W]={get(){let{level:D}=this;return function(...q){let J=m(n.color[l[D]][W](...q),n.color.close,this._styler);return x(this,J,this._isEmpty)}}};for(let W of g){let D="bg"+W[0].toUpperCase()+W.slice(1);c[D]={get(){let{level:q}=this;return function(...J){let H=m(n.bgColor[l[q]][W](...J),n.bgColor.close,this._styler);return x(this,H,this._isEmpty)}}}}var b=Object.defineProperties(()=>{},rl(il({},c),{level:{enumerable:!0,get(){return this._generator.level},set(W){this._generator.level=W}}})),m=(W,D,q)=>{let J,H;return q===void 0?(J=W,H=D):(J=q.openAll+W,H=D+q.closeAll),{open:W,close:D,openAll:J,closeAll:H,parent:q}},x=(W,D,q)=>{let J=(...H)=>a(H[0])&&a(H[0].raw)?v(J,Y(J,...H)):v(J,H.length===1?""+H[0]:H.join(" "));return Object.setPrototypeOf(J,b),J._generator=W,J._styler=D,J._isEmpty=q,J},v=(W,D)=>{if(W.level<=0||!D)return W._isEmpty?"":D;let q=W._styler;if(q===void 0)return D;let{openAll:J,closeAll:H}=q;if(D.indexOf("\x1B")!==-1)for(;q!==void 0;)D=s(D,q.close,q.open),q=q.parent;let Oe=D.indexOf(`
69
+ `);return Oe!==-1&&(D=o(D,H,J,Oe)),J+D+H},L,Y=(W,...D)=>{let[q]=D;if(!a(q)||!a(q.raw))return D.join(" ");let J=D.slice(1),H=[q.raw[0]];for(let Oe=1;Oe<q.length;Oe++)H.push(String(J[Oe-1]).replace(/[{}\\]/g,"\\$&"),String(q.raw[Oe]));return L===void 0&&(L=dl()),L(W,H.join(""))};Object.defineProperties(h.prototype,c);var z=h();z.supportsColor=i,z.stderr=h({level:r?r.level:0}),z.stderr.supportsColor=r,t.exports=z});import{existsSync as lp,mkdirSync as cp}from"fs";import{readdir as fp,unlink as up}from"fs/promises";import{extname as pp,join as Fs}from"path";function _o(e){return typeof e=="undefined"||e===null}function hl(e){return typeof e=="object"&&e!==null}function ml(e){return Array.isArray(e)?e:_o(e)?[]:[e]}function gl(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 bl(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function yl(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var wl=_o,Cl=hl,Al=ml,xl=bl,vl=yl,Ol=gl,de={isNothing:wl,isObject:Cl,toArray:Al,repeat:xl,isNegativeZero:vl,extend:Ol};function Eo(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
- `+e.mark.snippet),i+" "+n):i}function pn(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Po(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}pn.prototype=Object.create(Error.prototype);pn.prototype.constructor=pn;pn.prototype.toString=function(t){return this.name+": "+Po(this,t)};var Ee=pn;function Mi(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 Fi(e,t){return ge.repeat(" ",t-e.length)+e}function Pl(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,c,f=Math.min(e.line+t.linesAfter,r.length).toString().length,u=t.maxLength-(t.indent+f+3);for(l=1;l<=t.linesBefore&&!(o-l<0);l++)c=Mi(e.buffer,i[o-l],r[o-l],e.position-(i[o]-i[o-l]),u),a=ge.repeat(" ",t.indent)+Fi((e.line-l+1).toString(),f)+" | "+c.str+`
72
- `+a;for(c=Mi(e.buffer,i[o],r[o],e.position,u),a+=ge.repeat(" ",t.indent)+Fi((e.line+1).toString(),f)+" | "+c.str+`
73
- `,a+=ge.repeat("-",t.indent+f+3+c.pos)+`^
74
- `,l=1;l<=t.linesAfter&&!(o+l>=r.length);l++)c=Mi(e.buffer,i[o+l],r[o+l],e.position-(i[o]-i[o+l]),u),a+=ge.repeat(" ",t.indent)+Fi((e.line+l+1).toString(),f)+" | "+c.str+`
75
- `;return a.replace(/\n$/,"")}var Ml=Pl,Fl=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ll=["scalar","sequence","mapping"];function Dl(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function Nl(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Fl.indexOf(n)===-1)throw new Ee('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=Dl(t.styleAliases||null),Ll.indexOf(this.kind)===-1)throw new Ee('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var xe=Nl;function ho(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 Tl(){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 Di(e){return this.extend(e)}Di.prototype.extend=function(t){var n=[],i=[];if(t instanceof xe)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 Ee("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof xe))throw new Ee("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Ee("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 Ee("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 xe))throw new Ee("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(Di.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=ho(r,"implicit"),r.compiledExplicit=ho(r,"explicit"),r.compiledTypeMap=Tl(r.compiledImplicit,r.compiledExplicit),r};var Rl=Di,$l=new xe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Ul=new xe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Hl=new xe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Bl=new Rl({explicit:[$l,Ul,Hl]});function Wl(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Yl(){return null}function kl(e){return e===null}var zl=new xe("tag:yaml.org,2002:null",{kind:"scalar",resolve:Wl,construct:Yl,predicate:kl,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Gl(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 Kl(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Vl=new xe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Gl,construct:ql,predicate:Kl,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 Jl(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Ql(e){return 48<=e&&e<=55}function Zl(e){return 48<=e&&e<=57}function Xl(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(!Jl(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Ql(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<t;n++)if(r=e[n],r!=="_"){if(!Zl(e.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function ec(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 tc(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ge.isNegativeZero(e)}var nc=new xe("tag:yaml.org,2002:int",{kind:"scalar",resolve:Xl,construct:ec,predicate:tc,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"]}}),ic=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function rc(e){return!(e===null||!ic.test(e)||e[e.length-1]==="_")}function oc(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 sc=/^[-+]?[0-9]+e/;function ac(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),sc.test(n)?n.replace("e",".e"):n}function lc(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ge.isNegativeZero(e))}var cc=new xe("tag:yaml.org,2002:float",{kind:"scalar",resolve:rc,construct:oc,predicate:lc,represent:ac,defaultStyle:"lowercase"}),fc=Bl.extend({implicit:[zl,Vl,nc,cc]}),uc=fc,Mo=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Fo=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 pc(e){return e===null?!1:Mo.exec(e)!==null||Fo.exec(e)!==null}function dc(e){var t,n,i,r,s,o,a,l=0,c=null,f,u,p;if(t=Mo.exec(e),t===null&&(t=Fo.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]&&(f=+t[10],u=+(t[11]||0),c=(f*60+u)*6e4,t[9]==="-"&&(c=-c)),p=new Date(Date.UTC(n,i,r,s,o,a,l)),c&&p.setTime(p.getTime()-c),p}function hc(e){return e.toISOString()}var mc=new xe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:pc,construct:dc,instanceOf:Date,represent:hc});function gc(e){return e==="<<"||e===null}var bc=new xe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:gc}),Ui=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
76
- \r`;function yc(e){if(e===null)return!1;var t,n,i=0,r=e.length,s=Ui;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 wc(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,s=Ui,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 Cc(e){var t="",n=0,i,r,s=e.length,o=Ui;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 Ac(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var xc=new xe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:yc,construct:wc,predicate:Ac,represent:Cc}),vc=Object.prototype.hasOwnProperty,Oc=Object.prototype.toString;function _c(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,Oc.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 Ec(e){return e!==null?e:[]}var Sc=new xe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:_c,construct:Ec}),Ic=Object.prototype.toString;function jc(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],Ic.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;s[t]=[r[0],i[r[0]]]}return!0}function Pc(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 Mc=new xe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:jc,construct:Pc}),Fc=Object.prototype.hasOwnProperty;function Lc(e){if(e===null)return!0;var t,n=e;for(t in n)if(Fc.call(n,t)&&n[t]!==null)return!1;return!0}function Dc(e){return e!==null?e:{}}var Nc=new xe("tag:yaml.org,2002:set",{kind:"mapping",resolve:Lc,construct:Dc}),Lo=uc.extend({implicit:[mc,bc],explicit:[xc,Sc,Mc,Nc]}),ot=Object.prototype.hasOwnProperty,Rn=1,Do=2,No=3,$n=4,Li=1,Tc=2,mo=3,Rc=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,$c=/[\x85\u2028\u2029]/,Uc=/[,\[\]\{\}]/,To=/^(?:!|!!|![a-z\-]+!)$/i,Ro=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function go(e){return Object.prototype.toString.call(e)}function We(e){return e===10||e===13}function Rt(e){return e===9||e===32}function Se(e){return e===9||e===32||e===10||e===13}function Vt(e){return e===44||e===91||e===93||e===123||e===125}function Hc(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Bc(e){return e===120?2:e===117?4:e===85?8:0}function Wc(e){return 48<=e&&e<=57?e-48:-1}function bo(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 Yc(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var $o=new Array(256),Uo=new Array(256);for(Tt=0;Tt<256;Tt++)$o[Tt]=bo(Tt)?1:0,Uo[Tt]=bo(Tt);var Tt;function kc(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Lo,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 Ho(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=Ml(n),new Ee(t,n)}function U(e,t){throw Ho(e,t)}function Un(e,t){e.onWarning&&e.onWarning.call(null,Ho(e,t))}var yo={YAML:function(t,n,i){var r,s,o;t.version!==null&&U(t,"duplication of %YAML directive"),i.length!==1&&U(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&U(t,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),o=parseInt(r[2],10),s!==1&&U(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Un(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,s;i.length!==2&&U(t,"TAG directive accepts exactly two arguments"),r=i[0],s=i[1],To.test(r)||U(t,"ill-formed tag handle (first argument) of the TAG directive"),ot.call(t.tagMap,r)&&U(t,'there is a previously declared suffix for "'+r+'" tag handle'),Ro.test(s)||U(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(o){U(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||U(e,"expected valid JSON character");else Rc.test(a)&&U(e,"the stream contains non-printable characters");e.result+=a}}function wo(e,t,n,i){var r,s,o,a;for(ge.isObject(n)||U(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 Jt(e,t,n,i,r,s,o,a,l){var c,f;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),c=0,f=r.length;c<f;c+=1)Array.isArray(r[c])&&U(e,"nested arrays are not supported inside keys"),typeof r=="object"&&go(r[c])==="[object Object]"&&(r[c]="[object Object]");if(typeof r=="object"&&go(r)==="[object Object]"&&(r="[object Object]"),r=String(r),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,f=s.length;c<f;c+=1)wo(e,t,s[c],n);else wo(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,U(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 Hi(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++):U(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function pe(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);r!==0;){for(;Rt(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(Hi(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&&Un(e,"deficient indentation"),i}function Wn(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||Se(n)))}function Bi(e,t){t===1?e.result+=" ":t>1&&(e.result+=ge.repeat(`
78
- `,t-1))}function zc(e,t,n){var i,r,s,o,a,l,c,f,u=e.kind,p=e.result,h;if(h=e.input.charCodeAt(e.position),Se(h)||Vt(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),Se(r)||n&&Vt(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),Se(r)||n&&Vt(r))break}else if(h===35){if(i=e.input.charCodeAt(e.position-1),Se(i))break}else{if(e.position===e.lineStart&&Wn(e)||n&&Vt(h))break;if(We(h))if(l=e.line,c=e.lineStart,f=e.lineIndent,pe(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=c,e.lineIndent=f;break}}a&&(rt(e,s,o,!1),Bi(e,e.line-l),s=o=e.position,a=!1),Rt(h)||(o=e.position+1),h=e.input.charCodeAt(++e.position)}return rt(e,s,o,!1),e.result?!0:(e.kind=u,e.result=p,!1)}function Gc(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),Bi(e,pe(e,!1,t)),i=r=e.position):e.position===e.lineStart&&Wn(e)?U(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);U(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))pe(e,!1,t);else if(a<256&&$o[a])e.result+=Uo[a],e.position++;else if((o=Bc(a))>0){for(r=o,s=0;r>0;r--)a=e.input.charCodeAt(++e.position),(o=Hc(a))>=0?s=(s<<4)+o:U(e,"expected hexadecimal character");e.result+=Yc(s),e.position++}else U(e,"unknown escape sequence");n=i=e.position}else We(a)?(rt(e,n,i,!0),Bi(e,pe(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Wn(e)?U(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}U(e,"unexpected end of the stream within a double quoted scalar")}function Kc(e,t){var n=!0,i,r,s,o=e.tag,a,l=e.anchor,c,f,u,p,h,g=Object.create(null),b,m,v,O;if(O=e.input.charCodeAt(e.position),O===91)f=93,h=!1,a=[];else if(O===123)f=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(pe(e,!0,t),O=e.input.charCodeAt(e.position),O===f)return e.position++,e.tag=o,e.anchor=l,e.kind=h?"mapping":"sequence",e.result=a,!0;n?O===44&&U(e,"expected the node content, but found ','"):U(e,"missed comma between flow collection entries"),m=b=v=null,u=p=!1,O===63&&(c=e.input.charCodeAt(e.position+1),Se(c)&&(u=p=!0,e.position++,pe(e,!0,t))),i=e.line,r=e.lineStart,s=e.position,Qt(e,t,Rn,!1,!0),m=e.tag,b=e.result,pe(e,!0,t),O=e.input.charCodeAt(e.position),(p||e.line===i)&&O===58&&(u=!0,O=e.input.charCodeAt(++e.position),pe(e,!0,t),Qt(e,t,Rn,!1,!0),v=e.result),h?Jt(e,a,g,m,b,v,i,r,s):u?a.push(Jt(e,null,g,m,b,v,i,r,s)):a.push(b),pe(e,!0,t),O=e.input.charCodeAt(e.position),O===44?(n=!0,O=e.input.charCodeAt(++e.position)):n=!1}U(e,"unexpected end of the stream within a flow collection")}function Vc(e,t){var n,i,r=Li,s=!1,o=!1,a=t,l=0,c=!1,f,u;if(u=e.input.charCodeAt(e.position),u===124)i=!1;else if(u===62)i=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)Li===r?r=u===43?mo:Tc:U(e,"repeat of a chomping mode identifier");else if((f=Wc(u))>=0)f===0?U(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?U(e,"repeat of an indentation width identifier"):(a=t+f-1,o=!0);else break;if(Rt(u)){do u=e.input.charCodeAt(++e.position);while(Rt(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!We(u)&&u!==0)}for(;u!==0;){for(Hi(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),We(u)){l++;continue}if(e.lineIndent<a){r===mo?e.result+=ge.repeat(`
79
- `,s?1+l:l):r===Li&&s&&(e.result+=`
80
- `);break}for(i?Rt(u)?(c=!0,e.result+=ge.repeat(`
81
- `,s?1+l:l)):c?(c=!1,e.result+=ge.repeat(`
82
- `,l+1)):l===0?s&&(e.result+=" "):e.result+=ge.repeat(`
83
- `,l):e.result+=ge.repeat(`
84
- `,s?1+l:l),s=!0,o=!0,l=0,n=e.position;!We(u)&&u!==0;)u=e.input.charCodeAt(++e.position);rt(e,n,e.position,!1)}return!0}function Co(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,U(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!Se(o))));){if(a=!0,e.position++,pe(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,Qt(e,t,No,!1,!0),s.push(e.result),pe(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)U(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 Jc(e,t,n){var i,r,s,o,a,l,c=e.tag,f=e.anchor,u={},p=Object.create(null),h=null,g=null,b=null,m=!1,v=!1,O;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),O=e.input.charCodeAt(e.position);O!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,U(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(O===63||O===58)&&Se(i))O===63?(m&&(Jt(e,u,p,h,g,null,o,a,l),h=g=b=null),v=!0,m=!0,r=!0):m?(m=!1,r=!0):U(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,!Qt(e,n,Do,!1,!0))break;if(e.line===s){for(O=e.input.charCodeAt(e.position);Rt(O);)O=e.input.charCodeAt(++e.position);if(O===58)O=e.input.charCodeAt(++e.position),Se(O)||U(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(Jt(e,u,p,h,g,null,o,a,l),h=g=b=null),v=!0,m=!1,r=!1,h=e.tag,g=e.result;else if(v)U(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=f,!0}else if(v)U(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=f,!0}if((e.line===s||e.lineIndent>t)&&(m&&(o=e.line,a=e.lineStart,l=e.position),Qt(e,t,$n,!0,r)&&(m?g=e.result:b=e.result),m||(Jt(e,u,p,h,g,b,o,a,l),h=g=b=null),pe(e,!0,-1),O=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&O!==0)U(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&Jt(e,u,p,h,g,null,o,a,l),v&&(e.tag=c,e.anchor=f,e.kind="mapping",e.result=u),v}function Qc(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&&U(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)):U(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Se(o);)o===33&&(i?U(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),To.test(r)||U(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),Uc.test(s)&&U(e,"tag suffix cannot contain flow indicator characters")}s&&!Ro.test(s)&&U(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch(a){U(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:U(e,'undeclared tag handle "'+r+'"'),!0}function Zc(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&U(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Se(n)&&!Vt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&U(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Xc(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&&!Se(i)&&!Vt(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&U(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),ot.call(e.anchorMap,n)||U(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],pe(e,!0,-1),!0}function Qt(e,t,n,i,r){var s,o,a,l=1,c=!1,f=!1,u,p,h,g,b,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=a=$n===n||No===n,i&&pe(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Qc(e)||Zc(e);)pe(e,!0,-1)?(c=!0,a=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=c||r),(l===1||$n===n)&&(Rn===n||Do===n?b=t:b=t+1,m=e.position-e.lineStart,l===1?a&&(Co(e,m)||Jc(e,m,b))||Kc(e,b)?f=!0:(o&&Vc(e,b)||Gc(e,b)||qc(e,b)?f=!0:Xc(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&U(e,"alias node should not have any properties")):zc(e,b,Rn===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(f=a&&Co(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"&&U(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,p=e.implicitTypes.length;u<p;u+=1)if(g=e.implicitTypes[u],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.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))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,h=e.typeMap.multi[e.kind||"fallback"],u=0,p=h.length;u<p;u+=1)if(e.tag.slice(0,h[u].tag.length)===h[u].tag){g=h[u];break}g||U(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&U(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):U(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function ef(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&&(pe(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&&!Se(o);)o=e.input.charCodeAt(++e.position);for(i=e.input.slice(n,e.position),r=[],i.length<1&&U(e,"directive name must not be less than one character in length");o!==0;){for(;Rt(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&&!Se(o);)o=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}o!==0&&Hi(e),ot.call(yo,i)?yo[i](e,i,r):Un(e,'unknown document directive "'+i+'"')}if(pe(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,pe(e,!0,-1)):s&&U(e,"directives end mark is expected"),Qt(e,e.lineIndent-1,$n,!1,!0),pe(e,!0,-1),e.checkLineBreaks&&$c.test(e.input.slice(t,e.position))&&Un(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Wn(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,pe(e,!0,-1));return}if(e.position<e.length-1)U(e,"end of the stream or a document separator is expected");else return}function Bo(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 kc(e,t),i=e.indexOf("\0");for(i!==-1&&(n.position=i,U(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;)ef(n);return n.documents}function tf(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var i=Bo(e,n);if(typeof t!="function")return i;for(var r=0,s=i.length;r<s;r+=1)t(i[r])}function nf(e,t){var n=Bo(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Ee("expected a single document in the stream, but found more")}}var rf=tf,of=nf,Wo={loadAll:rf,load:of},Yo=Object.prototype.toString,ko=Object.prototype.hasOwnProperty,Wi=65279,sf=9,dn=10,af=13,lf=32,cf=33,ff=34,Ni=35,uf=37,pf=38,df=39,hf=42,zo=44,mf=45,Hn=58,gf=61,bf=62,yf=63,wf=64,Go=91,qo=93,Cf=96,Ko=123,Af=124,Vo=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 xf=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],vf=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Of(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&&ko.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function _f(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 Ee("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+ge.repeat("0",i-t.length)+t}var Ef=1,hn=2;function Sf(e){this.schema=e.schema||Lo,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=Of(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==='"'?hn:Ef,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 Ao(e,t){for(var n=ge.repeat(" ",t),i=0,r=-1,s="",o,a=e.length;i<a;)r=e.indexOf(`
71
+ `+e.mark.snippet),i+" "+n):i}function ln(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Eo(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ln.prototype=Object.create(Error.prototype);ln.prototype.constructor=ln;ln.prototype.toString=function(t){return this.name+": "+Eo(this,t)};var xe=ln;function Si(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 Ii(e,t){return de.repeat(" ",t-e.length)+e}function _l(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,c,f=Math.min(e.line+t.linesAfter,r.length).toString().length,u=t.maxLength-(t.indent+f+3);for(l=1;l<=t.linesBefore&&!(o-l<0);l++)c=Si(e.buffer,i[o-l],r[o-l],e.position-(i[o]-i[o-l]),u),a=de.repeat(" ",t.indent)+Ii((e.line-l+1).toString(),f)+" | "+c.str+`
72
+ `+a;for(c=Si(e.buffer,i[o],r[o],e.position,u),a+=de.repeat(" ",t.indent)+Ii((e.line+1).toString(),f)+" | "+c.str+`
73
+ `,a+=de.repeat("-",t.indent+f+3+c.pos)+`^
74
+ `,l=1;l<=t.linesAfter&&!(o+l>=r.length);l++)c=Si(e.buffer,i[o+l],r[o+l],e.position-(i[o]-i[o+l]),u),a+=de.repeat(" ",t.indent)+Ii((e.line+l+1).toString(),f)+" | "+c.str+`
75
+ `;return a.replace(/\n$/,"")}var El=_l,Sl=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Il=["scalar","sequence","mapping"];function jl(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function Pl(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Sl.indexOf(n)===-1)throw new xe('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=jl(t.styleAliases||null),Il.indexOf(this.kind)===-1)throw new xe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ye=Pl;function co(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 Ml(){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 Pi(e){return this.extend(e)}Pi.prototype.extend=function(t){var n=[],i=[];if(t instanceof ye)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 xe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof ye))throw new xe("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new xe("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 xe("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 ye))throw new xe("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(Pi.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=co(r,"implicit"),r.compiledExplicit=co(r,"explicit"),r.compiledTypeMap=Ml(r.compiledImplicit,r.compiledExplicit),r};var Fl=Pi,Ll=new ye("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Dl=new ye("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Nl=new ye("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Tl=new Fl({explicit:[Ll,Dl,Nl]});function Rl(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function $l(){return null}function Ul(e){return e===null}var Hl=new ye("tag:yaml.org,2002:null",{kind:"scalar",resolve:Rl,construct:$l,predicate:Ul,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Bl(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 Wl(e){return e==="true"||e==="True"||e==="TRUE"}function Yl(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var kl=new ye("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Bl,construct:Wl,predicate:Yl,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 zl(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Gl(e){return 48<=e&&e<=55}function ql(e){return 48<=e&&e<=57}function Kl(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(!zl(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Gl(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 Vl(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 Jl(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!de.isNegativeZero(e)}var Ql=new ye("tag:yaml.org,2002:int",{kind:"scalar",resolve:Kl,construct:Vl,predicate:Jl,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"]}}),Zl=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Xl(e){return!(e===null||!Zl.test(e)||e[e.length-1]==="_")}function ec(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 tc=/^[-+]?[0-9]+e/;function nc(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(de.isNegativeZero(e))return"-0.0";return n=e.toString(10),tc.test(n)?n.replace("e",".e"):n}function ic(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||de.isNegativeZero(e))}var rc=new ye("tag:yaml.org,2002:float",{kind:"scalar",resolve:Xl,construct:ec,predicate:ic,represent:nc,defaultStyle:"lowercase"}),oc=Tl.extend({implicit:[Hl,kl,Ql,rc]}),sc=oc,So=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Io=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 ac(e){return e===null?!1:So.exec(e)!==null||Io.exec(e)!==null}function lc(e){var t,n,i,r,s,o,a,l=0,c=null,f,u,p;if(t=So.exec(e),t===null&&(t=Io.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]&&(f=+t[10],u=+(t[11]||0),c=(f*60+u)*6e4,t[9]==="-"&&(c=-c)),p=new Date(Date.UTC(n,i,r,s,o,a,l)),c&&p.setTime(p.getTime()-c),p}function cc(e){return e.toISOString()}var fc=new ye("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:ac,construct:lc,instanceOf:Date,represent:cc});function uc(e){return e==="<<"||e===null}var pc=new ye("tag:yaml.org,2002:merge",{kind:"scalar",resolve:uc}),Ni=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
76
+ \r`;function dc(e){if(e===null)return!1;var t,n,i=0,r=e.length,s=Ni;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 hc(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,s=Ni,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 mc(e){var t="",n=0,i,r,s=e.length,o=Ni;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 gc(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var bc=new ye("tag:yaml.org,2002:binary",{kind:"scalar",resolve:dc,construct:hc,predicate:gc,represent:mc}),yc=Object.prototype.hasOwnProperty,wc=Object.prototype.toString;function Cc(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,wc.call(r)!=="[object Object]")return!1;for(s in r)if(yc.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 Ac(e){return e!==null?e:[]}var xc=new ye("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Cc,construct:Ac}),vc=Object.prototype.toString;function Oc(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],vc.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;s[t]=[r[0],i[r[0]]]}return!0}function _c(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 Ec=new ye("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Oc,construct:_c}),Sc=Object.prototype.hasOwnProperty;function Ic(e){if(e===null)return!0;var t,n=e;for(t in n)if(Sc.call(n,t)&&n[t]!==null)return!1;return!0}function jc(e){return e!==null?e:{}}var Pc=new ye("tag:yaml.org,2002:set",{kind:"mapping",resolve:Ic,construct:jc}),jo=sc.extend({implicit:[fc,pc],explicit:[bc,xc,Ec,Pc]}),tt=Object.prototype.hasOwnProperty,Ln=1,Po=2,Mo=3,Dn=4,ji=1,Mc=2,fo=3,Fc=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Lc=/[\x85\u2028\u2029]/,Dc=/[,\[\]\{\}]/,Fo=/^(?:!|!!|![a-z\-]+!)$/i,Lo=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function uo(e){return Object.prototype.toString.call(e)}function $e(e){return e===10||e===13}function Lt(e){return e===9||e===32}function ve(e){return e===9||e===32||e===10||e===13}function zt(e){return e===44||e===91||e===93||e===123||e===125}function Nc(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Tc(e){return e===120?2:e===117?4:e===85?8:0}function Rc(e){return 48<=e&&e<=57?e-48:-1}function po(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 $c(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Do=new Array(256),No=new Array(256);for(Ft=0;Ft<256;Ft++)Do[Ft]=po(Ft)?1:0,No[Ft]=po(Ft);var Ft;function Uc(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||jo,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 To(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=El(n),new xe(t,n)}function T(e,t){throw To(e,t)}function Nn(e,t){e.onWarning&&e.onWarning.call(null,To(e,t))}var ho={YAML:function(t,n,i){var r,s,o;t.version!==null&&T(t,"duplication of %YAML directive"),i.length!==1&&T(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&T(t,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),o=parseInt(r[2],10),s!==1&&T(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Nn(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,s;i.length!==2&&T(t,"TAG directive accepts exactly two arguments"),r=i[0],s=i[1],Fo.test(r)||T(t,"ill-formed tag handle (first argument) of the TAG directive"),tt.call(t.tagMap,r)&&T(t,'there is a previously declared suffix for "'+r+'" tag handle'),Lo.test(s)||T(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(o){T(t,"tag prefix is malformed: "+s)}t.tagMap[r]=s}};function et(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||T(e,"expected valid JSON character");else Fc.test(a)&&T(e,"the stream contains non-printable characters");e.result+=a}}function mo(e,t,n,i){var r,s,o,a;for(de.isObject(n)||T(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],tt.call(t,s)||(t[s]=n[s],i[s]=!0)}function Gt(e,t,n,i,r,s,o,a,l){var c,f;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),c=0,f=r.length;c<f;c+=1)Array.isArray(r[c])&&T(e,"nested arrays are not supported inside keys"),typeof r=="object"&&uo(r[c])==="[object Object]"&&(r[c]="[object Object]");if(typeof r=="object"&&uo(r)==="[object Object]"&&(r="[object Object]"),r=String(r),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,f=s.length;c<f;c+=1)mo(e,t,s[c],n);else mo(e,t,s,n);else!e.json&&!tt.call(n,r)&&tt.call(t,r)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,T(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 Ti(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++):T(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ce(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);r!==0;){for(;Lt(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($e(r))for(Ti(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&&Nn(e,"deficient indentation"),i}function $n(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||ve(n)))}function Ri(e,t){t===1?e.result+=" ":t>1&&(e.result+=de.repeat(`
78
+ `,t-1))}function Hc(e,t,n){var i,r,s,o,a,l,c,f,u=e.kind,p=e.result,h;if(h=e.input.charCodeAt(e.position),ve(h)||zt(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),ve(r)||n&&zt(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),ve(r)||n&&zt(r))break}else if(h===35){if(i=e.input.charCodeAt(e.position-1),ve(i))break}else{if(e.position===e.lineStart&&$n(e)||n&&zt(h))break;if($e(h))if(l=e.line,c=e.lineStart,f=e.lineIndent,ce(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=c,e.lineIndent=f;break}}a&&(et(e,s,o,!1),Ri(e,e.line-l),s=o=e.position,a=!1),Lt(h)||(o=e.position+1),h=e.input.charCodeAt(++e.position)}return et(e,s,o,!1),e.result?!0:(e.kind=u,e.result=p,!1)}function Bc(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(et(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 $e(n)?(et(e,i,r,!0),Ri(e,ce(e,!1,t)),i=r=e.position):e.position===e.lineStart&&$n(e)?T(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);T(e,"unexpected end of the stream within a single quoted scalar")}function Wc(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 et(e,n,e.position,!0),e.position++,!0;if(a===92){if(et(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),$e(a))ce(e,!1,t);else if(a<256&&Do[a])e.result+=No[a],e.position++;else if((o=Tc(a))>0){for(r=o,s=0;r>0;r--)a=e.input.charCodeAt(++e.position),(o=Nc(a))>=0?s=(s<<4)+o:T(e,"expected hexadecimal character");e.result+=$c(s),e.position++}else T(e,"unknown escape sequence");n=i=e.position}else $e(a)?(et(e,n,i,!0),Ri(e,ce(e,!1,t)),n=i=e.position):e.position===e.lineStart&&$n(e)?T(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}T(e,"unexpected end of the stream within a double quoted scalar")}function Yc(e,t){var n=!0,i,r,s,o=e.tag,a,l=e.anchor,c,f,u,p,h,g=Object.create(null),b,m,x,v;if(v=e.input.charCodeAt(e.position),v===91)f=93,h=!1,a=[];else if(v===123)f=125,h=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),v=e.input.charCodeAt(++e.position);v!==0;){if(ce(e,!0,t),v=e.input.charCodeAt(e.position),v===f)return e.position++,e.tag=o,e.anchor=l,e.kind=h?"mapping":"sequence",e.result=a,!0;n?v===44&&T(e,"expected the node content, but found ','"):T(e,"missed comma between flow collection entries"),m=b=x=null,u=p=!1,v===63&&(c=e.input.charCodeAt(e.position+1),ve(c)&&(u=p=!0,e.position++,ce(e,!0,t))),i=e.line,r=e.lineStart,s=e.position,qt(e,t,Ln,!1,!0),m=e.tag,b=e.result,ce(e,!0,t),v=e.input.charCodeAt(e.position),(p||e.line===i)&&v===58&&(u=!0,v=e.input.charCodeAt(++e.position),ce(e,!0,t),qt(e,t,Ln,!1,!0),x=e.result),h?Gt(e,a,g,m,b,x,i,r,s):u?a.push(Gt(e,null,g,m,b,x,i,r,s)):a.push(b),ce(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}T(e,"unexpected end of the stream within a flow collection")}function kc(e,t){var n,i,r=ji,s=!1,o=!1,a=t,l=0,c=!1,f,u;if(u=e.input.charCodeAt(e.position),u===124)i=!1;else if(u===62)i=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)ji===r?r=u===43?fo:Mc:T(e,"repeat of a chomping mode identifier");else if((f=Rc(u))>=0)f===0?T(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?T(e,"repeat of an indentation width identifier"):(a=t+f-1,o=!0);else break;if(Lt(u)){do u=e.input.charCodeAt(++e.position);while(Lt(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!$e(u)&&u!==0)}for(;u!==0;){for(Ti(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),$e(u)){l++;continue}if(e.lineIndent<a){r===fo?e.result+=de.repeat(`
79
+ `,s?1+l:l):r===ji&&s&&(e.result+=`
80
+ `);break}for(i?Lt(u)?(c=!0,e.result+=de.repeat(`
81
+ `,s?1+l:l)):c?(c=!1,e.result+=de.repeat(`
82
+ `,l+1)):l===0?s&&(e.result+=" "):e.result+=de.repeat(`
83
+ `,l):e.result+=de.repeat(`
84
+ `,s?1+l:l),s=!0,o=!0,l=0,n=e.position;!$e(u)&&u!==0;)u=e.input.charCodeAt(++e.position);et(e,n,e.position,!1)}return!0}function go(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,T(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!ve(o))));){if(a=!0,e.position++,ce(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,qt(e,t,Mo,!1,!0),s.push(e.result),ce(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)T(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 zc(e,t,n){var i,r,s,o,a,l,c=e.tag,f=e.anchor,u={},p=Object.create(null),h=null,g=null,b=null,m=!1,x=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),v=e.input.charCodeAt(e.position);v!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,T(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(v===63||v===58)&&ve(i))v===63?(m&&(Gt(e,u,p,h,g,null,o,a,l),h=g=b=null),x=!0,m=!0,r=!0):m?(m=!1,r=!0):T(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,v=i;else{if(o=e.line,a=e.lineStart,l=e.position,!qt(e,n,Po,!1,!0))break;if(e.line===s){for(v=e.input.charCodeAt(e.position);Lt(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),ve(v)||T(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(Gt(e,u,p,h,g,null,o,a,l),h=g=b=null),x=!0,m=!1,r=!1,h=e.tag,g=e.result;else if(x)T(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=f,!0}else if(x)T(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=f,!0}if((e.line===s||e.lineIndent>t)&&(m&&(o=e.line,a=e.lineStart,l=e.position),qt(e,t,Dn,!0,r)&&(m?g=e.result:b=e.result),m||(Gt(e,u,p,h,g,b,o,a,l),h=g=b=null),ce(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&v!==0)T(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&Gt(e,u,p,h,g,null,o,a,l),x&&(e.tag=c,e.anchor=f,e.kind="mapping",e.result=u),x}function Gc(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&&T(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)):T(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!ve(o);)o===33&&(i?T(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),Fo.test(r)||T(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),Dc.test(s)&&T(e,"tag suffix cannot contain flow indicator characters")}s&&!Lo.test(s)&&T(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch(a){T(e,"tag name is malformed: "+s)}return n?e.tag=s:tt.call(e.tagMap,r)?e.tag=e.tagMap[r]+s:r==="!"?e.tag="!"+s:r==="!!"?e.tag="tag:yaml.org,2002:"+s:T(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&&T(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!ve(n)&&!zt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&T(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Kc(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&&!ve(i)&&!zt(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&T(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),tt.call(e.anchorMap,n)||T(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ce(e,!0,-1),!0}function qt(e,t,n,i,r){var s,o,a,l=1,c=!1,f=!1,u,p,h,g,b,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=a=Dn===n||Mo===n,i&&ce(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Gc(e)||qc(e);)ce(e,!0,-1)?(c=!0,a=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=c||r),(l===1||Dn===n)&&(Ln===n||Po===n?b=t:b=t+1,m=e.position-e.lineStart,l===1?a&&(go(e,m)||zc(e,m,b))||Yc(e,b)?f=!0:(o&&kc(e,b)||Bc(e,b)||Wc(e,b)?f=!0:Kc(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&T(e,"alias node should not have any properties")):Hc(e,b,Ln===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(f=a&&go(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"&&T(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,p=e.implicitTypes.length;u<p;u+=1)if(g=e.implicitTypes[u],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(tt.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,h=e.typeMap.multi[e.kind||"fallback"],u=0,p=h.length;u<p;u+=1)if(e.tag.slice(0,h[u].tag.length)===h[u].tag){g=h[u];break}g||T(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&T(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):T(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function Vc(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&&(ce(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&&!ve(o);)o=e.input.charCodeAt(++e.position);for(i=e.input.slice(n,e.position),r=[],i.length<1&&T(e,"directive name must not be less than one character in length");o!==0;){for(;Lt(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!$e(o));break}if($e(o))break;for(n=e.position;o!==0&&!ve(o);)o=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}o!==0&&Ti(e),tt.call(ho,i)?ho[i](e,i,r):Nn(e,'unknown document directive "'+i+'"')}if(ce(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,ce(e,!0,-1)):s&&T(e,"directives end mark is expected"),qt(e,e.lineIndent-1,Dn,!1,!0),ce(e,!0,-1),e.checkLineBreaks&&Lc.test(e.input.slice(t,e.position))&&Nn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&$n(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ce(e,!0,-1));return}if(e.position<e.length-1)T(e,"end of the stream or a document separator is expected");else return}function Ro(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 Uc(e,t),i=e.indexOf("\0");for(i!==-1&&(n.position=i,T(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;)Vc(n);return n.documents}function Jc(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var i=Ro(e,n);if(typeof t!="function")return i;for(var r=0,s=i.length;r<s;r+=1)t(i[r])}function Qc(e,t){var n=Ro(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new xe("expected a single document in the stream, but found more")}}var Zc=Jc,Xc=Qc,$o={loadAll:Zc,load:Xc},Uo=Object.prototype.toString,Ho=Object.prototype.hasOwnProperty,$i=65279,ef=9,cn=10,tf=13,nf=32,rf=33,of=34,Mi=35,sf=37,af=38,lf=39,cf=42,Bo=44,ff=45,Tn=58,uf=61,pf=62,df=63,hf=64,Wo=91,Yo=93,mf=96,ko=123,gf=124,zo=125,we={};we[0]="\\0";we[7]="\\a";we[8]="\\b";we[9]="\\t";we[10]="\\n";we[11]="\\v";we[12]="\\f";we[13]="\\r";we[27]="\\e";we[34]='\\"';we[92]="\\\\";we[133]="\\N";we[160]="\\_";we[8232]="\\L";we[8233]="\\P";var bf=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],yf=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function wf(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&&Ho.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function Cf(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 xe("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+de.repeat("0",i-t.length)+t}var Af=1,fn=2;function xf(e){this.schema=e.schema||jo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=de.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=wf(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==='"'?fn:Af,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 bo(e,t){for(var n=de.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
- `&&(s+=n),s+=o;return s}function Ti(e,t){return`
88
- `+ge.repeat(" ",e.indent*t)}function If(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 Bn(e){return e===lf||e===sf}function mn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Wi||65536<=e&&e<=1114111}function xo(e){return mn(e)&&e!==Wi&&e!==af&&e!==dn}function vo(e,t,n){var i=xo(e),r=i&&!Bn(e);return(n?i:i&&e!==zo&&e!==Go&&e!==qo&&e!==Ko&&e!==Vo)&&e!==Ni&&!(t===Hn&&!r)||xo(t)&&!Bn(t)&&e===Ni||t===Hn&&r}function jf(e){return mn(e)&&e!==Wi&&!Bn(e)&&e!==mf&&e!==yf&&e!==Hn&&e!==zo&&e!==Go&&e!==qo&&e!==Ko&&e!==Vo&&e!==Ni&&e!==pf&&e!==hf&&e!==cf&&e!==Af&&e!==gf&&e!==bf&&e!==df&&e!==ff&&e!==uf&&e!==wf&&e!==Cf}function Pf(e){return!Bn(e)&&e!==Hn}function un(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 Jo(e){var t=/^\n* /;return t.test(e)}var Qo=1,Ri=2,Zo=3,Xo=4,Kt=5;function Mf(e,t,n,i,r,s,o,a){var l,c=0,f=null,u=!1,p=!1,h=i!==-1,g=-1,b=jf(un(e,0))&&Pf(un(e,e.length-1));if(t||o)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=un(e,l),!mn(c))return Kt;b=b&&vo(c,f,a),f=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=un(e,l),c===dn)u=!0,h&&(p=p||l-g-1>i&&e[g+1]!==" ",g=l);else if(!mn(c))return Kt;b=b&&vo(c,f,a),f=c}p=p||h&&l-g-1>i&&e[g+1]!==" "}return!u&&!p?b&&!o&&!r(e)?Qo:s===hn?Kt:Ri:n>9&&Jo(e)?Kt:o?s===hn?Kt:Ri:p?Xo:Zo}function Ff(e,t,n,i,r){e.dump=function(){if(t.length===0)return e.quotingType===hn?'""':"''";if(!e.noCompatMode&&(xf.indexOf(t)!==-1||vf.test(t)))return e.quotingType===hn?'"'+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(c){return If(e,c)}switch(Mf(t,a,e.indent,o,l,e.quotingType,e.forceQuotes&&!i,r)){case Qo:return t;case Ri:return"'"+t.replace(/'/g,"''")+"'";case Zo:return"|"+Oo(t,e.indent)+_o(Ao(t,s));case Xo:return">"+Oo(t,e.indent)+_o(Ao(Lf(t,o),s));case Kt:return'"'+Df(t)+'"';default:throw new Ee("impossible error: invalid scalar style")}}()}function Oo(e,t){var n=Jo(e)?String(t):"",i=e[e.length-1]===`
87
+ `&&(s+=n),s+=o;return s}function Fi(e,t){return`
88
+ `+de.repeat(" ",e.indent*t)}function vf(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 Rn(e){return e===nf||e===ef}function un(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==$i||65536<=e&&e<=1114111}function yo(e){return un(e)&&e!==$i&&e!==tf&&e!==cn}function wo(e,t,n){var i=yo(e),r=i&&!Rn(e);return(n?i:i&&e!==Bo&&e!==Wo&&e!==Yo&&e!==ko&&e!==zo)&&e!==Mi&&!(t===Tn&&!r)||yo(t)&&!Rn(t)&&e===Mi||t===Tn&&r}function Of(e){return un(e)&&e!==$i&&!Rn(e)&&e!==ff&&e!==df&&e!==Tn&&e!==Bo&&e!==Wo&&e!==Yo&&e!==ko&&e!==zo&&e!==Mi&&e!==af&&e!==cf&&e!==rf&&e!==gf&&e!==uf&&e!==pf&&e!==lf&&e!==of&&e!==sf&&e!==hf&&e!==mf}function _f(e){return!Rn(e)&&e!==Tn}function an(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 Go(e){var t=/^\n* /;return t.test(e)}var qo=1,Li=2,Ko=3,Vo=4,kt=5;function Ef(e,t,n,i,r,s,o,a){var l,c=0,f=null,u=!1,p=!1,h=i!==-1,g=-1,b=Of(an(e,0))&&_f(an(e,e.length-1));if(t||o)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=an(e,l),!un(c))return kt;b=b&&wo(c,f,a),f=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=an(e,l),c===cn)u=!0,h&&(p=p||l-g-1>i&&e[g+1]!==" ",g=l);else if(!un(c))return kt;b=b&&wo(c,f,a),f=c}p=p||h&&l-g-1>i&&e[g+1]!==" "}return!u&&!p?b&&!o&&!r(e)?qo:s===fn?kt:Li:n>9&&Go(e)?kt:o?s===fn?kt:Li:p?Vo:Ko}function Sf(e,t,n,i,r){e.dump=function(){if(t.length===0)return e.quotingType===fn?'""':"''";if(!e.noCompatMode&&(bf.indexOf(t)!==-1||yf.test(t)))return e.quotingType===fn?'"'+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(c){return vf(e,c)}switch(Ef(t,a,e.indent,o,l,e.quotingType,e.forceQuotes&&!i,r)){case qo:return t;case Li:return"'"+t.replace(/'/g,"''")+"'";case Ko:return"|"+Co(t,e.indent)+Ao(bo(t,s));case Vo:return">"+Co(t,e.indent)+Ao(bo(If(t,o),s));case kt:return'"'+jf(t)+'"';default:throw new xe("impossible error: invalid scalar style")}}()}function Co(e,t){var n=Go(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 _o(e){return e[e.length-1]===`
93
- `?e.slice(0,-1):e}function Lf(e,t){for(var n=/(\n+)([^\n]*)/g,i=function(){var c=e.indexOf(`
94
- `);return c=c!==-1?c:e.length,n.lastIndex=c,Eo(e.slice(0,c),t)}(),r=e[0]===`
92
+ `}function Ao(e){return e[e.length-1]===`
93
+ `?e.slice(0,-1):e}function If(e,t){for(var n=/(\n+)([^\n]*)/g,i=function(){var c=e.indexOf(`
94
+ `);return c=c!==-1?c:e.length,n.lastIndex=c,xo(e.slice(0,c),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
- `:"")+Eo(l,t),r=s}return i}function Eo(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+=`
96
+ `:"")+xo(l,t),r=s}return i}function xo(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 Df(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=un(e,r),i=ve[n],!i&&mn(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||_f(n);return t}function Nf(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)),(qe(e,t,a,!1,!1)||typeof a=="undefined"&&qe(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function So(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)),(qe(e,t+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&qe(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=Ti(e,t)),e.dump&&dn===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=s,e.dump=r||"[]"}function Tf(e,t,n){var i="",r=e.tag,s=Object.keys(n),o,a,l,c,f;for(o=0,a=s.length;o<a;o+=1)f="",i!==""&&(f+=", "),e.condenseFlow&&(f+='"'),l=s[o],c=n[l],e.replacer&&(c=e.replacer.call(n,l,c)),qe(e,t,l,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),qe(e,t,c,!1,!1)&&(f+=e.dump,i+=f));e.tag=r,e.dump="{"+i+"}"}function Rf(e,t,n,i){var r="",s=e.tag,o=Object.keys(n),a,l,c,f,u,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Ee("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)p="",(!i||r!=="")&&(p+=Ti(e,t)),c=o[a],f=n[c],e.replacer&&(f=e.replacer.call(n,c,f)),qe(e,t+1,c,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&dn===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,u&&(p+=Ti(e,t)),qe(e,t+1,f,!0,u)&&(e.dump&&dn===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,r+=p));e.tag=s,e.dump=r||"{}"}function Io(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,Yo.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(ko.call(a.represent,l))i=a.represent[l](t,l);else throw new Ee("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function qe(e,t,n,i,r,s,o){e.tag=null,e.dump=n,Io(e,n,!1)||Io(e,n,!0);var a=Yo.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var f=a==="[object Object]"||a==="[object Array]",u,p;if(f&&(u=e.duplicates.indexOf(n),p=u!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(r=!1),p&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(f&&p&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(Rf(e,t,e.dump,r),p&&(e.dump="&ref_"+u+e.dump)):(Tf(e,t,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?So(e,t-1,e.dump,r):So(e,t,e.dump,r),p&&(e.dump="&ref_"+u+e.dump)):(Nf(e,t,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Ff(e,e.dump,t,s,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Ee("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function $f(e,t){var n=[],i=[],r,s;for($i(e,n,i),r=0,s=i.length;r<s;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(s)}function $i(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)$i(e[r],t,n);else for(i=Object.keys(e),r=0,s=i.length;r<s;r+=1)$i(e[i[r]],t,n)}function Uf(e,t){t=t||{};var n=new Sf(t);n.noRefs||$f(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),qe(n,0,i,!0,!0)?n.dump+`
100
- `:""}var Hf=Uf,Bf={dump:Hf};function Yi(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 es=Wo.load,Ih=Wo.loadAll,ts=Bf.dump;var jh=Yi("safeLoad","load"),Ph=Yi("safeLoadAll","loadAll"),Mh=Yi("safeDump","dump");import{writeFileSync as yp}from"fs";import{extname as Rs}from"path";import{readFileSync as wp}from"fs";import Cp from"fs";A();function Ke(){}Ke.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(b){return r?(setTimeout(function(){r(void 0,b)},0),!0):b}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,c=1,f=a+l,u=[{newPos:-1,components:[]}],p=this.extractCommon(u[0],n,t,0);if(u[0].newPos+1>=a&&p+1>=l)return o([{value:this.join(n),count:n.length}]);function h(){for(var b=-1*c;b<=c;b+=2){var m=void 0,v=u[b-1],O=u[b+1],N=(O?O.newPos:0)-b;v&&(u[b-1]=void 0);var G=v&&v.newPos+1<a,K=O&&0<=N&&N<l;if(!G&&!K){u[b]=void 0;continue}if(!G||K&&v.newPos<O.newPos?(m=Yf(O),s.pushComponent(m.components,void 0,!0)):(m=v,m.newPos++,s.pushComponent(m.components,!0,void 0)),N=s.extractCommon(m,n,t,b),m.newPos+1>=a&&N+1>=l)return o(Wf(s,m.components,n,t,s.useLongestToken));u[b]=m}c++}if(r)(function b(){setTimeout(function(){if(c>f)return r();h()||b()},0)})();else for(;c<=f;){var g=h();if(g)return g}},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,c=0;a+1<s&&l+1<o&&this.equals(n[a+1],i[l+1]);)a++,l++,c++;return c&&t.components.push({count:c}),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 Wf(e,t,n,i,r){for(var s=0,o=t.length,a=0,l=0;s<o;s++){var c=t[s];if(c.removed){if(c.value=e.join(i.slice(l,l+c.count)),l+=c.count,s&&t[s-1].added){var u=t[s-1];t[s-1]=t[s],t[s]=u}}else{if(!c.added&&r){var f=n.slice(a,a+c.count);f=f.map(function(h,g){var b=i[l+g];return b.length>h.length?b:h}),c.value=e.join(f)}else c.value=e.join(n.slice(a,a+c.count));a+=c.count,c.added||(l+=c.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 Yf(e){return{newPos:e.newPos,components:e.components.slice(0)}}var Lh=new Ke;var ns=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,is=/\S/,rs=new Ke;rs.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!is.test(e)&&!is.test(t)};rs.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]&&ns.test(t[n])&&ns.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Gi=new Ke;Gi.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 qi(e,t,n){return Gi.diff(e,t,n)}var kf=new Ke;kf.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var zf=new Ke;zf.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Yn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Yn=function(t){return typeof t}:Yn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(e)}var Gf=Object.prototype.toString,Zt=new Ke;Zt.useLongestToken=!0;Zt.tokenize=Gi.tokenize;Zt.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(ki(e,null,null,r),r," ")};Zt.equals=function(e,t){return Ke.prototype.equals.call(Zt,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function os(e,t,n){return Zt.diff(e,t,n)}function ki(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(Gf.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]=ki(e[s],t,n,i,r);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Yn(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]=ki(e[l],t,n,i,l);t.pop(),n.pop()}else o=e;return o}var zi=new Ke;zi.tokenize=function(e){return e.slice()};zi.join=zi.removeEmpty=function(e){return e};var Hs=na(Ns(),1);we();we();async function ct({objects:e,selectIdentifier:t,selectDisplayName:n=t,onSyncComplete:i}){let r=e.reduce((a,l)=>{let c=t(l);if(a[c])throw new Error(`Identifier ${c} was not unique.`);return a[c]={id:c,object:l,providerId:c,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 pp=ji(Pi());we();function se(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 ae(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=Rs(e);return t===".yaml"||t===".yml"||t===".json"}function Ye(e,t,n){let i;if(n&&!t){let r=Rs(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=ts(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?yp(n,i,"utf8"):console.log(i)}function rn(e){let t=wp(e,"utf8");return es(t,{filename:e,json:!0})}async function*ei(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}){dp(e)||hp(e,{recursive:!0});let r=await mp(e,"utf-8"),s=new Set(r.filter(l=>{let c=bp(l);return c===".json"||c===".yaml"||c===".yml"})),o=l=>Ts(e,`${l}.${t}`);async function*a(){for(let l of s){let c=Ts(e,l);try{let f=await rn(c);yield{id:n(f),displayName:i(f),providerId:c,object:f}}catch(f){throw console.error(pp.default.red(`Failed to read ${c}, data is likely invalid.
101
- ${f==null?void 0:f.message}`)),f}}}return{objects:a(),deleteObject:async l=>{await gp(l)},writeObject:async l=>{Ye(l.object,t,o(l.id))}}}we();function $s(e,t){if(!t&&!Cp.existsSync(e))return{};let n=rn(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function Us(e,t){Ye(t,void 0,e)}we();async function ht({source:e,target:t,compareContents:n=(a,l)=>(0,Hs.default)(a.object,l.object,(c,f,u)=>u==="created"||u==="modified"?!0:void 0),mode:i,allowEmptySource:r=!1,whatIf:s=!1,log:o=()=>{}}){var a,l;let c=new Map;for await(let p of t.objects)c.set(p.id,p);let f=[],u=!1;for await(let p of e.objects){u=!0;let h=p.id,g=c.get(h);if(g){if(!n(p,g)&&(i==="createOrUpdate"||i==="mirror")){let b=async(m,v)=>{var O;if(!s)try{await t.writeObject(m,v)}catch(N){throw new Xn(N,m)}o({action:"update",id:h,providerId:m.providerId,displayName:(O=m.displayName)!=null?O:m.providerId,whatIf:s,diff:os(v.object,m.object)})};f.push(b(p,g))}c.delete(h)}else{let b=async(m,v)=>{var O;if(!s)try{await t.writeObject(m)}catch(N){throw new Xn(N,m)}o({action:"create",id:v,providerId:v,displayName:(O=m.displayName)!=null?O:m.providerId,whatIf:s,diff:qi("",JSON.stringify(m.object,null,2))})};f.push(b(p,h))}}if(await Promise.all(f),i==="mirror"){if(!u&&!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=[];c.forEach(async h=>{let g=async b=>{var m;if(!s)try{await t.deleteObject(b.providerId)}catch(v){throw new Xn(v,b)}o({action:"delete",id:b.id,providerId:b.providerId,displayName:(m=b.displayName)!=null?m:b.providerId,whatIf:s,diff:qi(JSON.stringify(b.object,null,2),"")})};p.push(g(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 Xn=class extends Error{constructor(e,t){var n;super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
102
- ${e}`),this.stack=void 0,Object.setPrototypeOf(this,Xn.prototype)}};we();var nn=ji(Pi());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=nn.default.green("[A]");break;case"update":l=nn.default.white("[U]");break;case"delete":l=nn.default.yellow("[D]");break}let c="";(t==="on"||t==="update"&&r==="update")&&(c=`
103
- `+a.map(f=>f.added?nn.default.green(f.value):f.removed?nn.default.red(f.value):f.value).join("")),console.log(`${n!=null?n:""}${o?nn.default.gray("[WHATIF]"):""}${l}${i!=null?i:""} ${s}${c}`)}}var Bs={command:"get <id>",describe:"Fetch a component definition",builder:e=>ft(se(ae(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 oe({apiKey:t,apiHost:e,fetch:Ap,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 xp from"isomorphic-unfetch";var Ws={command:"list",describe:"List component definitions",aliases:["ls"],builder:e=>ft(se(ae(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 oe({apiKey:t,apiHost:e,fetch:xp,projectId:o}).getComponentDefinitions({limit:n,offset:i});Ye(l.componentDefinitions,r,s)}};A();A();import vp from"p-limit";function ti(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 Op from"isomorphic-unfetch";A();A();var yt=e=>e.id,wt=e=>`${e.name} (pid: ${e.id})`;function ni({client:e}){async function*t(){let n=ei(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 $s(e,t)}function ii(e,t){Us(e,t)}var Ys={command:"pull <directory>",describe:"Pulls all component definitions to local files in a directory",builder:e=>se(ae(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 oe({apiKey:t,apiHost:e,fetch:Op,projectId:o,limitPolicy:bt}),c=ni({client:l}),f;if(pt(n)){let h=Ct(n,!1);f=await ct({objects:(p=h.components)!=null?p:[],selectIdentifier:yt,selectDisplayName:wt,onSyncComplete:async(g,b)=>{h.components=b,ii(n,h)}})}else f=await dt({directory:n,selectIdentifier:yt,selectDisplayName:wt,format:i});await ht({source:c,target:f,mode:r,whatIf:s,log:mt({diffMode:a})})}};A();import _p from"isomorphic-unfetch";var ks={command:"push <directory>",describe:"Pushes all component definitions from files in a directory to Uniform Optimize",builder:e=>se(ae(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 u;let a=new oe({apiKey:t,apiHost:e,fetch:_p,projectId:s,limitPolicy:bt}),l;if(pt(n)){let p=Ct(n,!0);l=await ct({objects:(u=p.components)!=null?u:[],selectIdentifier:yt,selectDisplayName:wt})}else l=await dt({directory:n,selectIdentifier:yt,selectDisplayName:wt});let f=ni({client:a});await ht({source:l,target:f,mode:i,whatIf:r,log:mt({diffMode:o})})}};A();import Ep from"isomorphic-unfetch";var zs={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a component definition",builder:e=>se(ae(e.positional("id",{demandOption:!0,describe:"Component definition public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new oe({apiKey:t,apiHost:e,fetch:Ep,projectId:i}).removeComponentDefinition({componentId:n})}};A();import Sp from"isomorphic-unfetch";var Gs={command:"update <filename>",aliases:["put"],describe:"Insert or update a component definition",builder:e=>se(ae(e.positional("filename",{demandOption:!0,describe:"Component definition file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new oe({apiKey:t,apiHost:e,fetch:Sp,projectId:i}),s=rn(n);await r.updateComponentDefinition({componentDefinition:s})}};var qs={command:"component <command>",aliases:["def"],describe:"Commands for Canvas component definitions",builder:e=>e.command(Ys).command(ks).command(Bs).command(zs).command(Ws).command(Gs).demandCommand(),handler:()=>{qt.help()}};A();A();import Ip from"isomorphic-unfetch";var Ks={command:"get <id>",describe:"Fetch a composition",builder:e=>ft(se(ae(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 oe({apiKey:t,apiHost:e,fetch:Ip,projectId:o}),c=ti(await l.getCompositionById({compositionId:n,state:gt(s),skipPatternResolution:!a}));Ye(c,i,r)}};A();import jp from"isomorphic-unfetch";var Vs={command:"list",describe:"List compositions",aliases:["ls"],builder:e=>ft(se(ae(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 f=await new oe({apiKey:t,apiHost:e,fetch:jp,projectId:o}).getCompositionList({limit:n,offset:i,state:gt(a),skipPatternResolution:!l});Ye(f.compositions,r,s)}};A();import Pp 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 ri({client:e,state:t}){let n=gt(t);async function*i(){let r=ei(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:ti(s)}}return{objects:i(),deleteObject:async r=>{await e.removeComposition({compositionId:r})},writeObject:async r=>{await e.updateComposition({...r.object,state:n})}}}var Js={command:"pull <directory>",describe:"Pulls all compositions to local files in a directory",builder:e=>se(ae(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 c=new oe({apiKey:t,apiHost:e,fetch:Pp,projectId:a,limitPolicy:bt}),f=ri({client:c,state:o}),u=pt(n),p;if(u){let g=Ct(n,!1);p=await ct({objects:(h=g==null?void 0:g.compositions)!=null?h:[],selectIdentifier:At,selectDisplayName:xt,onSyncComplete:async(b,m)=>{g.compositions=m,ii(n,g)}})}else p=await dt({directory:n,selectIdentifier:At,selectDisplayName:xt,format:i});await ht({source:f,target:p,mode:r,whatIf:s,log:mt({diffMode:l})})}};A();import Mp from"isomorphic-unfetch";var Qs={command:"push <directory>",describe:"Pushes all compositions from files in a directory to Uniform Optimize",builder:e=>se(ae(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 oe({apiKey:t,apiHost:e,fetch:Mp,projectId:o,limitPolicy:bt}),c;if(pt(n)){let h=Ct(n,!0);c=await ct({objects:(p=h.compositions)!=null?p:[],selectIdentifier:At,selectDisplayName:xt})}else c=await dt({directory:n,selectIdentifier:At,selectDisplayName:xt});let u=ri({client:l,state:s});await ht({source:c,target:u,mode:i,whatIf:r,log:mt({diffMode:a})})}};A();import Fp from"isomorphic-unfetch";var Zs={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a composition",builder:e=>se(ae(e.positional("id",{demandOption:!0,describe:"Composition public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new oe({apiKey:t,apiHost:e,fetch:Fp,projectId:i}).removeComposition({compositionId:n})}};A();import Lp from"isomorphic-unfetch";var Xs={command:"update <filename>",aliases:["put"],describe:"Insert or update a composition",builder:e=>se(ae(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 oe({apiKey:t,apiHost:e,fetch:Lp,projectId:i}),o=rn(n);await s.updateComposition({...o,state:gt(r)})}};var ea={command:"composition <command>",describe:"Commands for Canvas compositions",aliases:["comp"],builder:e=>e.command(Js).command(Qs).command(Ks).command(Zs).command(Vs).command(Xs).demandCommand(),handler:()=>{qt.help()}};var L0={commands:[{command:"canvas <command>",aliases:["cv","pm","presentation"],describe:"Uniform Canvas commands",builder:e=>e.command(ea).command(qs).demandCommand(),handler:()=>{qt.showHelp()}}]};export{Ct as readCanvasPackage,L0 as uniformCLI,ii as writeCanvasPackage};
99
+ `+e.slice(o+1):l+=e.slice(r),l.slice(1)}function jf(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=an(e,r),i=we[n],!i&&un(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||Cf(n);return t}function Pf(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)),(Ye(e,t,a,!1,!1)||typeof a=="undefined"&&Ye(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function vo(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)),(Ye(e,t+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&Ye(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=Fi(e,t)),e.dump&&cn===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=s,e.dump=r||"[]"}function Mf(e,t,n){var i="",r=e.tag,s=Object.keys(n),o,a,l,c,f;for(o=0,a=s.length;o<a;o+=1)f="",i!==""&&(f+=", "),e.condenseFlow&&(f+='"'),l=s[o],c=n[l],e.replacer&&(c=e.replacer.call(n,l,c)),Ye(e,t,l,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ye(e,t,c,!1,!1)&&(f+=e.dump,i+=f));e.tag=r,e.dump="{"+i+"}"}function Ff(e,t,n,i){var r="",s=e.tag,o=Object.keys(n),a,l,c,f,u,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new xe("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)p="",(!i||r!=="")&&(p+=Fi(e,t)),c=o[a],f=n[c],e.replacer&&(f=e.replacer.call(n,c,f)),Ye(e,t+1,c,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&cn===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,u&&(p+=Fi(e,t)),Ye(e,t+1,f,!0,u)&&(e.dump&&cn===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,r+=p));e.tag=s,e.dump=r||"{}"}function Oo(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,Uo.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(Ho.call(a.represent,l))i=a.represent[l](t,l);else throw new xe("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function Ye(e,t,n,i,r,s,o){e.tag=null,e.dump=n,Oo(e,n,!1)||Oo(e,n,!0);var a=Uo.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var f=a==="[object Object]"||a==="[object Array]",u,p;if(f&&(u=e.duplicates.indexOf(n),p=u!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(r=!1),p&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(f&&p&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(Ff(e,t,e.dump,r),p&&(e.dump="&ref_"+u+e.dump)):(Mf(e,t,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?vo(e,t-1,e.dump,r):vo(e,t,e.dump,r),p&&(e.dump="&ref_"+u+e.dump)):(Pf(e,t,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Sf(e,e.dump,t,s,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new xe("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function Lf(e,t){var n=[],i=[],r,s;for(Di(e,n,i),r=0,s=i.length;r<s;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(s)}function Di(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)Di(e[r],t,n);else for(i=Object.keys(e),r=0,s=i.length;r<s;r+=1)Di(e[i[r]],t,n)}function Df(e,t){t=t||{};var n=new xf(t);n.noRefs||Lf(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),Ye(n,0,i,!0,!0)?n.dump+`
100
+ `:""}var Nf=Df,Tf={dump:Nf};function Ui(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 Jo=$o.load,vh=$o.loadAll,Qo=Tf.dump;var Oh=Ui("safeLoad","load"),_h=Ui("safeLoadAll","loadAll"),Eh=Ui("safeDump","dump");import{writeFileSync as dp}from"fs";import{extname as Ls}from"path";import{readFileSync as hp}from"fs";import mp from"fs";function ke(){}ke.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(b){return r?(setTimeout(function(){r(void 0,b)},0),!0):b}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,c=1,f=a+l,u=[{newPos:-1,components:[]}],p=this.extractCommon(u[0],n,t,0);if(u[0].newPos+1>=a&&p+1>=l)return o([{value:this.join(n),count:n.length}]);function h(){for(var b=-1*c;b<=c;b+=2){var m=void 0,x=u[b-1],v=u[b+1],L=(v?v.newPos:0)-b;x&&(u[b-1]=void 0);var Y=x&&x.newPos+1<a,z=v&&0<=L&&L<l;if(!Y&&!z){u[b]=void 0;continue}if(!Y||z&&x.newPos<v.newPos?(m=$f(v),s.pushComponent(m.components,void 0,!0)):(m=x,m.newPos++,s.pushComponent(m.components,!0,void 0)),L=s.extractCommon(m,n,t,b),m.newPos+1>=a&&L+1>=l)return o(Rf(s,m.components,n,t,s.useLongestToken));u[b]=m}c++}if(r)(function b(){setTimeout(function(){if(c>f)return r();h()||b()},0)})();else for(;c<=f;){var g=h();if(g)return g}},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,c=0;a+1<s&&l+1<o&&this.equals(n[a+1],i[l+1]);)a++,l++,c++;return c&&t.components.push({count:c}),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 Rf(e,t,n,i,r){for(var s=0,o=t.length,a=0,l=0;s<o;s++){var c=t[s];if(c.removed){if(c.value=e.join(i.slice(l,l+c.count)),l+=c.count,s&&t[s-1].added){var u=t[s-1];t[s-1]=t[s],t[s]=u}}else{if(!c.added&&r){var f=n.slice(a,a+c.count);f=f.map(function(h,g){var b=i[l+g];return b.length>h.length?b:h}),c.value=e.join(f)}else c.value=e.join(n.slice(a,a+c.count));a+=c.count,c.added||(l+=c.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 $f(e){return{newPos:e.newPos,components:e.components.slice(0)}}var Ih=new ke;var Zo=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Xo=/\S/,es=new ke;es.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Xo.test(e)&&!Xo.test(t)};es.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]&&Zo.test(t[n])&&Zo.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Wi=new ke;Wi.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 Yi(e,t,n){return Wi.diff(e,t,n)}var Uf=new ke;Uf.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Hf=new ke;Hf.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Un(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Un=function(t){return typeof t}:Un=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(e)}var Bf=Object.prototype.toString,Kt=new ke;Kt.useLongestToken=!0;Kt.tokenize=Wi.tokenize;Kt.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(Hi(e,null,null,r),r," ")};Kt.equals=function(e,t){return ke.prototype.equals.call(Kt,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function ts(e,t,n){return Kt.diff(e,t,n)}function Hi(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(Bf.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]=Hi(e[s],t,n,i,r);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Un(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]=Hi(e[l],t,n,i,l);t.pop(),n.pop()}else o=e;return o}var Bi=new ke;Bi.tokenize=function(e){return e.slice()};Bi.join=Bi.removeEmpty=function(e){return e};var Ts=Zs(Ms(),1);async function ot({objects:e,selectIdentifier:t,selectDisplayName:n=t,onSyncComplete:i}){let r=e.reduce((a,l)=>{let c=t(l);if(a[c])throw new Error(`Identifier ${c} was not unique.`);return a[c]={id:c,object:l,providerId:c,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}}var ap=_i(Ei());function ie(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 re(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 st(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 at(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 lt(e){let t=Ls(e);return t===".yaml"||t===".yml"||t===".json"}function Ue(e,t,n){let i;if(n&&!t){let r=Ls(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=Qo(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?dp(n,i,"utf8"):console.log(i)}function Xt(e){let t=hp(e,"utf8");return Jo(t,{filename:e,json:!0})}async function*Jn(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 ct({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:i=n}){lp(e)||cp(e,{recursive:!0});let r=await fp(e,"utf-8"),s=new Set(r.filter(l=>{let c=pp(l);return c===".json"||c===".yaml"||c===".yml"})),o=l=>Fs(e,`${l}.${t}`);async function*a(){for(let l of s){let c=Fs(e,l);try{let f=await Xt(c);yield{id:n(f),displayName:i(f),providerId:c,object:f}}catch(f){throw console.error(ap.default.red(`Failed to read ${c}, data is likely invalid.
101
+ ${f==null?void 0:f.message}`)),f}}}return{objects:a(),deleteObject:async l=>{await up(l)},writeObject:async l=>{Ue(l.object,t,o(l.id))}}}function Ds(e,t){if(!t&&!mp.existsSync(e))return{};let n=Xt(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function Ns(e,t){Ue(t,void 0,e)}async function ft({source:e,target:t,compareContents:n=(a,l)=>(0,Ts.default)(a.object,l.object,(c,f,u)=>u==="created"||u==="modified"?!0:void 0),mode:i,allowEmptySource:r=!1,whatIf:s=!1,log:o=()=>{}}){var a,l;let c=new Map;for await(let p of t.objects)c.set(p.id,p);let f=[],u=!1;for await(let p of e.objects){u=!0;let h=p.id,g=c.get(h);if(g){if(!n(p,g)&&(i==="createOrUpdate"||i==="mirror")){let b=async(m,x)=>{var v;if(!s)try{await t.writeObject(m,x)}catch(L){throw new Vn(L,m)}o({action:"update",id:h,providerId:m.providerId,displayName:(v=m.displayName)!=null?v:m.providerId,whatIf:s,diff:ts(x.object,m.object)})};f.push(b(p,g))}c.delete(h)}else{let b=async(m,x)=>{var v;if(!s)try{await t.writeObject(m)}catch(L){throw new Vn(L,m)}o({action:"create",id:x,providerId:x,displayName:(v=m.displayName)!=null?v:m.providerId,whatIf:s,diff:Yi("",JSON.stringify(m.object,null,2))})};f.push(b(p,h))}}if(await Promise.all(f),i==="mirror"){if(!u&&!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=[];c.forEach(async h=>{let g=async b=>{var m;if(!s)try{await t.deleteObject(b.providerId)}catch(x){throw new Vn(x,b)}o({action:"delete",id:b.id,providerId:b.providerId,displayName:(m=b.displayName)!=null?m:b.providerId,whatIf:s,diff:Yi(JSON.stringify(b.object,null,2),"")})};p.push(g(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 Vn=class extends Error{constructor(e,t){var n;super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
102
+ ${e}`),this.stack=void 0,Object.setPrototypeOf(this,Vn.prototype)}},Zt=_i(Ei());function ut(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=Zt.default.green("[A]");break;case"update":l=Zt.default.white("[U]");break;case"delete":l=Zt.default.yellow("[D]");break}let c="";(t==="on"||t==="update"&&r==="update")&&(c=`
103
+ `+a.map(f=>f.added?Zt.default.green(f.value):f.removed?Zt.default.red(f.value):f.value).join("")),console.log(`${n!=null?n:""}${o?Zt.default.gray("[WHATIF]"):""}${l}${i!=null?i:""} ${s}${c}`)}}var Rs={command:"get <id>",describe:"Fetch a component definition",builder:e=>st(ie(re(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 ne({apiKey:t,apiHost:e,fetch:gp,projectId:r}).getComponentDefinitions({componentId:n,limit:1});a.componentDefinitions.length===0?(console.error("Component did not exist"),process.exit(1)):Ue(a.componentDefinitions[0],i,s)}};import bp from"isomorphic-unfetch";var $s={command:"list",describe:"List component definitions",aliases:["ls"],builder:e=>st(ie(re(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 ne({apiKey:t,apiHost:e,fetch:bp,projectId:o}).getComponentDefinitions({limit:n,offset:i});Ue(l.componentDefinitions,r,s)}};import yp from"p-limit";function Qn(e){let t={...e};return delete t.projectId,delete t.state,t}function He(e){return e.option("state",{type:"string",describe:"Composition state to fetch.",choices:["preview","published"],default:"preview"})}function pt(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 dt=yp(8);import wp from"isomorphic-unfetch";var ht=e=>e.id,mt=e=>`${e.name} (pid: ${e.id})`;function Zn({client:e}){async function*t(){let n=Jn(async(i,r)=>(await e.getComponentDefinitions({limit:r,offset:i})).componentDefinitions,{pageSize:100});for await(let i of n)yield{id:ht(i),displayName:mt(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})}}}function gt(e,t){return Ds(e,t)}function Xn(e,t){Ns(e,t)}var Us={command:"pull <directory>",describe:"Pulls all component definitions to local files in a directory",builder:e=>ie(re(at(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 ne({apiKey:t,apiHost:e,fetch:wp,projectId:o,limitPolicy:dt}),c=Zn({client:l}),f;if(lt(n)){let h=gt(n,!1);f=await ot({objects:(p=h.components)!=null?p:[],selectIdentifier:ht,selectDisplayName:mt,onSyncComplete:async(g,b)=>{h.components=b,Xn(n,h)}})}else f=await ct({directory:n,selectIdentifier:ht,selectDisplayName:mt,format:i});await ft({source:c,target:f,mode:r,whatIf:s,log:ut({diffMode:a})})}};import Cp from"isomorphic-unfetch";var Hs={command:"push <directory>",describe:"Pushes all component definitions from files in a directory to Uniform Optimize",builder:e=>ie(re(at(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 u;let a=new ne({apiKey:t,apiHost:e,fetch:Cp,projectId:s,limitPolicy:dt}),l;if(lt(n)){let p=gt(n,!0);l=await ot({objects:(u=p.components)!=null?u:[],selectIdentifier:ht,selectDisplayName:mt})}else l=await ct({directory:n,selectIdentifier:ht,selectDisplayName:mt});let f=Zn({client:a});await ft({source:l,target:f,mode:i,whatIf:r,log:ut({diffMode:o})})}};import Ap from"isomorphic-unfetch";var Bs={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a component definition",builder:e=>ie(re(e.positional("id",{demandOption:!0,describe:"Component definition public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new ne({apiKey:t,apiHost:e,fetch:Ap,projectId:i}).removeComponentDefinition({componentId:n})}};import xp from"isomorphic-unfetch";var Ws={command:"update <filename>",aliases:["put"],describe:"Insert or update a component definition",builder:e=>ie(re(e.positional("filename",{demandOption:!0,describe:"Component definition file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new ne({apiKey:t,apiHost:e,fetch:xp,projectId:i}),s=Xt(n);await r.updateComponentDefinition({componentDefinition:s})}};var Ys={command:"component <command>",aliases:["def"],describe:"Commands for Canvas component definitions",builder:e=>e.command(Us).command(Hs).command(Rs).command(Bs).command($s).command(Ws).demandCommand(),handler:()=>{Yt.help()}};import vp from"isomorphic-unfetch";var ks={command:"get <id>",describe:"Fetch a composition",builder:e=>st(ie(re(He(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 ne({apiKey:t,apiHost:e,fetch:vp,projectId:o}),c=Qn(await l.getCompositionById({compositionId:n,state:pt(s),skipPatternResolution:!a}));Ue(c,i,r)}};import Op from"isomorphic-unfetch";var zs={command:"list",describe:"List compositions",aliases:["ls"],builder:e=>st(ie(re(He(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 f=await new ne({apiKey:t,apiHost:e,fetch:Op,projectId:o}).getCompositionList({limit:n,offset:i,state:pt(a),skipPatternResolution:!l});Ue(f.compositions,r,s)}};import _p from"isomorphic-unfetch";var bt=e=>e.composition._id,yt=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 ei({client:e,state:t}){let n=pt(t);async function*i(){let r=Jn(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:bt(s),displayName:yt(s),providerId:s.composition._id,object:Qn(s)}}return{objects:i(),deleteObject:async r=>{await e.removeComposition({compositionId:r})},writeObject:async r=>{await e.updateComposition({...r.object,state:n})}}}var Gs={command:"pull <directory>",describe:"Pulls all compositions to local files in a directory",builder:e=>ie(re(He(at(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 c=new ne({apiKey:t,apiHost:e,fetch:_p,projectId:a,limitPolicy:dt}),f=ei({client:c,state:o}),u=lt(n),p;if(u){let g=gt(n,!1);p=await ot({objects:(h=g==null?void 0:g.compositions)!=null?h:[],selectIdentifier:bt,selectDisplayName:yt,onSyncComplete:async(b,m)=>{g.compositions=m,Xn(n,g)}})}else p=await ct({directory:n,selectIdentifier:bt,selectDisplayName:yt,format:i});await ft({source:f,target:p,mode:r,whatIf:s,log:ut({diffMode:l})})}};import Ep from"isomorphic-unfetch";var qs={command:"push <directory>",describe:"Pushes all compositions from files in a directory to Uniform Optimize",builder:e=>ie(re(He(at(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 ne({apiKey:t,apiHost:e,fetch:Ep,projectId:o,limitPolicy:dt}),c;if(lt(n)){let h=gt(n,!0);c=await ot({objects:(p=h.compositions)!=null?p:[],selectIdentifier:bt,selectDisplayName:yt})}else c=await ct({directory:n,selectIdentifier:bt,selectDisplayName:yt});let u=ei({client:l,state:s});await ft({source:c,target:u,mode:i,whatIf:r,log:ut({diffMode:a})})}};import Sp from"isomorphic-unfetch";var Ks={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a composition",builder:e=>ie(re(e.positional("id",{demandOption:!0,describe:"Composition public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new ne({apiKey:t,apiHost:e,fetch:Sp,projectId:i}).removeComposition({compositionId:n})}};import Ip from"isomorphic-unfetch";var Vs={command:"update <filename>",aliases:["put"],describe:"Insert or update a composition",builder:e=>ie(re(He(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 ne({apiKey:t,apiHost:e,fetch:Ip,projectId:i}),o=Xt(n);await s.updateComposition({...o,state:pt(r)})}};var Js={command:"composition <command>",describe:"Commands for Canvas compositions",aliases:["comp"],builder:e=>e.command(Gs).command(qs).command(ks).command(Ks).command(zs).command(Vs).demandCommand(),handler:()=>{Yt.help()}};var I0={commands:[{command:"canvas <command>",aliases:["cv","pm","presentation"],describe:"Uniform Canvas commands",builder:e=>e.command(Js).command(Ys).demandCommand(),handler:()=>{Yt.showHelp()}}]};export{gt as readCanvasPackage,I0 as uniformCLI,Xn 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