@uniformdev/canvas 16.2.1 → 16.2.2

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.js CHANGED
@@ -1,13 +1,13 @@
1
- "use strict";var Sa=Object.create;var xn=Object.defineProperty;var Ia=Object.getOwnPropertyDescriptor;var ja=Object.getOwnPropertyNames;var Pa=Object.getPrototypeOf,Ma=Object.prototype.hasOwnProperty;var La=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Fa=(e,t)=>{for(var n in t)xn(e,n,{get:t[n],enumerable:!0})},mr=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ja(t))!Ma.call(e,r)&&r!==n&&xn(e,r,{get:()=>t[r],enumerable:!(i=Ia(t,r))||i.enumerable});return e};var be=(e,t,n)=>(n=e!=null?Sa(Pa(e)):{},mr(t||!e||!e.__esModule?xn(n,"default",{value:e,enumerable:!0}):n,e)),Ta=e=>mr(xn({},"__esModule",{value:!0}),e);var Gs=La((gn,Xt)=>{var Xf=200,fr="__lodash_hash_undefined__",Is=1,ti=2,js=9007199254740991,Jn="[object Arguments]",nr="[object Array]",Ps="[object Boolean]",Ms="[object Date]",Ls="[object Error]",Fs="[object Function]",eu="[object GeneratorFunction]",Qn="[object Map]",Ts="[object Number]",Zt="[object Object]",ys="[object Promise]",Ds="[object RegExp]",Zn="[object Set]",Ns="[object String]",tu="[object Symbol]",ir="[object WeakMap]",Rs="[object ArrayBuffer]",Xn="[object DataView]",nu="[object Float32Array]",iu="[object Float64Array]",ru="[object Int8Array]",ou="[object Int16Array]",su="[object Int32Array]",au="[object Uint8Array]",lu="[object Uint8ClampedArray]",cu="[object Uint16Array]",fu="[object Uint32Array]",uu=/[\\^$.*+?()[\]{}|]/g,pu=/^\[object .+?Constructor\]$/,hu=/^(?:0|[1-9]\d*)$/,ne={};ne[nu]=ne[iu]=ne[ru]=ne[ou]=ne[su]=ne[au]=ne[lu]=ne[cu]=ne[fu]=!0;ne[Jn]=ne[nr]=ne[Rs]=ne[Ps]=ne[Xn]=ne[Ms]=ne[Ls]=ne[Fs]=ne[Qn]=ne[Ts]=ne[Zt]=ne[Ds]=ne[Zn]=ne[Ns]=ne[ir]=!1;var $s=typeof global=="object"&&global&&global.Object===Object&&global,du=typeof self=="object"&&self&&self.Object===Object&&self,st=$s||du||Function("return this")(),Us=typeof gn=="object"&&gn&&!gn.nodeType&&gn,ws=Us&&typeof Xt=="object"&&Xt&&!Xt.nodeType&&Xt,mu=ws&&ws.exports===Us,Cs=mu&&$s.process,As=function(){try{return Cs&&Cs.binding("util")}catch(e){}}(),xs=As&&As.isTypedArray;function gu(e,t){for(var n=-1,i=e?e.length:0;++n<i;)if(t(e[n],n,e))return!0;return!1}function bu(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function yu(e){return function(t){return e(t)}}function wu(e,t){return e==null?void 0:e[t]}function rr(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 Au(e,t){return function(n){return e(t(n))}}function xu(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var vu=Array.prototype,Ou=Function.prototype,ni=Object.prototype,er=st["__core-js_shared__"],vs=function(){var e=/[^.]+$/.exec(er&&er.keys&&er.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Hs=Ou.toString,ze=ni.hasOwnProperty,wn=ni.toString,_u=RegExp("^"+Hs.call(ze).replace(uu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Os=st.Symbol,_s=st.Uint8Array,Eu=ni.propertyIsEnumerable,Su=vu.splice,Iu=Au(Object.keys,Object),or=en(st,"DataView"),bn=en(st,"Map"),sr=en(st,"Promise"),ar=en(st,"Set"),lr=en(st,"WeakMap"),yn=en(Object,"create"),ju=Rt(or),Pu=Rt(bn),Mu=Rt(sr),Lu=Rt(ar),Fu=Rt(lr),Es=Os?Os.prototype:void 0,tr=Es?Es.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 Tu(){this.__data__=yn?yn(null):{}}function Du(e){return this.has(e)&&delete this.__data__[e]}function Nu(e){var t=this.__data__;if(yn){var n=t[e];return n===fr?void 0:n}return ze.call(t,e)?t[e]:void 0}function Ru(e){var t=this.__data__;return yn?t[e]!==void 0:ze.call(t,e)}function $u(e,t){var n=this.__data__;return n[e]=yn&&t===void 0?fr:t,this}Dt.prototype.clear=Tu;Dt.prototype.delete=Du;Dt.prototype.get=Nu;Dt.prototype.has=Ru;Dt.prototype.set=$u;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 Uu(){this.__data__=[]}function Hu(e){var t=this.__data__,n=ii(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():Su.call(t,n,1),!0}function Bu(e){var t=this.__data__,n=ii(t,e);return n<0?void 0:t[n][1]}function Wu(e){return ii(this.__data__,e)>-1}function ku(e,t){var n=this.__data__,i=ii(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}Ge.prototype.clear=Uu;Ge.prototype.delete=Hu;Ge.prototype.get=Bu;Ge.prototype.has=Wu;Ge.prototype.set=ku;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 Yu(){this.__data__={hash:new Dt,map:new(bn||Ge),string:new Dt}}function qu(e){return ri(this,e).delete(e)}function zu(e){return ri(this,e).get(e)}function Gu(e){return ri(this,e).has(e)}function Ku(e,t){return ri(this,e).set(e,t),this}Nt.prototype.clear=Yu;Nt.prototype.delete=qu;Nt.prototype.get=zu;Nt.prototype.has=Gu;Nt.prototype.set=Ku;function ei(e){var t=-1,n=e?e.length:0;for(this.__data__=new Nt;++t<n;)this.add(e[t])}function Vu(e){return this.__data__.set(e,fr),this}function Ju(e){return this.__data__.has(e)}ei.prototype.add=ei.prototype.push=Vu;ei.prototype.has=Ju;function ot(e){this.__data__=new Ge(e)}function Qu(){this.__data__=new Ge}function Zu(e){return this.__data__.delete(e)}function Xu(e){return this.__data__.get(e)}function ep(e){return this.__data__.has(e)}function tp(e,t){var n=this.__data__;if(n instanceof Ge){var i=n.__data__;if(!bn||i.length<Xf-1)return i.push([e,t]),this;n=this.__data__=new Nt(i)}return n.set(e,t),this}ot.prototype.clear=Qu;ot.prototype.delete=Zu;ot.prototype.get=Xu;ot.prototype.has=ep;ot.prototype.set=tp;function np(e,t){var n=cr(e)||dp(e)?bu(e.length,String):[],i=n.length,r=!!i;for(var s in e)(t||ze.call(e,s))&&!(r&&(s=="length"||fp(s,i)))&&n.push(s);return n}function ii(e,t){for(var n=e.length;n--;)if(ks(e[n][0],t))return n;return-1}function ip(e){return wn.call(e)}function Bs(e,t,n,i,r){return e===t?!0:e==null||t==null||!ur(e)&&!pr(t)?e!==e&&t!==t:rp(e,t,Bs,n,i,r)}function rp(e,t,n,i,r,s){var o=cr(e),a=cr(t),l=nr,c=nr;o||(l=rt(e),l=l==Jn?Zt:l),a||(c=rt(t),c=c==Jn?Zt:c);var f=l==Zt&&!rr(e),u=c==Zt&&!rr(t),p=l==c;if(p&&!f)return s||(s=new ot),o||bp(e)?Ws(e,t,n,i,r,s):lp(e,t,l,n,i,r,s);if(!(r&ti)){var d=f&&ze.call(e,"__wrapped__"),g=u&&ze.call(t,"__wrapped__");if(d||g){var b=d?e.value():e,m=g?t.value():t;return s||(s=new ot),n(b,m,i,r,s)}}return p?(s||(s=new ot),cp(e,t,n,i,r,s)):!1}function op(e){if(!ur(e)||pp(e))return!1;var t=qs(e)||rr(e)?_u:pu;return t.test(Rt(e))}function sp(e){return pr(e)&&zs(e.length)&&!!ne[wn.call(e)]}function ap(e){if(!hp(e))return Iu(e);var t=[];for(var n in Object(e))ze.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ws(e,t,n,i,r,s){var o=r&ti,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&Is?new ei:void 0;for(s.set(e,t),s.set(t,e);++f<a;){var d=e[f],g=t[f];if(i)var b=o?i(g,d,f,t,e,s):i(d,g,f,e,t,s);if(b!==void 0){if(b)continue;u=!1;break}if(p){if(!gu(t,function(m,x){if(!p.has(x)&&(d===m||n(d,m,i,r,s)))return p.add(x)})){u=!1;break}}else if(!(d===g||n(d,g,i,r,s))){u=!1;break}}return s.delete(e),s.delete(t),u}function lp(e,t,n,i,r,s,o){switch(n){case Xn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Rs:return!(e.byteLength!=t.byteLength||!i(new _s(e),new _s(t)));case Ps:case Ms:case Ts:return ks(+e,+t);case Ls:return e.name==t.name&&e.message==t.message;case Ds:case Ns:return e==t+"";case Qn:var a=Cu;case Zn:var l=s&ti;if(a||(a=xu),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;s|=Is,o.set(e,t);var f=Ws(a(e),a(t),i,r,s,o);return o.delete(e),f;case tu:if(tr)return tr.call(e)==tr.call(t)}return!1}function cp(e,t,n,i,r,s){var o=r&ti,a=Ss(e),l=a.length,c=Ss(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 d=s.get(e);if(d&&s.get(t))return d==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 F=e.constructor,k=t.constructor;F!=k&&"constructor"in e&&"constructor"in t&&!(typeof F=="function"&&F instanceof F&&typeof k=="function"&&k instanceof k)&&(g=!1)}return s.delete(e),s.delete(t),g}function ri(e,t){var n=e.__data__;return up(t)?n[typeof t=="string"?"string":"hash"]:n.map}function en(e,t){var n=wu(e,t);return op(n)?n:void 0}var rt=ip;(or&&rt(new or(new ArrayBuffer(1)))!=Xn||bn&&rt(new bn)!=Qn||sr&&rt(sr.resolve())!=ys||ar&&rt(new ar)!=Zn||lr&&rt(new lr)!=ir)&&(rt=function(e){var t=wn.call(e),n=t==Zt?e.constructor:void 0,i=n?Rt(n):void 0;if(i)switch(i){case ju:return Xn;case Pu:return Qn;case Mu:return ys;case Lu:return Zn;case Fu:return ir}return t});function fp(e,t){return t=t==null?js:t,!!t&&(typeof e=="number"||hu.test(e))&&e>-1&&e%1==0&&e<t}function up(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function pp(e){return!!vs&&vs in e}function hp(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||ni;return e===n}function Rt(e){if(e!=null){try{return Hs.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function ks(e,t){return e===t||e!==e&&t!==t}function dp(e){return mp(e)&&ze.call(e,"callee")&&(!Eu.call(e,"callee")||wn.call(e)==Jn)}var cr=Array.isArray;function Ys(e){return e!=null&&zs(e.length)&&!qs(e)}function mp(e){return pr(e)&&Ys(e)}function gp(e,t,n){n=typeof n=="function"?n:void 0;var i=n?n(e,t):void 0;return i===void 0?Bs(e,t,n):!!i}function qs(e){var t=ur(e)?wn.call(e):"";return t==Fs||t==eu}function zs(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=js}function ur(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function pr(e){return!!e&&typeof e=="object"}var bp=xs?yu(xs):sp;function Ss(e){return Ys(e)?np(e):ap(e)}Xt.exports=gp});var Ap={};Fa(Ap,{readCanvasPackage:()=>Ke,uniformCLI:()=>Cp,writeCanvasPackage:()=>An});module.exports=Ta(Ap);var Pn=require("assert");var Da={right:Ha,center:Ba},Na=0,vn=1,Ra=2,On=3,hi=class{constructor(t){var n;this.width=t.width,this.wrap=(n=t.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...t){let n=this.div(...t);n.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let n=t.map(i=>typeof i=="string"?this.colFromString(i):i);return this.rows.push(n),n}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let n=t.split(`
1
+ "use strict";var Ia=Object.create;var xn=Object.defineProperty;var ja=Object.getOwnPropertyDescriptor;var Pa=Object.getOwnPropertyNames;var Ma=Object.getPrototypeOf,La=Object.prototype.hasOwnProperty;var Fa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ta=(e,t)=>{for(var n in t)xn(e,n,{get:t[n],enumerable:!0})},br=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Pa(t))!La.call(e,r)&&r!==n&&xn(e,r,{get:()=>t[r],enumerable:!(i=ja(t,r))||i.enumerable});return e};var be=(e,t,n)=>(n=e!=null?Ia(Ma(e)):{},br(t||!e||!e.__esModule?xn(n,"default",{value:e,enumerable:!0}):n,e)),Da=e=>br(xn({},"__esModule",{value:!0}),e);var Ks=Fa((gn,Xt)=>{var eu=200,pr="__lodash_hash_undefined__",js=1,ti=2,Ps=9007199254740991,Jn="[object Arguments]",rr="[object Array]",Ms="[object Boolean]",Ls="[object Date]",Fs="[object Error]",Ts="[object Function]",tu="[object GeneratorFunction]",Qn="[object Map]",Ds="[object Number]",Zt="[object Object]",ws="[object Promise]",Ns="[object RegExp]",Zn="[object Set]",Rs="[object String]",nu="[object Symbol]",or="[object WeakMap]",$s="[object ArrayBuffer]",Xn="[object DataView]",iu="[object Float32Array]",ru="[object Float64Array]",ou="[object Int8Array]",su="[object Int16Array]",au="[object Int32Array]",lu="[object Uint8Array]",cu="[object Uint8ClampedArray]",fu="[object Uint16Array]",uu="[object Uint32Array]",pu=/[\\^$.*+?()[\]{}|]/g,hu=/^\[object .+?Constructor\]$/,du=/^(?:0|[1-9]\d*)$/,ne={};ne[iu]=ne[ru]=ne[ou]=ne[su]=ne[au]=ne[lu]=ne[cu]=ne[fu]=ne[uu]=!0;ne[Jn]=ne[rr]=ne[$s]=ne[Ms]=ne[Xn]=ne[Ls]=ne[Fs]=ne[Ts]=ne[Qn]=ne[Ds]=ne[Zt]=ne[Ns]=ne[Zn]=ne[Rs]=ne[or]=!1;var Us=typeof global=="object"&&global&&global.Object===Object&&global,mu=typeof self=="object"&&self&&self.Object===Object&&self,st=Us||mu||Function("return this")(),Hs=typeof gn=="object"&&gn&&!gn.nodeType&&gn,Cs=Hs&&typeof Xt=="object"&&Xt&&!Xt.nodeType&&Xt,gu=Cs&&Cs.exports===Hs,As=gu&&Us.process,xs=function(){try{return As&&As.binding("util")}catch(e){}}(),vs=xs&&xs.isTypedArray;function bu(e,t){for(var n=-1,i=e?e.length:0;++n<i;)if(t(e[n],n,e))return!0;return!1}function yu(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function wu(e){return function(t){return e(t)}}function Cu(e,t){return e==null?void 0:e[t]}function sr(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function Au(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function xu(e,t){return function(n){return e(t(n))}}function vu(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var Ou=Array.prototype,_u=Function.prototype,ni=Object.prototype,nr=st["__core-js_shared__"],Os=function(){var e=/[^.]+$/.exec(nr&&nr.keys&&nr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Bs=_u.toString,ze=ni.hasOwnProperty,wn=ni.toString,Eu=RegExp("^"+Bs.call(ze).replace(pu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_s=st.Symbol,Es=st.Uint8Array,Su=ni.propertyIsEnumerable,Iu=Ou.splice,ju=xu(Object.keys,Object),ar=en(st,"DataView"),bn=en(st,"Map"),lr=en(st,"Promise"),cr=en(st,"Set"),fr=en(st,"WeakMap"),yn=en(Object,"create"),Pu=Rt(ar),Mu=Rt(bn),Lu=Rt(lr),Fu=Rt(cr),Tu=Rt(fr),Ss=_s?_s.prototype:void 0,ir=Ss?Ss.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 Du(){this.__data__=yn?yn(null):{}}function Nu(e){return this.has(e)&&delete this.__data__[e]}function Ru(e){var t=this.__data__;if(yn){var n=t[e];return n===pr?void 0:n}return ze.call(t,e)?t[e]:void 0}function $u(e){var t=this.__data__;return yn?t[e]!==void 0:ze.call(t,e)}function Uu(e,t){var n=this.__data__;return n[e]=yn&&t===void 0?pr:t,this}Dt.prototype.clear=Du;Dt.prototype.delete=Nu;Dt.prototype.get=Ru;Dt.prototype.has=$u;Dt.prototype.set=Uu;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 Hu(){this.__data__=[]}function Bu(e){var t=this.__data__,n=ii(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():Iu.call(t,n,1),!0}function Wu(e){var t=this.__data__,n=ii(t,e);return n<0?void 0:t[n][1]}function ku(e){return ii(this.__data__,e)>-1}function Yu(e,t){var n=this.__data__,i=ii(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}Ge.prototype.clear=Hu;Ge.prototype.delete=Bu;Ge.prototype.get=Wu;Ge.prototype.has=ku;Ge.prototype.set=Yu;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 qu(){this.__data__={hash:new Dt,map:new(bn||Ge),string:new Dt}}function zu(e){return ri(this,e).delete(e)}function Gu(e){return ri(this,e).get(e)}function Ku(e){return ri(this,e).has(e)}function Vu(e,t){return ri(this,e).set(e,t),this}Nt.prototype.clear=qu;Nt.prototype.delete=zu;Nt.prototype.get=Gu;Nt.prototype.has=Ku;Nt.prototype.set=Vu;function ei(e){var t=-1,n=e?e.length:0;for(this.__data__=new Nt;++t<n;)this.add(e[t])}function Ju(e){return this.__data__.set(e,pr),this}function Qu(e){return this.__data__.has(e)}ei.prototype.add=ei.prototype.push=Ju;ei.prototype.has=Qu;function ot(e){this.__data__=new Ge(e)}function Zu(){this.__data__=new Ge}function Xu(e){return this.__data__.delete(e)}function ep(e){return this.__data__.get(e)}function tp(e){return this.__data__.has(e)}function np(e,t){var n=this.__data__;if(n instanceof Ge){var i=n.__data__;if(!bn||i.length<eu-1)return i.push([e,t]),this;n=this.__data__=new Nt(i)}return n.set(e,t),this}ot.prototype.clear=Zu;ot.prototype.delete=Xu;ot.prototype.get=ep;ot.prototype.has=tp;ot.prototype.set=np;function ip(e,t){var n=ur(e)||mp(e)?yu(e.length,String):[],i=n.length,r=!!i;for(var s in e)(t||ze.call(e,s))&&!(r&&(s=="length"||up(s,i)))&&n.push(s);return n}function ii(e,t){for(var n=e.length;n--;)if(Ys(e[n][0],t))return n;return-1}function rp(e){return wn.call(e)}function Ws(e,t,n,i,r){return e===t?!0:e==null||t==null||!hr(e)&&!dr(t)?e!==e&&t!==t:op(e,t,Ws,n,i,r)}function op(e,t,n,i,r,s){var o=ur(e),a=ur(t),l=rr,c=rr;o||(l=rt(e),l=l==Jn?Zt:l),a||(c=rt(t),c=c==Jn?Zt:c);var f=l==Zt&&!sr(e),u=c==Zt&&!sr(t),p=l==c;if(p&&!f)return s||(s=new ot),o||yp(e)?ks(e,t,n,i,r,s):cp(e,t,l,n,i,r,s);if(!(r&ti)){var d=f&&ze.call(e,"__wrapped__"),g=u&&ze.call(t,"__wrapped__");if(d||g){var b=d?e.value():e,m=g?t.value():t;return s||(s=new ot),n(b,m,i,r,s)}}return p?(s||(s=new ot),fp(e,t,n,i,r,s)):!1}function sp(e){if(!hr(e)||hp(e))return!1;var t=zs(e)||sr(e)?Eu:hu;return t.test(Rt(e))}function ap(e){return dr(e)&&Gs(e.length)&&!!ne[wn.call(e)]}function lp(e){if(!dp(e))return ju(e);var t=[];for(var n in Object(e))ze.call(e,n)&&n!="constructor"&&t.push(n);return t}function ks(e,t,n,i,r,s){var o=r&ti,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&js?new ei:void 0;for(s.set(e,t),s.set(t,e);++f<a;){var d=e[f],g=t[f];if(i)var b=o?i(g,d,f,t,e,s):i(d,g,f,e,t,s);if(b!==void 0){if(b)continue;u=!1;break}if(p){if(!bu(t,function(m,x){if(!p.has(x)&&(d===m||n(d,m,i,r,s)))return p.add(x)})){u=!1;break}}else if(!(d===g||n(d,g,i,r,s))){u=!1;break}}return s.delete(e),s.delete(t),u}function cp(e,t,n,i,r,s,o){switch(n){case Xn: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 Es(e),new Es(t)));case Ms:case Ls:case Ds:return Ys(+e,+t);case Fs:return e.name==t.name&&e.message==t.message;case Ns:case Rs:return e==t+"";case Qn:var a=Au;case Zn:var l=s&ti;if(a||(a=vu),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;s|=js,o.set(e,t);var f=ks(a(e),a(t),i,r,s,o);return o.delete(e),f;case nu:if(ir)return ir.call(e)==ir.call(t)}return!1}function fp(e,t,n,i,r,s){var o=r&ti,a=Is(e),l=a.length,c=Is(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 d=s.get(e);if(d&&s.get(t))return d==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 F=e.constructor,k=t.constructor;F!=k&&"constructor"in e&&"constructor"in t&&!(typeof F=="function"&&F instanceof F&&typeof k=="function"&&k instanceof k)&&(g=!1)}return s.delete(e),s.delete(t),g}function ri(e,t){var n=e.__data__;return pp(t)?n[typeof t=="string"?"string":"hash"]:n.map}function en(e,t){var n=Cu(e,t);return sp(n)?n:void 0}var rt=rp;(ar&&rt(new ar(new ArrayBuffer(1)))!=Xn||bn&&rt(new bn)!=Qn||lr&&rt(lr.resolve())!=ws||cr&&rt(new cr)!=Zn||fr&&rt(new fr)!=or)&&(rt=function(e){var t=wn.call(e),n=t==Zt?e.constructor:void 0,i=n?Rt(n):void 0;if(i)switch(i){case Pu:return Xn;case Mu:return Qn;case Lu:return ws;case Fu:return Zn;case Tu:return or}return t});function up(e,t){return t=t==null?Ps:t,!!t&&(typeof e=="number"||du.test(e))&&e>-1&&e%1==0&&e<t}function pp(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function hp(e){return!!Os&&Os in e}function dp(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||ni;return e===n}function Rt(e){if(e!=null){try{return Bs.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ys(e,t){return e===t||e!==e&&t!==t}function mp(e){return gp(e)&&ze.call(e,"callee")&&(!Su.call(e,"callee")||wn.call(e)==Jn)}var ur=Array.isArray;function qs(e){return e!=null&&Gs(e.length)&&!zs(e)}function gp(e){return dr(e)&&qs(e)}function bp(e,t,n){n=typeof n=="function"?n:void 0;var i=n?n(e,t):void 0;return i===void 0?Ws(e,t,n):!!i}function zs(e){var t=hr(e)?wn.call(e):"";return t==Ts||t==tu}function Gs(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ps}function hr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function dr(e){return!!e&&typeof e=="object"}var yp=vs?wu(vs):ap;function Is(e){return qs(e)?ip(e):lp(e)}Xt.exports=bp});var xp={};Ta(xp,{readCanvasPackage:()=>Ke,uniformCLI:()=>Ap,writeCanvasPackage:()=>An});module.exports=Da(xp);var Pn=require("assert");var Na={right:Ba,center:Wa},Ra=0,vn=1,$a=2,On=3,hi=class{constructor(t){var n;this.width=t.width,this.wrap=(n=t.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...t){let n=this.div(...t);n.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let n=t.map(i=>typeof i=="string"?this.colFromString(i):i);return this.rows.push(n),n}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let n=t.split(`
2
2
  `).map(r=>r.split(" ")),i=0;return n.forEach(r=>{r.length>1&&_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;if(c>_e.stringWidth(o)&&(f+=" ".repeat(c-_e.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap){let p=Da[t[a].align];f=p(f,c),_e.stringWidth(f)<c&&(f+=" ".repeat((l||0)-_e.stringWidth(f)-1))}let u=t[a].padding||[0,0,0,0];u[On]&&(s+=" ".repeat(u[On])),s+=gr(t[a],f,"| "),s+=f,s+=gr(t[a],f," |"),u[vn]&&(s+=" ".repeat(u[vn])),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(`
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;if(c>_e.stringWidth(o)&&(f+=" ".repeat(c-_e.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap){let p=Na[t[a].align];f=p(f,c),_e.stringWidth(f)<c&&(f+=" ".repeat((l||0)-_e.stringWidth(f)-1))}let u=t[a].padding||[0,0,0,0];u[On]&&(s+=" ".repeat(u[On])),s+=yr(t[a],f,"| "),s+=f,s+=yr(t[a],f," |"),u[vn]&&(s+=" ".repeat(u[vn])),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[Na]||0).fill("")),r.push(...new Array(s.padding[Ra]||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[On]||0)+(t.padding[vn]||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,$a(t[a])):o)}};function gr(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function $a(e){let t=e.padding||[],n=1+(t[On]||0)+(t[vn]||0);return e.border?n+4:n}function Ua(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Ha(e,t){e=e.trim();let n=_e.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function Ba(e,t){e=e.trim();let n=_e.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var _e;function br(e,t){return _e=t,new hi({width:(e==null?void 0:e.width)||Ua(),wrap:e==null?void 0:e.wrap})}var yr=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function di(e){return e.replace(yr,"")}function wr(e,t){let[n,i]=e.match(yr)||["",""];e=di(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 mi(e){return br(e,{stringWidth:t=>[...t].length,stripAnsi:di,wrap:wr})}var Ut=require("path"),_n=require("fs");function Cr(e,t){let n=(0,Ut.resolve)(".",e),i;for((0,_n.statSync)(n).isDirectory()||(n=(0,Ut.dirname)(n));;){if(i=t(n,(0,_n.readdirSync)(n)),i)return(0,Ut.resolve)(n,i);if(n=(0,Ut.dirname)(i=n),i===n)break}}var Dr=require("util"),Nr=require("fs"),Rr=require("url");var Or=require("util"),jn=require("path");function Ct(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 En(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 Sn(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 Ar(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 ke,In=class{constructor(t){ke=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=Ar(t),s=typeof t=="string",o=Wa(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?"--":"_",d=Object.create(null),g=Object.create(null),b=i.__||ke.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)})),rn(i.key,o,i.default,m.arrays),Object.keys(l).forEach(function(y){(m.aliases[y]||[]).forEach(function(C){l[C]=l[y]})});let F=null;pi();let k=[],q=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,D,de;if(C!=="--"&&Z(C))T(C);else if(O.match(/---+(=|$)/)){T(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=G(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=G(y,w,r):(D=r[y+1],D!==void 0&&(!D.match(/^-/)||D.match(x))&&!R(w,m.bools)&&!R(w,m.counts)||/^(true|false)$/.test(D)?(H(w,D),y++):H(w,z(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))D=r[y+1],E=C.match(/^-(.\..+)/),E!==null&&Array.isArray(E)&&E.length>=2&&(w=E[1],D!==void 0&&!D.match(/^-/)&&!R(w,m.bools)&&!R(w,m.counts)?(H(w,D),y++):H(w,z(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(D=C.slice(Ce+2),j[Ce+1]&&j[Ce+1]==="="){de=C.slice(Ce+3),w=j[Ce],R(w,m.arrays)?y=J(y,w,r,de):R(w,m.nargs)!==!1?y=G(y,w,r,de):H(w,de),A=!0;break}if(D==="-"){H(j[Ce],D);continue}if(/[A-Za-z]/.test(j[Ce])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(D)&&R(D,m.bools)===!1){H(j[Ce],D),A=!0;break}if(j[Ce+1]&&j[Ce+1].match(/\W/)){H(j[Ce],D),A=!0;break}else H(j[Ce],z(j[Ce]))}w=C.slice(-1)[0],!A&&w!=="-"&&(R(w,m.arrays)?y=J(y,w,r):R(w,m.nargs)!==!1?y=G(y,w,r):(D=r[y+1],D!==void 0&&(!/^(-|--)[^-]/.test(D)||D.match(x))&&!R(w,m.bools)&&!R(w,m.counts)||/^(true|false)$/.test(D)?(H(w,D),y++):H(w,z(w))))}else if(C.match(/^-[0-9]$/)&&C.match(x)&&R(C.slice(1),m.bools))w=C.slice(1),H(w,z(w));else if(C==="--"){k=r.slice(y+1);break}else if(a["halt-at-non-option"]){k=r.slice(y);break}else T(C)}le(q,!0),le(q,!1),M(q),V(),Ve(q,m.aliases,l,!0),K(q),a["set-placeholder-key"]&&fe(q),Object.keys(m.counts).forEach(function(y){ee(q,y.split("."))||H(y,0)}),u&&k.length&&(q[p]=[]),k.forEach(function(y){q[p].push(y)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(q).filter(y=>y!=="--"&&y.includes("-")).forEach(y=>{delete q[y]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(y=>o[y])).forEach(y=>{a["camel-case-expansion"]&&y.includes("-")&&delete q[y.split(".").map(C=>Ct(C)).join(".")],delete q[y]});function T(y){let C=_("_",y);(typeof C=="string"||typeof C=="number")&&q._.push(C)}function G(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)||(F=Error(b("Argument unexpected for: %s",C))),H(C,z(C)),y;let E=pe(A)?0:1;if(a["nargs-eats-options"])O.length-(y+1)+E<j&&(F=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)||Z(O[w]));w++)E++;E<j&&(F=Error(b("Not enough arguments following: %s",C)))}let D=Math.min(E,j);for(!pe(A)&&D>0&&(H(C,A),D--),w=y+1;w<D+y+1;w++)H(C,O[w]);return y+D}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)&&!Z(j)){if(l[C]!==void 0){let D=l[C];w=Array.isArray(D)?D:[D]}}else{pe(A)||w.push(P(C,A,!0));for(let D=y+1;D<O.length&&!(!a["greedy-arrays"]&&w.length>0||E&&typeof E=="number"&&w.length>=E||(j=O[D],/^-/.test(j)&&!x.test(j)&&!Z(j)));D++)y=D,w.push(P(C,j,s))}return typeof E=="number"&&(E&&w.length<E||isNaN(E)&&w.length===0)&&(F=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 Ct(E)}).join(".");Oe(y,j)}let A=P(y,C,O),w=y.split(".");We(q,w,A),m.aliases[y]&&m.aliases[y].forEach(function(j){let E=j.split(".");We(q,E,A)}),w.length>1&&a["dot-notation"]&&(m.aliases[w[0]]||[]).forEach(function(j){let E=j.split("."),D=[].concat(w);D.shift(),E=E.concat(D),(m.aliases[y]||[]).includes(E.join("."))||We(q,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(D){C=typeof D=="string"?ke.normalize(D):D}})})}function Oe(y,C){m.aliases[y]&&m.aliases[y].length||(m.aliases[y]=[C],d[C]=!0),m.aliases[C]&&m.aliases[C].length||Oe(C,y)}function P(y,C,O){O&&(C=ka(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=gi()),R(y,m.normalize)&&R(y,m.arrays)&&(Array.isArray(C)?A=C.map(w=>ke.normalize(w)):A=ke.normalize(C)),A}function _(y,C){return!a["parse-positional-numbers"]&&y==="_"||!R(y,m.strings)&&!R(y,m.bools)&&!Array.isArray(C)&&(Sn(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);Ve(C,m.aliases,l),Object.keys(m.configs).forEach(function(O){let A=y[O]||C[O];if(A)try{let w=null,j=ke.resolve(ke.cwd(),A),E=m.configs[O];if(typeof E=="function"){try{w=E(j)}catch(D){w=D}if(w instanceof Error){F=w;return}}else w=ke.require(j);B(w)}catch(w){w.name==="PermissionDenied"?F=w:y[O]&&(F=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):(!ee(q,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=ke.env();Object.keys(A).forEach(function(w){if(O===""||w.lastIndexOf(O,0)===0){let j=w.split("__").map(function(E,D){return D===0&&(E=E.substring(O.length)),Ct(E)});(C&&m.configs[j.join(".")]||!C)&&!ee(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){F=w}})}function fe(y){return m.keys.forEach(C=>{~C.indexOf(".")||typeof y[C]=="undefined"&&(y[C]=void 0)}),y}function Ve(y,C,O,A=!1){Object.keys(O).forEach(function(w){ee(y,w.split("."))||(We(y,w.split("."),O[w]),A&&(g[w]=!0),(C[w]||[]).forEach(function(j){ee(y,j.split("."))||We(y,j.split("."),O[w])}))})}function ee(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 We(y,C,O){let A=y;a["dot-notation"]||(C=[C.join(".")]),C.slice(0,-1).forEach(function(de){de=xr(de),typeof A=="object"&&A[de]===void 0&&(A[de]={}),typeof A[de]!="object"||Array.isArray(A[de])?(Array.isArray(A[de])?A[de].push({}):A[de]=[A[de],{}],A=A[de][A[de].length-1]):A=A[de]});let w=xr(C[C.length-1]),j=R(C.join("."),m.arrays),E=Array.isArray(O),D=a["duplicate-arguments-array"];!D&&R(w,m.nargs)&&(D=!0,(!pe(A[w])&&m.nargs[w]===1||Array.isArray(A[w])&&A[w].length===m.nargs[w])&&(A[w]=void 0)),O===gi()?A[w]=gi(A[w]):Array.isArray(A[w])?D&&j&&E?A[w]=a["flatten-duplicate-arrays"]?A[w].concat(O):(Array.isArray(A[w][0])?A[w]:[A[w]]).concat([O]):!D&&Boolean(j)===Boolean(E)?A[w]=O:A[w]=A[w].concat([O]):A[w]===void 0&&j?A[w]=E?O:[O]:D&&!(A[w]===void 0||R(w,m.counts)||R(w,m.bools))?A[w]=[A[w],O]:A[w]=O}function rn(...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=Ct(A);w!==O&&m.aliases[O].indexOf(w)===-1&&(m.aliases[O].push(w),d[w]=!0)}}),m.aliases[O].concat(O).forEach(function(A){if(A.length>1&&/[A-Z]/.test(A)&&a["camel-case-expansion"]){let w=En(A,"-");w!==O&&m.aliases[O].indexOf(w)===-1&&(m.aliases[O].push(w),d[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 $t(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 dr(y,...C){return[].concat(...C).some(function(A){let w=y.match(A);return w&&$t(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),!$t(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 Z(y){return a["unknown-options-as-args"]&&ue(y)}function ue(y){return y=y.replace(/^-{3,}/,"--"),y.match(x)||$(y)?!1:!dr(y,/^-+([^=]+?)=[\s\S]*$/,v,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function z(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 pi(){Object.keys(m.counts).find(y=>R(y,m.arrays)?(F=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",y)),!0):R(y,m.nargs)?(F=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",y)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(W,q),configuration:a,defaulted:Object.assign({},g),error:F,newAliases:Object.assign({},d)}}};function Wa(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 gi(e){return e!==void 0?e+1:1}function xr(e){return e==="__proto__"?"___proto___":e}function ka(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}var _r=require("fs");var vr=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])<vr)throw Error(`yargs parser supports a minimum Node.js version of ${vr}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Ya=process?process.env:{},Er=new In({cwd:process.cwd,env:()=>Ya,format:Or.format,normalize:jn.normalize,resolve:jn.resolve,require:e=>{if(typeof require!="undefined")return require(e);if(e.match(/\.json$/))return JSON.parse((0,_r.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),on=function(t,n){return Er.parse(t.slice(),n).argv};on.detailed=function(e,t){return Er.parse(e.slice(),t)};on.camelCase=Ct;on.decamelize=En;on.looksLikeNumber=Sn;var Sr=on;var De=require("path");function qa(){return za()?0:1}function za(){return Ga()&&!process.defaultApp}function Ga(){return!!process.versions.electron}function Ir(){return process.argv[qa()]}var X=class extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,X)}};var Ht=require("fs"),jr=require("util"),Pr=require("path"),Mr={fs:{readFileSync:Ht.readFileSync,writeFile:Ht.writeFile},format:jr.format,resolve:Pr.resolve,exists:e=>{try{return(0,Ht.statSync)(e).isFile()}catch(t){return!1}}};var Te,bi=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(),Te.format.apply(Te.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),Te.format.apply(Te.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);Te.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{Te.fs.readFileSync&&(t=JSON.parse(Te.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=Te.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(i)&&~n.lastIndexOf("_")){let r=Te.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(r)&&(i=r)}return i}_fileExistsSync(t){return Te.exists(t)}};function Lr(e,t){Te=t;let n=new bi(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 Ka=e=>Lr(e,Mr),Fr=Ka;var Qa={},Va="require is not supported by ESM",Tr="loading a directory of commands is not supported yet for ESM",sn;try{sn=(0,Rr.fileURLToPath)(Qa.url)}catch(e){sn=process.cwd()}var Ja=sn.substring(0,sn.lastIndexOf("node_modules")),$r={assert:{notStrictEqual:Pn.notStrictEqual,strictEqual:Pn.strictEqual},cliui:mi,findUp:Cr,getEnv:e=>process.env[e],inspect:Dr.inspect,getCallerFile:()=>{throw new X(Tr)},getProcessArgvBin:Ir,mainFilename:Ja||process.cwd(),Parser:Sr,path:{basename:De.basename,dirname:De.dirname,extname:De.extname,relative:De.relative,resolve:De.resolve},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:Nr.readFileSync,require:()=>{throw new X(Va)},requireDirectory:()=>{throw new X(Tr)},stringWidth:e=>[...e].length,y18n:Fr({directory:(0,De.resolve)(sn,"../../../locales"),updateFiles:!1})};function Ae(e,t,n,i){n.assert.notStrictEqual(e,t,i)}function yi(e,t){t.assert.strictEqual(typeof e,"string")}function Bt(e){return Object.keys(e)}function te(e){return!!e&&!!e.then&&typeof e.then=="function"}function Je(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 Za=["first","second","third","fourth","fifth","sixth"];function S(e,t,n){function i(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[Je(`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 X(`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 X(`Too many arguments provided. Expected max ${f} but received ${c}.`);s.demanded.forEach(u=>{let p=l.shift(),d=Ur(p);u.cmd.filter(b=>b===d||b==="*").length===0&&Hr(d,u.cmd,r),r+=1}),s.optional.forEach(u=>{if(l.length===0)return;let p=l.shift(),d=Ur(p);u.cmd.filter(b=>b===d||b==="*").length===0&&Hr(d,u.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function Ur(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function Hr(e,t,n){throw new X(`Invalid ${Za[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var Mn=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 Br(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function At(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(te(r))return r.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(r,t);return te(o)?o.then(a=>Object.assign(r,a)):Object.assign(r,o)}},e)}function xt(e,t,n=i=>{throw i}){try{let i=Xa(e)?e():e;return te(i)?i.then(r=>t(r)):t(i)}catch(i){return n(i)}}function Xa(e){return typeof e=="function"}function wi(e){if(typeof require=="undefined")return null;for(let t=0,n=Object.keys(require.cache),i;t<n.length;t++)if(i=require.cache[n[t]],i.exports===e)return i;return null}var Wt=/(^\*)|(^\$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=Br(s);if(r=r||(()=>{}),Array.isArray(t))if(el(t))[t,...a]=t;else for(let c of t)this.addHandler(c);else if(nl(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(Wr(i)){this.addHandler([t].concat(a),n,i.builder,i.handler,i.middlewares,i.deprecated);return}if(typeof t=="string"){let c=Je(t);a=a.map(p=>Je(p).cmd);let f=!1,u=[c.cmd].concat(a).filter(p=>Wt.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(Wt,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 te(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(Ln(c)){let u=c(i.getInternalMethods().reset(r),l);if(te(u))return u.then(p=>(f=Yr(p)?p:i,this.parseAndUpdateUsage(t,n,f,s,o,a)))}else tl(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 te(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=Wt.test(n.original)?n.original.replace(Wt,"").trim():n.original,r=t.filter(s=>!Wt.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=xt(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=At(i,o,a,!1),i=xt(i,f=>{let u=n.handler(f);return te(u)?u.then(()=>f):f}),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),te(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=At(i,a,c,!0);return te(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=Je(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=Wt.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(Ln(n))return n(t,!0);Wr(n)||Object.keys(n).forEach(i=>{t.option(i,n[i])})}moduleName(t){let n=wi(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 kr(e,t,n,i){return new Ci(e,t,n,i)}function Wr(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function el(e){return e.every(t=>typeof t=="string")}function Ln(e){return typeof e=="function"}function tl(e){return typeof e=="object"}function nl(e){return typeof e=="object"&&!Array.isArray(e)}function Qe(e={},t=()=>!0){let n={};return Bt(e).forEach(i=>{t(i,e[i])&&(n[i]=e[i])}),n}function Ze(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 il(e){return typeof e=="boolean"}function zr(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(il(le)){if(M)throw M;if(_)throw Error(_)}else le(_,M,i)}else{if(e.getExitProcess()&&Ze(!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 X(_),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 d={};i.describe=function(_,M){Array.isArray(_)?_.forEach(B=>{i.describe(B,M)}):typeof _=="object"?Object.keys(_).forEach(B=>{i.describe(B,_[B])}):d[_]=M},i.getDescriptions=()=>d;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(q)return q;k();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(d)),fe=fe.concat(Object.keys(M)),fe=fe.concat(Object.keys(B)),fe=fe.concat(Object.keys(K.default)),fe=fe.filter(T),fe=Object.keys(fe.reduce(($,Z)=>(Z!=="_"&&($[Z]=!0),$),{}));let Ve=x(),ee=t.cliui({width:Ve,wrap:!!Ve});if(!f){if(c.length)c.forEach($=>{ee.div({text:`${$[0].replace(/\$0/g,_)}`}),$[1]&&ee.div({text:`${$[1]}`,padding:[1,0,0,0]})}),ee.div();else if(p.length){let $=null;B._?$=`${_} <${n("command")}>
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[Ra]||0).fill("")),r.push(...new Array(s.padding[$a]||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[On]||0)+(t.padding[vn]||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,Ua(t[a])):o)}};function yr(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function Ua(e){let t=e.padding||[],n=1+(t[On]||0)+(t[vn]||0);return e.border?n+4:n}function Ha(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Ba(e,t){e=e.trim();let n=_e.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function Wa(e,t){e=e.trim();let n=_e.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var _e;function wr(e,t){return _e=t,new hi({width:(e==null?void 0:e.width)||Ha(),wrap:e==null?void 0:e.wrap})}var Cr=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function di(e){return e.replace(Cr,"")}function Ar(e,t){let[n,i]=e.match(Cr)||["",""];e=di(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 mi(e){return wr(e,{stringWidth:t=>[...t].length,stripAnsi:di,wrap:Ar})}var Ut=require("path"),_n=require("fs");function xr(e,t){let n=(0,Ut.resolve)(".",e),i;for((0,_n.statSync)(n).isDirectory()||(n=(0,Ut.dirname)(n));;){if(i=t(n,(0,_n.readdirSync)(n)),i)return(0,Ut.resolve)(n,i);if(n=(0,Ut.dirname)(i=n),i===n)break}}var Rr=require("util"),$r=require("fs"),Ur=require("url");var Er=require("util"),jn=require("path");function Ct(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 En(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 Sn(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 vr(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 ke,In=class{constructor(t){ke=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=vr(t),s=typeof t=="string",o=ka(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?"--":"_",d=Object.create(null),g=Object.create(null),b=i.__||ke.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)})),rn(i.key,o,i.default,m.arrays),Object.keys(l).forEach(function(y){(m.aliases[y]||[]).forEach(function(C){l[C]=l[y]})});let F=null;pi();let k=[],q=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,D,de;if(C!=="--"&&Z(C))T(C);else if(O.match(/---+(=|$)/)){T(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=G(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=G(y,w,r):(D=r[y+1],D!==void 0&&(!D.match(/^-/)||D.match(x))&&!R(w,m.bools)&&!R(w,m.counts)||/^(true|false)$/.test(D)?(H(w,D),y++):H(w,z(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))D=r[y+1],E=C.match(/^-(.\..+)/),E!==null&&Array.isArray(E)&&E.length>=2&&(w=E[1],D!==void 0&&!D.match(/^-/)&&!R(w,m.bools)&&!R(w,m.counts)?(H(w,D),y++):H(w,z(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(D=C.slice(Ce+2),j[Ce+1]&&j[Ce+1]==="="){de=C.slice(Ce+3),w=j[Ce],R(w,m.arrays)?y=J(y,w,r,de):R(w,m.nargs)!==!1?y=G(y,w,r,de):H(w,de),A=!0;break}if(D==="-"){H(j[Ce],D);continue}if(/[A-Za-z]/.test(j[Ce])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(D)&&R(D,m.bools)===!1){H(j[Ce],D),A=!0;break}if(j[Ce+1]&&j[Ce+1].match(/\W/)){H(j[Ce],D),A=!0;break}else H(j[Ce],z(j[Ce]))}w=C.slice(-1)[0],!A&&w!=="-"&&(R(w,m.arrays)?y=J(y,w,r):R(w,m.nargs)!==!1?y=G(y,w,r):(D=r[y+1],D!==void 0&&(!/^(-|--)[^-]/.test(D)||D.match(x))&&!R(w,m.bools)&&!R(w,m.counts)||/^(true|false)$/.test(D)?(H(w,D),y++):H(w,z(w))))}else if(C.match(/^-[0-9]$/)&&C.match(x)&&R(C.slice(1),m.bools))w=C.slice(1),H(w,z(w));else if(C==="--"){k=r.slice(y+1);break}else if(a["halt-at-non-option"]){k=r.slice(y);break}else T(C)}le(q,!0),le(q,!1),M(q),V(),Ve(q,m.aliases,l,!0),K(q),a["set-placeholder-key"]&&fe(q),Object.keys(m.counts).forEach(function(y){ee(q,y.split("."))||H(y,0)}),u&&k.length&&(q[p]=[]),k.forEach(function(y){q[p].push(y)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(q).filter(y=>y!=="--"&&y.includes("-")).forEach(y=>{delete q[y]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(y=>o[y])).forEach(y=>{a["camel-case-expansion"]&&y.includes("-")&&delete q[y.split(".").map(C=>Ct(C)).join(".")],delete q[y]});function T(y){let C=_("_",y);(typeof C=="string"||typeof C=="number")&&q._.push(C)}function G(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)||(F=Error(b("Argument unexpected for: %s",C))),H(C,z(C)),y;let E=pe(A)?0:1;if(a["nargs-eats-options"])O.length-(y+1)+E<j&&(F=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)||Z(O[w]));w++)E++;E<j&&(F=Error(b("Not enough arguments following: %s",C)))}let D=Math.min(E,j);for(!pe(A)&&D>0&&(H(C,A),D--),w=y+1;w<D+y+1;w++)H(C,O[w]);return y+D}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)&&!Z(j)){if(l[C]!==void 0){let D=l[C];w=Array.isArray(D)?D:[D]}}else{pe(A)||w.push(P(C,A,!0));for(let D=y+1;D<O.length&&!(!a["greedy-arrays"]&&w.length>0||E&&typeof E=="number"&&w.length>=E||(j=O[D],/^-/.test(j)&&!x.test(j)&&!Z(j)));D++)y=D,w.push(P(C,j,s))}return typeof E=="number"&&(E&&w.length<E||isNaN(E)&&w.length===0)&&(F=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 Ct(E)}).join(".");Oe(y,j)}let A=P(y,C,O),w=y.split(".");We(q,w,A),m.aliases[y]&&m.aliases[y].forEach(function(j){let E=j.split(".");We(q,E,A)}),w.length>1&&a["dot-notation"]&&(m.aliases[w[0]]||[]).forEach(function(j){let E=j.split("."),D=[].concat(w);D.shift(),E=E.concat(D),(m.aliases[y]||[]).includes(E.join("."))||We(q,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(D){C=typeof D=="string"?ke.normalize(D):D}})})}function Oe(y,C){m.aliases[y]&&m.aliases[y].length||(m.aliases[y]=[C],d[C]=!0),m.aliases[C]&&m.aliases[C].length||Oe(C,y)}function P(y,C,O){O&&(C=Ya(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=gi()),R(y,m.normalize)&&R(y,m.arrays)&&(Array.isArray(C)?A=C.map(w=>ke.normalize(w)):A=ke.normalize(C)),A}function _(y,C){return!a["parse-positional-numbers"]&&y==="_"||!R(y,m.strings)&&!R(y,m.bools)&&!Array.isArray(C)&&(Sn(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);Ve(C,m.aliases,l),Object.keys(m.configs).forEach(function(O){let A=y[O]||C[O];if(A)try{let w=null,j=ke.resolve(ke.cwd(),A),E=m.configs[O];if(typeof E=="function"){try{w=E(j)}catch(D){w=D}if(w instanceof Error){F=w;return}}else w=ke.require(j);B(w)}catch(w){w.name==="PermissionDenied"?F=w:y[O]&&(F=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):(!ee(q,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=ke.env();Object.keys(A).forEach(function(w){if(O===""||w.lastIndexOf(O,0)===0){let j=w.split("__").map(function(E,D){return D===0&&(E=E.substring(O.length)),Ct(E)});(C&&m.configs[j.join(".")]||!C)&&!ee(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){F=w}})}function fe(y){return m.keys.forEach(C=>{~C.indexOf(".")||typeof y[C]=="undefined"&&(y[C]=void 0)}),y}function Ve(y,C,O,A=!1){Object.keys(O).forEach(function(w){ee(y,w.split("."))||(We(y,w.split("."),O[w]),A&&(g[w]=!0),(C[w]||[]).forEach(function(j){ee(y,j.split("."))||We(y,j.split("."),O[w])}))})}function ee(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 We(y,C,O){let A=y;a["dot-notation"]||(C=[C.join(".")]),C.slice(0,-1).forEach(function(de){de=Or(de),typeof A=="object"&&A[de]===void 0&&(A[de]={}),typeof A[de]!="object"||Array.isArray(A[de])?(Array.isArray(A[de])?A[de].push({}):A[de]=[A[de],{}],A=A[de][A[de].length-1]):A=A[de]});let w=Or(C[C.length-1]),j=R(C.join("."),m.arrays),E=Array.isArray(O),D=a["duplicate-arguments-array"];!D&&R(w,m.nargs)&&(D=!0,(!pe(A[w])&&m.nargs[w]===1||Array.isArray(A[w])&&A[w].length===m.nargs[w])&&(A[w]=void 0)),O===gi()?A[w]=gi(A[w]):Array.isArray(A[w])?D&&j&&E?A[w]=a["flatten-duplicate-arrays"]?A[w].concat(O):(Array.isArray(A[w][0])?A[w]:[A[w]]).concat([O]):!D&&Boolean(j)===Boolean(E)?A[w]=O:A[w]=A[w].concat([O]):A[w]===void 0&&j?A[w]=E?O:[O]:D&&!(A[w]===void 0||R(w,m.counts)||R(w,m.bools))?A[w]=[A[w],O]:A[w]=O}function rn(...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=Ct(A);w!==O&&m.aliases[O].indexOf(w)===-1&&(m.aliases[O].push(w),d[w]=!0)}}),m.aliases[O].concat(O).forEach(function(A){if(A.length>1&&/[A-Z]/.test(A)&&a["camel-case-expansion"]){let w=En(A,"-");w!==O&&m.aliases[O].indexOf(w)===-1&&(m.aliases[O].push(w),d[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 $t(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 gr(y,...C){return[].concat(...C).some(function(A){let w=y.match(A);return w&&$t(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),!$t(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 Z(y){return a["unknown-options-as-args"]&&ue(y)}function ue(y){return y=y.replace(/^-{3,}/,"--"),y.match(x)||$(y)?!1:!gr(y,/^-+([^=]+?)=[\s\S]*$/,v,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function z(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 pi(){Object.keys(m.counts).find(y=>R(y,m.arrays)?(F=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",y)),!0):R(y,m.nargs)?(F=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",y)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(W,q),configuration:a,defaulted:Object.assign({},g),error:F,newAliases:Object.assign({},d)}}};function ka(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 gi(e){return e!==void 0?e+1:1}function Or(e){return e==="__proto__"?"___proto___":e}function Ya(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}var Sr=require("fs");var _r=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])<_r)throw Error(`yargs parser supports a minimum Node.js version of ${_r}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var qa=process?process.env:{},Ir=new In({cwd:process.cwd,env:()=>qa,format:Er.format,normalize:jn.normalize,resolve:jn.resolve,require:e=>{if(typeof require!="undefined")return require(e);if(e.match(/\.json$/))return JSON.parse((0,Sr.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),on=function(t,n){return Ir.parse(t.slice(),n).argv};on.detailed=function(e,t){return Ir.parse(e.slice(),t)};on.camelCase=Ct;on.decamelize=En;on.looksLikeNumber=Sn;var jr=on;var De=require("path");function za(){return Ga()?0:1}function Ga(){return Ka()&&!process.defaultApp}function Ka(){return!!process.versions.electron}function Pr(){return process.argv[za()]}var X=class extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,X)}};var Ht=require("fs"),Mr=require("util"),Lr=require("path"),Fr={fs:{readFileSync:Ht.readFileSync,writeFile:Ht.writeFile},format:Mr.format,resolve:Lr.resolve,exists:e=>{try{return(0,Ht.statSync)(e).isFile()}catch(t){return!1}}};var Te,bi=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(),Te.format.apply(Te.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),Te.format.apply(Te.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);Te.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{Te.fs.readFileSync&&(t=JSON.parse(Te.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=Te.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(i)&&~n.lastIndexOf("_")){let r=Te.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(r)&&(i=r)}return i}_fileExistsSync(t){return Te.exists(t)}};function Tr(e,t){Te=t;let n=new bi(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 Va=e=>Tr(e,Fr),Dr=Va;var Za={},Ja="require is not supported by ESM",Nr="loading a directory of commands is not supported yet for ESM",sn;try{sn=(0,Ur.fileURLToPath)(Za.url)}catch(e){sn=process.cwd()}var Qa=sn.substring(0,sn.lastIndexOf("node_modules")),Hr={assert:{notStrictEqual:Pn.notStrictEqual,strictEqual:Pn.strictEqual},cliui:mi,findUp:xr,getEnv:e=>process.env[e],inspect:Rr.inspect,getCallerFile:()=>{throw new X(Nr)},getProcessArgvBin:Pr,mainFilename:Qa||process.cwd(),Parser:jr,path:{basename:De.basename,dirname:De.dirname,extname:De.extname,relative:De.relative,resolve:De.resolve},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:$r.readFileSync,require:()=>{throw new X(Ja)},requireDirectory:()=>{throw new X(Nr)},stringWidth:e=>[...e].length,y18n:Dr({directory:(0,De.resolve)(sn,"../../../locales"),updateFiles:!1})};function Ae(e,t,n,i){n.assert.notStrictEqual(e,t,i)}function yi(e,t){t.assert.strictEqual(typeof e,"string")}function Bt(e){return Object.keys(e)}function te(e){return!!e&&!!e.then&&typeof e.then=="function"}function Je(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 Xa=["first","second","third","fourth","fifth","sixth"];function S(e,t,n){function i(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[Je(`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 X(`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 X(`Too many arguments provided. Expected max ${f} but received ${c}.`);s.demanded.forEach(u=>{let p=l.shift(),d=Br(p);u.cmd.filter(b=>b===d||b==="*").length===0&&Wr(d,u.cmd,r),r+=1}),s.optional.forEach(u=>{if(l.length===0)return;let p=l.shift(),d=Br(p);u.cmd.filter(b=>b===d||b==="*").length===0&&Wr(d,u.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function Br(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function Wr(e,t,n){throw new X(`Invalid ${Xa[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var Mn=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 kr(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function At(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(te(r))return r.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(r,t);return te(o)?o.then(a=>Object.assign(r,a)):Object.assign(r,o)}},e)}function xt(e,t,n=i=>{throw i}){try{let i=el(e)?e():e;return te(i)?i.then(r=>t(r)):t(i)}catch(i){return n(i)}}function el(e){return typeof e=="function"}function wi(e){if(typeof require=="undefined")return null;for(let t=0,n=Object.keys(require.cache),i;t<n.length;t++)if(i=require.cache[n[t]],i.exports===e)return i;return null}var Wt=/(^\*)|(^\$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=kr(s);if(r=r||(()=>{}),Array.isArray(t))if(tl(t))[t,...a]=t;else for(let c of t)this.addHandler(c);else if(il(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(Yr(i)){this.addHandler([t].concat(a),n,i.builder,i.handler,i.middlewares,i.deprecated);return}if(typeof t=="string"){let c=Je(t);a=a.map(p=>Je(p).cmd);let f=!1,u=[c.cmd].concat(a).filter(p=>Wt.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(Wt,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 te(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(Ln(c)){let u=c(i.getInternalMethods().reset(r),l);if(te(u))return u.then(p=>(f=zr(p)?p:i,this.parseAndUpdateUsage(t,n,f,s,o,a)))}else nl(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 te(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=Wt.test(n.original)?n.original.replace(Wt,"").trim():n.original,r=t.filter(s=>!Wt.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=xt(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=At(i,o,a,!1),i=xt(i,f=>{let u=n.handler(f);return te(u)?u.then(()=>f):f}),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),te(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=At(i,a,c,!0);return te(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=Je(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=Wt.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(Ln(n))return n(t,!0);Yr(n)||Object.keys(n).forEach(i=>{t.option(i,n[i])})}moduleName(t){let n=wi(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 qr(e,t,n,i){return new Ci(e,t,n,i)}function Yr(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function tl(e){return e.every(t=>typeof t=="string")}function Ln(e){return typeof e=="function"}function nl(e){return typeof e=="object"}function il(e){return typeof e=="object"&&!Array.isArray(e)}function Qe(e={},t=()=>!0){let n={};return Bt(e).forEach(i=>{t(i,e[i])&&(n[i]=e[i])}),n}function Ze(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 rl(e){return typeof e=="boolean"}function Kr(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(rl(le)){if(M)throw M;if(_)throw Error(_)}else le(_,M,i)}else{if(e.getExitProcess()&&Ze(!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 X(_),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 d={};i.describe=function(_,M){Array.isArray(_)?_.forEach(B=>{i.describe(B,M)}):typeof _=="object"?Object.keys(_).forEach(B=>{i.describe(B,_[B])}):d[_]=M},i.getDescriptions=()=>d;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(q)return q;k();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(d)),fe=fe.concat(Object.keys(M)),fe=fe.concat(Object.keys(B)),fe=fe.concat(Object.keys(K.default)),fe=fe.filter(T),fe=Object.keys(fe.reduce(($,Z)=>(Z!=="_"&&($[Z]=!0),$),{}));let Ve=x(),ee=t.cliui({width:Ve,wrap:!!Ve});if(!f){if(c.length)c.forEach($=>{ee.div({text:`${$[0].replace(/\$0/g,_)}`}),$[1]&&ee.div({text:`${$[1]}`,padding:[1,0,0,0]})}),ee.div();else if(p.length){let $=null;B._?$=`${_} <${n("command")}>
7
7
  `:$=`${_} [${n("command")}]
8
- `,ee.div(`${$}`)}}if(p.length>1||p.length===1&&!p[0][2]){ee.div(n("Commands:"));let $=e.getInternalMethods().getContext(),Z=$.commands.length?`${$.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(p=p.sort((z,ge)=>z[0].localeCompare(ge[0])));let ue=_?`${_} `:"";p.forEach(z=>{let ge=`${ue}${Z}${z[0].replace(/^\$0 ?/,"")}`;ee.span({text:ge,padding:[0,2,0,2],width:F(p,Ve,`${_}${Z}`)+4},{text:z[1]});let se=[];z[2]&&se.push(`[${n("default")}]`),z[3]&&z[3].length&&se.push(`[${n("aliases:")} ${z[3].join(", ")}]`),z[4]&&(typeof z[4]=="string"?se.push(`[${n("deprecated: %s",z[4])}]`):se.push(`[${n("deprecated")}]`)),se.length?ee.div({text:se.join(" "),padding:[0,0,0,2],align:"right"}):ee.div()}),ee.div()}let We=(Object.keys(K.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);fe=fe.filter($=>!e.parsed.newAliases[$]&&We.every(Z=>(K.alias[Z]||[]).indexOf($)===-1));let rn=n("Options:");le[rn]||(le[rn]=[]),W(fe,K.alias,le,rn);let R=$=>/^--/.test(Fn($)),$t=Object.keys(le).filter($=>le[$].length>0).map($=>{let Z=le[$].filter(T).map(ue=>{if(We.includes(ue))return ue;for(let z=0,ge;(ge=We[z])!==void 0;z++)if((K.alias[ge]||[]).includes(ue))return ge;return ue});return{groupName:$,normalizedKeys:Z}}).filter(({normalizedKeys:$})=>$.length>0).map(({groupName:$,normalizedKeys:Z})=>{let ue=Z.reduce((z,ge)=>(z[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(", "),z),{});return{groupName:$,normalizedKeys:Z,switches:ue}});if($t.filter(({groupName:$})=>$!==i.getPositionalGroupName()).some(({normalizedKeys:$,switches:Z})=>!$.every(ue=>R(Z[ue])))&&$t.filter(({groupName:$})=>$!==i.getPositionalGroupName()).forEach(({normalizedKeys:$,switches:Z})=>{$.forEach(ue=>{R(Z[ue])&&(Z[ue]=rl(Z[ue],4))})}),$t.forEach(({groupName:$,normalizedKeys:Z,switches:ue})=>{ee.div($),Z.forEach(z=>{let ge=ue[z],se=d[z]||"",pe=null;se.includes(v)&&(se=n(se.substring(v.length))),K.boolean.includes(z)&&(pe=`[${n("boolean")}]`),K.count.includes(z)&&(pe=`[${n("count")}]`),K.string.includes(z)&&(pe=`[${n("string")}]`),K.normalize.includes(z)&&(pe=`[${n("string")}]`),K.array.includes(z)&&(pe=`[${n("array")}]`),K.number.includes(z)&&(pe=`[${n("number")}]`);let pi=C=>typeof C=="string"?`[${n("deprecated: %s",C)}]`:`[${n("deprecated")}]`,y=[z in V?pi(V[z]):null,pe,z in M?`[${n("required")}]`:null,K.choices&&K.choices[z]?`[${n("choices:")} ${i.stringifiedValues(K.choices[z])}]`:null,G(K.default[z],K.defaultDescription[z])].filter(Boolean).join(" ");ee.span({text:Fn(ge),padding:[0,2,0,2+qr(ge)],width:F(ue,Ve)+4},se),y?ee.div({text:y,padding:[0,0,0,2],align:"right"}):ee.div()}),ee.div()}),u.length&&(ee.div(n("Examples:")),u.forEach($=>{$[0]=$[0].replace(/\$0/g,_)}),u.forEach($=>{$[1]===""?ee.div({text:$[0],padding:[0,2,0,2]}):ee.div({text:$[0],padding:[0,2,0,2],width:F(u,Ve)+4},{text:$[1]})}),ee.div()),g.length>0){let $=g.map(Z=>Z.replace(/\$0/g,_)).join(`
8
+ `,ee.div(`${$}`)}}if(p.length>1||p.length===1&&!p[0][2]){ee.div(n("Commands:"));let $=e.getInternalMethods().getContext(),Z=$.commands.length?`${$.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(p=p.sort((z,ge)=>z[0].localeCompare(ge[0])));let ue=_?`${_} `:"";p.forEach(z=>{let ge=`${ue}${Z}${z[0].replace(/^\$0 ?/,"")}`;ee.span({text:ge,padding:[0,2,0,2],width:F(p,Ve,`${_}${Z}`)+4},{text:z[1]});let se=[];z[2]&&se.push(`[${n("default")}]`),z[3]&&z[3].length&&se.push(`[${n("aliases:")} ${z[3].join(", ")}]`),z[4]&&(typeof z[4]=="string"?se.push(`[${n("deprecated: %s",z[4])}]`):se.push(`[${n("deprecated")}]`)),se.length?ee.div({text:se.join(" "),padding:[0,0,0,2],align:"right"}):ee.div()}),ee.div()}let We=(Object.keys(K.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);fe=fe.filter($=>!e.parsed.newAliases[$]&&We.every(Z=>(K.alias[Z]||[]).indexOf($)===-1));let rn=n("Options:");le[rn]||(le[rn]=[]),W(fe,K.alias,le,rn);let R=$=>/^--/.test(Fn($)),$t=Object.keys(le).filter($=>le[$].length>0).map($=>{let Z=le[$].filter(T).map(ue=>{if(We.includes(ue))return ue;for(let z=0,ge;(ge=We[z])!==void 0;z++)if((K.alias[ge]||[]).includes(ue))return ge;return ue});return{groupName:$,normalizedKeys:Z}}).filter(({normalizedKeys:$})=>$.length>0).map(({groupName:$,normalizedKeys:Z})=>{let ue=Z.reduce((z,ge)=>(z[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(", "),z),{});return{groupName:$,normalizedKeys:Z,switches:ue}});if($t.filter(({groupName:$})=>$!==i.getPositionalGroupName()).some(({normalizedKeys:$,switches:Z})=>!$.every(ue=>R(Z[ue])))&&$t.filter(({groupName:$})=>$!==i.getPositionalGroupName()).forEach(({normalizedKeys:$,switches:Z})=>{$.forEach(ue=>{R(Z[ue])&&(Z[ue]=ol(Z[ue],4))})}),$t.forEach(({groupName:$,normalizedKeys:Z,switches:ue})=>{ee.div($),Z.forEach(z=>{let ge=ue[z],se=d[z]||"",pe=null;se.includes(v)&&(se=n(se.substring(v.length))),K.boolean.includes(z)&&(pe=`[${n("boolean")}]`),K.count.includes(z)&&(pe=`[${n("count")}]`),K.string.includes(z)&&(pe=`[${n("string")}]`),K.normalize.includes(z)&&(pe=`[${n("string")}]`),K.array.includes(z)&&(pe=`[${n("array")}]`),K.number.includes(z)&&(pe=`[${n("number")}]`);let pi=C=>typeof C=="string"?`[${n("deprecated: %s",C)}]`:`[${n("deprecated")}]`,y=[z in V?pi(V[z]):null,pe,z in M?`[${n("required")}]`:null,K.choices&&K.choices[z]?`[${n("choices:")} ${i.stringifiedValues(K.choices[z])}]`:null,G(K.default[z],K.defaultDescription[z])].filter(Boolean).join(" ");ee.span({text:Fn(ge),padding:[0,2,0,2+Gr(ge)],width:F(ue,Ve)+4},se),y?ee.div({text:y,padding:[0,0,0,2],align:"right"}):ee.div()}),ee.div()}),u.length&&(ee.div(n("Examples:")),u.forEach($=>{$[0]=$[0].replace(/\$0/g,_)}),u.forEach($=>{$[1]===""?ee.div({text:$[0],padding:[0,2,0,2]}):ee.div({text:$[0],padding:[0,2,0,2],width:F(u,Ve)+4},{text:$[1]})}),ee.div()),g.length>0){let $=g.map(Z=>Z.replace(/\$0/g,_)).join(`
9
9
  `);ee.div(`${$}
10
- `)}return ee.toString().replace(/\s*$/,"")};function F(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} ${Fn(V[0])}`:Fn(V[0]))+qr(V[0]),B)}),_&&(B=Math.min(B,parseInt((_*.5).toString(),10))),B}function k(){let P=e.getDemandedOptions(),_=e.getOptions();(Object.keys(_.alias)||[]).forEach(M=>{_.alias[M].forEach(B=>{d[B]&&i.describe(M,d[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 q;i.cacheHelpMessage=function(){q=this.help()},i.clearCachedHelpMessage=function(){q=void 0},i.hasCachedHelpMessage=function(){return!!q};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 T(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 G(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=[],d=Qe(d,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:d})},i.unfreeze=function(_=!1){let M=Oe.pop();!M||(_?(d={...M.descriptions,...d},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:d}=M)},i}function Ai(e){return typeof e=="object"}function rl(e,t){return Ai(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function qr(e){return Ai(e)?e.indentation:0}function Fn(e){return Ai(e)?e.text:e}var Gr=`###-begin-{{app_name}}-completions-###
10
+ `)}return ee.toString().replace(/\s*$/,"")};function F(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} ${Fn(V[0])}`:Fn(V[0]))+Gr(V[0]),B)}),_&&(B=Math.min(B,parseInt((_*.5).toString(),10))),B}function k(){let P=e.getDemandedOptions(),_=e.getOptions();(Object.keys(_.alias)||[]).forEach(M=>{_.alias[M].forEach(B=>{d[B]&&i.describe(M,d[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 q;i.cacheHelpMessage=function(){q=this.help()},i.clearCachedHelpMessage=function(){q=void 0},i.hasCachedHelpMessage=function(){return!!q};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 T(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 G(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=[],d=Qe(d,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:d})},i.unfreeze=function(_=!1){let M=Oe.pop();!M||(_?(d={...M.descriptions,...d},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:d}=M)},i}function Ai(e){return typeof e=="object"}function ol(e,t){return Ai(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function Gr(e){return Ai(e)?e.indentation:0}function Fn(e){return Ai(e)?e.text:e}var Vr=`###-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
- `,Kr=`#compdef {{app_name}}
38
+ `,Jr=`#compdef {{app_name}}
39
39
  ###-begin-{{app_name}}-completions-###
40
40
  #
41
41
  # yargs command completion script
@@ -54,54 +54,54 @@ _{{app_name}}_yargs_completions()
54
54
  }
55
55
  compdef _{{app_name}}_yargs_completions {{app_name}}
56
56
  ###-end-{{app_name}}-completions-###
57
- `;var xi=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(Ln(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=Je(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),sl(this.customCompletionFunction)){let s=this.customCompletionFunction(i,n);return te(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 al(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 te(r)?r.then(s):s(r)}generateCompletionScript(t,n){let i=this.zshShell?Kr:Gr,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 Vr(e,t,n,i){return new xi(e,t,n,i)}function sl(e){return e.length<3}function al(e){return e.length>3}function Jr(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 Qr=["$0","--","_"];function Zr(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 d=null;for(let g of Object.keys(p))(!Object.prototype.hasOwnProperty.call(u,g)||typeof u[g]=="undefined")&&(d=d||{},d[g]=p[g]);if(d){let g=[];for(let m of Object.keys(d)){let x=d[m];x&&g.indexOf(x)<0&&g.push(x)}let b=g.length?`
57
+ `;var xi=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(Ln(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=Je(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),al(this.customCompletionFunction)){let s=this.customCompletionFunction(i,n);return te(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 ll(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 te(r)?r.then(s):s(r)}generateCompletionScript(t,n){let i=this.zshShell?Jr:Vr,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 Qr(e,t,n,i){return new xi(e,t,n,i)}function al(e){return e.length<3}function ll(e){return e.length>3}function Zr(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 Xr=["$0","--","_"];function eo(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 d=null;for(let g of Object.keys(p))(!Object.prototype.hasOwnProperty.call(u,g)||typeof u[g]=="undefined")&&(d=d||{},d[g]=p[g]);if(d){let g=[];for(let m of Object.keys(d)){let x=d[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(d).length,Object.keys(d).join(", ")+b))}},s.unknownArguments=function(u,p,d,g,b=!0){var m;let x=e.getInternalMethods().getCommandInstance().getCommands(),v=[],F=e.getInternalMethods().getContext();if(Object.keys(u).forEach(k=>{!Qr.includes(k)&&!Object.prototype.hasOwnProperty.call(d,k)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),k)&&!s.isValidAndSomeAliasIsNotNew(k,p)&&v.push(k)}),b&&(F.commands.length>0||x.length>0||g)&&u._.slice(F.commands.length).forEach(k=>{x.includes(""+k)||v.push(""+k)}),b){let q=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,W=F.commands.length+q;W<u._.length&&u._.slice(W).forEach(T=>{T=String(T),!F.commands.includes(T)&&!v.includes(T)&&v.push(T)})}v.length&&t.fail(r("Unknown argument: %s","Unknown arguments: %s",v.length,v.map(k=>k.trim()?k:`"${k}"`).join(", ")))},s.unknownCommands=function(u){let p=e.getInternalMethods().getCommandInstance().getCommands(),d=[],g=e.getInternalMethods().getContext();return(g.commands.length>0||p.length>0)&&u._.slice(g.commands.length).forEach(b=>{p.includes(""+b)||d.push(""+b)}),d.length>0?(t.fail(r("Unknown command: %s","Unknown commands: %s",d.length,d.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(u,p){if(!Object.prototype.hasOwnProperty.call(p,u))return!1;let d=e.parsed.newAliases;return[u,...p[u]].some(g=>!Object.prototype.hasOwnProperty.call(d,g)||!d[u])},s.limitedChoices=function(u){let p=e.getOptions(),d={};if(!Object.keys(p.choices).length)return;Object.keys(u).forEach(m=>{Qr.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(p.choices,m)&&[].concat(u[m]).forEach(x=>{p.choices[m].indexOf(x)===-1&&x!==void 0&&(d[m]=(d[m]||[]).concat(x))})});let g=Object.keys(d);if(!g.length)return;let b=i("Invalid values:");g.forEach(m=>{b+=`
59
+ `)}`:"";t.fail(r("Missing required argument: %s","Missing required arguments: %s",Object.keys(d).length,Object.keys(d).join(", ")+b))}},s.unknownArguments=function(u,p,d,g,b=!0){var m;let x=e.getInternalMethods().getCommandInstance().getCommands(),v=[],F=e.getInternalMethods().getContext();if(Object.keys(u).forEach(k=>{!Xr.includes(k)&&!Object.prototype.hasOwnProperty.call(d,k)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),k)&&!s.isValidAndSomeAliasIsNotNew(k,p)&&v.push(k)}),b&&(F.commands.length>0||x.length>0||g)&&u._.slice(F.commands.length).forEach(k=>{x.includes(""+k)||v.push(""+k)}),b){let q=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,W=F.commands.length+q;W<u._.length&&u._.slice(W).forEach(T=>{T=String(T),!F.commands.includes(T)&&!v.includes(T)&&v.push(T)})}v.length&&t.fail(r("Unknown argument: %s","Unknown arguments: %s",v.length,v.map(k=>k.trim()?k:`"${k}"`).join(", ")))},s.unknownCommands=function(u){let p=e.getInternalMethods().getCommandInstance().getCommands(),d=[],g=e.getInternalMethods().getContext();return(g.commands.length>0||p.length>0)&&u._.slice(g.commands.length).forEach(b=>{p.includes(""+b)||d.push(""+b)}),d.length>0?(t.fail(r("Unknown command: %s","Unknown commands: %s",d.length,d.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(u,p){if(!Object.prototype.hasOwnProperty.call(p,u))return!1;let d=e.parsed.newAliases;return[u,...p[u]].some(g=>!Object.prototype.hasOwnProperty.call(d,g)||!d[u])},s.limitedChoices=function(u){let p=e.getOptions(),d={};if(!Object.keys(p.choices).length)return;Object.keys(u).forEach(m=>{Xr.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(p.choices,m)&&[].concat(u[m]).forEach(x=>{p.choices[m].indexOf(x)===-1&&x!==void 0&&(d[m]=(d[m]||[]).concat(x))})});let g=Object.keys(d);if(!g.length)return;let b=i("Invalid values:");g.forEach(m=>{b+=`
60
60
  ${i("Argument: %s, Given: %s, Choices: %s",m,t.stringifiedValues(d[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(d=>{s.implies(d,u[d])}):(e.global(u),o[u]||(o[u]=[]),Array.isArray(p)?p.forEach(d=>s.implies(u,d)):(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(d=>{let g=d;(o[d]||[]).forEach(b=>{let m=g,x=b;m=a(u,m),b=a(u,b),m&&!b&&p.push(` ${g} -> ${x}`)})}),p.length){let d=`${i("Implications failed:")}
61
- `;p.forEach(g=>{d+=g}),t.fail(d)}};let l={};s.conflicts=function(u,p){S("<string|object> [array|string]",[u,p],arguments.length),typeof u=="object"?Object.keys(u).forEach(d=>{s.conflicts(d,u[d])}):(e.global(u),l[u]||(l[u]=[]),Array.isArray(p)?p.forEach(d=>s.conflicts(u,d)):l[u].push(p))},s.getConflicting=()=>l,s.conflicting=function(u){Object.keys(u).forEach(p=>{l[p]&&l[p].forEach(d=>{d&&u[p]!==void 0&&u[d]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,d))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(p=>{l[p].forEach(d=>{d&&u[n.Parser.camelCase(p)]!==void 0&&u[n.Parser.camelCase(d)]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,d))})})},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=Jr(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=Qe(o,p=>!u[p]),l=Qe(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 vi=[],an;function Tn(e,t,n,i){an=i;let r={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return r;let s=/\.json|\..*rc$/.test(e.extends),o=null;if(s)o=cl(t,e.extends);else try{o=require.resolve(e.extends)}catch(a){return e}ll(o),vi.push(o),r=s?JSON.parse(an.readFileSync(o,"utf8")):require(e.extends),delete e.extends,r=Tn(r,an.path.dirname(o),n,an)}return vi=[],n?Xr(r,e):Object.assign({},r,e)}function ll(e){if(vi.indexOf(e)>-1)throw new X(`Circular extended configurations: '${e}'.`)}function cl(e,t){return an.path.resolve(e,t)}function Xr(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]=Xr(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},h=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,vt,ln,Pe,Ee,Dn,Xe,Ot,Nn,Me,Rn,Le,Ne,Se,Fe,$n,kt,me,L,Un,Hn,Ie,_t,Yt,Et,et,Bn,U,St,It,jt,Y,Re,oe;function wo(e){return(t=[],n=e.process.cwd(),i)=>{let r=new Ti(t,n,i,e);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var eo=Symbol("copyDoubleDash"),to=Symbol("copyDoubleDash"),Oi=Symbol("deleteFromParserHintObject"),no=Symbol("emitWarning"),io=Symbol("freeze"),ro=Symbol("getDollarZero"),Pt=Symbol("getParserConfiguration"),_i=Symbol("guessLocale"),oo=Symbol("guessVersion"),so=Symbol("parsePositionalNumbers"),Ei=Symbol("pkgUp"),tt=Symbol("populateParserHintArray"),qt=Symbol("populateParserHintSingleValueDictionary"),Si=Symbol("populateParserHintArrayDictionary"),Ii=Symbol("populateParserHintDictionary"),ji=Symbol("sanitizeKey"),Pi=Symbol("setKey"),Mi=Symbol("unfreeze"),ao=Symbol("validateAsync"),lo=Symbol("getCommandInstance"),co=Symbol("getContext"),fo=Symbol("getHasOutput"),uo=Symbol("getLoggerInstance"),po=Symbol("getParseContext"),ho=Symbol("getUsageInstance"),mo=Symbol("getValidationInstance"),Wn=Symbol("hasParseCallback"),go=Symbol("isGlobalContext"),Mt=Symbol("postProcess"),bo=Symbol("rebase"),Li=Symbol("reset"),cn=Symbol("runYargsParserAndExecuteCommands"),Fi=Symbol("runValidation"),yo=Symbol("setHasOutput"),Lt=Symbol("kTrackManuallySetKeys"),Ti=class{constructor(t=[],n,i,r){this.customScriptName=!1,this.parsed=!1,ae.set(this,void 0),vt.set(this,void 0),ln.set(this,{commands:[],fullCommands:[]}),Pe.set(this,null),Ee.set(this,null),Dn.set(this,"show-hidden"),Xe.set(this,null),Ot.set(this,!0),Nn.set(this,{}),Me.set(this,!0),Rn.set(this,[]),Le.set(this,void 0),Ne.set(this,{}),Se.set(this,!1),Fe.set(this,null),$n.set(this,!0),kt.set(this,void 0),me.set(this,""),L.set(this,void 0),Un.set(this,void 0),Hn.set(this,{}),Ie.set(this,null),_t.set(this,null),Yt.set(this,{}),Et.set(this,{}),et.set(this,void 0),Bn.set(this,!1),U.set(this,void 0),St.set(this,!1),It.set(this,!1),jt.set(this,!1),Y.set(this,void 0),Re.set(this,null),oe.set(this,void 0),I(this,U,r,"f"),I(this,et,t,"f"),I(this,vt,n,"f"),I(this,Un,i,"f"),I(this,Le,new Mn(this),"f"),this.$0=this[ro](),this[Li](),I(this,ae,h(this,ae,"f"),"f"),I(this,Y,h(this,Y,"f"),"f"),I(this,oe,h(this,oe,"f"),"f"),I(this,L,h(this,L,"f"),"f"),h(this,L,"f").showHiddenOpt=h(this,Dn,"f"),I(this,kt,this[to](),"f")}addHelpOpt(t,n){let i="help";return S("[string|boolean] [string]",[t,n],arguments.length),h(this,Fe,"f")&&(this[Oi](h(this,Fe,"f")),I(this,Fe,null,"f")),t===!1&&n===void 0?this:(I(this,Fe,typeof t=="string"?t:i,"f"),this.boolean(h(this,Fe,"f")),this.describe(h(this,Fe,"f"),n||h(this,Y,"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:h(this,Dn,"f");return this.boolean(i),this.describe(i,n||h(this,Y,"f").deferY18nLookup("Show hidden options")),h(this,L,"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[Si](this.alias.bind(this),"alias",t,n),this}array(t){return S("<array|string>",[t],arguments.length),this[tt]("array",t),this[Lt](t),this}boolean(t){return S("<array|string>",[t],arguments.length),this[tt]("boolean",t),this[Lt](t),this}check(t,n){return S("<function> [boolean]",[t,n],arguments.length),this.middleware((i,r)=>xt(()=>t(i,r.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&h(this,Y,"f").fail(s.toString(),s):h(this,Y,"f").fail(h(this,U,"f").y18n.__("Argument check failed: %s",t.toString())),i),s=>(h(this,Y,"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[Si](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 X("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 X("coerce callback must be provided");return h(this,L,"f").key[t]=!0,h(this,Le,"f").addCoerceMiddleware((i,r)=>{let s;return Object.prototype.hasOwnProperty.call(i,t)?xt(()=>(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 X(a.message)}):i},t),this}conflicts(t,n){return S("<string|object> [string|array]",[t,n],arguments.length),h(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=Tn(t,h(this,vt,"f"),this[Pt]()["deep-merge-config"]||!1,h(this,U,"f")),h(this,L,"f").configObjects=(h(this,L,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(i=n,n=void 0),this.describe(t,n||h(this,Y,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(r=>{h(this,L,"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||h(this,Ee,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(h(this,Ee,"f"),n),i&&h(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),h(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=h(this,Un,"f")||h(this,U,"f").require;return h(this,ae,"f").addDirectory(t,i,h(this,U,"f").getCallerFile(),n),this}count(t){return S("<array|string>",[t],arguments.length),this[tt]("count",t),this[Lt](t),this}default(t,n,i){return S("<object|string|array> [*] [string]",[t,n,i],arguments.length),i&&(yi(t,h(this,U,"f")),h(this,L,"f").defaultDescription[t]=i),typeof n=="function"&&(yi(t,h(this,U,"f")),h(this,L,"f").defaultDescription[t]||(h(this,L,"f").defaultDescription[t]=h(this,Y,"f").functionDescription(n)),n=n.call()),this[qt](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),h(this,L,"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,h(this,U,"f")),this.demandOption(r,i)}),n=1/0):typeof n!="number"&&(i=n,n=1/0),typeof t=="number"?(Ae(i,!0,h(this,U,"f")),this.demandCommand(t,n,i,i)):Array.isArray(t)?t.forEach(r=>{Ae(i,!0,h(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[qt](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return S("<string> [string|boolean]",[t,n],arguments.length),h(this,L,"f").deprecatedOptions[t]=n,this}describe(t,n){return S("<object|string|array> [string]",[t,n],arguments.length),this[Pi](t,!0),h(this,Y,"f").describe(t,n),this}detectLocale(t){return S("<boolean>",[t],arguments.length),I(this,Ot,t,"f"),this}env(t){return S("[string|boolean]",[t],arguments.length),t===!1?delete h(this,L,"f").envPrefix:h(this,L,"f").envPrefix=t||"",this}epilogue(t){return S("<string>",[t],arguments.length),h(this,Y,"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)):h(this,Y,"f").example(t,n),this}exit(t,n){I(this,Se,!0,"f"),I(this,Xe,n,"f"),h(this,Me,"f")&&h(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 X("Invalid first argument. Expected function or boolean 'false'");return h(this,Y,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return S("<array> [function]",[t,n],arguments.length),n?h(this,Pe,"f").getCompletion(t,n):new Promise((i,r)=>{h(this,Pe,"f").getCompletion(t,(s,o)=>{s?r(s):i(o)})})}getDemandedOptions(){return S([],0),h(this,L,"f").demandedOptions}getDemandedCommands(){return S([],0),h(this,L,"f").demandedCommands}getDeprecatedOptions(){return S([],0),h(this,L,"f").deprecatedOptions}getDetectLocale(){return h(this,Ot,"f")}getExitProcess(){return h(this,Me,"f")}getGroups(){return Object.assign({},h(this,Ne,"f"),h(this,Et,"f"))}getHelp(){if(I(this,Se,!0,"f"),!h(this,Y,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[cn](h(this,et,"f"),void 0,void 0,0,!0);if(te(n))return n.then(()=>h(this,Y,"f").help())}let t=h(this,ae,"f").runDefaultBuilderOn(this);if(te(t))return t.then(()=>h(this,Y,"f").help())}return Promise.resolve(h(this,Y,"f").help())}getOptions(){return h(this,L,"f")}getStrict(){return h(this,St,"f")}getStrictCommands(){return h(this,It,"f")}getStrictOptions(){return h(this,jt,"f")}global(t,n){return S("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?h(this,L,"f").local=h(this,L,"f").local.filter(i=>t.indexOf(i)===-1):t.forEach(i=>{h(this,L,"f").local.includes(i)||h(this,L,"f").local.push(i)}),this}group(t,n){S("<string|array> <string>",[t,n],arguments.length);let i=h(this,Et,"f")[n]||h(this,Ne,"f")[n];h(this,Et,"f")[n]&&delete h(this,Et,"f")[n];let r={};return h(this,Ne,"f")[n]=(i||[]).concat(t).filter(s=>r[s]?!1:r[s]=!0),this}hide(t){return S("<string>",[t],arguments.length),h(this,L,"f").hiddenOptions.push(t),this}implies(t,n){return S("<string|object> [number|string|array]",[t,n],arguments.length),h(this,oe,"f").implies(t,n),this}locale(t){return S("[string]",[t],arguments.length),t===void 0?(this[_i](),h(this,U,"f").y18n.getLocale()):(I(this,Ot,!1,"f"),h(this,U,"f").y18n.setLocale(t),this)}middleware(t,n,i){return h(this,Le,"f").addMiddleware(t,!!n,i)}nargs(t,n){return S("<string|object|array> [number]",[t,n],arguments.length),this[qt](this.nargs.bind(this),"narg",t,n),this}normalize(t){return S("<array|string>",[t],arguments.length),this[tt]("normalize",t),this}number(t){return S("<array|string>",[t],arguments.length),this[tt]("number",t),this[Lt](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[Lt](t),h(this,Re,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[no](['"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"),h(this,L,"f").key[t]=!0,n.alias&&this.alias(t,n.alias);let i=n.deprecate||n.deprecated;i&&this.deprecateOption(t,i);let r=n.demand||n.required||n.require;r&&this.demand(t,r),n.demandOption&&this.demandOption(t,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),"default"in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(t),typeof n.global=="boolean"&&this.global(t,n.global),n.defaultDescription&&(h(this,L,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let s=n.describe||n.description||n.desc;this.describe(t,s),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,i){S("[string|array] [function|boolean|object] [function]",[t,n,i],arguments.length),this[io](),typeof t=="undefined"&&(t=h(this,et,"f")),typeof n=="object"&&(I(this,_t,n,"f"),n=i),typeof n=="function"&&(I(this,Ie,n,"f"),n=!1),n||I(this,et,t,"f"),h(this,Ie,"f")&&I(this,Me,!1,"f");let r=this[cn](t,!!n),s=this.parsed;return h(this,Pe,"f").setParsed(this.parsed),te(r)?r.then(o=>(h(this,Ie,"f")&&h(this,Ie,"f").call(this,h(this,Xe,"f"),o,h(this,me,"f")),o)).catch(o=>{throw h(this,Ie,"f")&&h(this,Ie,"f")(o,this.parsed.argv,h(this,me,"f")),o}).finally(()=>{this[Mi](),this.parsed=s}):(h(this,Ie,"f")&&h(this,Ie,"f").call(this,h(this,Xe,"f"),r,h(this,me,"f")),this[Mi](),this.parsed=s,r)}parseAsync(t,n,i){let r=this.parse(t,n,i);return te(r)?r:Promise.resolve(r)}parseSync(t,n,i){let r=this.parse(t,n,i);if(te(r))throw new X(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(t){return S("<object>",[t],arguments.length),I(this,Hn,t,"f"),this}pkgConf(t,n){S("<string> [string]",[t,n],arguments.length);let i=null,r=this[Ei](n||h(this,vt,"f"));return r[t]&&typeof r[t]=="object"&&(i=Tn(r[t],n||h(this,vt,"f"),this[Pt]()["deep-merge-config"]||!1,h(this,U,"f")),h(this,L,"f").configObjects=(h(this,L,"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=Qe(n,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:i.includes(o));let r=h(this,ln,"f").fullCommands[h(this,ln,"f").fullCommands.length-1],s=r?h(this,ae,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return Bt(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,h(this,Y,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return S("[boolean]",[t],arguments.length),I(this,Bn,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"&&h(this,L,"f").narg[t]?this:(this[qt](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return S("[string] [string]",[t,n],arguments.length),t=t||this.$0,h(this,kt,"f").log(h(this,Pe,"f").generateCompletionScript(t,n||h(this,Ee,"f")||"completion")),this}showHelp(t){if(S("[string|function]",[t],arguments.length),I(this,Se,!0,"f"),!h(this,Y,"f").hasCachedHelpMessage()){if(!this.parsed){let i=this[cn](h(this,et,"f"),void 0,void 0,0,!0);if(te(i))return i.then(()=>{h(this,Y,"f").showHelp(t)}),this}let n=h(this,ae,"f").runDefaultBuilderOn(this);if(te(n))return n.then(()=>{h(this,Y,"f").showHelp(t)}),this}return h(this,Y,"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),h(this,Y,"f").showHelpOnFail(t,n),this}showVersion(t){return S("[string|function]",[t],arguments.length),h(this,Y,"f").showVersion(t),this}skipValidation(t){return S("<array|string>",[t],arguments.length),this[tt]("skipValidation",t),this}strict(t){return S("[boolean]",[t],arguments.length),I(this,St,t!==!1,"f"),this}strictCommands(t){return S("[boolean]",[t],arguments.length),I(this,It,t!==!1,"f"),this}strictOptions(t){return S("[boolean]",[t],arguments.length),I(this,jt,t!==!1,"f"),this}string(t){return S("<array|string>",[t],arguments.length),this[tt]("string",t),this[Lt](t),this}terminalWidth(){return S([],0),h(this,U,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return S("<object>",[t],arguments.length),I(this,Ot,!1,"f"),h(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,h(this,U,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,i,r);throw new X(".usage() description must start with $0 if being used as alias for .command()")}else return h(this,Y,"f").usage(t),this}version(t,n,i){let r="version";if(S("[boolean|string] [string] [string]",[t,n,i],arguments.length),h(this,Re,"f")&&(this[Oi](h(this,Re,"f")),h(this,Y,"f").version(void 0),I(this,Re,null,"f")),arguments.length===0)i=this[oo](),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,Re,typeof t=="string"?t:r,"f"),n=n||h(this,Y,"f").deferY18nLookup("Show version number"),h(this,Y,"f").version(i||void 0),this.boolean(h(this,Re,"f")),this.describe(h(this,Re,"f"),n),this}wrap(t){return S("<number|null|undefined>",[t],arguments.length),h(this,Y,"f").wrap(t),this}[(ae=new WeakMap,vt=new WeakMap,ln=new WeakMap,Pe=new WeakMap,Ee=new WeakMap,Dn=new WeakMap,Xe=new WeakMap,Ot=new WeakMap,Nn=new WeakMap,Me=new WeakMap,Rn=new WeakMap,Le=new WeakMap,Ne=new WeakMap,Se=new WeakMap,Fe=new WeakMap,$n=new WeakMap,kt=new WeakMap,me=new WeakMap,L=new WeakMap,Un=new WeakMap,Hn=new WeakMap,Ie=new WeakMap,_t=new WeakMap,Yt=new WeakMap,Et=new WeakMap,et=new WeakMap,Bn=new WeakMap,U=new WeakMap,St=new WeakMap,It=new WeakMap,jt=new WeakMap,Y=new WeakMap,Re=new WeakMap,oe=new WeakMap,eo)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[to](){return{log:(...t)=>{this[Wn]()||console.log(...t),I(this,Se,!0,"f"),h(this,me,"f").length&&I(this,me,h(this,me,"f")+`
61
+ `;p.forEach(g=>{d+=g}),t.fail(d)}};let l={};s.conflicts=function(u,p){S("<string|object> [array|string]",[u,p],arguments.length),typeof u=="object"?Object.keys(u).forEach(d=>{s.conflicts(d,u[d])}):(e.global(u),l[u]||(l[u]=[]),Array.isArray(p)?p.forEach(d=>s.conflicts(u,d)):l[u].push(p))},s.getConflicting=()=>l,s.conflicting=function(u){Object.keys(u).forEach(p=>{l[p]&&l[p].forEach(d=>{d&&u[p]!==void 0&&u[d]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,d))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(p=>{l[p].forEach(d=>{d&&u[n.Parser.camelCase(p)]!==void 0&&u[n.Parser.camelCase(d)]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,d))})})},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=Zr(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=Qe(o,p=>!u[p]),l=Qe(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 vi=[],an;function Tn(e,t,n,i){an=i;let r={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return r;let s=/\.json|\..*rc$/.test(e.extends),o=null;if(s)o=fl(t,e.extends);else try{o=require.resolve(e.extends)}catch(a){return e}cl(o),vi.push(o),r=s?JSON.parse(an.readFileSync(o,"utf8")):require(e.extends),delete e.extends,r=Tn(r,an.path.dirname(o),n,an)}return vi=[],n?to(r,e):Object.assign({},r,e)}function cl(e){if(vi.indexOf(e)>-1)throw new X(`Circular extended configurations: '${e}'.`)}function fl(e,t){return an.path.resolve(e,t)}function to(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]=to(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},h=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,vt,ln,Pe,Ee,Dn,Xe,Ot,Nn,Me,Rn,Le,Ne,Se,Fe,$n,kt,me,L,Un,Hn,Ie,_t,Yt,Et,et,Bn,U,St,It,jt,Y,Re,oe;function Ao(e){return(t=[],n=e.process.cwd(),i)=>{let r=new Ti(t,n,i,e);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var no=Symbol("copyDoubleDash"),io=Symbol("copyDoubleDash"),Oi=Symbol("deleteFromParserHintObject"),ro=Symbol("emitWarning"),oo=Symbol("freeze"),so=Symbol("getDollarZero"),Pt=Symbol("getParserConfiguration"),_i=Symbol("guessLocale"),ao=Symbol("guessVersion"),lo=Symbol("parsePositionalNumbers"),Ei=Symbol("pkgUp"),tt=Symbol("populateParserHintArray"),qt=Symbol("populateParserHintSingleValueDictionary"),Si=Symbol("populateParserHintArrayDictionary"),Ii=Symbol("populateParserHintDictionary"),ji=Symbol("sanitizeKey"),Pi=Symbol("setKey"),Mi=Symbol("unfreeze"),co=Symbol("validateAsync"),fo=Symbol("getCommandInstance"),uo=Symbol("getContext"),po=Symbol("getHasOutput"),ho=Symbol("getLoggerInstance"),mo=Symbol("getParseContext"),go=Symbol("getUsageInstance"),bo=Symbol("getValidationInstance"),Wn=Symbol("hasParseCallback"),yo=Symbol("isGlobalContext"),Mt=Symbol("postProcess"),wo=Symbol("rebase"),Li=Symbol("reset"),cn=Symbol("runYargsParserAndExecuteCommands"),Fi=Symbol("runValidation"),Co=Symbol("setHasOutput"),Lt=Symbol("kTrackManuallySetKeys"),Ti=class{constructor(t=[],n,i,r){this.customScriptName=!1,this.parsed=!1,ae.set(this,void 0),vt.set(this,void 0),ln.set(this,{commands:[],fullCommands:[]}),Pe.set(this,null),Ee.set(this,null),Dn.set(this,"show-hidden"),Xe.set(this,null),Ot.set(this,!0),Nn.set(this,{}),Me.set(this,!0),Rn.set(this,[]),Le.set(this,void 0),Ne.set(this,{}),Se.set(this,!1),Fe.set(this,null),$n.set(this,!0),kt.set(this,void 0),me.set(this,""),L.set(this,void 0),Un.set(this,void 0),Hn.set(this,{}),Ie.set(this,null),_t.set(this,null),Yt.set(this,{}),Et.set(this,{}),et.set(this,void 0),Bn.set(this,!1),U.set(this,void 0),St.set(this,!1),It.set(this,!1),jt.set(this,!1),Y.set(this,void 0),Re.set(this,null),oe.set(this,void 0),I(this,U,r,"f"),I(this,et,t,"f"),I(this,vt,n,"f"),I(this,Un,i,"f"),I(this,Le,new Mn(this),"f"),this.$0=this[so](),this[Li](),I(this,ae,h(this,ae,"f"),"f"),I(this,Y,h(this,Y,"f"),"f"),I(this,oe,h(this,oe,"f"),"f"),I(this,L,h(this,L,"f"),"f"),h(this,L,"f").showHiddenOpt=h(this,Dn,"f"),I(this,kt,this[io](),"f")}addHelpOpt(t,n){let i="help";return S("[string|boolean] [string]",[t,n],arguments.length),h(this,Fe,"f")&&(this[Oi](h(this,Fe,"f")),I(this,Fe,null,"f")),t===!1&&n===void 0?this:(I(this,Fe,typeof t=="string"?t:i,"f"),this.boolean(h(this,Fe,"f")),this.describe(h(this,Fe,"f"),n||h(this,Y,"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:h(this,Dn,"f");return this.boolean(i),this.describe(i,n||h(this,Y,"f").deferY18nLookup("Show hidden options")),h(this,L,"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[Si](this.alias.bind(this),"alias",t,n),this}array(t){return S("<array|string>",[t],arguments.length),this[tt]("array",t),this[Lt](t),this}boolean(t){return S("<array|string>",[t],arguments.length),this[tt]("boolean",t),this[Lt](t),this}check(t,n){return S("<function> [boolean]",[t,n],arguments.length),this.middleware((i,r)=>xt(()=>t(i,r.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&h(this,Y,"f").fail(s.toString(),s):h(this,Y,"f").fail(h(this,U,"f").y18n.__("Argument check failed: %s",t.toString())),i),s=>(h(this,Y,"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[Si](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 X("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 X("coerce callback must be provided");return h(this,L,"f").key[t]=!0,h(this,Le,"f").addCoerceMiddleware((i,r)=>{let s;return Object.prototype.hasOwnProperty.call(i,t)?xt(()=>(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 X(a.message)}):i},t),this}conflicts(t,n){return S("<string|object> [string|array]",[t,n],arguments.length),h(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=Tn(t,h(this,vt,"f"),this[Pt]()["deep-merge-config"]||!1,h(this,U,"f")),h(this,L,"f").configObjects=(h(this,L,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(i=n,n=void 0),this.describe(t,n||h(this,Y,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(r=>{h(this,L,"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||h(this,Ee,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(h(this,Ee,"f"),n),i&&h(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),h(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=h(this,Un,"f")||h(this,U,"f").require;return h(this,ae,"f").addDirectory(t,i,h(this,U,"f").getCallerFile(),n),this}count(t){return S("<array|string>",[t],arguments.length),this[tt]("count",t),this[Lt](t),this}default(t,n,i){return S("<object|string|array> [*] [string]",[t,n,i],arguments.length),i&&(yi(t,h(this,U,"f")),h(this,L,"f").defaultDescription[t]=i),typeof n=="function"&&(yi(t,h(this,U,"f")),h(this,L,"f").defaultDescription[t]||(h(this,L,"f").defaultDescription[t]=h(this,Y,"f").functionDescription(n)),n=n.call()),this[qt](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),h(this,L,"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,h(this,U,"f")),this.demandOption(r,i)}),n=1/0):typeof n!="number"&&(i=n,n=1/0),typeof t=="number"?(Ae(i,!0,h(this,U,"f")),this.demandCommand(t,n,i,i)):Array.isArray(t)?t.forEach(r=>{Ae(i,!0,h(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[qt](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return S("<string> [string|boolean]",[t,n],arguments.length),h(this,L,"f").deprecatedOptions[t]=n,this}describe(t,n){return S("<object|string|array> [string]",[t,n],arguments.length),this[Pi](t,!0),h(this,Y,"f").describe(t,n),this}detectLocale(t){return S("<boolean>",[t],arguments.length),I(this,Ot,t,"f"),this}env(t){return S("[string|boolean]",[t],arguments.length),t===!1?delete h(this,L,"f").envPrefix:h(this,L,"f").envPrefix=t||"",this}epilogue(t){return S("<string>",[t],arguments.length),h(this,Y,"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)):h(this,Y,"f").example(t,n),this}exit(t,n){I(this,Se,!0,"f"),I(this,Xe,n,"f"),h(this,Me,"f")&&h(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 X("Invalid first argument. Expected function or boolean 'false'");return h(this,Y,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return S("<array> [function]",[t,n],arguments.length),n?h(this,Pe,"f").getCompletion(t,n):new Promise((i,r)=>{h(this,Pe,"f").getCompletion(t,(s,o)=>{s?r(s):i(o)})})}getDemandedOptions(){return S([],0),h(this,L,"f").demandedOptions}getDemandedCommands(){return S([],0),h(this,L,"f").demandedCommands}getDeprecatedOptions(){return S([],0),h(this,L,"f").deprecatedOptions}getDetectLocale(){return h(this,Ot,"f")}getExitProcess(){return h(this,Me,"f")}getGroups(){return Object.assign({},h(this,Ne,"f"),h(this,Et,"f"))}getHelp(){if(I(this,Se,!0,"f"),!h(this,Y,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[cn](h(this,et,"f"),void 0,void 0,0,!0);if(te(n))return n.then(()=>h(this,Y,"f").help())}let t=h(this,ae,"f").runDefaultBuilderOn(this);if(te(t))return t.then(()=>h(this,Y,"f").help())}return Promise.resolve(h(this,Y,"f").help())}getOptions(){return h(this,L,"f")}getStrict(){return h(this,St,"f")}getStrictCommands(){return h(this,It,"f")}getStrictOptions(){return h(this,jt,"f")}global(t,n){return S("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?h(this,L,"f").local=h(this,L,"f").local.filter(i=>t.indexOf(i)===-1):t.forEach(i=>{h(this,L,"f").local.includes(i)||h(this,L,"f").local.push(i)}),this}group(t,n){S("<string|array> <string>",[t,n],arguments.length);let i=h(this,Et,"f")[n]||h(this,Ne,"f")[n];h(this,Et,"f")[n]&&delete h(this,Et,"f")[n];let r={};return h(this,Ne,"f")[n]=(i||[]).concat(t).filter(s=>r[s]?!1:r[s]=!0),this}hide(t){return S("<string>",[t],arguments.length),h(this,L,"f").hiddenOptions.push(t),this}implies(t,n){return S("<string|object> [number|string|array]",[t,n],arguments.length),h(this,oe,"f").implies(t,n),this}locale(t){return S("[string]",[t],arguments.length),t===void 0?(this[_i](),h(this,U,"f").y18n.getLocale()):(I(this,Ot,!1,"f"),h(this,U,"f").y18n.setLocale(t),this)}middleware(t,n,i){return h(this,Le,"f").addMiddleware(t,!!n,i)}nargs(t,n){return S("<string|object|array> [number]",[t,n],arguments.length),this[qt](this.nargs.bind(this),"narg",t,n),this}normalize(t){return S("<array|string>",[t],arguments.length),this[tt]("normalize",t),this}number(t){return S("<array|string>",[t],arguments.length),this[tt]("number",t),this[Lt](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[Lt](t),h(this,Re,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[ro](['"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"),h(this,L,"f").key[t]=!0,n.alias&&this.alias(t,n.alias);let i=n.deprecate||n.deprecated;i&&this.deprecateOption(t,i);let r=n.demand||n.required||n.require;r&&this.demand(t,r),n.demandOption&&this.demandOption(t,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),"default"in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(t),typeof n.global=="boolean"&&this.global(t,n.global),n.defaultDescription&&(h(this,L,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let s=n.describe||n.description||n.desc;this.describe(t,s),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,i){S("[string|array] [function|boolean|object] [function]",[t,n,i],arguments.length),this[oo](),typeof t=="undefined"&&(t=h(this,et,"f")),typeof n=="object"&&(I(this,_t,n,"f"),n=i),typeof n=="function"&&(I(this,Ie,n,"f"),n=!1),n||I(this,et,t,"f"),h(this,Ie,"f")&&I(this,Me,!1,"f");let r=this[cn](t,!!n),s=this.parsed;return h(this,Pe,"f").setParsed(this.parsed),te(r)?r.then(o=>(h(this,Ie,"f")&&h(this,Ie,"f").call(this,h(this,Xe,"f"),o,h(this,me,"f")),o)).catch(o=>{throw h(this,Ie,"f")&&h(this,Ie,"f")(o,this.parsed.argv,h(this,me,"f")),o}).finally(()=>{this[Mi](),this.parsed=s}):(h(this,Ie,"f")&&h(this,Ie,"f").call(this,h(this,Xe,"f"),r,h(this,me,"f")),this[Mi](),this.parsed=s,r)}parseAsync(t,n,i){let r=this.parse(t,n,i);return te(r)?r:Promise.resolve(r)}parseSync(t,n,i){let r=this.parse(t,n,i);if(te(r))throw new X(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(t){return S("<object>",[t],arguments.length),I(this,Hn,t,"f"),this}pkgConf(t,n){S("<string> [string]",[t,n],arguments.length);let i=null,r=this[Ei](n||h(this,vt,"f"));return r[t]&&typeof r[t]=="object"&&(i=Tn(r[t],n||h(this,vt,"f"),this[Pt]()["deep-merge-config"]||!1,h(this,U,"f")),h(this,L,"f").configObjects=(h(this,L,"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=Qe(n,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:i.includes(o));let r=h(this,ln,"f").fullCommands[h(this,ln,"f").fullCommands.length-1],s=r?h(this,ae,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return Bt(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,h(this,Y,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return S("[boolean]",[t],arguments.length),I(this,Bn,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"&&h(this,L,"f").narg[t]?this:(this[qt](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return S("[string] [string]",[t,n],arguments.length),t=t||this.$0,h(this,kt,"f").log(h(this,Pe,"f").generateCompletionScript(t,n||h(this,Ee,"f")||"completion")),this}showHelp(t){if(S("[string|function]",[t],arguments.length),I(this,Se,!0,"f"),!h(this,Y,"f").hasCachedHelpMessage()){if(!this.parsed){let i=this[cn](h(this,et,"f"),void 0,void 0,0,!0);if(te(i))return i.then(()=>{h(this,Y,"f").showHelp(t)}),this}let n=h(this,ae,"f").runDefaultBuilderOn(this);if(te(n))return n.then(()=>{h(this,Y,"f").showHelp(t)}),this}return h(this,Y,"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),h(this,Y,"f").showHelpOnFail(t,n),this}showVersion(t){return S("[string|function]",[t],arguments.length),h(this,Y,"f").showVersion(t),this}skipValidation(t){return S("<array|string>",[t],arguments.length),this[tt]("skipValidation",t),this}strict(t){return S("[boolean]",[t],arguments.length),I(this,St,t!==!1,"f"),this}strictCommands(t){return S("[boolean]",[t],arguments.length),I(this,It,t!==!1,"f"),this}strictOptions(t){return S("[boolean]",[t],arguments.length),I(this,jt,t!==!1,"f"),this}string(t){return S("<array|string>",[t],arguments.length),this[tt]("string",t),this[Lt](t),this}terminalWidth(){return S([],0),h(this,U,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return S("<object>",[t],arguments.length),I(this,Ot,!1,"f"),h(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,h(this,U,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,i,r);throw new X(".usage() description must start with $0 if being used as alias for .command()")}else return h(this,Y,"f").usage(t),this}version(t,n,i){let r="version";if(S("[boolean|string] [string] [string]",[t,n,i],arguments.length),h(this,Re,"f")&&(this[Oi](h(this,Re,"f")),h(this,Y,"f").version(void 0),I(this,Re,null,"f")),arguments.length===0)i=this[ao](),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,Re,typeof t=="string"?t:r,"f"),n=n||h(this,Y,"f").deferY18nLookup("Show version number"),h(this,Y,"f").version(i||void 0),this.boolean(h(this,Re,"f")),this.describe(h(this,Re,"f"),n),this}wrap(t){return S("<number|null|undefined>",[t],arguments.length),h(this,Y,"f").wrap(t),this}[(ae=new WeakMap,vt=new WeakMap,ln=new WeakMap,Pe=new WeakMap,Ee=new WeakMap,Dn=new WeakMap,Xe=new WeakMap,Ot=new WeakMap,Nn=new WeakMap,Me=new WeakMap,Rn=new WeakMap,Le=new WeakMap,Ne=new WeakMap,Se=new WeakMap,Fe=new WeakMap,$n=new WeakMap,kt=new WeakMap,me=new WeakMap,L=new WeakMap,Un=new WeakMap,Hn=new WeakMap,Ie=new WeakMap,_t=new WeakMap,Yt=new WeakMap,Et=new WeakMap,et=new WeakMap,Bn=new WeakMap,U=new WeakMap,St=new WeakMap,It=new WeakMap,jt=new WeakMap,Y=new WeakMap,Re=new WeakMap,oe=new WeakMap,no)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[io](){return{log:(...t)=>{this[Wn]()||console.log(...t),I(this,Se,!0,"f"),h(this,me,"f").length&&I(this,me,h(this,me,"f")+`
63
63
  `,"f"),I(this,me,h(this,me,"f")+t.join(" "),"f")},error:(...t)=>{this[Wn]()||console.error(...t),I(this,Se,!0,"f"),h(this,me,"f").length&&I(this,me,h(this,me,"f")+`
64
- `,"f"),I(this,me,h(this,me,"f")+t.join(" "),"f")}}}[Oi](t){Bt(h(this,L,"f")).forEach(n=>{if((r=>r==="configObjects")(n))return;let i=h(this,L,"f")[n];Array.isArray(i)?i.includes(t)&&i.splice(i.indexOf(t),1):typeof i=="object"&&delete i[t]}),delete h(this,Y,"f").getDescriptions()[t]}[no](t,n,i){h(this,Nn,"f")[i]||(h(this,U,"f").process.emitWarning(t,n),h(this,Nn,"f")[i]=!0)}[io](){h(this,Rn,"f").push({options:h(this,L,"f"),configObjects:h(this,L,"f").configObjects.slice(0),exitProcess:h(this,Me,"f"),groups:h(this,Ne,"f"),strict:h(this,St,"f"),strictCommands:h(this,It,"f"),strictOptions:h(this,jt,"f"),completionCommand:h(this,Ee,"f"),output:h(this,me,"f"),exitError:h(this,Xe,"f"),hasOutput:h(this,Se,"f"),parsed:this.parsed,parseFn:h(this,Ie,"f"),parseContext:h(this,_t,"f")}),h(this,Y,"f").freeze(),h(this,oe,"f").freeze(),h(this,ae,"f").freeze(),h(this,Le,"f").freeze()}[ro](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(h(this,U,"f").process.argv()[0])?n=h(this,U,"f").process.argv().slice(1,2):n=h(this,U,"f").process.argv().slice(0,1),t=n.map(i=>{let r=this[bo](h(this,vt,"f"),i);return i.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<i.length?r:i}).join(" ").trim(),h(this,U,"f").getEnv("_")&&h(this,U,"f").getProcessArgvBin()===h(this,U,"f").getEnv("_")&&(t=h(this,U,"f").getEnv("_").replace(`${h(this,U,"f").path.dirname(h(this,U,"f").process.execPath())}/`,"")),t}[Pt](){return h(this,Hn,"f")}[_i](){if(!h(this,Ot,"f"))return;let t=h(this,U,"f").getEnv("LC_ALL")||h(this,U,"f").getEnv("LC_MESSAGES")||h(this,U,"f").getEnv("LANG")||h(this,U,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[oo](){return this[Ei]().version||"unknown"}[so](t){let n=t["--"]?t["--"]:t._;for(let i=0,r;(r=n[i])!==void 0;i++)h(this,U,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(n[i]=Number(r));return t}[Ei](t){let n=t||"*";if(h(this,Yt,"f")[n])return h(this,Yt,"f")[n];let i={};try{let r=t||h(this,U,"f").mainFilename;!t&&h(this,U,"f").path.extname(r)&&(r=h(this,U,"f").path.dirname(r));let s=h(this,U,"f").findUp(r,(o,a)=>{if(a.includes("package.json"))return"package.json"});Ae(s,void 0,h(this,U,"f")),i=JSON.parse(h(this,U,"f").readFileSync(s,"utf8"))}catch(r){}return h(this,Yt,"f")[n]=i||{},h(this,Yt,"f")[n]}[tt](t,n){n=[].concat(n),n.forEach(i=>{i=this[ji](i),h(this,L,"f")[t].push(i)})}[qt](t,n,i,r){this[Ii](t,n,i,r,(s,o,a)=>{h(this,L,"f")[s][o]=a})}[Si](t,n,i,r){this[Ii](t,n,i,r,(s,o,a)=>{h(this,L,"f")[s][o]=(h(this,L,"f")[s][o]||[]).concat(a)})}[Ii](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 Bt(i))t(o,i[o]);else s(n,this[ji](i),r)}[ji](t){return t==="__proto__"?"___proto___":t}[Pi](t,n){return this[qt](this[Pi].bind(this),"key",t,n),this}[Mi](){var t,n,i,r,s,o,a,l,c,f,u,p;let d=h(this,Rn,"f").pop();Ae(d,void 0,h(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,L,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,Xe,b,"f")}}.value,hasOutput:{set value(b){I(o,Se,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){I(a,St,b,"f")}}.value,strictCommands:{set value(b){I(l,It,b,"f")}}.value,strictOptions:{set value(b){I(c,jt,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,_t,b,"f")}}.value}=d,h(this,L,"f").configObjects=g,h(this,Y,"f").unfreeze(),h(this,oe,"f").unfreeze(),h(this,ae,"f").unfreeze(),h(this,Le,"f").unfreeze()}[ao](t,n){return xt(n,i=>(t(i),i))}getInternalMethods(){return{getCommandInstance:this[lo].bind(this),getContext:this[co].bind(this),getHasOutput:this[fo].bind(this),getLoggerInstance:this[uo].bind(this),getParseContext:this[po].bind(this),getParserConfiguration:this[Pt].bind(this),getUsageInstance:this[ho].bind(this),getValidationInstance:this[mo].bind(this),hasParseCallback:this[Wn].bind(this),isGlobalContext:this[go].bind(this),postProcess:this[Mt].bind(this),reset:this[Li].bind(this),runValidation:this[Fi].bind(this),runYargsParserAndExecuteCommands:this[cn].bind(this),setHasOutput:this[yo].bind(this)}}[lo](){return h(this,ae,"f")}[co](){return h(this,ln,"f")}[fo](){return h(this,Se,"f")}[uo](){return h(this,kt,"f")}[po](){return h(this,_t,"f")||{}}[ho](){return h(this,Y,"f")}[mo](){return h(this,oe,"f")}[Wn](){return!!h(this,Ie,"f")}[go](){return h(this,$n,"f")}[Mt](t,n,i,r){return i||te(t)||(n||(t=this[eo](t)),(this[Pt]()["parse-positional-numbers"]||this[Pt]()["parse-positional-numbers"]===void 0)&&(t=this[so](t)),r&&(t=At(t,this,h(this,Le,"f").getMiddleware(),!1))),t}[Li](t={}){I(this,L,h(this,L,"f")||{},"f");let n={};n.local=h(this,L,"f").local||[],n.configObjects=h(this,L,"f").configObjects||[];let i={};n.local.forEach(o=>{i[o]=!0,(t[o]||[]).forEach(a=>{i[a]=!0})}),Object.assign(h(this,Et,"f"),Object.keys(h(this,Ne,"f")).reduce((o,a)=>{let l=h(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]=(h(this,L,"f")[o]||[]).filter(a=>!i[a])}),s.forEach(o=>{n[o]=Qe(h(this,L,"f")[o],a=>!i[a])}),n.envPrefix=h(this,L,"f").envPrefix,I(this,L,n,"f"),I(this,Y,h(this,Y,"f")?h(this,Y,"f").reset(i):zr(this,h(this,U,"f")),"f"),I(this,oe,h(this,oe,"f")?h(this,oe,"f").reset(i):Zr(this,h(this,Y,"f"),h(this,U,"f")),"f"),I(this,ae,h(this,ae,"f")?h(this,ae,"f").reset():kr(h(this,Y,"f"),h(this,oe,"f"),h(this,Le,"f"),h(this,U,"f")),"f"),h(this,Pe,"f")||I(this,Pe,Vr(this,h(this,Y,"f"),h(this,ae,"f"),h(this,U,"f")),"f"),h(this,Le,"f").reset(),I(this,Ee,null,"f"),I(this,me,"","f"),I(this,Xe,null,"f"),I(this,Se,!1,"f"),this.parsed=!1,this}[bo](t,n){return h(this,U,"f").path.relative(t,n)}[cn](t,n,i,r=0,s=!1){let o=!!i||s;t=t||h(this,et,"f"),h(this,L,"f").__=h(this,U,"f").y18n.__,h(this,L,"f").configuration=this[Pt]();let a=!!h(this,L,"f").configuration["populate--"],l=Object.assign({},h(this,L,"f").configuration,{"populate--":!0}),c=h(this,U,"f").Parser.detailed(t,Object.assign({},h(this,L,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),f=Object.assign(c.argv,h(this,_t,"f")),u,p=c.aliases,d=!1,g=!1;Object.keys(f).forEach(b=>{b===h(this,Fe,"f")&&f[b]?d=!0:b===h(this,Re,"f")&&f[b]&&(g=!0)}),f.$0=this.$0,this.parsed=c,r===0&&h(this,Y,"f").clearCachedHelpMessage();try{if(this[_i](),n)return this[Mt](f,a,!!i,!1);h(this,Fe,"f")&&[h(this,Fe,"f")].concat(p[h(this,Fe,"f")]||[]).filter(F=>F.length>1).includes(""+f._[f._.length-1])&&(f._.pop(),d=!0),I(this,$n,!1,"f");let b=h(this,ae,"f").getCommands(),m=h(this,Pe,"f").completionKey in f,x=d||m||s;if(f._.length){if(b.length){let v;for(let F=r||0,k;f._[F]!==void 0;F++)if(k=String(f._[F]),b.includes(k)&&k!==h(this,Ee,"f")){let q=h(this,ae,"f").runCommand(k,this,c,F+1,s,d||g||s);return this[Mt](q,a,!!i,!1)}else if(!v&&k!==h(this,Ee,"f")){v=k;break}!h(this,ae,"f").hasDefaultCommand()&&h(this,Bn,"f")&&v&&!x&&h(this,oe,"f").recommendCommands(v,b)}h(this,Ee,"f")&&f._.includes(h(this,Ee,"f"))&&!m&&(h(this,Me,"f")&&Ze(!0),this.showCompletionScript(),this.exit(0))}if(h(this,ae,"f").hasDefaultCommand()&&!x){let v=h(this,ae,"f").runCommand(null,this,c,0,s,d||g||s);return this[Mt](v,a,!!i,!1)}if(m){h(this,Me,"f")&&Ze(!0),t=[].concat(t);let v=t.slice(t.indexOf(`--${h(this,Pe,"f").completionKey}`)+1);return h(this,Pe,"f").getCompletion(v,(F,k)=>{if(F)throw new X(F.message);(k||[]).forEach(q=>{h(this,kt,"f").log(q)}),this.exit(0)}),this[Mt](f,!a,!!i,!1)}if(h(this,Se,"f")||(d?(h(this,Me,"f")&&Ze(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(h(this,Me,"f")&&Ze(!0),o=!0,h(this,Y,"f").showVersion("log"),this.exit(0))),!o&&h(this,L,"f").skipValidation.length>0&&(o=Object.keys(f).some(v=>h(this,L,"f").skipValidation.indexOf(v)>=0&&f[v]===!0)),!o){if(c.error)throw new X(c.error.message);if(!m){let v=this[Fi](p,{},c.error);i||(u=At(f,this,h(this,Le,"f").getMiddleware(),!0)),u=this[ao](v,u!=null?u:f),te(u)&&!i&&(u=u.then(()=>At(f,this,h(this,Le,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof X)h(this,Y,"f").fail(b.message,b);else throw b}return this[Mt](u!=null?u:f,a,!!i,!0)}[Fi](t,n,i,r){let s={...this.getDemandedOptions()};return o=>{if(i)throw new X(i.message);h(this,oe,"f").nonOptionCount(o),h(this,oe,"f").requiredArguments(o,s);let a=!1;h(this,It,"f")&&(a=h(this,oe,"f").unknownCommands(o)),h(this,St,"f")&&!a?h(this,oe,"f").unknownArguments(o,t,n,!!r):h(this,jt,"f")&&h(this,oe,"f").unknownArguments(o,t,{},!1,!1),h(this,oe,"f").limitedChoices(o),h(this,oe,"f").implications(o),h(this,oe,"f").conflicting(o)}}[yo](){I(this,Se,!0,"f")}[Lt](t){if(typeof t=="string")h(this,L,"f").key[t]=!0;else for(let n of t)h(this,L,"f").key[n]=!0}};function Yr(e){return!!e&&typeof e.getInternalMethods=="function"}var fl=wo($r),zt=fl;var Co=be(require("p-throttle")),Ao=be(require("p-retry"));function xo({throttle:e={interval:1e3,limit:10},retry:t={retries:1,factor:1.66}}){let n=e?(0,Co.default)(e):null;return function(r){let s=async()=>await r();if(n&&(s=n(s)),t){let o=s;s=()=>(0,Ao.default)(o,t)}return s()}}var fn=class extends Error{constructor(n,i,r,s,o,a){super(`${n}
65
- ${s}${o?" "+o:""} (${i} ${r}${a?` Request ID: ${a}`:""})`);this.errorMessage=n;this.fetchMethod=i;this.fetchUri=r;this.statusCode=s;this.statusText=o;this.requestId=a;Object.setPrototypeOf(this,fn.prototype)}},Q=class{constructor(t){var i,r,s,o,a;if(!t.apiKey&&!t.bearerToken)throw new Error("You must provide an API key or a bearer token");let n=t.fetch;if(!n)if(typeof globalThis!="undefined"&&typeof globalThis.fetch!="undefined")n=globalThis.fetch.bind(globalThis);else if(typeof fetch!="undefined")n=fetch;else throw new Error("You must provide or polyfill a fetch implementation when not in a browser");this.options={...t,fetch:n,apiHost:(i=t.apiHost)!=null?i:"https://uniform.app",apiKey:(r=t.apiKey)!=null?r:null,projectId:(s=t.projectId)!=null?s:null,bearerToken:(o=t.bearerToken)!=null?o:null,limitPolicy:(a=t.limitPolicy)!=null?a:xo({})}}async getCompositionList(t){let{projectId:n}=this.options,i=this.createUrl("/api/v1/canvas",{...t,projectId:n});return await this.apiClient(i)}async getCompositionBySlug(t){let{projectId:n}=this.options,i=this.createUrl("/api/v1/canvas",{...t,projectId:n});return await this.apiClient(i)}async getCompositionById(t){let{projectId:n}=this.options,i=this.createUrl("/api/v1/canvas",{...t,projectId:n});return await this.apiClient(i)}async updateComposition(t){let n=this.createUrl("/api/v1/canvas");await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeComposition(t){let n=this.createUrl("/api/v1/canvas"),{projectId:i}=this.options;await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:i}),expectNoContent:!0})}async getComponentDefinitions(t){let{projectId:n}=this.options,i=this.createUrl("/api/v1/canvas-definitions",{...t,projectId:n});return await this.apiClient(i)}async updateComponentDefinition(t){let n=this.createUrl("/api/v1/canvas-definitions");await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeComponentDefinition(t){let n=this.createUrl("/api/v1/canvas-definitions");await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async apiClient(t,n){return this.options.limitPolicy(async()=>{var s;let i=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},r=await this.options.fetch(t.toString(),{...n,headers:{...n==null?void 0:n.headers,...i}});if(!r.ok){let o="";try{let a=await r.text();try{let l=JSON.parse(a);l.errorMessage?o=Array.isArray(l.errorMessage)?l.errorMessage.join(", "):l.errorMessage:o=a}catch(l){o=a}}catch(a){o="General error"}throw new fn(o,(s=n==null?void 0:n.method)!=null?s:"GET",t.toString(),r.status,r.statusText,Q.getRequestId(r))}return n!=null&&n.expectNoContent?null:await r.json()})}createUrl(t,n){let i=new URL(`${this.options.apiHost}${t}`);return Object.entries(n!=null?n:{}).forEach(([r,s])=>{var o;typeof s!==void 0&&s!==null&&i.searchParams.append(r,(o=s==null?void 0:s.toString())!=null?o:"")}),i}static getRequestId(t){let n=t.headers.get("x-nf-request-id");if(n)return n}};var ea=be(require("isomorphic-unfetch"));var ul=Object.create,Oo=Object.defineProperty,pl=Object.getOwnPropertyDescriptor,hl=Object.getOwnPropertyNames,dl=Object.getPrototypeOf,ml=Object.prototype.hasOwnProperty,vo=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),$e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gl=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of hl(t))!ml.call(e,r)&&r!==n&&Oo(e,r,{get:()=>t[r],enumerable:!(i=pl(t,r))||i.enumerable});return e},Di=(e,t,n)=>(n=e!=null?ul(dl(e)):{},gl(t||!e||!e.__esModule?Oo(n,"default",{value:e,enumerable:!0}):n,e)),bl=$e((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]}}),_o=$e((e,t)=>{var n=bl(),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,d,g;u===f?d=0:a===u?d=(l-c)/p:l===u?d=2+(c-a)/p:c===u&&(d=4+(a-l)/p),d=Math.min(d*60,360),d<0&&(d+=360);let b=(f+u)/2;return u===f?g=0:b<=.5?g=p/(u+f):g=p/(2-u-f),[d,g*100,b*100]},r.rgb.hsv=function(o){let a,l,c,f,u,p=o[0]/255,d=o[1]/255,g=o[2]/255,b=Math.max(p,d,g),m=b-Math.min(p,d,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(d),c=x(g),p===b?f=c-l:d===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,d=(1-c-f)/(1-f)||0;return[u*100,p*100,d*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),d=200*(c-f);return[u,p,d]},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 d=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=d+(f-d)*6*u:2*u<1?p=f:3*u<2?p=d+(f-d)*(2/3-u)*6:p=d,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,d=c===0?2*f/(u+f):2*l/(c+l);return[a,d*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),d=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[d,c,p];case 2:return[p,c,g];case 3:return[p,d,c];case 4:return[g,p,c];case 5:return[c,p,d]}},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 d=(2-l)*f;return u=l*f,u/=d<=1?d:2-d,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),d=1-c;u=6*a-p,(p&1)!==0&&(u=1-u);let g=l+u*(d-l),b,m,x;switch(p){default:case 6:case 0:b=d,m=g,x=l;break;case 1:b=g,m=d,x=l;break;case 2:b=l,m=d,x=g;break;case 3:b=l,m=g,x=d;break;case 4:b=g,m=l,x=d;break;case 5:b=d,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),d=1-Math.min(1,c*(1-f)+f);return[u*255,p*255,d*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 d=u**3,g=f**3,b=p**3;return u=d>.008856?d:(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(d=>d+d).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,d,g;return p<1?d=u/(1-p):d=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,d*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,d=1-p,g=0;switch(Math.floor(u)){case 0:f[0]=1,f[1]=p,f[2]=0;break;case 1:f[0]=d,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]=d,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]=d}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]}}),yl=$e((e,t)=>{var n=_o();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,d=0;d<p;d++){let g=u[d],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 d=f[p];l[d].parent!==null&&(c[d]=o(d,l))}return c}}),wl=$e((e,t)=>{var n=_o(),i=yl(),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 d=p.length,g=0;g<d;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=$e((e,t)=>{"use strict";var n=(u,p)=>(...d)=>`\x1B[${u(...d)+p}m`,i=(u,p)=>(...d)=>{let g=u(...d);return`\x1B[${38+p};5;${g}m`},r=(u,p)=>(...d)=>{let g=u(...d);return`\x1B[${38+p};2;${g[0]};${g[1]};${g[2]}m`},s=u=>u,o=(u,p,d)=>[u,p,d],a=(u,p,d)=>{Object.defineProperty(u,p,{get:()=>{let g=d();return Object.defineProperty(u,p,{value:g,enumerable:!0,configurable:!0}),g},enumerable:!0,configurable:!0})},l,c=(u,p,d,g)=>{l===void 0&&(l=wl());let b=g?10:0,m={};for(let[x,v]of Object.entries(l)){let F=x==="ansi16"?"ansi":x;x===p?m[F]=u(d,b):typeof v=="object"&&(m[F]=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[d,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,d,{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})}),Al=$e((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)}}),xl=$e((e,t)=>{"use strict";var n=vo("os"),i=vo("tty"),r=Al(),{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 d=n.release().split(".");return Number(d[0])>=10&&Number(d[2])>=10586?Number(d[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(d=>d 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 d=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return d>=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)))}}),vl=$e((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
64
+ `,"f"),I(this,me,h(this,me,"f")+t.join(" "),"f")}}}[Oi](t){Bt(h(this,L,"f")).forEach(n=>{if((r=>r==="configObjects")(n))return;let i=h(this,L,"f")[n];Array.isArray(i)?i.includes(t)&&i.splice(i.indexOf(t),1):typeof i=="object"&&delete i[t]}),delete h(this,Y,"f").getDescriptions()[t]}[ro](t,n,i){h(this,Nn,"f")[i]||(h(this,U,"f").process.emitWarning(t,n),h(this,Nn,"f")[i]=!0)}[oo](){h(this,Rn,"f").push({options:h(this,L,"f"),configObjects:h(this,L,"f").configObjects.slice(0),exitProcess:h(this,Me,"f"),groups:h(this,Ne,"f"),strict:h(this,St,"f"),strictCommands:h(this,It,"f"),strictOptions:h(this,jt,"f"),completionCommand:h(this,Ee,"f"),output:h(this,me,"f"),exitError:h(this,Xe,"f"),hasOutput:h(this,Se,"f"),parsed:this.parsed,parseFn:h(this,Ie,"f"),parseContext:h(this,_t,"f")}),h(this,Y,"f").freeze(),h(this,oe,"f").freeze(),h(this,ae,"f").freeze(),h(this,Le,"f").freeze()}[so](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(h(this,U,"f").process.argv()[0])?n=h(this,U,"f").process.argv().slice(1,2):n=h(this,U,"f").process.argv().slice(0,1),t=n.map(i=>{let r=this[wo](h(this,vt,"f"),i);return i.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<i.length?r:i}).join(" ").trim(),h(this,U,"f").getEnv("_")&&h(this,U,"f").getProcessArgvBin()===h(this,U,"f").getEnv("_")&&(t=h(this,U,"f").getEnv("_").replace(`${h(this,U,"f").path.dirname(h(this,U,"f").process.execPath())}/`,"")),t}[Pt](){return h(this,Hn,"f")}[_i](){if(!h(this,Ot,"f"))return;let t=h(this,U,"f").getEnv("LC_ALL")||h(this,U,"f").getEnv("LC_MESSAGES")||h(this,U,"f").getEnv("LANG")||h(this,U,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[ao](){return this[Ei]().version||"unknown"}[lo](t){let n=t["--"]?t["--"]:t._;for(let i=0,r;(r=n[i])!==void 0;i++)h(this,U,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(n[i]=Number(r));return t}[Ei](t){let n=t||"*";if(h(this,Yt,"f")[n])return h(this,Yt,"f")[n];let i={};try{let r=t||h(this,U,"f").mainFilename;!t&&h(this,U,"f").path.extname(r)&&(r=h(this,U,"f").path.dirname(r));let s=h(this,U,"f").findUp(r,(o,a)=>{if(a.includes("package.json"))return"package.json"});Ae(s,void 0,h(this,U,"f")),i=JSON.parse(h(this,U,"f").readFileSync(s,"utf8"))}catch(r){}return h(this,Yt,"f")[n]=i||{},h(this,Yt,"f")[n]}[tt](t,n){n=[].concat(n),n.forEach(i=>{i=this[ji](i),h(this,L,"f")[t].push(i)})}[qt](t,n,i,r){this[Ii](t,n,i,r,(s,o,a)=>{h(this,L,"f")[s][o]=a})}[Si](t,n,i,r){this[Ii](t,n,i,r,(s,o,a)=>{h(this,L,"f")[s][o]=(h(this,L,"f")[s][o]||[]).concat(a)})}[Ii](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 Bt(i))t(o,i[o]);else s(n,this[ji](i),r)}[ji](t){return t==="__proto__"?"___proto___":t}[Pi](t,n){return this[qt](this[Pi].bind(this),"key",t,n),this}[Mi](){var t,n,i,r,s,o,a,l,c,f,u,p;let d=h(this,Rn,"f").pop();Ae(d,void 0,h(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,L,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,Xe,b,"f")}}.value,hasOutput:{set value(b){I(o,Se,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){I(a,St,b,"f")}}.value,strictCommands:{set value(b){I(l,It,b,"f")}}.value,strictOptions:{set value(b){I(c,jt,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,_t,b,"f")}}.value}=d,h(this,L,"f").configObjects=g,h(this,Y,"f").unfreeze(),h(this,oe,"f").unfreeze(),h(this,ae,"f").unfreeze(),h(this,Le,"f").unfreeze()}[co](t,n){return xt(n,i=>(t(i),i))}getInternalMethods(){return{getCommandInstance:this[fo].bind(this),getContext:this[uo].bind(this),getHasOutput:this[po].bind(this),getLoggerInstance:this[ho].bind(this),getParseContext:this[mo].bind(this),getParserConfiguration:this[Pt].bind(this),getUsageInstance:this[go].bind(this),getValidationInstance:this[bo].bind(this),hasParseCallback:this[Wn].bind(this),isGlobalContext:this[yo].bind(this),postProcess:this[Mt].bind(this),reset:this[Li].bind(this),runValidation:this[Fi].bind(this),runYargsParserAndExecuteCommands:this[cn].bind(this),setHasOutput:this[Co].bind(this)}}[fo](){return h(this,ae,"f")}[uo](){return h(this,ln,"f")}[po](){return h(this,Se,"f")}[ho](){return h(this,kt,"f")}[mo](){return h(this,_t,"f")||{}}[go](){return h(this,Y,"f")}[bo](){return h(this,oe,"f")}[Wn](){return!!h(this,Ie,"f")}[yo](){return h(this,$n,"f")}[Mt](t,n,i,r){return i||te(t)||(n||(t=this[no](t)),(this[Pt]()["parse-positional-numbers"]||this[Pt]()["parse-positional-numbers"]===void 0)&&(t=this[lo](t)),r&&(t=At(t,this,h(this,Le,"f").getMiddleware(),!1))),t}[Li](t={}){I(this,L,h(this,L,"f")||{},"f");let n={};n.local=h(this,L,"f").local||[],n.configObjects=h(this,L,"f").configObjects||[];let i={};n.local.forEach(o=>{i[o]=!0,(t[o]||[]).forEach(a=>{i[a]=!0})}),Object.assign(h(this,Et,"f"),Object.keys(h(this,Ne,"f")).reduce((o,a)=>{let l=h(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]=(h(this,L,"f")[o]||[]).filter(a=>!i[a])}),s.forEach(o=>{n[o]=Qe(h(this,L,"f")[o],a=>!i[a])}),n.envPrefix=h(this,L,"f").envPrefix,I(this,L,n,"f"),I(this,Y,h(this,Y,"f")?h(this,Y,"f").reset(i):Kr(this,h(this,U,"f")),"f"),I(this,oe,h(this,oe,"f")?h(this,oe,"f").reset(i):eo(this,h(this,Y,"f"),h(this,U,"f")),"f"),I(this,ae,h(this,ae,"f")?h(this,ae,"f").reset():qr(h(this,Y,"f"),h(this,oe,"f"),h(this,Le,"f"),h(this,U,"f")),"f"),h(this,Pe,"f")||I(this,Pe,Qr(this,h(this,Y,"f"),h(this,ae,"f"),h(this,U,"f")),"f"),h(this,Le,"f").reset(),I(this,Ee,null,"f"),I(this,me,"","f"),I(this,Xe,null,"f"),I(this,Se,!1,"f"),this.parsed=!1,this}[wo](t,n){return h(this,U,"f").path.relative(t,n)}[cn](t,n,i,r=0,s=!1){let o=!!i||s;t=t||h(this,et,"f"),h(this,L,"f").__=h(this,U,"f").y18n.__,h(this,L,"f").configuration=this[Pt]();let a=!!h(this,L,"f").configuration["populate--"],l=Object.assign({},h(this,L,"f").configuration,{"populate--":!0}),c=h(this,U,"f").Parser.detailed(t,Object.assign({},h(this,L,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),f=Object.assign(c.argv,h(this,_t,"f")),u,p=c.aliases,d=!1,g=!1;Object.keys(f).forEach(b=>{b===h(this,Fe,"f")&&f[b]?d=!0:b===h(this,Re,"f")&&f[b]&&(g=!0)}),f.$0=this.$0,this.parsed=c,r===0&&h(this,Y,"f").clearCachedHelpMessage();try{if(this[_i](),n)return this[Mt](f,a,!!i,!1);h(this,Fe,"f")&&[h(this,Fe,"f")].concat(p[h(this,Fe,"f")]||[]).filter(F=>F.length>1).includes(""+f._[f._.length-1])&&(f._.pop(),d=!0),I(this,$n,!1,"f");let b=h(this,ae,"f").getCommands(),m=h(this,Pe,"f").completionKey in f,x=d||m||s;if(f._.length){if(b.length){let v;for(let F=r||0,k;f._[F]!==void 0;F++)if(k=String(f._[F]),b.includes(k)&&k!==h(this,Ee,"f")){let q=h(this,ae,"f").runCommand(k,this,c,F+1,s,d||g||s);return this[Mt](q,a,!!i,!1)}else if(!v&&k!==h(this,Ee,"f")){v=k;break}!h(this,ae,"f").hasDefaultCommand()&&h(this,Bn,"f")&&v&&!x&&h(this,oe,"f").recommendCommands(v,b)}h(this,Ee,"f")&&f._.includes(h(this,Ee,"f"))&&!m&&(h(this,Me,"f")&&Ze(!0),this.showCompletionScript(),this.exit(0))}if(h(this,ae,"f").hasDefaultCommand()&&!x){let v=h(this,ae,"f").runCommand(null,this,c,0,s,d||g||s);return this[Mt](v,a,!!i,!1)}if(m){h(this,Me,"f")&&Ze(!0),t=[].concat(t);let v=t.slice(t.indexOf(`--${h(this,Pe,"f").completionKey}`)+1);return h(this,Pe,"f").getCompletion(v,(F,k)=>{if(F)throw new X(F.message);(k||[]).forEach(q=>{h(this,kt,"f").log(q)}),this.exit(0)}),this[Mt](f,!a,!!i,!1)}if(h(this,Se,"f")||(d?(h(this,Me,"f")&&Ze(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(h(this,Me,"f")&&Ze(!0),o=!0,h(this,Y,"f").showVersion("log"),this.exit(0))),!o&&h(this,L,"f").skipValidation.length>0&&(o=Object.keys(f).some(v=>h(this,L,"f").skipValidation.indexOf(v)>=0&&f[v]===!0)),!o){if(c.error)throw new X(c.error.message);if(!m){let v=this[Fi](p,{},c.error);i||(u=At(f,this,h(this,Le,"f").getMiddleware(),!0)),u=this[co](v,u!=null?u:f),te(u)&&!i&&(u=u.then(()=>At(f,this,h(this,Le,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof X)h(this,Y,"f").fail(b.message,b);else throw b}return this[Mt](u!=null?u:f,a,!!i,!0)}[Fi](t,n,i,r){let s={...this.getDemandedOptions()};return o=>{if(i)throw new X(i.message);h(this,oe,"f").nonOptionCount(o),h(this,oe,"f").requiredArguments(o,s);let a=!1;h(this,It,"f")&&(a=h(this,oe,"f").unknownCommands(o)),h(this,St,"f")&&!a?h(this,oe,"f").unknownArguments(o,t,n,!!r):h(this,jt,"f")&&h(this,oe,"f").unknownArguments(o,t,{},!1,!1),h(this,oe,"f").limitedChoices(o),h(this,oe,"f").implications(o),h(this,oe,"f").conflicting(o)}}[Co](){I(this,Se,!0,"f")}[Lt](t){if(typeof t=="string")h(this,L,"f").key[t]=!0;else for(let n of t)h(this,L,"f").key[n]=!0}};function zr(e){return!!e&&typeof e.getInternalMethods=="function"}var ul=Ao(Hr),zt=ul;var Di=class extends Error{constructor(){super("Throttled function aborted"),this.name="AbortError"}};function Ni({limit:e,interval:t,strict:n}){if(!Number.isFinite(e))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(t))throw new TypeError("Expected `interval` to be a finite number");let i=new Map,r=0,s=0;function o(){let f=Date.now();return f-r>t?(s=1,r=f,0):(s<e?s++:(r+=t,s=1),r-f)}let a=[];function l(){let f=Date.now();if(a.length<e)return a.push(f),0;let u=a.shift()+t;return f>=u?(a.push(f),0):(a.push(u),u-f)}let c=n?l:o;return f=>{let u=function(...p){if(!u.isEnabled)return(async()=>f.apply(this,p))();let d;return new Promise((g,b)=>{d=setTimeout(()=>{g(f.apply(this,p)),i.delete(d)},c()),i.set(d,b)})};return u.abort=()=>{for(let p of i.keys())clearTimeout(p),i.get(p)(new Di);i.clear(),a.splice(0,a.length)},u.isEnabled=!0,u}}var xo=be(require("p-retry"));function vo({throttle:e={interval:1e3,limit:10},retry:t={retries:1,factor:1.66}}){let n=e?Ni(e):null;return function(r){let s=async()=>await r();if(n&&(s=n(s)),t){let o=s;s=()=>(0,xo.default)(o,t)}return s()}}var fn=class extends Error{constructor(n,i,r,s,o,a){super(`${n}
65
+ ${s}${o?" "+o:""} (${i} ${r}${a?` Request ID: ${a}`:""})`);this.errorMessage=n;this.fetchMethod=i;this.fetchUri=r;this.statusCode=s;this.statusText=o;this.requestId=a;Object.setPrototypeOf(this,fn.prototype)}},Q=class{constructor(t){var i,r,s,o,a;if(!t.apiKey&&!t.bearerToken)throw new Error("You must provide an API key or a bearer token");let n=t.fetch;if(!n)if(typeof globalThis!="undefined"&&typeof globalThis.fetch!="undefined")n=globalThis.fetch.bind(globalThis);else if(typeof fetch!="undefined")n=fetch;else throw new Error("You must provide or polyfill a fetch implementation when not in a browser");this.options={...t,fetch:n,apiHost:(i=t.apiHost)!=null?i:"https://uniform.app",apiKey:(r=t.apiKey)!=null?r:null,projectId:(s=t.projectId)!=null?s:null,bearerToken:(o=t.bearerToken)!=null?o:null,limitPolicy:(a=t.limitPolicy)!=null?a:vo({})}}async getCompositionList(t){let{projectId:n}=this.options,i=this.createUrl("/api/v1/canvas",{...t,projectId:n});return await this.apiClient(i)}async getCompositionBySlug(t){let{projectId:n}=this.options,i=this.createUrl("/api/v1/canvas",{...t,projectId:n});return await this.apiClient(i)}async getCompositionById(t){let{projectId:n}=this.options,i=this.createUrl("/api/v1/canvas",{...t,projectId:n});return await this.apiClient(i)}async updateComposition(t){let n=this.createUrl("/api/v1/canvas");await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeComposition(t){let n=this.createUrl("/api/v1/canvas"),{projectId:i}=this.options;await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:i}),expectNoContent:!0})}async getComponentDefinitions(t){let{projectId:n}=this.options,i=this.createUrl("/api/v1/canvas-definitions",{...t,projectId:n});return await this.apiClient(i)}async updateComponentDefinition(t){let n=this.createUrl("/api/v1/canvas-definitions");await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeComponentDefinition(t){let n=this.createUrl("/api/v1/canvas-definitions");await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async apiClient(t,n){return this.options.limitPolicy(async()=>{var s;let i=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},r=await this.options.fetch(t.toString(),{...n,headers:{...n==null?void 0:n.headers,...i}});if(!r.ok){let o="";try{let a=await r.text();try{let l=JSON.parse(a);l.errorMessage?o=Array.isArray(l.errorMessage)?l.errorMessage.join(", "):l.errorMessage:o=a}catch(l){o=a}}catch(a){o="General error"}throw new fn(o,(s=n==null?void 0:n.method)!=null?s:"GET",t.toString(),r.status,r.statusText,Q.getRequestId(r))}return n!=null&&n.expectNoContent?null:await r.json()})}createUrl(t,n){let i=new URL(`${this.options.apiHost}${t}`);return Object.entries(n!=null?n:{}).forEach(([r,s])=>{var o;typeof s!==void 0&&s!==null&&i.searchParams.append(r,(o=s==null?void 0:s.toString())!=null?o:"")}),i}static getRequestId(t){let n=t.headers.get("x-nf-request-id");if(n)return n}};var ta=be(require("isomorphic-unfetch"));var pl=Object.create,_o=Object.defineProperty,hl=Object.getOwnPropertyDescriptor,dl=Object.getOwnPropertyNames,ml=Object.getPrototypeOf,gl=Object.prototype.hasOwnProperty,Oo=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),$e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bl=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of dl(t))!gl.call(e,r)&&r!==n&&_o(e,r,{get:()=>t[r],enumerable:!(i=hl(t,r))||i.enumerable});return e},Ri=(e,t,n)=>(n=e!=null?pl(ml(e)):{},bl(t||!e||!e.__esModule?_o(n,"default",{value:e,enumerable:!0}):n,e)),yl=$e((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]}}),Eo=$e((e,t)=>{var n=yl(),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,d,g;u===f?d=0:a===u?d=(l-c)/p:l===u?d=2+(c-a)/p:c===u&&(d=4+(a-l)/p),d=Math.min(d*60,360),d<0&&(d+=360);let b=(f+u)/2;return u===f?g=0:b<=.5?g=p/(u+f):g=p/(2-u-f),[d,g*100,b*100]},r.rgb.hsv=function(o){let a,l,c,f,u,p=o[0]/255,d=o[1]/255,g=o[2]/255,b=Math.max(p,d,g),m=b-Math.min(p,d,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(d),c=x(g),p===b?f=c-l:d===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,d=(1-c-f)/(1-f)||0;return[u*100,p*100,d*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),d=200*(c-f);return[u,p,d]},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 d=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=d+(f-d)*6*u:2*u<1?p=f:3*u<2?p=d+(f-d)*(2/3-u)*6:p=d,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,d=c===0?2*f/(u+f):2*l/(c+l);return[a,d*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),d=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[d,c,p];case 2:return[p,c,g];case 3:return[p,d,c];case 4:return[g,p,c];case 5:return[c,p,d]}},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 d=(2-l)*f;return u=l*f,u/=d<=1?d:2-d,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),d=1-c;u=6*a-p,(p&1)!==0&&(u=1-u);let g=l+u*(d-l),b,m,x;switch(p){default:case 6:case 0:b=d,m=g,x=l;break;case 1:b=g,m=d,x=l;break;case 2:b=l,m=d,x=g;break;case 3:b=l,m=g,x=d;break;case 4:b=g,m=l,x=d;break;case 5:b=d,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),d=1-Math.min(1,c*(1-f)+f);return[u*255,p*255,d*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 d=u**3,g=f**3,b=p**3;return u=d>.008856?d:(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(d=>d+d).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,d,g;return p<1?d=u/(1-p):d=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,d*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,d=1-p,g=0;switch(Math.floor(u)){case 0:f[0]=1,f[1]=p,f[2]=0;break;case 1:f[0]=d,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]=d,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]=d}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]}}),wl=$e((e,t)=>{var n=Eo();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,d=0;d<p;d++){let g=u[d],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 d=f[p];l[d].parent!==null&&(c[d]=o(d,l))}return c}}),Cl=$e((e,t)=>{var n=Eo(),i=wl(),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 d=p.length,g=0;g<d;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}),Al=$e((e,t)=>{"use strict";var n=(u,p)=>(...d)=>`\x1B[${u(...d)+p}m`,i=(u,p)=>(...d)=>{let g=u(...d);return`\x1B[${38+p};5;${g}m`},r=(u,p)=>(...d)=>{let g=u(...d);return`\x1B[${38+p};2;${g[0]};${g[1]};${g[2]}m`},s=u=>u,o=(u,p,d)=>[u,p,d],a=(u,p,d)=>{Object.defineProperty(u,p,{get:()=>{let g=d();return Object.defineProperty(u,p,{value:g,enumerable:!0,configurable:!0}),g},enumerable:!0,configurable:!0})},l,c=(u,p,d,g)=>{l===void 0&&(l=Cl());let b=g?10:0,m={};for(let[x,v]of Object.entries(l)){let F=x==="ansi16"?"ansi":x;x===p?m[F]=u(d,b):typeof v=="object"&&(m[F]=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[d,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,d,{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})}),xl=$e((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)}}),vl=$e((e,t)=>{"use strict";var n=Oo("os"),i=Oo("tty"),r=xl(),{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 d=n.release().split(".");return Number(d[0])>=10&&Number(d[2])>=10586?Number(d[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(d=>d 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 d=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return d>=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)))}}),Ol=$e((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
66
66
  `:`
67
67
  `)+o,l=a+1,a=r.indexOf(`
68
- `,l)}while(a!==-1);return c+=r.substr(l),c};t.exports={stringReplaceAll:n,stringEncaseCRLFWithFirstIndex:i}}),Ol=$e((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",`
69
- `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function a(u){let p=u[0]==="u",d=u[1]==="{";return p&&!d&&u.length===5||u[0]==="x"&&u.length===3?String.fromCharCode(parseInt(u.slice(1),16)):p&&d?String.fromCodePoint(parseInt(u.slice(2,-1),16)):o.get(u)||u}function l(u,p){let d=[],g=p.trim().split(/\s*,\s*/g),b;for(let m of g){let x=Number(m);if(!Number.isNaN(x))d.push(x);else if(b=m.match(r))d.push(b[2].replace(s,(v,F,k)=>F?a(F):k));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${u}')`)}return d}function c(u){i.lastIndex=0;let p=[],d;for(;(d=i.exec(u))!==null;){let g=d[1];if(d[2]){let b=l(g,d[2]);p.push([g].concat(b))}else p.push([g])}return p}function f(u,p){let d={};for(let b of p)for(let m of b.styles)d[m[0]]=b.inverse?null:m.slice(1);let g=u;for(let[b,m]of Object.entries(d))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 d=[],g=[],b=[];if(p.replace(n,(m,x,v,F,k,q)=>{if(x)b.push(a(x));else if(F){let W=b.join("");b=[],g.push(d.length===0?W:f(u,d)(W)),d.push({inverse:v,styles:c(F)})}else if(k){if(d.length===0)throw new Error("Found extraneous } in Chalk template literal");g.push(f(u,d)(b.join(""))),b=[],d.pop()}else b.push(q)}),g.push(b.join("")),d.length>0){let m=`Chalk template literal is missing ${d.length} closing bracket${d.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return g.join("")}}),Ni=$e((e,t)=>{"use strict";var n=Cl(),{stdout:i,stderr:r}=xl(),{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:o}=vl(),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],c=Object.create(null),f=(W,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 G=i?i.level:0;W.level=T.level===void 0?G:T.level},u=class{constructor(W){return p(W)}},p=W=>{let T={};return f(T,W),T.template=(...G)=>k(T.template,...G),Object.setPrototypeOf(T,d.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 d(W){return p(W)}for(let[W,T]of Object.entries(n))c[W]={get(){let G=x(this,m(T.open,T.close,this._styler),this._isEmpty);return Object.defineProperty(this,W,{value:G}),G}};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:T}=this;return function(...G){let J=m(n.color[l[T]][W](...G),n.color.close,this._styler);return x(this,J,this._isEmpty)}}};for(let W of g){let T="bg"+W[0].toUpperCase()+W.slice(1);c[T]={get(){let{level:G}=this;return function(...J){let H=m(n.bgColor[l[G]][W](...J),n.bgColor.close,this._styler);return x(this,H,this._isEmpty)}}}}var b=Object.defineProperties(()=>{},{...c,level:{enumerable:!0,get(){return this._generator.level},set(W){this._generator.level=W}}}),m=(W,T,G)=>{let J,H;return G===void 0?(J=W,H=T):(J=G.openAll+W,H=T+G.closeAll),{open:W,close:T,openAll:J,closeAll:H,parent:G}},x=(W,T,G)=>{let J=(...H)=>a(H[0])&&a(H[0].raw)?v(J,k(J,...H)):v(J,H.length===1?""+H[0]:H.join(" "));return Object.setPrototypeOf(J,b),J._generator=W,J._styler=T,J._isEmpty=G,J},v=(W,T)=>{if(W.level<=0||!T)return W._isEmpty?"":T;let G=W._styler;if(G===void 0)return T;let{openAll:J,closeAll:H}=G;if(T.indexOf("\x1B")!==-1)for(;G!==void 0;)T=s(T,G.close,G.open),G=G.parent;let Oe=T.indexOf(`
70
- `);return Oe!==-1&&(T=o(T,H,J,Oe)),J+T+H},F,k=(W,...T)=>{let[G]=T;if(!a(G)||!a(G.raw))return T.join(" ");let J=T.slice(1),H=[G.raw[0]];for(let Oe=1;Oe<G.length;Oe++)H.push(String(J[Oe-1]).replace(/[{}\\]/g,"\\$&"),String(G.raw[Oe]));return F===void 0&&(F=Ol()),F(W,H.join(""))};Object.defineProperties(d.prototype,c);var q=d();q.supportsColor=i,q.stderr=d({level:r?r.level:0}),q.stderr.supportsColor=r,t.exports=q});var si=require("fs"),ai=require("fs/promises"),Cn=require("path");function Bo(e){return typeof e=="undefined"||e===null}function _l(e){return typeof e=="object"&&e!==null}function El(e){return Array.isArray(e)?e:Bo(e)?[]:[e]}function Sl(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 Il(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function jl(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Pl=Bo,Ml=_l,Ll=El,Fl=Il,Tl=jl,Dl=Sl,he={isNothing:Pl,isObject:Ml,toArray:Ll,repeat:Fl,isNegativeZero:Tl,extend:Dl};function Wo(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
68
+ `,l)}while(a!==-1);return c+=r.substr(l),c};t.exports={stringReplaceAll:n,stringEncaseCRLFWithFirstIndex:i}}),_l=$e((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",`
69
+ `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function a(u){let p=u[0]==="u",d=u[1]==="{";return p&&!d&&u.length===5||u[0]==="x"&&u.length===3?String.fromCharCode(parseInt(u.slice(1),16)):p&&d?String.fromCodePoint(parseInt(u.slice(2,-1),16)):o.get(u)||u}function l(u,p){let d=[],g=p.trim().split(/\s*,\s*/g),b;for(let m of g){let x=Number(m);if(!Number.isNaN(x))d.push(x);else if(b=m.match(r))d.push(b[2].replace(s,(v,F,k)=>F?a(F):k));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${u}')`)}return d}function c(u){i.lastIndex=0;let p=[],d;for(;(d=i.exec(u))!==null;){let g=d[1];if(d[2]){let b=l(g,d[2]);p.push([g].concat(b))}else p.push([g])}return p}function f(u,p){let d={};for(let b of p)for(let m of b.styles)d[m[0]]=b.inverse?null:m.slice(1);let g=u;for(let[b,m]of Object.entries(d))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 d=[],g=[],b=[];if(p.replace(n,(m,x,v,F,k,q)=>{if(x)b.push(a(x));else if(F){let W=b.join("");b=[],g.push(d.length===0?W:f(u,d)(W)),d.push({inverse:v,styles:c(F)})}else if(k){if(d.length===0)throw new Error("Found extraneous } in Chalk template literal");g.push(f(u,d)(b.join(""))),b=[],d.pop()}else b.push(q)}),g.push(b.join("")),d.length>0){let m=`Chalk template literal is missing ${d.length} closing bracket${d.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return g.join("")}}),$i=$e((e,t)=>{"use strict";var n=Al(),{stdout:i,stderr:r}=vl(),{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:o}=Ol(),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],c=Object.create(null),f=(W,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 G=i?i.level:0;W.level=T.level===void 0?G:T.level},u=class{constructor(W){return p(W)}},p=W=>{let T={};return f(T,W),T.template=(...G)=>k(T.template,...G),Object.setPrototypeOf(T,d.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 d(W){return p(W)}for(let[W,T]of Object.entries(n))c[W]={get(){let G=x(this,m(T.open,T.close,this._styler),this._isEmpty);return Object.defineProperty(this,W,{value:G}),G}};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:T}=this;return function(...G){let J=m(n.color[l[T]][W](...G),n.color.close,this._styler);return x(this,J,this._isEmpty)}}};for(let W of g){let T="bg"+W[0].toUpperCase()+W.slice(1);c[T]={get(){let{level:G}=this;return function(...J){let H=m(n.bgColor[l[G]][W](...J),n.bgColor.close,this._styler);return x(this,H,this._isEmpty)}}}}var b=Object.defineProperties(()=>{},{...c,level:{enumerable:!0,get(){return this._generator.level},set(W){this._generator.level=W}}}),m=(W,T,G)=>{let J,H;return G===void 0?(J=W,H=T):(J=G.openAll+W,H=T+G.closeAll),{open:W,close:T,openAll:J,closeAll:H,parent:G}},x=(W,T,G)=>{let J=(...H)=>a(H[0])&&a(H[0].raw)?v(J,k(J,...H)):v(J,H.length===1?""+H[0]:H.join(" "));return Object.setPrototypeOf(J,b),J._generator=W,J._styler=T,J._isEmpty=G,J},v=(W,T)=>{if(W.level<=0||!T)return W._isEmpty?"":T;let G=W._styler;if(G===void 0)return T;let{openAll:J,closeAll:H}=G;if(T.indexOf("\x1B")!==-1)for(;G!==void 0;)T=s(T,G.close,G.open),G=G.parent;let Oe=T.indexOf(`
70
+ `);return Oe!==-1&&(T=o(T,H,J,Oe)),J+T+H},F,k=(W,...T)=>{let[G]=T;if(!a(G)||!a(G.raw))return T.join(" ");let J=T.slice(1),H=[G.raw[0]];for(let Oe=1;Oe<G.length;Oe++)H.push(String(J[Oe-1]).replace(/[{}\\]/g,"\\$&"),String(G.raw[Oe]));return F===void 0&&(F=_l()),F(W,H.join(""))};Object.defineProperties(d.prototype,c);var q=d();q.supportsColor=i,q.stderr=d({level:r?r.level:0}),q.stderr.supportsColor=r,t.exports=q});var si=require("fs"),ai=require("fs/promises"),Cn=require("path");function Wo(e){return typeof e=="undefined"||e===null}function El(e){return typeof e=="object"&&e!==null}function Sl(e){return Array.isArray(e)?e:Wo(e)?[]:[e]}function Il(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 jl(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function Pl(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Ml=Wo,Ll=El,Fl=Sl,Tl=jl,Dl=Pl,Nl=Il,he={isNothing:Ml,isObject:Ll,toArray:Fl,repeat:Tl,isNegativeZero:Dl,extend:Nl};function ko(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+=`
71
71
 
72
- `+e.mark.snippet),i+" "+n):i}function pn(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Wo(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+": "+Wo(this,t)};var xe=pn;function Ri(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 $i(e,t){return he.repeat(" ",t-e.length)+e}function Nl(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=Ri(e.buffer,i[o-l],r[o-l],e.position-(i[o]-i[o-l]),u),a=he.repeat(" ",t.indent)+$i((e.line-l+1).toString(),f)+" | "+c.str+`
73
- `+a;for(c=Ri(e.buffer,i[o],r[o],e.position,u),a+=he.repeat(" ",t.indent)+$i((e.line+1).toString(),f)+" | "+c.str+`
72
+ `+e.mark.snippet),i+" "+n):i}function pn(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=ko(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+": "+ko(this,t)};var xe=pn;function Ui(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 Hi(e,t){return he.repeat(" ",t-e.length)+e}function Rl(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=Ui(e.buffer,i[o-l],r[o-l],e.position-(i[o]-i[o-l]),u),a=he.repeat(" ",t.indent)+Hi((e.line-l+1).toString(),f)+" | "+c.str+`
73
+ `+a;for(c=Ui(e.buffer,i[o],r[o],e.position,u),a+=he.repeat(" ",t.indent)+Hi((e.line+1).toString(),f)+" | "+c.str+`
74
74
  `,a+=he.repeat("-",t.indent+f+3+c.pos)+`^
75
- `,l=1;l<=t.linesAfter&&!(o+l>=r.length);l++)c=Ri(e.buffer,i[o+l],r[o+l],e.position-(i[o]-i[o+l]),u),a+=he.repeat(" ",t.indent)+$i((e.line+l+1).toString(),f)+" | "+c.str+`
76
- `;return a.replace(/\n$/,"")}var Rl=Nl,$l=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ul=["scalar","sequence","mapping"];function Hl(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function Bl(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if($l.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=Hl(t.styleAliases||null),Ul.indexOf(this.kind)===-1)throw new xe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ye=Bl;function Eo(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 Wl(){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 Hi(e){return this.extend(e)}Hi.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(Hi.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=Eo(r,"implicit"),r.compiledExplicit=Eo(r,"explicit"),r.compiledTypeMap=Wl(r.compiledImplicit,r.compiledExplicit),r};var kl=Hi,Yl=new ye("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),ql=new ye("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),zl=new ye("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Gl=new kl({explicit:[Yl,ql,zl]});function Kl(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Vl(){return null}function Jl(e){return e===null}var Ql=new ye("tag:yaml.org,2002:null",{kind:"scalar",resolve:Kl,construct:Vl,predicate:Jl,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Zl(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Xl(e){return e==="true"||e==="True"||e==="TRUE"}function ec(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var tc=new ye("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Zl,construct:Xl,predicate:ec,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 nc(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function ic(e){return 48<=e&&e<=55}function rc(e){return 48<=e&&e<=57}function oc(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(!nc(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!ic(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<t;n++)if(r=e[n],r!=="_"){if(!rc(e.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function sc(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 ac(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!he.isNegativeZero(e)}var lc=new ye("tag:yaml.org,2002:int",{kind:"scalar",resolve:oc,construct:sc,predicate:ac,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"]}}),cc=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function fc(e){return!(e===null||!cc.test(e)||e[e.length-1]==="_")}function uc(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 pc=/^[-+]?[0-9]+e/;function hc(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(he.isNegativeZero(e))return"-0.0";return n=e.toString(10),pc.test(n)?n.replace("e",".e"):n}function dc(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||he.isNegativeZero(e))}var mc=new ye("tag:yaml.org,2002:float",{kind:"scalar",resolve:fc,construct:uc,predicate:dc,represent:hc,defaultStyle:"lowercase"}),gc=Gl.extend({implicit:[Ql,tc,lc,mc]}),bc=gc,ko=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Yo=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 yc(e){return e===null?!1:ko.exec(e)!==null||Yo.exec(e)!==null}function wc(e){var t,n,i,r,s,o,a,l=0,c=null,f,u,p;if(t=ko.exec(e),t===null&&(t=Yo.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 Ac=new ye("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:yc,construct:wc,instanceOf:Date,represent:Cc});function xc(e){return e==="<<"||e===null}var vc=new ye("tag:yaml.org,2002:merge",{kind:"scalar",resolve:xc}),qi=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
77
- \r`;function Oc(e){if(e===null)return!1;var t,n,i=0,r=e.length,s=qi;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 _c(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,s=qi,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 Ec(e){var t="",n=0,i,r,s=e.length,o=qi;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 Sc(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Ic=new ye("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Oc,construct:_c,predicate:Sc,represent:Ec}),jc=Object.prototype.hasOwnProperty,Pc=Object.prototype.toString;function Mc(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,Pc.call(r)!=="[object Object]")return!1;for(s in r)if(jc.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 Lc(e){return e!==null?e:[]}var Fc=new ye("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Mc,construct:Lc}),Tc=Object.prototype.toString;function Dc(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],Tc.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;s[t]=[r[0],i[r[0]]]}return!0}function Nc(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 Rc=new ye("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Dc,construct:Nc}),$c=Object.prototype.hasOwnProperty;function Uc(e){if(e===null)return!0;var t,n=e;for(t in n)if($c.call(n,t)&&n[t]!==null)return!1;return!0}function Hc(e){return e!==null?e:{}}var Bc=new ye("tag:yaml.org,2002:set",{kind:"mapping",resolve:Uc,construct:Hc}),qo=bc.extend({implicit:[Ac,vc],explicit:[Ic,Fc,Rc,Bc]}),it=Object.prototype.hasOwnProperty,kn=1,zo=2,Go=3,Yn=4,Ui=1,Wc=2,So=3,kc=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Yc=/[\x85\u2028\u2029]/,qc=/[,\[\]\{\}]/,Ko=/^(?:!|!!|![a-z\-]+!)$/i,Vo=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Io(e){return Object.prototype.toString.call(e)}function Ue(e){return e===10||e===13}function Tt(e){return e===9||e===32}function ve(e){return e===9||e===32||e===10||e===13}function Kt(e){return e===44||e===91||e===93||e===123||e===125}function zc(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Gc(e){return e===120?2:e===117?4:e===85?8:0}function Kc(e){return 48<=e&&e<=57?e-48:-1}function jo(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
78
- `: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 Vc(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Jo=new Array(256),Qo=new Array(256);for(Ft=0;Ft<256;Ft++)Jo[Ft]=jo(Ft)?1:0,Qo[Ft]=jo(Ft);var Ft;function Jc(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||qo,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 Zo(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=Rl(n),new xe(t,n)}function N(e,t){throw Zo(e,t)}function qn(e,t){e.onWarning&&e.onWarning.call(null,Zo(e,t))}var Po={YAML:function(t,n,i){var r,s,o;t.version!==null&&N(t,"duplication of %YAML directive"),i.length!==1&&N(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&N(t,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),o=parseInt(r[2],10),s!==1&&N(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&qn(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,s;i.length!==2&&N(t,"TAG directive accepts exactly two arguments"),r=i[0],s=i[1],Ko.test(r)||N(t,"ill-formed tag handle (first argument) of the TAG directive"),it.call(t.tagMap,r)&&N(t,'there is a previously declared suffix for "'+r+'" tag handle'),Vo.test(s)||N(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(o){N(t,"tag prefix is malformed: "+s)}t.tagMap[r]=s}};function nt(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||N(e,"expected valid JSON character");else kc.test(a)&&N(e,"the stream contains non-printable characters");e.result+=a}}function Mo(e,t,n,i){var r,s,o,a;for(he.isObject(n)||N(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),o=0,a=r.length;o<a;o+=1)s=r[o],it.call(t,s)||(t[s]=n[s],i[s]=!0)}function Vt(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])&&N(e,"nested arrays are not supported inside keys"),typeof r=="object"&&Io(r[c])==="[object Object]"&&(r[c]="[object Object]");if(typeof r=="object"&&Io(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&&!it.call(n,r)&&it.call(t,r)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,N(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 zi(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++):N(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(;Tt(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(Ue(r))for(zi(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&&qn(e,"deficient indentation"),i}function Kn(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 Gi(e,t){t===1?e.result+=" ":t>1&&(e.result+=he.repeat(`
79
- `,t-1))}function Qc(e,t,n){var i,r,s,o,a,l,c,f,u=e.kind,p=e.result,d;if(d=e.input.charCodeAt(e.position),ve(d)||Kt(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(r=e.input.charCodeAt(e.position+1),ve(r)||n&&Kt(r)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,a=!1;d!==0;){if(d===58){if(r=e.input.charCodeAt(e.position+1),ve(r)||n&&Kt(r))break}else if(d===35){if(i=e.input.charCodeAt(e.position-1),ve(i))break}else{if(e.position===e.lineStart&&Kn(e)||n&&Kt(d))break;if(Ue(d))if(l=e.line,c=e.lineStart,f=e.lineIndent,ce(e,!1,-1),e.lineIndent>=t){a=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=c,e.lineIndent=f;break}}a&&(nt(e,s,o,!1),Gi(e,e.line-l),s=o=e.position,a=!1),Tt(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return nt(e,s,o,!1),e.result?!0:(e.kind=u,e.result=p,!1)}function Zc(e,t){var n,i,r;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(nt(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 Ue(n)?(nt(e,i,r,!0),Gi(e,ce(e,!1,t)),i=r=e.position):e.position===e.lineStart&&Kn(e)?N(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);N(e,"unexpected end of the stream within a single quoted scalar")}function Xc(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 nt(e,n,e.position,!0),e.position++,!0;if(a===92){if(nt(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),Ue(a))ce(e,!1,t);else if(a<256&&Jo[a])e.result+=Qo[a],e.position++;else if((o=Gc(a))>0){for(r=o,s=0;r>0;r--)a=e.input.charCodeAt(++e.position),(o=zc(a))>=0?s=(s<<4)+o:N(e,"expected hexadecimal character");e.result+=Vc(s),e.position++}else N(e,"unknown escape sequence");n=i=e.position}else Ue(a)?(nt(e,n,i,!0),Gi(e,ce(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Kn(e)?N(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}N(e,"unexpected end of the stream within a double quoted scalar")}function ef(e,t){var n=!0,i,r,s,o=e.tag,a,l=e.anchor,c,f,u,p,d,g=Object.create(null),b,m,x,v;if(v=e.input.charCodeAt(e.position),v===91)f=93,d=!1,a=[];else if(v===123)f=125,d=!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=d?"mapping":"sequence",e.result=a,!0;n?v===44&&N(e,"expected the node content, but found ','"):N(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,Jt(e,t,kn,!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),Jt(e,t,kn,!1,!0),x=e.result),d?Vt(e,a,g,m,b,x,i,r,s):u?a.push(Vt(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}N(e,"unexpected end of the stream within a flow collection")}function tf(e,t){var n,i,r=Ui,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)Ui===r?r=u===43?So:Wc:N(e,"repeat of a chomping mode identifier");else if((f=Kc(u))>=0)f===0?N(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?N(e,"repeat of an indentation width identifier"):(a=t+f-1,o=!0);else break;if(Tt(u)){do u=e.input.charCodeAt(++e.position);while(Tt(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!Ue(u)&&u!==0)}for(;u!==0;){for(zi(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),Ue(u)){l++;continue}if(e.lineIndent<a){r===So?e.result+=he.repeat(`
80
- `,s?1+l:l):r===Ui&&s&&(e.result+=`
75
+ `,l=1;l<=t.linesAfter&&!(o+l>=r.length);l++)c=Ui(e.buffer,i[o+l],r[o+l],e.position-(i[o]-i[o+l]),u),a+=he.repeat(" ",t.indent)+Hi((e.line+l+1).toString(),f)+" | "+c.str+`
76
+ `;return a.replace(/\n$/,"")}var $l=Rl,Ul=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Hl=["scalar","sequence","mapping"];function Bl(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function Wl(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Ul.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=Bl(t.styleAliases||null),Hl.indexOf(this.kind)===-1)throw new xe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ye=Wl;function So(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 kl(){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 Wi(e){return this.extend(e)}Wi.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(Wi.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=So(r,"implicit"),r.compiledExplicit=So(r,"explicit"),r.compiledTypeMap=kl(r.compiledImplicit,r.compiledExplicit),r};var Yl=Wi,ql=new ye("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),zl=new ye("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Gl=new ye("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Kl=new Yl({explicit:[ql,zl,Gl]});function Vl(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Jl(){return null}function Ql(e){return e===null}var Zl=new ye("tag:yaml.org,2002:null",{kind:"scalar",resolve:Vl,construct:Jl,predicate:Ql,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Xl(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 ec(e){return e==="true"||e==="True"||e==="TRUE"}function tc(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var nc=new ye("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Xl,construct:ec,predicate:tc,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 ic(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function rc(e){return 48<=e&&e<=55}function oc(e){return 48<=e&&e<=57}function sc(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(!ic(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!rc(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<t;n++)if(r=e[n],r!=="_"){if(!oc(e.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function ac(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 lc(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!he.isNegativeZero(e)}var cc=new ye("tag:yaml.org,2002:int",{kind:"scalar",resolve:sc,construct:ac,predicate:lc,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"]}}),fc=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function uc(e){return!(e===null||!fc.test(e)||e[e.length-1]==="_")}function pc(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 hc=/^[-+]?[0-9]+e/;function dc(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(he.isNegativeZero(e))return"-0.0";return n=e.toString(10),hc.test(n)?n.replace("e",".e"):n}function mc(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||he.isNegativeZero(e))}var gc=new ye("tag:yaml.org,2002:float",{kind:"scalar",resolve:uc,construct:pc,predicate:mc,represent:dc,defaultStyle:"lowercase"}),bc=Kl.extend({implicit:[Zl,nc,cc,gc]}),yc=bc,Yo=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),qo=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 wc(e){return e===null?!1:Yo.exec(e)!==null||qo.exec(e)!==null}function Cc(e){var t,n,i,r,s,o,a,l=0,c=null,f,u,p;if(t=Yo.exec(e),t===null&&(t=qo.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 Ac(e){return e.toISOString()}var xc=new ye("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:wc,construct:Cc,instanceOf:Date,represent:Ac});function vc(e){return e==="<<"||e===null}var Oc=new ye("tag:yaml.org,2002:merge",{kind:"scalar",resolve:vc}),Gi=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
77
+ \r`;function _c(e){if(e===null)return!1;var t,n,i=0,r=e.length,s=Gi;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 Ec(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,s=Gi,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 Sc(e){var t="",n=0,i,r,s=e.length,o=Gi;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 Ic(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var jc=new ye("tag:yaml.org,2002:binary",{kind:"scalar",resolve:_c,construct:Ec,predicate:Ic,represent:Sc}),Pc=Object.prototype.hasOwnProperty,Mc=Object.prototype.toString;function Lc(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,Mc.call(r)!=="[object Object]")return!1;for(s in r)if(Pc.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 Fc(e){return e!==null?e:[]}var Tc=new ye("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Lc,construct:Fc}),Dc=Object.prototype.toString;function Nc(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],Dc.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;s[t]=[r[0],i[r[0]]]}return!0}function Rc(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 $c=new ye("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Nc,construct:Rc}),Uc=Object.prototype.hasOwnProperty;function Hc(e){if(e===null)return!0;var t,n=e;for(t in n)if(Uc.call(n,t)&&n[t]!==null)return!1;return!0}function Bc(e){return e!==null?e:{}}var Wc=new ye("tag:yaml.org,2002:set",{kind:"mapping",resolve:Hc,construct:Bc}),zo=yc.extend({implicit:[xc,Oc],explicit:[jc,Tc,$c,Wc]}),it=Object.prototype.hasOwnProperty,kn=1,Go=2,Ko=3,Yn=4,Bi=1,kc=2,Io=3,Yc=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,qc=/[\x85\u2028\u2029]/,zc=/[,\[\]\{\}]/,Vo=/^(?:!|!!|![a-z\-]+!)$/i,Jo=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function jo(e){return Object.prototype.toString.call(e)}function Ue(e){return e===10||e===13}function Tt(e){return e===9||e===32}function ve(e){return e===9||e===32||e===10||e===13}function Kt(e){return e===44||e===91||e===93||e===123||e===125}function Gc(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Kc(e){return e===120?2:e===117?4:e===85?8:0}function Vc(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?`
78
+ `: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 Jc(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Qo=new Array(256),Zo=new Array(256);for(Ft=0;Ft<256;Ft++)Qo[Ft]=Po(Ft)?1:0,Zo[Ft]=Po(Ft);var Ft;function Qc(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||zo,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 Xo(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=$l(n),new xe(t,n)}function N(e,t){throw Xo(e,t)}function qn(e,t){e.onWarning&&e.onWarning.call(null,Xo(e,t))}var Mo={YAML:function(t,n,i){var r,s,o;t.version!==null&&N(t,"duplication of %YAML directive"),i.length!==1&&N(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&N(t,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),o=parseInt(r[2],10),s!==1&&N(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&qn(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,s;i.length!==2&&N(t,"TAG directive accepts exactly two arguments"),r=i[0],s=i[1],Vo.test(r)||N(t,"ill-formed tag handle (first argument) of the TAG directive"),it.call(t.tagMap,r)&&N(t,'there is a previously declared suffix for "'+r+'" tag handle'),Jo.test(s)||N(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(o){N(t,"tag prefix is malformed: "+s)}t.tagMap[r]=s}};function nt(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||N(e,"expected valid JSON character");else Yc.test(a)&&N(e,"the stream contains non-printable characters");e.result+=a}}function Lo(e,t,n,i){var r,s,o,a;for(he.isObject(n)||N(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),o=0,a=r.length;o<a;o+=1)s=r[o],it.call(t,s)||(t[s]=n[s],i[s]=!0)}function Vt(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])&&N(e,"nested arrays are not supported inside keys"),typeof r=="object"&&jo(r[c])==="[object Object]"&&(r[c]="[object Object]");if(typeof r=="object"&&jo(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)Lo(e,t,s[c],n);else Lo(e,t,s,n);else!e.json&&!it.call(n,r)&&it.call(t,r)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,N(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 Ki(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++):N(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(;Tt(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(Ue(r))for(Ki(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&&qn(e,"deficient indentation"),i}function Kn(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 Vi(e,t){t===1?e.result+=" ":t>1&&(e.result+=he.repeat(`
79
+ `,t-1))}function Zc(e,t,n){var i,r,s,o,a,l,c,f,u=e.kind,p=e.result,d;if(d=e.input.charCodeAt(e.position),ve(d)||Kt(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(r=e.input.charCodeAt(e.position+1),ve(r)||n&&Kt(r)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,a=!1;d!==0;){if(d===58){if(r=e.input.charCodeAt(e.position+1),ve(r)||n&&Kt(r))break}else if(d===35){if(i=e.input.charCodeAt(e.position-1),ve(i))break}else{if(e.position===e.lineStart&&Kn(e)||n&&Kt(d))break;if(Ue(d))if(l=e.line,c=e.lineStart,f=e.lineIndent,ce(e,!1,-1),e.lineIndent>=t){a=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=c,e.lineIndent=f;break}}a&&(nt(e,s,o,!1),Vi(e,e.line-l),s=o=e.position,a=!1),Tt(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return nt(e,s,o,!1),e.result?!0:(e.kind=u,e.result=p,!1)}function Xc(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(nt(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 Ue(n)?(nt(e,i,r,!0),Vi(e,ce(e,!1,t)),i=r=e.position):e.position===e.lineStart&&Kn(e)?N(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);N(e,"unexpected end of the stream within a single quoted scalar")}function ef(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 nt(e,n,e.position,!0),e.position++,!0;if(a===92){if(nt(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),Ue(a))ce(e,!1,t);else if(a<256&&Qo[a])e.result+=Zo[a],e.position++;else if((o=Kc(a))>0){for(r=o,s=0;r>0;r--)a=e.input.charCodeAt(++e.position),(o=Gc(a))>=0?s=(s<<4)+o:N(e,"expected hexadecimal character");e.result+=Jc(s),e.position++}else N(e,"unknown escape sequence");n=i=e.position}else Ue(a)?(nt(e,n,i,!0),Vi(e,ce(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Kn(e)?N(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}N(e,"unexpected end of the stream within a double quoted scalar")}function tf(e,t){var n=!0,i,r,s,o=e.tag,a,l=e.anchor,c,f,u,p,d,g=Object.create(null),b,m,x,v;if(v=e.input.charCodeAt(e.position),v===91)f=93,d=!1,a=[];else if(v===123)f=125,d=!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=d?"mapping":"sequence",e.result=a,!0;n?v===44&&N(e,"expected the node content, but found ','"):N(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,Jt(e,t,kn,!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),Jt(e,t,kn,!1,!0),x=e.result),d?Vt(e,a,g,m,b,x,i,r,s):u?a.push(Vt(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}N(e,"unexpected end of the stream within a flow collection")}function nf(e,t){var n,i,r=Bi,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)Bi===r?r=u===43?Io:kc:N(e,"repeat of a chomping mode identifier");else if((f=Vc(u))>=0)f===0?N(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?N(e,"repeat of an indentation width identifier"):(a=t+f-1,o=!0);else break;if(Tt(u)){do u=e.input.charCodeAt(++e.position);while(Tt(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!Ue(u)&&u!==0)}for(;u!==0;){for(Ki(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),Ue(u)){l++;continue}if(e.lineIndent<a){r===Io?e.result+=he.repeat(`
80
+ `,s?1+l:l):r===Bi&&s&&(e.result+=`
81
81
  `);break}for(i?Tt(u)?(c=!0,e.result+=he.repeat(`
82
82
  `,s?1+l:l)):c?(c=!1,e.result+=he.repeat(`
83
83
  `,l+1)):l===0?s&&(e.result+=" "):e.result+=he.repeat(`
84
84
  `,l):e.result+=he.repeat(`
85
- `,s?1+l:l),s=!0,o=!0,l=0,n=e.position;!Ue(u)&&u!==0;)u=e.input.charCodeAt(++e.position);nt(e,n,e.position,!1)}return!0}function Lo(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,N(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,Jt(e,t,Go,!1,!0),s.push(e.result),ce(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)N(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 nf(e,t,n){var i,r,s,o,a,l,c=e.tag,f=e.anchor,u={},p=Object.create(null),d=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,N(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&&(Vt(e,u,p,d,g,null,o,a,l),d=g=b=null),x=!0,m=!0,r=!0):m?(m=!1,r=!0):N(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,!Jt(e,n,zo,!1,!0))break;if(e.line===s){for(v=e.input.charCodeAt(e.position);Tt(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),ve(v)||N(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(Vt(e,u,p,d,g,null,o,a,l),d=g=b=null),x=!0,m=!1,r=!1,d=e.tag,g=e.result;else if(x)N(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=f,!0}else if(x)N(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),Jt(e,t,Yn,!0,r)&&(m?g=e.result:b=e.result),m||(Vt(e,u,p,d,g,b,o,a,l),d=g=b=null),ce(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&v!==0)N(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&Vt(e,u,p,d,g,null,o,a,l),x&&(e.tag=c,e.anchor=f,e.kind="mapping",e.result=u),x}function rf(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&&N(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)):N(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!ve(o);)o===33&&(i?N(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),Ko.test(r)||N(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),qc.test(s)&&N(e,"tag suffix cannot contain flow indicator characters")}s&&!Vo.test(s)&&N(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch(a){N(e,"tag name is malformed: "+s)}return n?e.tag=s:it.call(e.tagMap,r)?e.tag=e.tagMap[r]+s:r==="!"?e.tag="!"+s:r==="!!"?e.tag="tag:yaml.org,2002:"+s:N(e,'undeclared tag handle "'+r+'"'),!0}function of(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&N(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!ve(n)&&!Kt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function sf(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)&&!Kt(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),it.call(e.anchorMap,n)||N(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ce(e,!0,-1),!0}function Jt(e,t,n,i,r){var s,o,a,l=1,c=!1,f=!1,u,p,d,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=Yn===n||Go===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(;rf(e)||of(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||Yn===n)&&(kn===n||zo===n?b=t:b=t+1,m=e.position-e.lineStart,l===1?a&&(Lo(e,m)||nf(e,m,b))||ef(e,b)?f=!0:(o&&tf(e,b)||Zc(e,b)||Xc(e,b)?f=!0:sf(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&N(e,"alias node should not have any properties")):Qc(e,b,kn===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(f=a&&Lo(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"&&N(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(it.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,d=e.typeMap.multi[e.kind||"fallback"],u=0,p=d.length;u<p;u+=1)if(e.tag.slice(0,d[u].tag.length)===d[u].tag){g=d[u];break}g||N(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&N(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)):N(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 af(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&&N(e,"directive name must not be less than one character in length");o!==0;){for(;Tt(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!Ue(o));break}if(Ue(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&&zi(e),it.call(Po,i)?Po[i](e,i,r):qn(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&&N(e,"directives end mark is expected"),Jt(e,e.lineIndent-1,Yn,!1,!0),ce(e,!0,-1),e.checkLineBreaks&&Yc.test(e.input.slice(t,e.position))&&qn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Kn(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ce(e,!0,-1));return}if(e.position<e.length-1)N(e,"end of the stream or a document separator is expected");else return}function Xo(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
86
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Jc(e,t),i=e.indexOf("\0");for(i!==-1&&(n.position=i,N(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;)af(n);return n.documents}function lf(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var i=Xo(e,n);if(typeof t!="function")return i;for(var r=0,s=i.length;r<s;r+=1)t(i[r])}function cf(e,t){var n=Xo(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 ff=lf,uf=cf,es={loadAll:ff,load:uf},ts=Object.prototype.toString,ns=Object.prototype.hasOwnProperty,Ki=65279,pf=9,hn=10,hf=13,df=32,mf=33,gf=34,Bi=35,bf=37,yf=38,wf=39,Cf=42,is=44,Af=45,zn=58,xf=61,vf=62,Of=63,_f=64,rs=91,os=93,Ef=96,ss=123,Sf=124,as=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 If=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],jf=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Pf(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&&ns.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function Mf(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+he.repeat("0",i-t.length)+t}var Lf=1,dn=2;function Ff(e){this.schema=e.schema||qo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=he.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Pf(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?dn:Lf,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 Fo(e,t){for(var n=he.repeat(" ",t),i=0,r=-1,s="",o,a=e.length;i<a;)r=e.indexOf(`
85
+ `,s?1+l:l),s=!0,o=!0,l=0,n=e.position;!Ue(u)&&u!==0;)u=e.input.charCodeAt(++e.position);nt(e,n,e.position,!1)}return!0}function Fo(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,N(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,Jt(e,t,Ko,!1,!0),s.push(e.result),ce(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)N(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 rf(e,t,n){var i,r,s,o,a,l,c=e.tag,f=e.anchor,u={},p=Object.create(null),d=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,N(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&&(Vt(e,u,p,d,g,null,o,a,l),d=g=b=null),x=!0,m=!0,r=!0):m?(m=!1,r=!0):N(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,!Jt(e,n,Go,!1,!0))break;if(e.line===s){for(v=e.input.charCodeAt(e.position);Tt(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),ve(v)||N(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(Vt(e,u,p,d,g,null,o,a,l),d=g=b=null),x=!0,m=!1,r=!1,d=e.tag,g=e.result;else if(x)N(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=f,!0}else if(x)N(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),Jt(e,t,Yn,!0,r)&&(m?g=e.result:b=e.result),m||(Vt(e,u,p,d,g,b,o,a,l),d=g=b=null),ce(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&v!==0)N(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&Vt(e,u,p,d,g,null,o,a,l),x&&(e.tag=c,e.anchor=f,e.kind="mapping",e.result=u),x}function of(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&&N(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)):N(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!ve(o);)o===33&&(i?N(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),Vo.test(r)||N(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),zc.test(s)&&N(e,"tag suffix cannot contain flow indicator characters")}s&&!Jo.test(s)&&N(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch(a){N(e,"tag name is malformed: "+s)}return n?e.tag=s:it.call(e.tagMap,r)?e.tag=e.tagMap[r]+s:r==="!"?e.tag="!"+s:r==="!!"?e.tag="tag:yaml.org,2002:"+s:N(e,'undeclared tag handle "'+r+'"'),!0}function sf(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&N(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!ve(n)&&!Kt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function af(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)&&!Kt(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),it.call(e.anchorMap,n)||N(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ce(e,!0,-1),!0}function Jt(e,t,n,i,r){var s,o,a,l=1,c=!1,f=!1,u,p,d,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=Yn===n||Ko===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(;of(e)||sf(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||Yn===n)&&(kn===n||Go===n?b=t:b=t+1,m=e.position-e.lineStart,l===1?a&&(Fo(e,m)||rf(e,m,b))||tf(e,b)?f=!0:(o&&nf(e,b)||Xc(e,b)||ef(e,b)?f=!0:af(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&N(e,"alias node should not have any properties")):Zc(e,b,kn===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(f=a&&Fo(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"&&N(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(it.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,d=e.typeMap.multi[e.kind||"fallback"],u=0,p=d.length;u<p;u+=1)if(e.tag.slice(0,d[u].tag.length)===d[u].tag){g=d[u];break}g||N(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&N(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)):N(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 lf(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&&N(e,"directive name must not be less than one character in length");o!==0;){for(;Tt(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!Ue(o));break}if(Ue(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&&Ki(e),it.call(Mo,i)?Mo[i](e,i,r):qn(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&&N(e,"directives end mark is expected"),Jt(e,e.lineIndent-1,Yn,!1,!0),ce(e,!0,-1),e.checkLineBreaks&&qc.test(e.input.slice(t,e.position))&&qn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Kn(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ce(e,!0,-1));return}if(e.position<e.length-1)N(e,"end of the stream or a document separator is expected");else return}function es(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
86
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Qc(e,t),i=e.indexOf("\0");for(i!==-1&&(n.position=i,N(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;)lf(n);return n.documents}function cf(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var i=es(e,n);if(typeof t!="function")return i;for(var r=0,s=i.length;r<s;r+=1)t(i[r])}function ff(e,t){var n=es(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 uf=cf,pf=ff,ts={loadAll:uf,load:pf},ns=Object.prototype.toString,is=Object.prototype.hasOwnProperty,Ji=65279,hf=9,hn=10,df=13,mf=32,gf=33,bf=34,ki=35,yf=37,wf=38,Cf=39,Af=42,rs=44,xf=45,zn=58,vf=61,Of=62,_f=63,Ef=64,os=91,ss=93,Sf=96,as=123,If=124,ls=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 jf=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Pf=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Mf(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&&is.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function Lf(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+he.repeat("0",i-t.length)+t}var Ff=1,dn=2;function Tf(e){this.schema=e.schema||zo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=he.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Mf(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?dn:Ff,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 To(e,t){for(var n=he.repeat(" ",t),i=0,r=-1,s="",o,a=e.length;i<a;)r=e.indexOf(`
87
87
  `,i),r===-1?(o=e.slice(i),i=a):(o=e.slice(i,r+1),i=r+1),o.length&&o!==`
88
- `&&(s+=n),s+=o;return s}function Wi(e,t){return`
89
- `+he.repeat(" ",e.indent*t)}function Tf(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 Gn(e){return e===df||e===pf}function mn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ki||65536<=e&&e<=1114111}function To(e){return mn(e)&&e!==Ki&&e!==hf&&e!==hn}function Do(e,t,n){var i=To(e),r=i&&!Gn(e);return(n?i:i&&e!==is&&e!==rs&&e!==os&&e!==ss&&e!==as)&&e!==Bi&&!(t===zn&&!r)||To(t)&&!Gn(t)&&e===Bi||t===zn&&r}function Df(e){return mn(e)&&e!==Ki&&!Gn(e)&&e!==Af&&e!==Of&&e!==zn&&e!==is&&e!==rs&&e!==os&&e!==ss&&e!==as&&e!==Bi&&e!==yf&&e!==Cf&&e!==mf&&e!==Sf&&e!==xf&&e!==vf&&e!==wf&&e!==gf&&e!==bf&&e!==_f&&e!==Ef}function Nf(e){return!Gn(e)&&e!==zn}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 ls(e){var t=/^\n* /;return t.test(e)}var cs=1,ki=2,fs=3,us=4,Gt=5;function Rf(e,t,n,i,r,s,o,a){var l,c=0,f=null,u=!1,p=!1,d=i!==-1,g=-1,b=Df(un(e,0))&&Nf(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 Gt;b=b&&Do(c,f,a),f=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=un(e,l),c===hn)u=!0,d&&(p=p||l-g-1>i&&e[g+1]!==" ",g=l);else if(!mn(c))return Gt;b=b&&Do(c,f,a),f=c}p=p||d&&l-g-1>i&&e[g+1]!==" "}return!u&&!p?b&&!o&&!r(e)?cs:s===dn?Gt:ki:n>9&&ls(e)?Gt:o?s===dn?Gt:ki:p?us:fs}function $f(e,t,n,i,r){e.dump=function(){if(t.length===0)return e.quotingType===dn?'""':"''";if(!e.noCompatMode&&(If.indexOf(t)!==-1||jf.test(t)))return e.quotingType===dn?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),a=i||e.flowLevel>-1&&n>=e.flowLevel;function l(c){return Tf(e,c)}switch(Rf(t,a,e.indent,o,l,e.quotingType,e.forceQuotes&&!i,r)){case cs:return t;case ki:return"'"+t.replace(/'/g,"''")+"'";case fs:return"|"+No(t,e.indent)+Ro(Fo(t,s));case us:return">"+No(t,e.indent)+Ro(Fo(Uf(t,o),s));case Gt:return'"'+Hf(t)+'"';default:throw new xe("impossible error: invalid scalar style")}}()}function No(e,t){var n=ls(e)?String(t):"",i=e[e.length-1]===`
88
+ `&&(s+=n),s+=o;return s}function Yi(e,t){return`
89
+ `+he.repeat(" ",e.indent*t)}function Df(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 Gn(e){return e===mf||e===hf}function mn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ji||65536<=e&&e<=1114111}function Do(e){return mn(e)&&e!==Ji&&e!==df&&e!==hn}function No(e,t,n){var i=Do(e),r=i&&!Gn(e);return(n?i:i&&e!==rs&&e!==os&&e!==ss&&e!==as&&e!==ls)&&e!==ki&&!(t===zn&&!r)||Do(t)&&!Gn(t)&&e===ki||t===zn&&r}function Nf(e){return mn(e)&&e!==Ji&&!Gn(e)&&e!==xf&&e!==_f&&e!==zn&&e!==rs&&e!==os&&e!==ss&&e!==as&&e!==ls&&e!==ki&&e!==wf&&e!==Af&&e!==gf&&e!==If&&e!==vf&&e!==Of&&e!==Cf&&e!==bf&&e!==yf&&e!==Ef&&e!==Sf}function Rf(e){return!Gn(e)&&e!==zn}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 cs(e){var t=/^\n* /;return t.test(e)}var fs=1,qi=2,us=3,ps=4,Gt=5;function $f(e,t,n,i,r,s,o,a){var l,c=0,f=null,u=!1,p=!1,d=i!==-1,g=-1,b=Nf(un(e,0))&&Rf(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 Gt;b=b&&No(c,f,a),f=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=un(e,l),c===hn)u=!0,d&&(p=p||l-g-1>i&&e[g+1]!==" ",g=l);else if(!mn(c))return Gt;b=b&&No(c,f,a),f=c}p=p||d&&l-g-1>i&&e[g+1]!==" "}return!u&&!p?b&&!o&&!r(e)?fs:s===dn?Gt:qi:n>9&&cs(e)?Gt:o?s===dn?Gt:qi:p?ps:us}function Uf(e,t,n,i,r){e.dump=function(){if(t.length===0)return e.quotingType===dn?'""':"''";if(!e.noCompatMode&&(jf.indexOf(t)!==-1||Pf.test(t)))return e.quotingType===dn?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),a=i||e.flowLevel>-1&&n>=e.flowLevel;function l(c){return Df(e,c)}switch($f(t,a,e.indent,o,l,e.quotingType,e.forceQuotes&&!i,r)){case fs:return t;case qi:return"'"+t.replace(/'/g,"''")+"'";case us:return"|"+Ro(t,e.indent)+$o(To(t,s));case ps:return">"+Ro(t,e.indent)+$o(To(Hf(t,o),s));case Gt:return'"'+Bf(t)+'"';default:throw new xe("impossible error: invalid scalar style")}}()}function Ro(e,t){var n=cs(e)?String(t):"",i=e[e.length-1]===`
90
90
  `,r=i&&(e[e.length-2]===`
91
91
  `||e===`
92
92
  `),s=r?"+":i?"":"-";return n+s+`
93
- `}function Ro(e){return e[e.length-1]===`
94
- `?e.slice(0,-1):e}function Uf(e,t){for(var n=/(\n+)([^\n]*)/g,i=function(){var c=e.indexOf(`
95
- `);return c=c!==-1?c:e.length,n.lastIndex=c,$o(e.slice(0,c),t)}(),r=e[0]===`
93
+ `}function $o(e){return e[e.length-1]===`
94
+ `?e.slice(0,-1):e}function Hf(e,t){for(var n=/(\n+)([^\n]*)/g,i=function(){var c=e.indexOf(`
95
+ `);return c=c!==-1?c:e.length,n.lastIndex=c,Uo(e.slice(0,c),t)}(),r=e[0]===`
96
96
  `||e[0]===" ",s,o;o=n.exec(e);){var a=o[1],l=o[2];s=l[0]===" ",i+=a+(!r&&!s&&l!==""?`
97
- `:"")+$o(l,t),r=s}return i}function $o(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
+ `:"")+Uo(l,t),r=s}return i}function Uo(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+=`
98
98
  `+e.slice(r,s),r=s+1),o=a;return l+=`
99
99
  `,e.length-r>t&&o>r?l+=e.slice(r,o)+`
100
- `+e.slice(o+1):l+=e.slice(r),l.slice(1)}function Hf(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=un(e,r),i=we[n],!i&&mn(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||Mf(n);return t}function Bf(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 Uo(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+=Wi(e,t)),e.dump&&hn===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=s,e.dump=r||"[]"}function Wf(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 kf(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+=Wi(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&&hn===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,u&&(p+=Wi(e,t)),Ye(e,t+1,f,!0,u)&&(e.dump&&hn===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,r+=p));e.tag=s,e.dump=r||"{}"}function Ho(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,ts.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(ns.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,Ho(e,n,!1)||Ho(e,n,!0);var a=ts.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?(kf(e,t,e.dump,r),p&&(e.dump="&ref_"+u+e.dump)):(Wf(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?Uo(e,t-1,e.dump,r):Uo(e,t,e.dump,r),p&&(e.dump="&ref_"+u+e.dump)):(Bf(e,t,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&$f(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 Yf(e,t){var n=[],i=[],r,s;for(Yi(e,n,i),r=0,s=i.length;r<s;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(s)}function Yi(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)Yi(e[r],t,n);else for(i=Object.keys(e),r=0,s=i.length;r<s;r+=1)Yi(e[i[r]],t,n)}function qf(e,t){t=t||{};var n=new Ff(t);n.noRefs||Yf(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),Ye(n,0,i,!0,!0)?n.dump+`
101
- `:""}var zf=qf,Gf={dump:zf};function Vi(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 ps=es.load,fd=es.loadAll,hs=Gf.dump;var ud=Vi("safeLoad","load"),pd=Vi("safeLoadAll","loadAll"),hd=Vi("safeDump","dump");var Ks=require("fs"),hr=require("path"),Vs=require("fs"),Js=be(require("fs"),1);function qe(){}qe.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;i.maxEditLength&&(f=Math.min(f,i.maxEditLength));var 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 d(){for(var b=-1*c;b<=c;b+=2){var m=void 0,x=u[b-1],v=u[b+1],F=(v?v.newPos:0)-b;x&&(u[b-1]=void 0);var k=x&&x.newPos+1<a,q=v&&0<=F&&F<l;if(!k&&!q){u[b]=void 0;continue}if(!k||q&&x.newPos<v.newPos?(m=Vf(v),s.pushComponent(m.components,void 0,!0)):(m=x,m.newPos++,s.pushComponent(m.components,!0,void 0)),F=s.extractCommon(m,n,t,b),m.newPos+1>=a&&F+1>=l)return o(Kf(s,m.components,n,t,s.useLongestToken));u[b]=m}c++}if(r)(function b(){setTimeout(function(){if(c>f)return r();d()||b()},0)})();else for(;c<=f;){var g=d();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 Kf(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(d,g){var b=i[l+g];return b.length>d.length?b:d}),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 Vf(e){return{newPos:e.newPos,components:e.components.slice(0)}}var md=new qe;var ds=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,ms=/\S/,gs=new qe;gs.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!ms.test(e)&&!ms.test(t)};gs.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]&&ds.test(t[n])&&ds.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Zi=new qe;Zi.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 Xi(e,t,n){return Zi.diff(e,t,n)}var Jf=new qe;Jf.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Qf=new qe;Qf.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Vn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Vn=function(t){return typeof t}:Vn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vn(e)}var Zf=Object.prototype.toString,Qt=new qe;Qt.useLongestToken=!0;Qt.tokenize=Zi.tokenize;Qt.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(Ji(e,null,null,r),r," ")};Qt.equals=function(e,t){return qe.prototype.equals.call(Qt,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function bs(e,t,n){return Qt.diff(e,t,n)}function Ji(e,t,n,i,r){t=t||[],n=n||[],i&&(e=i(r,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];var o;if(Zf.call(e)==="[object Array]"){for(t.push(e),o=new Array(e.length),n.push(o),s=0;s<e.length;s+=1)o[s]=Ji(e[s],t,n,i,r);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Vn(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]=Ji(e[l],t,n,i,l);t.pop(),n.pop()}else o=e;return o}var Qi=new qe;Qi.tokenize=function(e){return e.slice()};Qi.join=Qi.removeEmpty=function(e){return e};var Xs=be(Gs(),1);async function at({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 yp=Di(Ni());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 lt(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 ct(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 ft(e){let t=(0,hr.extname)(e);return t===".yaml"||t===".yml"||t===".json"}function He(e,t,n){let i;if(n&&!t){let r=(0,hr.extname)(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=hs(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?(0,Ks.writeFileSync)(n,i,"utf8"):console.log(i)}function nn(e){let t=(0,Vs.readFileSync)(e,"utf8");return ps(t,{filename:e,json:!0})}async function*li(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 ut({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:i=n}){(0,si.existsSync)(e)||(0,si.mkdirSync)(e,{recursive:!0});let r=await(0,ai.readdir)(e,"utf-8"),s=new Set(r.filter(l=>{let c=(0,Cn.extname)(l);return c===".json"||c===".yaml"||c===".yml"})),o=l=>(0,Cn.join)(e,`${l}.${t}`);async function*a(){for(let l of s){let c=(0,Cn.join)(e,l);try{let f=await nn(c);yield{id:n(f),displayName:i(f),providerId:c,object:f}}catch(f){throw console.error(yp.default.red(`Failed to read ${c}, data is likely invalid.
102
- ${f==null?void 0:f.message}`)),f}}}return{objects:a(),deleteObject:async l=>{await(0,ai.unlink)(l)},writeObject:async l=>{He(l.object,t,o(l.id))}}}function Qs(e,t){if(!t&&!Js.default.existsSync(e))return{};let n=nn(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function Zs(e,t){He(t,void 0,e)}async function pt({source:e,target:t,compareContents:n=(a,l)=>(0,Xs.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 d=p.id,g=c.get(d);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(F){throw new oi(F,m)}o({action:"update",id:d,providerId:m.providerId,displayName:(v=m.displayName)!=null?v:m.providerId,whatIf:s,diff:bs(x.object,m.object)})};f.push(b(p,g))}c.delete(d)}else{let b=async(m,x)=>{var v;if(!s)try{await t.writeObject(m)}catch(F){throw new oi(F,m)}o({action:"create",id:x,providerId:x,displayName:(v=m.displayName)!=null?v:m.providerId,whatIf:s,diff:Xi("",JSON.stringify(m.object,null,2))})};f.push(b(p,d))}}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 d=>{let g=async b=>{var m;if(!s)try{await t.deleteObject(b.providerId)}catch(x){throw new oi(x,b)}o({action:"delete",id:b.id,providerId:b.providerId,displayName:(m=b.displayName)!=null?m:b.providerId,whatIf:s,diff:Xi(JSON.stringify(b.object,null,2),"")})};p.push(g(d))}),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 oi=class extends Error{constructor(e,t){var n;super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
103
- ${e}`),this.stack=void 0,Object.setPrototypeOf(this,oi.prototype)}},tn=Di(Ni());function ht(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=tn.default.green("[A]");break;case"update":l=tn.default.white("[U]");break;case"delete":l=tn.default.yellow("[D]");break}let c="";(t==="on"||t==="update"&&r==="update")&&(c=`
104
- `+a.map(f=>f.added?tn.default.green(f.value):f.removed?tn.default.red(f.value):f.value).join("")),console.log(`${n!=null?n:""}${o?tn.default.gray("[WHATIF]"):""}${l}${i!=null?i:""} ${s}${c}`)}}var ta={command:"get <id>",describe:"Fetch a component definition",builder:e=>lt(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 Q({apiKey:t,apiHost:e,fetch:ea.default,projectId:r}).getComponentDefinitions({componentId:n,limit:1});a.componentDefinitions.length===0?(console.error("Component did not exist"),process.exit(1)):He(a.componentDefinitions[0],i,s)}};var na=be(require("isomorphic-unfetch"));var ia={command:"list",describe:"List component definitions",aliases:["ls"],builder:e=>lt(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 Q({apiKey:t,apiHost:e,fetch:na.default,projectId:o}).getComponentDefinitions({limit:n,offset:i});He(l.componentDefinitions,r,s)}};var ra=be(require("p-limit"));function ci(e){let t={...e};return delete t.projectId,delete t.state,t}function Be(e){return e.option("state",{type:"string",describe:"Composition state to fetch.",choices:["preview","published"],default:"preview"})}function dt(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 mt=(0,ra.default)(8);var oa=be(require("isomorphic-unfetch"));var gt=e=>e.id,bt=e=>`${e.name} (pid: ${e.id})`;function fi({client:e}){async function*t(){let n=li(async(i,r)=>(await e.getComponentDefinitions({limit:r,offset:i})).componentDefinitions,{pageSize:100});for await(let i of n)yield{id:gt(i),displayName:bt(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 Ke(e,t){return Qs(e,t)}function An(e,t){Zs(e,t)}var sa={command:"pull <directory>",describe:"Pulls all component definitions to local files in a directory",builder:e=>ie(re(ct(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 Q({apiKey:t,apiHost:e,fetch:oa.default,projectId:o,limitPolicy:mt}),c=fi({client:l}),f;if(ft(n)){let d=Ke(n,!1);f=await at({objects:(p=d.components)!=null?p:[],selectIdentifier:gt,selectDisplayName:bt,onSyncComplete:async(g,b)=>{d.components=b,An(n,d)}})}else f=await ut({directory:n,selectIdentifier:gt,selectDisplayName:bt,format:i});await pt({source:c,target:f,mode:r,whatIf:s,log:ht({diffMode:a})})}};var aa=be(require("isomorphic-unfetch"));var la={command:"push <directory>",describe:"Pushes all component definitions from files in a directory to Uniform Canvas",builder:e=>ie(re(ct(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 Q({apiKey:t,apiHost:e,fetch:aa.default,projectId:s,limitPolicy:mt}),l;if(ft(n)){let p=Ke(n,!0);l=await at({objects:(u=p.components)!=null?u:[],selectIdentifier:gt,selectDisplayName:bt})}else l=await ut({directory:n,selectIdentifier:gt,selectDisplayName:bt});let f=fi({client:a});await pt({source:l,target:f,mode:i,whatIf:r,log:ht({diffMode:o})})}};var ca=be(require("isomorphic-unfetch"));var fa={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 Q({apiKey:t,apiHost:e,fetch:ca.default,projectId:i}).removeComponentDefinition({componentId:n})}};var ua=be(require("isomorphic-unfetch"));var pa={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 Q({apiKey:t,apiHost:e,fetch:ua.default,projectId:i}),s=nn(n);await r.updateComponentDefinition({componentDefinition:s})}};var ha={command:"component <command>",aliases:["def"],describe:"Commands for Canvas component definitions",builder:e=>e.command(sa).command(la).command(ta).command(fa).command(ia).command(pa).demandCommand(),handler:()=>{zt.help()}};var da=be(require("isomorphic-unfetch"));var ma={command:"get <id>",describe:"Fetch a composition",builder:e=>lt(ie(re(Be(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 Q({apiKey:t,apiHost:e,fetch:da.default,projectId:o}),c=ci(await l.getCompositionById({compositionId:n,state:dt(s),skipPatternResolution:!a}));He(c,i,r)}};var ga=be(require("isomorphic-unfetch"));var ba={command:"list",describe:"List compositions",aliases:["ls"],builder:e=>lt(ie(re(Be(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 Q({apiKey:t,apiHost:e,fetch:ga.default,projectId:o}).getCompositionList({limit:n,offset:i,state:dt(a),skipPatternResolution:!l});He(f.compositions,r,s)}};var ya=be(require("isomorphic-unfetch"));var yt=e=>e.composition._id,wt=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 ui({client:e,state:t}){let n=dt(t);async function*i(){let r=li(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:yt(s),displayName:wt(s),providerId:s.composition._id,object:ci(s)}}return{objects:i(),deleteObject:async r=>{await e.removeComposition({compositionId:r})},writeObject:async r=>{await e.updateComposition({...r.object,state:n})}}}var wa={command:"pull <directory>",describe:"Pulls all compositions to local files in a directory",builder:e=>ie(re(Be(ct(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 d;let c=new Q({apiKey:t,apiHost:e,fetch:ya.default,projectId:a,limitPolicy:mt}),f=ui({client:c,state:o}),u=ft(n),p;if(u){let g=Ke(n,!1);p=await at({objects:(d=g==null?void 0:g.compositions)!=null?d:[],selectIdentifier:yt,selectDisplayName:wt,onSyncComplete:async(b,m)=>{g.compositions=m,An(n,g)}})}else p=await ut({directory:n,selectIdentifier:yt,selectDisplayName:wt,format:i});await pt({source:f,target:p,mode:r,whatIf:s,log:ht({diffMode:l})})}};var Ca=be(require("isomorphic-unfetch"));var Aa={command:"push <directory>",describe:"Pushes all compositions from files in a directory to Uniform Canvas",builder:e=>ie(re(Be(ct(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 Q({apiKey:t,apiHost:e,fetch:Ca.default,projectId:o,limitPolicy:mt}),c;if(ft(n)){let d=Ke(n,!0);c=await at({objects:(p=d.compositions)!=null?p:[],selectIdentifier:yt,selectDisplayName:wt})}else c=await ut({directory:n,selectIdentifier:yt,selectDisplayName:wt});let u=ui({client:l,state:s});await pt({source:c,target:u,mode:i,whatIf:r,log:ht({diffMode:a})})}};var xa=be(require("isomorphic-unfetch"));var va={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 Q({apiKey:t,apiHost:e,fetch:xa.default,projectId:i}).removeComposition({compositionId:n})}};var Oa=be(require("isomorphic-unfetch"));var _a={command:"update <filename>",aliases:["put"],describe:"Insert or update a composition",builder:e=>ie(re(Be(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 Q({apiKey:t,apiHost:e,fetch:Oa.default,projectId:i}),o=nn(n);await s.updateComposition({...o,state:dt(r)})}};var Ea={command:"composition <command>",describe:"Commands for Canvas compositions",aliases:["comp"],builder:e=>e.command(wa).command(Aa).command(ma).command(va).command(ba).command(_a).demandCommand(),handler:()=>{zt.help()}};var Cp={commands:[{command:"canvas <command>",aliases:["cv","pm","presentation"],describe:"Uniform Canvas commands",builder:e=>e.command(Ea).command(ha).demandCommand(),handler:()=>{zt.showHelp()}}]};0&&(module.exports={readCanvasPackage,uniformCLI,writeCanvasPackage});
100
+ `+e.slice(o+1):l+=e.slice(r),l.slice(1)}function Bf(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=un(e,r),i=we[n],!i&&mn(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||Lf(n);return t}function Wf(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 Ho(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+=Yi(e,t)),e.dump&&hn===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=s,e.dump=r||"[]"}function kf(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 Yf(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+=Yi(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&&hn===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,u&&(p+=Yi(e,t)),Ye(e,t+1,f,!0,u)&&(e.dump&&hn===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,r+=p));e.tag=s,e.dump=r||"{}"}function Bo(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,ns.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(is.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,Bo(e,n,!1)||Bo(e,n,!0);var a=ns.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?(Yf(e,t,e.dump,r),p&&(e.dump="&ref_"+u+e.dump)):(kf(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?Ho(e,t-1,e.dump,r):Ho(e,t,e.dump,r),p&&(e.dump="&ref_"+u+e.dump)):(Wf(e,t,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Uf(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 qf(e,t){var n=[],i=[],r,s;for(zi(e,n,i),r=0,s=i.length;r<s;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(s)}function zi(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)zi(e[r],t,n);else for(i=Object.keys(e),r=0,s=i.length;r<s;r+=1)zi(e[i[r]],t,n)}function zf(e,t){t=t||{};var n=new Tf(t);n.noRefs||qf(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),Ye(n,0,i,!0,!0)?n.dump+`
101
+ `:""}var Gf=zf,Kf={dump:Gf};function Qi(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 hs=ts.load,hd=ts.loadAll,ds=Kf.dump;var dd=Qi("safeLoad","load"),md=Qi("safeLoadAll","loadAll"),gd=Qi("safeDump","dump");var Vs=require("fs"),mr=require("path"),Js=require("fs"),Qs=be(require("fs"),1);function qe(){}qe.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;i.maxEditLength&&(f=Math.min(f,i.maxEditLength));var 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 d(){for(var b=-1*c;b<=c;b+=2){var m=void 0,x=u[b-1],v=u[b+1],F=(v?v.newPos:0)-b;x&&(u[b-1]=void 0);var k=x&&x.newPos+1<a,q=v&&0<=F&&F<l;if(!k&&!q){u[b]=void 0;continue}if(!k||q&&x.newPos<v.newPos?(m=Jf(v),s.pushComponent(m.components,void 0,!0)):(m=x,m.newPos++,s.pushComponent(m.components,!0,void 0)),F=s.extractCommon(m,n,t,b),m.newPos+1>=a&&F+1>=l)return o(Vf(s,m.components,n,t,s.useLongestToken));u[b]=m}c++}if(r)(function b(){setTimeout(function(){if(c>f)return r();d()||b()},0)})();else for(;c<=f;){var g=d();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 Vf(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(d,g){var b=i[l+g];return b.length>d.length?b:d}),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 Jf(e){return{newPos:e.newPos,components:e.components.slice(0)}}var yd=new qe;var ms=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,gs=/\S/,bs=new qe;bs.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!gs.test(e)&&!gs.test(t)};bs.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]&&ms.test(t[n])&&ms.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var er=new qe;er.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 tr(e,t,n){return er.diff(e,t,n)}var Qf=new qe;Qf.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Zf=new qe;Zf.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Vn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Vn=function(t){return typeof t}:Vn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vn(e)}var Xf=Object.prototype.toString,Qt=new qe;Qt.useLongestToken=!0;Qt.tokenize=er.tokenize;Qt.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(Zi(e,null,null,r),r," ")};Qt.equals=function(e,t){return qe.prototype.equals.call(Qt,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function ys(e,t,n){return Qt.diff(e,t,n)}function Zi(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(Xf.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]=Zi(e[s],t,n,i,r);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Vn(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]=Zi(e[l],t,n,i,l);t.pop(),n.pop()}else o=e;return o}var Xi=new qe;Xi.tokenize=function(e){return e.slice()};Xi.join=Xi.removeEmpty=function(e){return e};var ea=be(Ks(),1);async function at({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 wp=Ri($i());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 lt(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 ct(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 ft(e){let t=(0,mr.extname)(e);return t===".yaml"||t===".yml"||t===".json"}function He(e,t,n){let i;if(n&&!t){let r=(0,mr.extname)(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=ds(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?(0,Vs.writeFileSync)(n,i,"utf8"):console.log(i)}function nn(e){let t=(0,Js.readFileSync)(e,"utf8");return hs(t,{filename:e,json:!0})}async function*li(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 ut({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:i=n}){(0,si.existsSync)(e)||(0,si.mkdirSync)(e,{recursive:!0});let r=await(0,ai.readdir)(e,"utf-8"),s=new Set(r.filter(l=>{let c=(0,Cn.extname)(l);return c===".json"||c===".yaml"||c===".yml"})),o=l=>(0,Cn.join)(e,`${l}.${t}`);async function*a(){for(let l of s){let c=(0,Cn.join)(e,l);try{let f=await nn(c);yield{id:n(f),displayName:i(f),providerId:c,object:f}}catch(f){throw console.error(wp.default.red(`Failed to read ${c}, data is likely invalid.
102
+ ${f==null?void 0:f.message}`)),f}}}return{objects:a(),deleteObject:async l=>{await(0,ai.unlink)(l)},writeObject:async l=>{He(l.object,t,o(l.id))}}}function Zs(e,t){if(!t&&!Qs.default.existsSync(e))return{};let n=nn(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function Xs(e,t){He(t,void 0,e)}async function pt({source:e,target:t,compareContents:n=(a,l)=>(0,ea.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 d=p.id,g=c.get(d);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(F){throw new oi(F,m)}o({action:"update",id:d,providerId:m.providerId,displayName:(v=m.displayName)!=null?v:m.providerId,whatIf:s,diff:ys(x.object,m.object)})};f.push(b(p,g))}c.delete(d)}else{let b=async(m,x)=>{var v;if(!s)try{await t.writeObject(m)}catch(F){throw new oi(F,m)}o({action:"create",id:x,providerId:x,displayName:(v=m.displayName)!=null?v:m.providerId,whatIf:s,diff:tr("",JSON.stringify(m.object,null,2))})};f.push(b(p,d))}}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 d=>{let g=async b=>{var m;if(!s)try{await t.deleteObject(b.providerId)}catch(x){throw new oi(x,b)}o({action:"delete",id:b.id,providerId:b.providerId,displayName:(m=b.displayName)!=null?m:b.providerId,whatIf:s,diff:tr(JSON.stringify(b.object,null,2),"")})};p.push(g(d))}),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 oi=class extends Error{constructor(e,t){var n;super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
103
+ ${e}`),this.stack=void 0,Object.setPrototypeOf(this,oi.prototype)}},tn=Ri($i());function ht(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=tn.default.green("[A]");break;case"update":l=tn.default.white("[U]");break;case"delete":l=tn.default.yellow("[D]");break}let c="";(t==="on"||t==="update"&&r==="update")&&(c=`
104
+ `+a.map(f=>f.added?tn.default.green(f.value):f.removed?tn.default.red(f.value):f.value).join("")),console.log(`${n!=null?n:""}${o?tn.default.gray("[WHATIF]"):""}${l}${i!=null?i:""} ${s}${c}`)}}var na={command:"get <id>",describe:"Fetch a component definition",builder:e=>lt(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 Q({apiKey:t,apiHost:e,fetch:ta.default,projectId:r}).getComponentDefinitions({componentId:n,limit:1});a.componentDefinitions.length===0?(console.error("Component did not exist"),process.exit(1)):He(a.componentDefinitions[0],i,s)}};var ia=be(require("isomorphic-unfetch"));var ra={command:"list",describe:"List component definitions",aliases:["ls"],builder:e=>lt(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 Q({apiKey:t,apiHost:e,fetch:ia.default,projectId:o}).getComponentDefinitions({limit:n,offset:i});He(l.componentDefinitions,r,s)}};var oa=be(require("p-limit"));function ci(e){let t={...e};return delete t.projectId,delete t.state,t}function Be(e){return e.option("state",{type:"string",describe:"Composition state to fetch.",choices:["preview","published"],default:"preview"})}function dt(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 mt=(0,oa.default)(8);var sa=be(require("isomorphic-unfetch"));var gt=e=>e.id,bt=e=>`${e.name} (pid: ${e.id})`;function fi({client:e}){async function*t(){let n=li(async(i,r)=>(await e.getComponentDefinitions({limit:r,offset:i})).componentDefinitions,{pageSize:100});for await(let i of n)yield{id:gt(i),displayName:bt(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 Ke(e,t){return Zs(e,t)}function An(e,t){Xs(e,t)}var aa={command:"pull <directory>",describe:"Pulls all component definitions to local files in a directory",builder:e=>ie(re(ct(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 Q({apiKey:t,apiHost:e,fetch:sa.default,projectId:o,limitPolicy:mt}),c=fi({client:l}),f;if(ft(n)){let d=Ke(n,!1);f=await at({objects:(p=d.components)!=null?p:[],selectIdentifier:gt,selectDisplayName:bt,onSyncComplete:async(g,b)=>{d.components=b,An(n,d)}})}else f=await ut({directory:n,selectIdentifier:gt,selectDisplayName:bt,format:i});await pt({source:c,target:f,mode:r,whatIf:s,log:ht({diffMode:a})})}};var la=be(require("isomorphic-unfetch"));var ca={command:"push <directory>",describe:"Pushes all component definitions from files in a directory to Uniform Canvas",builder:e=>ie(re(ct(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 Q({apiKey:t,apiHost:e,fetch:la.default,projectId:s,limitPolicy:mt}),l;if(ft(n)){let p=Ke(n,!0);l=await at({objects:(u=p.components)!=null?u:[],selectIdentifier:gt,selectDisplayName:bt})}else l=await ut({directory:n,selectIdentifier:gt,selectDisplayName:bt});let f=fi({client:a});await pt({source:l,target:f,mode:i,whatIf:r,log:ht({diffMode:o})})}};var fa=be(require("isomorphic-unfetch"));var ua={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 Q({apiKey:t,apiHost:e,fetch:fa.default,projectId:i}).removeComponentDefinition({componentId:n})}};var pa=be(require("isomorphic-unfetch"));var ha={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 Q({apiKey:t,apiHost:e,fetch:pa.default,projectId:i}),s=nn(n);await r.updateComponentDefinition({componentDefinition:s})}};var da={command:"component <command>",aliases:["def"],describe:"Commands for Canvas component definitions",builder:e=>e.command(aa).command(ca).command(na).command(ua).command(ra).command(ha).demandCommand(),handler:()=>{zt.help()}};var ma=be(require("isomorphic-unfetch"));var ga={command:"get <id>",describe:"Fetch a composition",builder:e=>lt(ie(re(Be(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 Q({apiKey:t,apiHost:e,fetch:ma.default,projectId:o}),c=ci(await l.getCompositionById({compositionId:n,state:dt(s),skipPatternResolution:!a}));He(c,i,r)}};var ba=be(require("isomorphic-unfetch"));var ya={command:"list",describe:"List compositions",aliases:["ls"],builder:e=>lt(ie(re(Be(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 Q({apiKey:t,apiHost:e,fetch:ba.default,projectId:o}).getCompositionList({limit:n,offset:i,state:dt(a),skipPatternResolution:!l});He(f.compositions,r,s)}};var wa=be(require("isomorphic-unfetch"));var yt=e=>e.composition._id,wt=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 ui({client:e,state:t}){let n=dt(t);async function*i(){let r=li(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:yt(s),displayName:wt(s),providerId:s.composition._id,object:ci(s)}}return{objects:i(),deleteObject:async r=>{await e.removeComposition({compositionId:r})},writeObject:async r=>{await e.updateComposition({...r.object,state:n})}}}var Ca={command:"pull <directory>",describe:"Pulls all compositions to local files in a directory",builder:e=>ie(re(Be(ct(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 d;let c=new Q({apiKey:t,apiHost:e,fetch:wa.default,projectId:a,limitPolicy:mt}),f=ui({client:c,state:o}),u=ft(n),p;if(u){let g=Ke(n,!1);p=await at({objects:(d=g==null?void 0:g.compositions)!=null?d:[],selectIdentifier:yt,selectDisplayName:wt,onSyncComplete:async(b,m)=>{g.compositions=m,An(n,g)}})}else p=await ut({directory:n,selectIdentifier:yt,selectDisplayName:wt,format:i});await pt({source:f,target:p,mode:r,whatIf:s,log:ht({diffMode:l})})}};var Aa=be(require("isomorphic-unfetch"));var xa={command:"push <directory>",describe:"Pushes all compositions from files in a directory to Uniform Canvas",builder:e=>ie(re(Be(ct(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 Q({apiKey:t,apiHost:e,fetch:Aa.default,projectId:o,limitPolicy:mt}),c;if(ft(n)){let d=Ke(n,!0);c=await at({objects:(p=d.compositions)!=null?p:[],selectIdentifier:yt,selectDisplayName:wt})}else c=await ut({directory:n,selectIdentifier:yt,selectDisplayName:wt});let u=ui({client:l,state:s});await pt({source:c,target:u,mode:i,whatIf:r,log:ht({diffMode:a})})}};var va=be(require("isomorphic-unfetch"));var Oa={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 Q({apiKey:t,apiHost:e,fetch:va.default,projectId:i}).removeComposition({compositionId:n})}};var _a=be(require("isomorphic-unfetch"));var Ea={command:"update <filename>",aliases:["put"],describe:"Insert or update a composition",builder:e=>ie(re(Be(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 Q({apiKey:t,apiHost:e,fetch:_a.default,projectId:i}),o=nn(n);await s.updateComposition({...o,state:dt(r)})}};var Sa={command:"composition <command>",describe:"Commands for Canvas compositions",aliases:["comp"],builder:e=>e.command(Ca).command(xa).command(ga).command(Oa).command(ya).command(Ea).demandCommand(),handler:()=>{zt.help()}};var Ap={commands:[{command:"canvas <command>",aliases:["cv","pm","presentation"],describe:"Uniform Canvas commands",builder:e=>e.command(Sa).command(da).demandCommand(),handler:()=>{zt.showHelp()}}]};0&&(module.exports={readCanvasPackage,uniformCLI,writeCanvasPackage});
105
105
  /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
106
106
  /**
107
107
  * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js