@uniformdev/context 12.2.1-alpha.141 → 12.2.1-alpha.171

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
- var yi=Object.create;var re=Object.defineProperty;var Ci=Object.getOwnPropertyDescriptor;var ji=Object.getOwnPropertyNames;var Ei=Object.getPrototypeOf,xi=Object.prototype.hasOwnProperty;var Ai=(s,t,e)=>t in s?re(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var nn=s=>re(s,"__esModule",{value:!0});var Pi=(s,t)=>{for(var e in t)re(s,e,{get:t[e],enumerable:!0})},sn=(s,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ji(t))!xi.call(s,i)&&(e||i!=="default")&&re(s,i,{get:()=>t[i],enumerable:!(n=Ci(t,i))||n.enumerable});return s},rn=(s,t)=>sn(nn(re(s!=null?yi(Ei(s)):{},"default",!t&&s&&s.__esModule?{get:()=>s.default,enumerable:!0}:{value:s,enumerable:!0})),s),Mi=(s=>(t,e)=>s&&s.get(t)||(e=sn(nn({}),t,1),s&&s.set(t,e),e))(typeof WeakMap!="undefined"?new WeakMap:0);var on=(s,t,e)=>(Ai(s,typeof t!="symbol"?t+"":t,e),e),Si=(s,t,e)=>{if(!t.has(s))throw TypeError("Cannot "+e)};var an=(s,t,e)=>(Si(s,t,"read from private field"),e?e.call(s):t.get(s)),ln=(s,t,e)=>{if(t.has(s))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(s):t.set(s,e)};var ls={};Pi(ls,{uniformCLI:()=>as});var Ii=()=>typeof document=="undefined"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,U=Ii();var Oe=require("assert");var $i={right:Di,center:Ui},Ni=0,ue=1,Fi=2,de=3,cn=class{constructor(t){var e;this.width=t.width,this.wrap=(e=t.wrap)!==null&&e!==void 0?e:!0,this.rows=[]}span(...t){let e=this.div(...t);e.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 e=t.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(e),e}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let e=t.split(`
2
- `).map(i=>i.split(" ")),n=0;return e.forEach(i=>{i.length>1&&lt.stringWidth(i[0])>n&&(n=Math.min(Math.floor(this.width*.5),lt.stringWidth(i[0])))}),e.forEach(i=>{this.div(...i.map((o,a)=>({text:o.trim(),padding:this.measurePadding(o),width:a===0&&i.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){let e=lt.stripAnsi(t);return[0,e.match(/\s*$/)[0].length,0,e.match(/^\s*/)[0].length]}toString(){let t=[];return this.rows.forEach(e=>{this.rowToString(e,t)}),t.filter(e=>!e.hidden).map(e=>e.text).join(`
3
- `)}rowToString(t,e){return this.rasterize(t).forEach((n,i)=>{let o="";n.forEach((a,c)=>{let{width:p}=t[c],O=this.negatePadding(t[c]),b=a;O>lt.stringWidth(a)&&(b+=" ".repeat(O-lt.stringWidth(a))),t[c].align&&t[c].align!=="left"&&this.wrap&&(b=$i[t[c].align](b,O),lt.stringWidth(b)<O&&(b+=" ".repeat((p||0)-lt.stringWidth(b)-1)));let f=t[c].padding||[0,0,0,0];f[de]&&(o+=" ".repeat(f[de])),o+=fn(t[c],b,"| "),o+=b,o+=fn(t[c],b," |"),f[ue]&&(o+=" ".repeat(f[ue])),i===0&&e.length>0&&(o=this.renderInline(o,e[e.length-1]))}),e.push({text:o.replace(/ +$/,""),span:t.span})}),e}renderInline(t,e){let n=t.match(/^ */),i=n?n[0].length:0,o=e.text,a=lt.stringWidth(o.trimRight());return e.span?this.wrap?i<a?t:(e.hidden=!0,o.trimRight()+" ".repeat(i-a)+t.trimLeft()):(e.hidden=!0,o+t):t}rasterize(t){let e=[],n=this.columnWidths(t),i;return t.forEach((o,a)=>{o.width=n[a],this.wrap?i=lt.wrap(o.text,this.negatePadding(o),{hard:!0}).split(`
4
- `):i=o.text.split(`
5
- `),o.border&&(i.unshift("."+"-".repeat(this.negatePadding(o)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(o)+2)+"'")),o.padding&&(i.unshift(...new Array(o.padding[Ni]||0).fill("")),i.push(...new Array(o.padding[Fi]||0).fill(""))),i.forEach((c,p)=>{e[p]||e.push([]);let O=e[p];for(let b=0;b<a;b++)O[b]===void 0&&O.push("");O.push(c)})}),e}negatePadding(t){let e=t.width||0;return t.padding&&(e-=(t.padding[de]||0)+(t.padding[ue]||0)),t.border&&(e-=4),e}columnWidths(t){if(!this.wrap)return t.map(a=>a.width||lt.stringWidth(a.text));let e=t.length,n=this.width,i=t.map(a=>{if(a.width)return e--,n-=a.width,a.width}),o=e?Math.floor(n/e):0;return i.map((a,c)=>a===void 0?Math.max(o,Li(t[c])):a)}};function fn(s,t,e){return s.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?e:" ":""}function Li(s){let t=s.padding||[],e=1+(t[de]||0)+(t[ue]||0);return s.border?e+4:e}function Ri(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Di(s,t){s=s.trim();let e=lt.stringWidth(s);return e<t?" ".repeat(t-e)+s:s}function Ui(s,t){s=s.trim();let e=lt.stringWidth(s);return e>=t?s:" ".repeat(t-e>>1)+s}var lt;function hn(s,t){return lt=t,new cn({width:(s==null?void 0:s.width)||Ri(),wrap:s==null?void 0:s.wrap})}var un=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function Re(s){return s.replace(un,"")}function dn(s,t){let[e,n]=s.match(un)||["",""];s=Re(s);let i="";for(let o=0;o<s.length;o++)o!==0&&o%t===0&&(i+=`
6
- `),i+=s.charAt(o);return e&&n&&(i=`${e}${i}${n}`),i}function De(s){return hn(s,{stringWidth:t=>[...t].length,stripAnsi:Re,wrap:dn})}var Xt=require("path"),pe=require("fs");function pn(s,t){let e=(0,Xt.resolve)(".",s),n;for((0,pe.statSync)(e).isDirectory()||(e=(0,Xt.dirname)(e));;){if(n=t(e,(0,pe.readdirSync)(e)),n)return(0,Xt.resolve)(e,n);if(e=(0,Xt.dirname)(n=e),n===e)break}}var Sn=require("util"),In=require("fs"),$n=require("url");var bn=require("util"),be=require("path");function Ut(s){if(s!==s.toLowerCase()&&s!==s.toUpperCase()||(s=s.toLowerCase()),s.indexOf("-")===-1&&s.indexOf("_")===-1)return s;{let e="",n=!1,i=s.match(/^-+/);for(let o=i?i[0].length:0;o<s.length;o++){let a=s.charAt(o);n&&(n=!1,a=a.toUpperCase()),o!==0&&(a==="-"||a==="_")?n=!0:a!=="-"&&a!=="_"&&(e+=a)}return e}}function me(s,t){let e=s.toLowerCase();t=t||"-";let n="";for(let i=0;i<s.length;i++){let o=e.charAt(i),a=s.charAt(i);o!==a&&i>0?n+=`${t}${e.charAt(i)}`:n+=a}return n}function ge(s){return s==null?!1:typeof s=="number"||/^0x[0-9a-f]+$/i.test(s)?!0:/^0[^.]/.test(s)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(s)}function mn(s){if(Array.isArray(s))return s.map(a=>typeof a!="string"?a+"":a);s=s.trim();let t=0,e=null,n=null,i=null,o=[];for(let a=0;a<s.length;a++){if(e=n,n=s.charAt(a),n===" "&&!i){e!==" "&&t++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),o[t]||(o[t]=""),o[t]+=n}return o}var ut;(function(s){s.BOOLEAN="boolean",s.STRING="string",s.NUMBER="number",s.ARRAY="array"})(ut||(ut={}));var At,Ue=class{constructor(t){At=t}parse(t,e){let n=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},e),i=mn(t),o=typeof t=="string",a=Wi(Object.assign(Object.create(null),n.alias)),c=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},n.configuration),p=Object.assign(Object.create(null),n.default),O=n.configObjects||[],b=n.envPrefix,f=c["populate--"],g=f?"--":"_",w=Object.create(null),S=Object.create(null),y=n.__||At.format,d={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:[]},W=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,T=new RegExp("^--"+c["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(l){let u=typeof l=="object"?l.key:l,_=Object.keys(l).map(function(m){return{boolean:"bools",string:"strings",number:"numbers"}[m]}).filter(Boolean).pop();_&&(d[_][u]=!0),d.arrays[u]=!0,d.keys.push(u)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(l){d.bools[l]=!0,d.keys.push(l)}),[].concat(n.string||[]).filter(Boolean).forEach(function(l){d.strings[l]=!0,d.keys.push(l)}),[].concat(n.number||[]).filter(Boolean).forEach(function(l){d.numbers[l]=!0,d.keys.push(l)}),[].concat(n.count||[]).filter(Boolean).forEach(function(l){d.counts[l]=!0,d.keys.push(l)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(l){d.normalize[l]=!0,d.keys.push(l)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([l,u])=>{typeof u=="number"&&(d.nargs[l]=u,d.keys.push(l))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([l,u])=>{typeof u=="function"&&(d.coercions[l]=u,d.keys.push(l))}),typeof n.config!="undefined"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(l){d.configs[l]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([l,u])=>{(typeof u=="boolean"||typeof u=="function")&&(d.configs[l]=u)})),Dt(n.key,a,n.default,d.arrays),Object.keys(p).forEach(function(l){(d.aliases[l]||[]).forEach(function(u){p[u]=p[l]})});let Y=null;he();let v=[],B=Object.assign(Object.create(null),{_:[]}),Pt={};for(let l=0;l<i.length;l++){let u=i[l],_=u.replace(/^-{3,}/,"---"),m,h,P,j,I,st;if(u!=="--"&&Z(u))bt(u);else if(_.match(/---+(=|$)/)){bt(u);continue}else if(u.match(/^--.+=/)||!c["short-option-groups"]&&u.match(/^-.+=/))j=u.match(/^--?([^=]+)=([\s\S]*)$/),j!==null&&Array.isArray(j)&&j.length>=3&&(F(j[1],d.arrays)?l=Lt(l,j[1],i,j[2]):F(j[1],d.nargs)!==!1?l=Zt(l,j[1],i,j[2]):G(j[1],j[2],!0));else if(u.match(T)&&c["boolean-negation"])j=u.match(T),j!==null&&Array.isArray(j)&&j.length>=2&&(h=j[1],G(h,F(h,d.arrays)?[!1]:!1));else if(u.match(/^--.+/)||!c["short-option-groups"]&&u.match(/^-[^-]+/))j=u.match(/^--?(.+)/),j!==null&&Array.isArray(j)&&j.length>=2&&(h=j[1],F(h,d.arrays)?l=Lt(l,h,i):F(h,d.nargs)!==!1?l=Zt(l,h,i):(I=i[l+1],I!==void 0&&(!I.match(/^-/)||I.match(W))&&!F(h,d.bools)&&!F(h,d.counts)||/^(true|false)$/.test(I)?(G(h,I),l++):G(h,X(h))));else if(u.match(/^-.\..+=/))j=u.match(/^-([^=]+)=([\s\S]*)$/),j!==null&&Array.isArray(j)&&j.length>=3&&G(j[1],j[2]);else if(u.match(/^-.\..+/)&&!u.match(W))I=i[l+1],j=u.match(/^-(.\..+)/),j!==null&&Array.isArray(j)&&j.length>=2&&(h=j[1],I!==void 0&&!I.match(/^-/)&&!F(h,d.bools)&&!F(h,d.counts)?(G(h,I),l++):G(h,X(h)));else if(u.match(/^-[^-]+/)&&!u.match(W)){P=u.slice(1,-1).split(""),m=!1;for(let ot=0;ot<P.length;ot++){if(I=u.slice(ot+2),P[ot+1]&&P[ot+1]==="="){st=u.slice(ot+3),h=P[ot],F(h,d.arrays)?l=Lt(l,h,i,st):F(h,d.nargs)!==!1?l=Zt(l,h,i,st):G(h,st),m=!0;break}if(I==="-"){G(P[ot],I);continue}if(/[A-Za-z]/.test(P[ot])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(I)&&F(I,d.bools)===!1){G(P[ot],I),m=!0;break}if(P[ot+1]&&P[ot+1].match(/\W/)){G(P[ot],I),m=!0;break}else G(P[ot],X(P[ot]))}h=u.slice(-1)[0],!m&&h!=="-"&&(F(h,d.arrays)?l=Lt(l,h,i):F(h,d.nargs)!==!1?l=Zt(l,h,i):(I=i[l+1],I!==void 0&&(!/^(-|--)[^-]/.test(I)||I.match(W))&&!F(h,d.bools)&&!F(h,d.counts)||/^(true|false)$/.test(I)?(G(h,I),l++):G(h,X(h))))}else if(u.match(/^-[0-9]$/)&&u.match(W)&&F(u.slice(1),d.bools))h=u.slice(1),G(h,X(h));else if(u==="--"){v=i.slice(l+1);break}else if(c["halt-at-non-option"]){v=i.slice(l);break}else bt(u)}H(B,!0),H(B,!1),R(B),tt(),Q(B,d.aliases,p,!0),it(B),c["set-placeholder-key"]&&Rt(B),Object.keys(d.counts).forEach(function(l){Et(B,l.split("."))||G(l,0)}),f&&v.length&&(B[g]=[]),v.forEach(function(l){B[g].push(l)}),c["camel-case-expansion"]&&c["strip-dashed"]&&Object.keys(B).filter(l=>l!=="--"&&l.includes("-")).forEach(l=>{delete B[l]}),c["strip-aliased"]&&[].concat(...Object.keys(a).map(l=>a[l])).forEach(l=>{c["camel-case-expansion"]&&l.includes("-")&&delete B[l.split(".").map(u=>Ut(u)).join(".")],delete B[l]});function bt(l){let u=$("_",l);(typeof u=="string"||typeof u=="number")&&B._.push(u)}function Zt(l,u,_,m){let h,P=F(u,d.nargs);if(P=typeof P!="number"||isNaN(P)?1:P,P===0)return _t(m)||(Y=Error(y("Argument unexpected for: %s",u))),G(u,X(u)),l;let j=_t(m)?0:1;if(c["nargs-eats-options"])_.length-(l+1)+j<P&&(Y=Error(y("Not enough arguments following: %s",u))),j=P;else{for(h=l+1;h<_.length&&(!_[h].match(/^-[^0-9]/)||_[h].match(W)||Z(_[h]));h++)j++;j<P&&(Y=Error(y("Not enough arguments following: %s",u)))}let I=Math.min(j,P);for(!_t(m)&&I>0&&(G(u,m),I--),h=l+1;h<I+l+1;h++)G(u,_[h]);return l+I}function Lt(l,u,_,m){let h=[],P=m||_[l+1],j=F(u,d.nargs);if(F(u,d.bools)&&!/^(true|false)$/.test(P))h.push(!0);else if(_t(P)||_t(m)&&/^-/.test(P)&&!W.test(P)&&!Z(P)){if(p[u]!==void 0){let I=p[u];h=Array.isArray(I)?I:[I]}}else{_t(m)||h.push(C(u,m,!0));for(let I=l+1;I<_.length&&!(!c["greedy-arrays"]&&h.length>0||j&&typeof j=="number"&&h.length>=j||(P=_[I],/^-/.test(P)&&!W.test(P)&&!Z(P)));I++)l=I,h.push(C(u,P,o))}return typeof j=="number"&&(j&&h.length<j||isNaN(j)&&h.length===0)&&(Y=Error(y("Not enough arguments following: %s",u))),G(u,h),l}function G(l,u,_=o){if(/-/.test(l)&&c["camel-case-expansion"]){let P=l.split(".").map(function(j){return Ut(j)}).join(".");A(l,P)}let m=C(l,u,_),h=l.split(".");xt(B,h,m),d.aliases[l]&&d.aliases[l].forEach(function(P){let j=P.split(".");xt(B,j,m)}),h.length>1&&c["dot-notation"]&&(d.aliases[h[0]]||[]).forEach(function(P){let j=P.split("."),I=[].concat(h);I.shift(),j=j.concat(I),(d.aliases[l]||[]).includes(j.join("."))||xt(B,j,m)}),F(l,d.normalize)&&!F(l,d.arrays)&&[l].concat(d.aliases[l]||[]).forEach(function(j){Object.defineProperty(Pt,j,{enumerable:!0,get(){return u},set(I){u=typeof I=="string"?At.normalize(I):I}})})}function A(l,u){d.aliases[l]&&d.aliases[l].length||(d.aliases[l]=[u],w[u]=!0),d.aliases[u]&&d.aliases[u].length||A(u,l)}function C(l,u,_){_&&(u=zi(u)),(F(l,d.bools)||F(l,d.counts))&&typeof u=="string"&&(u=u==="true");let m=Array.isArray(u)?u.map(function(h){return $(l,h)}):$(l,u);return F(l,d.counts)&&(_t(m)||typeof m=="boolean")&&(m=We()),F(l,d.normalize)&&F(l,d.arrays)&&(Array.isArray(u)?m=u.map(h=>At.normalize(h)):m=At.normalize(u)),m}function $(l,u){return!c["parse-positional-numbers"]&&l==="_"||!F(l,d.strings)&&!F(l,d.bools)&&!Array.isArray(u)&&(ge(u)&&c["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${u}`)))||!_t(u)&&F(l,d.numbers))&&(u=Number(u)),u}function R(l){let u=Object.create(null);Q(u,d.aliases,p),Object.keys(d.configs).forEach(function(_){let m=l[_]||u[_];if(m)try{let h=null,P=At.resolve(At.cwd(),m),j=d.configs[_];if(typeof j=="function"){try{h=j(P)}catch(I){h=I}if(h instanceof Error){Y=h;return}}else h=At.require(P);V(h)}catch(h){h.name==="PermissionDenied"?Y=h:l[_]&&(Y=Error(y("Invalid JSON config file: %s",m)))}})}function V(l,u){Object.keys(l).forEach(function(_){let m=l[_],h=u?u+"."+_:_;typeof m=="object"&&m!==null&&!Array.isArray(m)&&c["dot-notation"]?V(m,h):(!Et(B,h.split("."))||F(h,d.arrays)&&c["combine-arrays"])&&G(h,m)})}function tt(){typeof O!="undefined"&&O.forEach(function(l){V(l)})}function H(l,u){if(typeof b=="undefined")return;let _=typeof b=="string"?b:"",m=At.env();Object.keys(m).forEach(function(h){if(_===""||h.lastIndexOf(_,0)===0){let P=h.split("__").map(function(j,I){return I===0&&(j=j.substring(_.length)),Ut(j)});(u&&d.configs[P.join(".")]||!u)&&!Et(l,P)&&G(P.join("."),m[h])}})}function it(l){let u,_=new Set;Object.keys(l).forEach(function(m){if(!_.has(m)&&(u=F(m,d.coercions),typeof u=="function"))try{let h=$(m,u(l[m]));[].concat(d.aliases[m]||[],m).forEach(P=>{_.add(P),l[P]=h})}catch(h){Y=h}})}function Rt(l){return d.keys.forEach(u=>{~u.indexOf(".")||typeof l[u]=="undefined"&&(l[u]=void 0)}),l}function Q(l,u,_,m=!1){Object.keys(_).forEach(function(h){Et(l,h.split("."))||(xt(l,h.split("."),_[h]),m&&(S[h]=!0),(u[h]||[]).forEach(function(P){Et(l,P.split("."))||xt(l,P.split("."),_[h])}))})}function Et(l,u){let _=l;c["dot-notation"]||(u=[u.join(".")]),u.slice(0,-1).forEach(function(h){_=_[h]||{}});let m=u[u.length-1];return typeof _!="object"?!1:m in _}function xt(l,u,_){let m=l;c["dot-notation"]||(u=[u.join(".")]),u.slice(0,-1).forEach(function(st){st=gn(st),typeof m=="object"&&m[st]===void 0&&(m[st]={}),typeof m[st]!="object"||Array.isArray(m[st])?(Array.isArray(m[st])?m[st].push({}):m[st]=[m[st],{}],m=m[st][m[st].length-1]):m=m[st]});let h=gn(u[u.length-1]),P=F(u.join("."),d.arrays),j=Array.isArray(_),I=c["duplicate-arguments-array"];!I&&F(h,d.nargs)&&(I=!0,(!_t(m[h])&&d.nargs[h]===1||Array.isArray(m[h])&&m[h].length===d.nargs[h])&&(m[h]=void 0)),_===We()?m[h]=We(m[h]):Array.isArray(m[h])?I&&P&&j?m[h]=c["flatten-duplicate-arrays"]?m[h].concat(_):(Array.isArray(m[h][0])?m[h]:[m[h]]).concat([_]):!I&&Boolean(P)===Boolean(j)?m[h]=_:m[h]=m[h].concat([_]):m[h]===void 0&&P?m[h]=j?_:[_]:I&&!(m[h]===void 0||F(h,d.counts)||F(h,d.bools))?m[h]=[m[h],_]:m[h]=_}function Dt(...l){l.forEach(function(u){Object.keys(u||{}).forEach(function(_){d.aliases[_]||(d.aliases[_]=[].concat(a[_]||[]),d.aliases[_].concat(_).forEach(function(m){if(/-/.test(m)&&c["camel-case-expansion"]){let h=Ut(m);h!==_&&d.aliases[_].indexOf(h)===-1&&(d.aliases[_].push(h),w[h]=!0)}}),d.aliases[_].concat(_).forEach(function(m){if(m.length>1&&/[A-Z]/.test(m)&&c["camel-case-expansion"]){let h=me(m,"-");h!==_&&d.aliases[_].indexOf(h)===-1&&(d.aliases[_].push(h),w[h]=!0)}}),d.aliases[_].forEach(function(m){d.aliases[m]=[_].concat(d.aliases[_].filter(function(h){return m!==h}))}))})})}function F(l,u){let _=[].concat(d.aliases[l]||[],l),m=Object.keys(u),h=_.find(P=>m.includes(P));return h?u[h]:!1}function Le(l){let u=Object.keys(d);return[].concat(u.map(m=>d[m])).some(function(m){return Array.isArray(m)?m.includes(l):m[l]})}function N(l,...u){return[].concat(...u).some(function(m){let h=l.match(m);return h&&Le(h[1])})}function K(l){if(l.match(W)||!l.match(/^-[^-]+/))return!1;let u=!0,_,m=l.slice(1).split("");for(let h=0;h<m.length;h++){if(_=l.slice(h+2),!Le(m[h])){u=!1;break}if(m[h+1]&&m[h+1]==="="||_==="-"||/[A-Za-z]/.test(m[h])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(_)||m[h+1]&&m[h+1].match(/\W/))break}return u}function Z(l){return c["unknown-options-as-args"]&&z(l)}function z(l){return l=l.replace(/^-{3,}/,"--"),l.match(W)||K(l)?!1:!N(l,/^-+([^=]+?)=[\s\S]*$/,T,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function X(l){return!F(l,d.bools)&&!F(l,d.counts)&&`${l}`in p?p[l]:et(Ot(l))}function et(l){return{[ut.BOOLEAN]:!0,[ut.STRING]:"",[ut.NUMBER]:void 0,[ut.ARRAY]:[]}[l]}function Ot(l){let u=ut.BOOLEAN;return F(l,d.strings)?u=ut.STRING:F(l,d.numbers)?u=ut.NUMBER:F(l,d.bools)?u=ut.BOOLEAN:F(l,d.arrays)&&(u=ut.ARRAY),u}function _t(l){return l===void 0}function he(){Object.keys(d.counts).find(l=>F(l,d.arrays)?(Y=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",l)),!0):F(l,d.nargs)?(Y=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",l)),!0):!1)}return{aliases:Object.assign({},d.aliases),argv:Object.assign(Pt,B),configuration:c,defaulted:Object.assign({},S),error:Y,newAliases:Object.assign({},w)}}};function Wi(s){let t=[],e=Object.create(null),n=!0;for(Object.keys(s).forEach(function(i){t.push([].concat(s[i],i))});n;){n=!1;for(let i=0;i<t.length;i++)for(let o=i+1;o<t.length;o++)if(t[i].filter(function(c){return t[o].indexOf(c)!==-1}).length){t[i]=t[i].concat(t[o]),t.splice(o,1),n=!0;break}}return t.forEach(function(i){i=i.filter(function(a,c,p){return p.indexOf(a)===c});let o=i.pop();o!==void 0&&typeof o=="string"&&(e[o]=i)}),e}function We(s){return s!==void 0?s+1:1}function gn(s){return s==="__proto__"?"___proto___":s}function zi(s){return typeof s=="string"&&(s[0]==="'"||s[0]==='"')&&s[s.length-1]===s[0]?s.substring(1,s.length-1):s}var On=require("fs");var _n=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])<_n)throw Error(`yargs parser supports a minimum Node.js version of ${_n}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Ti=process?process.env:{},wn=new Ue({cwd:process.cwd,env:()=>Ti,format:bn.format,normalize:be.normalize,resolve:be.resolve,require:s=>{if(typeof require!="undefined")return require(s);if(s.match(/\.json$/))return JSON.parse((0,On.readFileSync)(s,"utf8"));throw Error("only .json config files are supported in ESM")}}),oe=function(t,e){return wn.parse(t.slice(),e).argv};oe.detailed=function(s,t){return wn.parse(s.slice(),t)};oe.camelCase=Ut;oe.decamelize=me;oe.looksLikeNumber=ge;var yn=oe;var yt=require("path");function Hi(){return vi()?0:1}function vi(){return Yi()&&!process.defaultApp}function Yi(){return!!process.versions.electron}function Cn(){return process.argv[Hi()]}var q=class extends Error{constructor(t){super(t||"yargs error");this.name="YError",Error.captureStackTrace(this,q)}};var kt=require("fs"),jn=require("util"),En=require("path"),xn={fs:{readFileSync:kt.readFileSync,writeFile:kt.writeFile},format:jn.format,resolve:En.resolve,exists:s=>{try{return(0,kt.statSync)(s).isFile()}catch(t){return!1}}};var wt,An=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 e=t.shift(),n=function(){};return typeof t[t.length-1]=="function"&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),wt.format.apply(wt.format,[this.cache[this.locale][e]||e].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),e=t.shift(),n=t.shift(),i=t.shift(),o=function(){};typeof t[t.length-1]=="function"&&(o=t.pop()),this.cache[this.locale]||this._readLocaleFile();let a=i===1?e:n;this.cache[this.locale][e]&&(a=this.cache[this.locale][e][i===1?"one":"other"]),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:o})):o();let c=[a];return~a.indexOf("%d")&&c.push(i),wt.format.apply(wt.format,c.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.cache[this.locale][e]=t[e])}_taggedLiteral(t,...e){let n="";return t.forEach(function(i,o){let a=e[o+1];n+=i,typeof a!="undefined"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(e,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,e=this.writeQueue[0],n=e.directory,i=e.locale,o=e.cb,a=this._resolveLocaleFile(n,i),c=JSON.stringify(this.cache[i],null,2);wt.fs.writeFile(a,c,"utf-8",function(p){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),o(p)})}_readLocaleFile(){let t={},e=this._resolveLocaleFile(this.directory,this.locale);try{wt.fs.readFileSync&&(t=JSON.parse(wt.fs.readFileSync(e,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+e),n.code==="ENOENT")t={};else throw n}this.cache[this.locale]=t}_resolveLocaleFile(t,e){let n=wt.resolve(t,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~e.lastIndexOf("_")){let i=wt.resolve(t,"./",e.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(t){return wt.exists(t)}};function Pn(s,t){wt=t;let e=new An(s);return{__:e.__.bind(e),__n:e.__n.bind(e),setLocale:e.setLocale.bind(e),getLocale:e.getLocale.bind(e),updateLocale:e.updateLocale.bind(e),locale:e.locale}}var Bi=s=>Pn(s,xn),Mn=Bi;var Gi="require is not supported by ESM",Nn="loading a directory of commands is not supported yet for ESM",_e;try{_e=(0,$n.fileURLToPath)(U)}catch(s){_e=process.cwd()}var Vi=_e.split("node_modules")[0],Fn={assert:{notStrictEqual:Oe.notStrictEqual,strictEqual:Oe.strictEqual},cliui:De,findUp:pn,getEnv:s=>process.env[s],inspect:Sn.inspect,getCallerFile:()=>{throw new q(Nn)},getProcessArgvBin:Cn,mainFilename:Vi||process.cwd(),Parser:yn,path:{basename:yt.basename,dirname:yt.dirname,extname:yt.extname,relative:yt.relative,resolve:yt.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(s,t)=>process.emitWarning(s,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns!="undefined"?process.stdout.columns:null},readFileSync:In.readFileSync,require:()=>{throw new q(Gi)},requireDirectory:()=>{throw new q(Nn)},stringWidth:s=>[...s].length,y18n:Mn({directory:(0,yt.resolve)(_e,"../../../locales"),updateFiles:!1})};function at(s,t,e,n){e.assert.notStrictEqual(s,t,n)}function ze(s,t){t.assert.strictEqual(typeof s,"string")}function te(s){return Object.keys(s)}function J(s){return!!s&&!!s.then&&typeof s.then=="function"}function Mt(s){let e=s.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=e.shift();if(!i)throw new Error(`No command found in: ${s}`);let o={cmd:i.replace(n,""),demanded:[],optional:[]};return e.forEach((a,c)=>{let p=!1;a=a.replace(/\s/g,""),/\.+[\]>]/.test(a)&&c===e.length-1&&(p=!0),/^\[/.test(a)?o.optional.push({cmd:a.replace(n,"").split("|"),variadic:p}):o.demanded.push({cmd:a.replace(n,"").split("|"),variadic:p})}),o}var qi=["first","second","third","fourth","fifth","sixth"];function E(s,t,e){function n(){return typeof s=="object"?[{demanded:[],optional:[]},s,t]:[Mt(`cmd ${s}`),t,e]}try{let i=0,[o,a,c]=n(),p=[].slice.call(a);for(;p.length&&p[p.length-1]===void 0;)p.pop();let O=c||p.length;if(O<o.demanded.length)throw new q(`Not enough arguments provided. Expected ${o.demanded.length} but received ${p.length}.`);let b=o.demanded.length+o.optional.length;if(O>b)throw new q(`Too many arguments provided. Expected max ${b} but received ${O}.`);o.demanded.forEach(f=>{let g=p.shift(),w=Ln(g);f.cmd.filter(y=>y===w||y==="*").length===0&&Rn(w,f.cmd,i),i+=1}),o.optional.forEach(f=>{if(p.length===0)return;let g=p.shift(),w=Ln(g);f.cmd.filter(y=>y===w||y==="*").length===0&&Rn(w,f.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function Ln(s){return Array.isArray(s)?"array":s===null?"null":typeof s}function Rn(s,t,e){throw new q(`Invalid ${qi[e]||"manyith"} argument. Expected ${t.join(" or ")} but received ${s}.`)}var Te=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,n=!0,i=!1){if(E("<array|function> [boolean] [boolean] [boolean]",[t,e,n],arguments.length),Array.isArray(t)){for(let o=0;o<t.length;o++){if(typeof t[o]!="function")throw Error("middleware must be a function");let a=t[o];a.applyBeforeValidation=e,a.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let o=t;o.applyBeforeValidation=e,o.global=n,o.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let o=[...n[e]||[],e];return i.option?!o.includes(i.option):!0}),t.option=e,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 Dn(s){return s?s.map(t=>(t.applyBeforeValidation=!1,t)):[]}function Wt(s,t,e,n){return e.reduce((i,o)=>{if(o.applyBeforeValidation!==n)return i;if(o.mutates){if(o.applied)return i;o.applied=!0}if(J(i))return i.then(a=>Promise.all([a,o(a,t)])).then(([a,c])=>Object.assign(a,c));{let a=o(i,t);return J(a)?a.then(c=>Object.assign(i,c)):Object.assign(i,a)}},s)}function zt(s,t,e=n=>{throw n}){try{let n=Ki(s)?s():s;return J(n)?n.then(i=>t(i)):t(n)}catch(n){return e(n)}}function Ki(s){return typeof s=="function"}function He(s){if(typeof require=="undefined")return null;for(let t=0,e=Object.keys(require.cache),n;t<e.length;t++)if(n=require.cache[e[t]],n.exports===s)return n;return null}var ee=/(^\*)|(^\$0)/,Un=class{constructor(t,e,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=n,this.validation=e}addDirectory(t,e,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let o=typeof i.visit=="function"?i.visit:a=>a;i.visit=(a,c,p)=>{let O=o(a,c,p);if(O){if(this.requireCache.has(c))return O;this.requireCache.add(c),this.addHandler(O)}return O},this.shim.requireDirectory({require:e,filename:n},t,i)}addHandler(t,e,n,i,o,a){let c=[],p=Dn(o);if(i=i||(()=>{}),Array.isArray(t))if(Ji(t))[t,...c]=t;else for(let O of t)this.addHandler(O);else if(Zi(t)){let O=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(O=[].concat(O).concat(t.aliases)),this.addHandler(O,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(zn(n)){this.addHandler([t].concat(c),e,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof t=="string"){let O=Mt(t);c=c.map(g=>Mt(g).cmd);let b=!1,f=[O.cmd].concat(c).filter(g=>ee.test(g)?(b=!0,!1):!0);f.length===0&&b&&f.push("$0"),b&&(O.cmd=f[0],c=f.slice(1),t=t.replace(ee,O.cmd)),c.forEach(g=>{this.aliasMap[g]=O.cmd}),e!==!1&&this.usage.command(t,e,b,c,a),this.handlers[O.cmd]={original:t,description:e,handler:i,builder:n||{},middlewares:p,deprecated:a,demanded:O.demanded,optional:O.optional},b&&(this.defaultCommand=this.handlers[O.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,n,i,o,a){let c=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,p=e.getInternalMethods().getContext(),O=p.commands.slice(),b=!t;t&&(p.commands.push(t),p.fullCommands.push(c.original));let f=this.applyBuilderUpdateUsageAndParse(b,c,e,n.aliases,O,i,o,a);return J(f)?f.then(g=>this.applyMiddlewareAndGetResult(b,c,g.innerArgv,p,o,g.aliases,e)):this.applyMiddlewareAndGetResult(b,c,f.innerArgv,p,o,f.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,n,i,o,a,c,p){let O=e.builder,b=n;if(we(O)){let f=O(n.getInternalMethods().reset(i),p);if(J(f))return f.then(g=>(b=Tn(g)?g:n,this.parseAndUpdateUsage(t,e,b,o,a,c)))}else Qi(O)&&(b=n.getInternalMethods().reset(i),Object.keys(e.builder).forEach(f=>{b.option(f,O[f])}));return this.parseAndUpdateUsage(t,e,b,o,a,c)}parseAndUpdateUsage(t,e,n,i,o,a){t&&n.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,e),e.description);let c=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,a);return J(c)?c.then(p=>({aliases:n.parsed.aliases,innerArgv:p})):{aliases:n.parsed.aliases,innerArgv:c}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,e){let n=ee.test(e.original)?e.original.replace(ee,"").trim():e.original,i=t.filter(o=>!ee.test(o));return i.push(n),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(t,e,n,i,o,a,c){let p={};if(o)return n;c.getInternalMethods().getHasOutput()||(p=this.populatePositionals(e,n,i,c));let O=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares);if(n=Wt(n,c,O,!0),!c.getInternalMethods().getHasOutput()){let b=c.getInternalMethods().runValidation(a,p,c.parsed.error,t);n=zt(n,f=>(b(f),f))}if(e.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let b=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,b,!1,!1),n=Wt(n,c,O,!1),n=zt(n,f=>{let g=e.handler(f);return J(g)?g.then(()=>f):f}),t||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),J(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(f=>{try{c.getInternalMethods().getUsageInstance().fail(null,f)}catch(g){}})}return t||(i.commands.pop(),i.fullCommands.pop()),n}populatePositionals(t,e,n,i){e._=e._.slice(n.commands.length);let o=t.demanded.slice(0),a=t.optional.slice(0),c={};for(this.validation.positionalCount(o.length,e._.length);o.length;){let p=o.shift();this.populatePositional(p,e,c)}for(;a.length;){let p=a.shift();this.populatePositional(p,e,c)}return e._=n.commands.concat(e._.map(p=>""+p)),this.postProcessPositionals(e,c,this.cmdToParseOptions(t.original),i),c}populatePositional(t,e,n){let i=t.cmd[0];t.variadic?n[i]=e._.splice(0).map(String):e._.length&&(n[i]=[String(e._.shift())])}cmdToParseOptions(t){let e={array:[],default:{},alias:{},demand:{}},n=Mt(t);return n.demanded.forEach(i=>{let[o,...a]=i.cmd;i.variadic&&(e.array.push(o),e.default[o]=[]),e.alias[o]=a,e.demand[o]=!0}),n.optional.forEach(i=>{let[o,...a]=i.cmd;i.variadic&&(e.array.push(o),e.default[o]=[]),e.alias[o]=a}),e}postProcessPositionals(t,e,n,i){let o=Object.assign({},i.getOptions());o.default=Object.assign(n.default,o.default);for(let O of Object.keys(n.alias))o.alias[O]=(o.alias[O]||[]).concat(n.alias[O]);o.array=o.array.concat(n.array),o.config={};let a=[];if(Object.keys(e).forEach(O=>{e[O].map(b=>{o.configuration["unknown-options-as-args"]&&(o.key[O]=!0),a.push(`--${O}`),a.push(b)})}),!a.length)return;let c=Object.assign({},o.configuration,{"populate--":!1}),p=this.shim.Parser.detailed(a,Object.assign({},o,{configuration:c}));if(p.error)i.getInternalMethods().getUsageInstance().fail(p.error.message,p.error);else{let O=Object.keys(e);Object.keys(e).forEach(f=>{O.push(...p.aliases[f])});let b=i.getOptions().default;Object.keys(p.argv).forEach(f=>{O.includes(f)&&(e[f]||(e[f]=p.argv[f]),!Object.prototype.hasOwnProperty.call(b,f)&&Object.prototype.hasOwnProperty.call(t,f)&&Object.prototype.hasOwnProperty.call(p.argv,f)&&(Array.isArray(t[f])||Array.isArray(p.argv[f]))?t[f]=[].concat(t[f],p.argv[f]):t[f]=p.argv[f])})}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let n=ee.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let e=this.defaultCommand.builder;if(we(e))return e(t,!0);zn(e)||Object.keys(e).forEach(n=>{t.option(n,e[n])})}moduleName(t){let e=He(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:n}){for(let i of[t,e,n]){if(typeof i=="string"||i===!1)return i;at(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();at(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 Wn(s,t,e,n){return new Un(s,t,e,n)}function zn(s){return typeof s=="object"&&!!s.builder&&typeof s.handler=="function"}function Ji(s){return s.every(t=>typeof t=="string")}function we(s){return typeof s=="function"}function Qi(s){return typeof s=="object"}function Zi(s){return typeof s=="object"&&!Array.isArray(s)}function St(s={},t=()=>!0){let e={};return te(s).forEach(n=>{t(n,s[n])&&(e[n]=s[n])}),e}function It(s){typeof process!="undefined"&&[process.stdout,process.stderr].forEach(t=>{let e=t;e._handle&&e.isTTY&&typeof e._handle.setBlocking=="function"&&e._handle.setBlocking(s)})}function Xi(s){return typeof s=="boolean"}function Hn(s,t){let e=t.y18n.__,n={},i=[];n.failFn=function(C){i.push(C)};let o=null,a=!0;n.showHelpOnFail=function(C=!0,$){function R(){return typeof C=="string"?[!0,C]:[C,$]}let[V,tt]=R();return o=tt,a=V,n};let c=!1;n.fail=function(C,$){let R=s.getInternalMethods().getLoggerInstance();if(i.length)for(let V=i.length-1;V>=0;--V){let tt=i[V];if(Xi(tt)){if($)throw $;if(C)throw Error(C)}else tt(C,$,n)}else{if(s.getExitProcess()&&It(!0),c||(c=!0,a&&(s.showHelp("error"),R.error()),(C||$)&&R.error(C||$),o&&((C||$)&&R.error(""),R.error(o))),$=$||new q(C),s.getExitProcess())return s.exit(1);if(s.getInternalMethods().hasParseCallback())return s.exit(1,$);throw $}};let p=[],O=!1;n.usage=(A,C)=>A===null?(O=!0,p=[],n):(O=!1,p.push([A,C||""]),n),n.getUsage=()=>p,n.getUsageDisabled=()=>O,n.getPositionalGroupName=()=>e("Positionals:");let b=[];n.example=(A,C)=>{b.push([A,C||""])};let f=[];n.command=function(C,$,R,V,tt=!1){R&&(f=f.map(H=>(H[2]=!1,H))),f.push([C,$||"",R,V,tt])},n.getCommands=()=>f;let g={};n.describe=function(C,$){Array.isArray(C)?C.forEach(R=>{n.describe(R,$)}):typeof C=="object"?Object.keys(C).forEach(R=>{n.describe(R,C[R])}):g[C]=$},n.getDescriptions=()=>g;let w=[];n.epilog=A=>{w.push(A)};let S=!1,y;n.wrap=A=>{S=!0,y=A};function d(){return S||(y=Zt(),S=!0),y}let W="__yargsString__:";n.deferY18nLookup=A=>W+A,n.help=function(){if(v)return v;Y();let C=s.customScriptName?s.$0:t.path.basename(s.$0),$=s.getDemandedOptions(),R=s.getDemandedCommands(),V=s.getDeprecatedOptions(),tt=s.getGroups(),H=s.getOptions(),it=[];it=it.concat(Object.keys(g)),it=it.concat(Object.keys($)),it=it.concat(Object.keys(R)),it=it.concat(Object.keys(H.default)),it=it.filter(Pt),it=Object.keys(it.reduce((N,K)=>(K!=="_"&&(N[K]=!0),N),{}));let Rt=d(),Q=t.cliui({width:Rt,wrap:!!Rt});if(!O){if(p.length)p.forEach(N=>{Q.div({text:`${N[0].replace(/\$0/g,C)}`}),N[1]&&Q.div({text:`${N[1]}`,padding:[1,0,0,0]})}),Q.div();else if(f.length){let N=null;R._?N=`${C} <${e("command")}>
7
- `:N=`${C} [${e("command")}]
8
- `,Q.div(`${N}`)}}if(f.length>1||f.length===1&&!f[0][2]){Q.div(e("Commands:"));let N=s.getInternalMethods().getContext(),K=N.commands.length?`${N.commands.join(" ")} `:"";s.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(f=f.sort((z,X)=>z[0].localeCompare(X[0])));let Z=C?`${C} `:"";f.forEach(z=>{let X=`${Z}${K}${z[0].replace(/^\$0 ?/,"")}`;Q.span({text:X,padding:[0,2,0,2],width:T(f,Rt,`${C}${K}`)+4},{text:z[1]});let et=[];z[2]&&et.push(`[${e("default")}]`),z[3]&&z[3].length&&et.push(`[${e("aliases:")} ${z[3].join(", ")}]`),z[4]&&(typeof z[4]=="string"?et.push(`[${e("deprecated: %s",z[4])}]`):et.push(`[${e("deprecated")}]`)),et.length?Q.div({text:et.join(" "),padding:[0,0,0,2],align:"right"}):Q.div()}),Q.div()}let Et=(Object.keys(H.alias)||[]).concat(Object.keys(s.parsed.newAliases)||[]);it=it.filter(N=>!s.parsed.newAliases[N]&&Et.every(K=>(H.alias[K]||[]).indexOf(N)===-1));let xt=e("Options:");tt[xt]||(tt[xt]=[]),B(it,H.alias,tt,xt);let Dt=N=>/^--/.test(ye(N)),F=Object.keys(tt).filter(N=>tt[N].length>0).map(N=>{let K=tt[N].filter(Pt).map(Z=>{if(Et.includes(Z))return Z;for(let z=0,X;(X=Et[z])!==void 0;z++)if((H.alias[X]||[]).includes(Z))return X;return Z});return{groupName:N,normalizedKeys:K}}).filter(({normalizedKeys:N})=>N.length>0).map(({groupName:N,normalizedKeys:K})=>{let Z=K.reduce((z,X)=>(z[X]=[X].concat(H.alias[X]||[]).map(et=>N===n.getPositionalGroupName()?et:(/^[0-9]$/.test(et)?H.boolean.includes(X)?"-":"--":et.length>1?"--":"-")+et).sort((et,Ot)=>Dt(et)===Dt(Ot)?0:Dt(et)?1:-1).join(", "),z),{});return{groupName:N,normalizedKeys:K,switches:Z}});if(F.filter(({groupName:N})=>N!==n.getPositionalGroupName()).some(({normalizedKeys:N,switches:K})=>!N.every(Z=>Dt(K[Z])))&&F.filter(({groupName:N})=>N!==n.getPositionalGroupName()).forEach(({normalizedKeys:N,switches:K})=>{N.forEach(Z=>{Dt(K[Z])&&(K[Z]=ki(K[Z],"-x, ".length))})}),F.forEach(({groupName:N,normalizedKeys:K,switches:Z})=>{Q.div(N),K.forEach(z=>{let X=Z[z],et=g[z]||"",Ot=null;et.includes(W)&&(et=e(et.substring(W.length))),H.boolean.includes(z)&&(Ot=`[${e("boolean")}]`),H.count.includes(z)&&(Ot=`[${e("count")}]`),H.string.includes(z)&&(Ot=`[${e("string")}]`),H.normalize.includes(z)&&(Ot=`[${e("string")}]`),H.array.includes(z)&&(Ot=`[${e("array")}]`),H.number.includes(z)&&(Ot=`[${e("number")}]`);let _t=l=>typeof l=="string"?`[${e("deprecated: %s",l)}]`:`[${e("deprecated")}]`,he=[z in V?_t(V[z]):null,Ot,z in $?`[${e("required")}]`:null,H.choices&&H.choices[z]?`[${e("choices:")} ${n.stringifiedValues(H.choices[z])}]`:null,bt(H.default[z],H.defaultDescription[z])].filter(Boolean).join(" ");Q.span({text:ye(X),padding:[0,2,0,2+vn(X)],width:T(Z,Rt)+4},et),he?Q.div({text:he,padding:[0,0,0,2],align:"right"}):Q.div()}),Q.div()}),b.length&&(Q.div(e("Examples:")),b.forEach(N=>{N[0]=N[0].replace(/\$0/g,C)}),b.forEach(N=>{N[1]===""?Q.div({text:N[0],padding:[0,2,0,2]}):Q.div({text:N[0],padding:[0,2,0,2],width:T(b,Rt)+4},{text:N[1]})}),Q.div()),w.length>0){let N=w.map(K=>K.replace(/\$0/g,C)).join(`
9
- `);Q.div(`${N}
10
- `)}return Q.toString().replace(/\s*$/,"")};function T(A,C,$){let R=0;return Array.isArray(A)||(A=Object.values(A).map(V=>[V])),A.forEach(V=>{R=Math.max(t.stringWidth($?`${$} ${ye(V[0])}`:ye(V[0]))+vn(V[0]),R)}),C&&(R=Math.min(R,parseInt((C*.5).toString(),10))),R}function Y(){let A=s.getDemandedOptions(),C=s.getOptions();(Object.keys(C.alias)||[]).forEach($=>{C.alias[$].forEach(R=>{g[R]&&n.describe($,g[R]),R in A&&s.demandOption($,A[R]),C.boolean.includes(R)&&s.boolean($),C.count.includes(R)&&s.count($),C.string.includes(R)&&s.string($),C.normalize.includes(R)&&s.normalize($),C.array.includes(R)&&s.array($),C.number.includes(R)&&s.number($)})})}let v;n.cacheHelpMessage=function(){v=this.help()},n.clearCachedHelpMessage=function(){v=void 0},n.hasCachedHelpMessage=function(){return!!v};function B(A,C,$,R){let V=[],tt=null;return Object.keys($).forEach(H=>{V=V.concat($[H])}),A.forEach(H=>{tt=[H].concat(C[H]),tt.some(it=>V.indexOf(it)!==-1)||$[R].push(H)}),V}function Pt(A){return s.getOptions().hiddenOptions.indexOf(A)<0||s.parsed.argv[s.getOptions().showHiddenOpt]}n.showHelp=A=>{let C=s.getInternalMethods().getLoggerInstance();A||(A="error"),(typeof A=="function"?A:C[A])(n.help())},n.functionDescription=A=>{let C=A.name?t.Parser.decamelize(A.name,"-"):e("generated-value");return["(",C,")"].join("")},n.stringifiedValues=function(C,$){let R="",V=$||", ",tt=[].concat(C);return!C||!tt.length||tt.forEach(H=>{R.length&&(R+=V),R+=JSON.stringify(H)}),R};function bt(A,C){let $=`[${e("default:")} `;if(A===void 0&&!C)return null;if(C)$+=C;else switch(typeof A){case"string":$+=`"${A}"`;break;case"object":$+=JSON.stringify(A);break;default:$+=A}return`${$}]`}function Zt(){let A=80;return t.process.stdColumns?Math.min(A,t.process.stdColumns):A}let Lt=null;n.version=A=>{Lt=A},n.showVersion=A=>{let C=s.getInternalMethods().getLoggerInstance();A||(A="error"),(typeof A=="function"?A:C[A])(Lt)},n.reset=function(C){return o=null,c=!1,p=[],O=!1,w=[],b=[],f=[],g=St(g,$=>!C[$]),n};let G=[];return n.freeze=function(){G.push({failMessage:o,failureOutput:c,usages:p,usageDisabled:O,epilogs:w,examples:b,commands:f,descriptions:g})},n.unfreeze=function(){let C=G.pop();!C||({failMessage:o,failureOutput:c,usages:p,usageDisabled:O,epilogs:w,examples:b,commands:f,descriptions:g}=C)},n}function ve(s){return typeof s=="object"}function ki(s,t){return ve(s)?{text:s.text,indentation:s.indentation+t}:{text:s,indentation:t}}function vn(s){return ve(s)?s.indentation:0}function ye(s){return ve(s)?s.text:s}var Yn=`###-begin-{{app_name}}-completions-###
1
+ var bl=Object.create;var xn=Object.defineProperty;var wl=Object.getOwnPropertyDescriptor;var Al=Object.getOwnPropertyNames;var xl=Object.getPrototypeOf,Cl=Object.prototype.hasOwnProperty;var Ol=(e,t,n)=>t in e?xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var jr=e=>xn(e,"__esModule",{value:!0});var vl=(e,t)=>()=>(e&&(t=e(e=0)),t);var El=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_l=(e,t)=>{for(var n in t)xn(e,n,{get:t[n],enumerable:!0})},Ir=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Al(t))!Cl.call(e,r)&&(n||r!=="default")&&xn(e,r,{get:()=>t[r],enumerable:!(i=wl(t,r))||i.enumerable});return e},Q=(e,t)=>Ir(jr(xn(e!=null?bl(xl(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Sl=(e=>(t,n)=>e&&e.get(t)||(n=Ir(jr({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var Mr=(e,t,n)=>(Ol(e,typeof t!="symbol"?t+"":t,n),n),Pl=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var ce=(e,t,n)=>(Pl(e,t,"read from private field"),n?n.call(e):t.get(e)),Ve=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};var jl,O,g=vl(()=>{jl=()=>typeof document=="undefined"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,O=jl()});var aa=El((Dn,gn)=>{g();var Lu=200,hr="__lodash_hash_undefined__",Fs=1,pi=2,Ls=9007199254740991,hi="[object Arguments]",mr="[object Array]",Ds="[object Boolean]",Ns="[object Date]",Ts="[object Error]",Us="[object Function]",Du="[object GeneratorFunction]",mi="[object Map]",Rs="[object Number]",hn="[object Object]",$s="[object Promise]",Ws="[object RegExp]",gi="[object Set]",ks="[object String]",Nu="[object Symbol]",gr="[object WeakMap]",Hs="[object ArrayBuffer]",yi="[object DataView]",Tu="[object Float32Array]",Uu="[object Float64Array]",Ru="[object Int8Array]",$u="[object Int16Array]",Wu="[object Int32Array]",ku="[object Uint8Array]",Hu="[object Uint8ClampedArray]",Yu="[object Uint16Array]",Gu="[object Uint32Array]",Bu=/[\\^$.*+?()[\]{}|]/g,qu=/^\[object .+?Constructor\]$/,zu=/^(?:0|[1-9]\d*)$/,X={};X[Tu]=X[Uu]=X[Ru]=X[$u]=X[Wu]=X[ku]=X[Hu]=X[Yu]=X[Gu]=!0;X[hi]=X[mr]=X[Hs]=X[Ds]=X[yi]=X[Ns]=X[Ts]=X[Us]=X[mi]=X[Rs]=X[hn]=X[Ws]=X[gi]=X[ks]=X[gr]=!1;var Ys=typeof global=="object"&&global&&global.Object===Object&&global,Vu=typeof self=="object"&&self&&self.Object===Object&&self,yt=Ys||Vu||Function("return this")(),Gs=typeof Dn=="object"&&Dn&&!Dn.nodeType&&Dn,Bs=Gs&&typeof gn=="object"&&gn&&!gn.nodeType&&gn,Qu=Bs&&Bs.exports===Gs,qs=Qu&&Ys.process,zs=function(){try{return qs&&qs.binding("util")}catch(e){}}(),Vs=zs&&zs.isTypedArray;function Ku(e,t){for(var n=-1,i=e?e.length:0;++n<i;)if(t(e[n],n,e))return!0;return!1}function Ju(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function Zu(e){return function(t){return e(t)}}function Xu(e,t){return e==null?void 0:e[t]}function yr(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function ed(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function td(e,t){return function(n){return e(t(n))}}function nd(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var id=Array.prototype,rd=Function.prototype,bi=Object.prototype,br=yt["__core-js_shared__"],Qs=function(){var e=/[^.]+$/.exec(br&&br.keys&&br.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ks=rd.toString,st=bi.hasOwnProperty,Mn=bi.toString,od=RegExp("^"+Ks.call(st).replace(Bu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Js=yt.Symbol,Zs=yt.Uint8Array,sd=bi.propertyIsEnumerable,ad=id.splice,ld=td(Object.keys,Object),wr=mn(yt,"DataView"),Fn=mn(yt,"Map"),Ar=mn(yt,"Promise"),xr=mn(yt,"Set"),Cr=mn(yt,"WeakMap"),Ln=mn(Object,"create"),cd=Kt(wr),fd=Kt(Fn),ud=Kt(Ar),dd=Kt(xr),pd=Kt(Cr),Xs=Js?Js.prototype:void 0,Or=Xs?Xs.valueOf:void 0;function Vt(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 hd(){this.__data__=Ln?Ln(null):{}}function md(e){return this.has(e)&&delete this.__data__[e]}function gd(e){var t=this.__data__;if(Ln){var n=t[e];return n===hr?void 0:n}return st.call(t,e)?t[e]:void 0}function yd(e){var t=this.__data__;return Ln?t[e]!==void 0:st.call(t,e)}function bd(e,t){var n=this.__data__;return n[e]=Ln&&t===void 0?hr:t,this}Vt.prototype.clear=hd;Vt.prototype.delete=md;Vt.prototype.get=gd;Vt.prototype.has=yd;Vt.prototype.set=bd;function at(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 wd(){this.__data__=[]}function Ad(e){var t=this.__data__,n=Ai(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():ad.call(t,n,1),!0}function xd(e){var t=this.__data__,n=Ai(t,e);return n<0?void 0:t[n][1]}function Cd(e){return Ai(this.__data__,e)>-1}function Od(e,t){var n=this.__data__,i=Ai(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}at.prototype.clear=wd;at.prototype.delete=Ad;at.prototype.get=xd;at.prototype.has=Cd;at.prototype.set=Od;function Qt(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 vd(){this.__data__={hash:new Vt,map:new(Fn||at),string:new Vt}}function Ed(e){return xi(this,e).delete(e)}function _d(e){return xi(this,e).get(e)}function Sd(e){return xi(this,e).has(e)}function Pd(e,t){return xi(this,e).set(e,t),this}Qt.prototype.clear=vd;Qt.prototype.delete=Ed;Qt.prototype.get=_d;Qt.prototype.has=Sd;Qt.prototype.set=Pd;function wi(e){var t=-1,n=e?e.length:0;for(this.__data__=new Qt;++t<n;)this.add(e[t])}function jd(e){return this.__data__.set(e,hr),this}function Id(e){return this.__data__.has(e)}wi.prototype.add=wi.prototype.push=jd;wi.prototype.has=Id;function bt(e){this.__data__=new at(e)}function Md(){this.__data__=new at}function Fd(e){return this.__data__.delete(e)}function Ld(e){return this.__data__.get(e)}function Dd(e){return this.__data__.has(e)}function Nd(e,t){var n=this.__data__;if(n instanceof at){var i=n.__data__;if(!Fn||i.length<Lu-1)return i.push([e,t]),this;n=this.__data__=new Qt(i)}return n.set(e,t),this}bt.prototype.clear=Md;bt.prototype.delete=Fd;bt.prototype.get=Ld;bt.prototype.has=Dd;bt.prototype.set=Nd;function Td(e,t){var n=vr(e)||Vd(e)?Ju(e.length,String):[],i=n.length,r=!!i;for(var o in e)(t||st.call(e,o))&&!(r&&(o=="length"||Gd(o,i)))&&n.push(o);return n}function Ai(e,t){for(var n=e.length;n--;)if(na(e[n][0],t))return n;return-1}function Ud(e){return Mn.call(e)}function ea(e,t,n,i,r){return e===t?!0:e==null||t==null||!Er(e)&&!_r(t)?e!==e&&t!==t:Rd(e,t,ea,n,i,r)}function Rd(e,t,n,i,r,o){var s=vr(e),a=vr(t),l=mr,u=mr;s||(l=wt(e),l=l==hi?hn:l),a||(u=wt(t),u=u==hi?hn:u);var d=l==hn&&!yr(e),f=u==hn&&!yr(t),p=l==u;if(p&&!d)return o||(o=new bt),s||Jd(e)?ta(e,t,n,i,r,o):Hd(e,t,l,n,i,r,o);if(!(r&pi)){var y=d&&st.call(e,"__wrapped__"),C=f&&st.call(t,"__wrapped__");if(y||C){var A=y?e.value():e,m=C?t.value():t;return o||(o=new bt),n(A,m,i,r,o)}}return p?(o||(o=new bt),Yd(e,t,n,i,r,o)):!1}function $d(e){if(!Er(e)||qd(e))return!1;var t=ra(e)||yr(e)?od:qu;return t.test(Kt(e))}function Wd(e){return _r(e)&&oa(e.length)&&!!X[Mn.call(e)]}function kd(e){if(!zd(e))return ld(e);var t=[];for(var n in Object(e))st.call(e,n)&&n!="constructor"&&t.push(n);return t}function ta(e,t,n,i,r,o){var s=r&pi,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var d=-1,f=!0,p=r&Fs?new wi:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var y=e[d],C=t[d];if(i)var A=s?i(C,y,d,t,e,o):i(y,C,d,e,t,o);if(A!==void 0){if(A)continue;f=!1;break}if(p){if(!Ku(t,function(m,P){if(!p.has(P)&&(y===m||n(y,m,i,r,o)))return p.add(P)})){f=!1;break}}else if(!(y===C||n(y,C,i,r,o))){f=!1;break}}return o.delete(e),o.delete(t),f}function Hd(e,t,n,i,r,o,s){switch(n){case yi:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Hs:return!(e.byteLength!=t.byteLength||!i(new Zs(e),new Zs(t)));case Ds:case Ns:case Rs:return na(+e,+t);case Ts:return e.name==t.name&&e.message==t.message;case Ws:case ks:return e==t+"";case mi:var a=ed;case gi:var l=o&pi;if(a||(a=nd),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;o|=Fs,s.set(e,t);var d=ta(a(e),a(t),i,r,o,s);return s.delete(e),d;case Nu:if(Or)return Or.call(e)==Or.call(t)}return!1}function Yd(e,t,n,i,r,o){var s=r&pi,a=sa(e),l=a.length,u=sa(t),d=u.length;if(l!=d&&!s)return!1;for(var f=l;f--;){var p=a[f];if(!(s?p in t:st.call(t,p)))return!1}var y=o.get(e);if(y&&o.get(t))return y==t;var C=!0;o.set(e,t),o.set(t,e);for(var A=s;++f<l;){p=a[f];var m=e[p],P=t[p];if(i)var E=s?i(P,m,p,t,e,o):i(m,P,p,e,t,o);if(!(E===void 0?m===P||n(m,P,i,r,o):E)){C=!1;break}A||(A=p=="constructor")}if(C&&!A){var G=e.constructor,B=t.constructor;G!=B&&"constructor"in e&&"constructor"in t&&!(typeof G=="function"&&G instanceof G&&typeof B=="function"&&B instanceof B)&&(C=!1)}return o.delete(e),o.delete(t),C}function xi(e,t){var n=e.__data__;return Bd(t)?n[typeof t=="string"?"string":"hash"]:n.map}function mn(e,t){var n=Xu(e,t);return $d(n)?n:void 0}var wt=Ud;(wr&&wt(new wr(new ArrayBuffer(1)))!=yi||Fn&&wt(new Fn)!=mi||Ar&&wt(Ar.resolve())!=$s||xr&&wt(new xr)!=gi||Cr&&wt(new Cr)!=gr)&&(wt=function(e){var t=Mn.call(e),n=t==hn?e.constructor:void 0,i=n?Kt(n):void 0;if(i)switch(i){case cd:return yi;case fd:return mi;case ud:return $s;case dd:return gi;case pd:return gr}return t});function Gd(e,t){return t=t==null?Ls:t,!!t&&(typeof e=="number"||zu.test(e))&&e>-1&&e%1==0&&e<t}function Bd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function qd(e){return!!Qs&&Qs in e}function zd(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||bi;return e===n}function Kt(e){if(e!=null){try{return Ks.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function na(e,t){return e===t||e!==e&&t!==t}function Vd(e){return Qd(e)&&st.call(e,"callee")&&(!sd.call(e,"callee")||Mn.call(e)==hi)}var vr=Array.isArray;function ia(e){return e!=null&&oa(e.length)&&!ra(e)}function Qd(e){return _r(e)&&ia(e)}function Kd(e,t,n){n=typeof n=="function"?n:void 0;var i=n?n(e,t):void 0;return i===void 0?ea(e,t,n):!!i}function ra(e){var t=Er(e)?Mn.call(e):"";return t==Us||t==Du}function oa(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ls}function Er(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function _r(e){return!!e&&typeof e=="object"}var Jd=Vs?Zu(Vs):Wd;function sa(e){return ia(e)?Td(e):kd(e)}gn.exports=Kd});var ep={};_l(ep,{uniformCLI:()=>Xd});g();g();g();var Vn=require("assert");g();g();var Il={right:Nl,center:Tl},Ml=0,Hn=1,Fl=2,Yn=3,Fr=class{constructor(t){var n;this.width=t.width,this.wrap=(n=t.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...t){let n=this.div(...t);n.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let n=t.map(i=>typeof i=="string"?this.colFromString(i):i);return this.rows.push(n),n}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let n=t.split(`
2
+ `).map(r=>r.split(" ")),i=0;return n.forEach(r=>{r.length>1&&De.stringWidth(r[0])>i&&(i=Math.min(Math.floor(this.width*.5),De.stringWidth(r[0])))}),n.forEach(r=>{this.div(...r.map((o,s)=>({text:o.trim(),padding:this.measurePadding(o),width:s===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=De.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 o="";i.forEach((s,a)=>{let{width:l}=t[a],u=this.negatePadding(t[a]),d=s;u>De.stringWidth(s)&&(d+=" ".repeat(u-De.stringWidth(s))),t[a].align&&t[a].align!=="left"&&this.wrap&&(d=Il[t[a].align](d,u),De.stringWidth(d)<u&&(d+=" ".repeat((l||0)-De.stringWidth(d)-1)));let f=t[a].padding||[0,0,0,0];f[Yn]&&(o+=" ".repeat(f[Yn])),o+=Lr(t[a],d,"| "),o+=d,o+=Lr(t[a],d," |"),f[Hn]&&(o+=" ".repeat(f[Hn])),r===0&&n.length>0&&(o=this.renderInline(o,n[n.length-1]))}),n.push({text:o.replace(/ +$/,""),span:t.span})}),n}renderInline(t,n){let i=t.match(/^ */),r=i?i[0].length:0,o=n.text,s=De.stringWidth(o.trimRight());return n.span?this.wrap?r<s?t:(n.hidden=!0,o.trimRight()+" ".repeat(r-s)+t.trimLeft()):(n.hidden=!0,o+t):t}rasterize(t){let n=[],i=this.columnWidths(t),r;return t.forEach((o,s)=>{o.width=i[s],this.wrap?r=De.wrap(o.text,this.negatePadding(o),{hard:!0}).split(`
4
+ `):r=o.text.split(`
5
+ `),o.border&&(r.unshift("."+"-".repeat(this.negatePadding(o)+2)+"."),r.push("'"+"-".repeat(this.negatePadding(o)+2)+"'")),o.padding&&(r.unshift(...new Array(o.padding[Ml]||0).fill("")),r.push(...new Array(o.padding[Fl]||0).fill(""))),r.forEach((a,l)=>{n[l]||n.push([]);let u=n[l];for(let d=0;d<s;d++)u[d]===void 0&&u.push("");u.push(a)})}),n}negatePadding(t){let n=t.width||0;return t.padding&&(n-=(t.padding[Yn]||0)+(t.padding[Hn]||0)),t.border&&(n-=4),n}columnWidths(t){if(!this.wrap)return t.map(s=>s.width||De.stringWidth(s.text));let n=t.length,i=this.width,r=t.map(s=>{if(s.width)return n--,i-=s.width,s.width}),o=n?Math.floor(i/n):0;return r.map((s,a)=>s===void 0?Math.max(o,Ll(t[a])):s)}};function Lr(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function Ll(e){let t=e.padding||[],n=1+(t[Yn]||0)+(t[Hn]||0);return e.border?n+4:n}function Dl(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Nl(e,t){e=e.trim();let n=De.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function Tl(e,t){e=e.trim();let n=De.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var De;function Dr(e,t){return De=t,new Fr({width:(e==null?void 0:e.width)||Dl(),wrap:e==null?void 0:e.wrap})}g();var Nr=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function Fi(e){return e.replace(Nr,"")}function Tr(e,t){let[n,i]=e.match(Nr)||["",""];e=Fi(e);let r="";for(let o=0;o<e.length;o++)o!==0&&o%t===0&&(r+=`
6
+ `),r+=e.charAt(o);return n&&i&&(r=`${n}${r}${i}`),r}function Li(e){return Dr(e,{stringWidth:t=>[...t].length,stripAnsi:Fi,wrap:Tr})}g();var tn=require("path"),Gn=require("fs");function Ur(e,t){let n=(0,tn.resolve)(".",e),i;for((0,Gn.statSync)(n).isDirectory()||(n=(0,tn.dirname)(n));;){if(i=t(n,(0,Gn.readdirSync)(n)),i)return(0,tn.resolve)(n,i);if(n=(0,tn.dirname)(i=n),i===n)break}}var Zr=require("util"),Xr=require("fs"),eo=require("url");g();var Wr=require("util"),zn=require("path");g();function Lt(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 o=r?r[0].length:0;o<e.length;o++){let s=e.charAt(o);i&&(i=!1,s=s.toUpperCase()),o!==0&&(s==="-"||s==="_")?i=!0:s!=="-"&&s!=="_"&&(n+=s)}return n}}function Bn(e,t){let n=e.toLowerCase();t=t||"-";let i="";for(let r=0;r<e.length;r++){let o=n.charAt(r),s=e.charAt(r);o!==s&&r>0?i+=`${t}${n.charAt(r)}`:i+=s}return i}function qn(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)}g();g();function Rr(e){if(Array.isArray(e))return e.map(s=>typeof s!="string"?s+"":s);e=e.trim();let t=0,n=null,i=null,r=null,o=[];for(let s=0;s<e.length;s++){if(n=i,i=e.charAt(s),i===" "&&!r){n!==" "&&t++;continue}i===r?r=null:(i==="'"||i==='"')&&!r&&(r=i),o[t]||(o[t]=""),o[t]+=i}return o}g();var $e;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})($e||($e={}));var it,Di=class{constructor(t){it=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=Rr(t),o=typeof t=="string",s=Ul(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),u=i.configObjects||[],d=i.envPrefix,f=a["populate--"],p=f?"--":"_",y=Object.create(null),C=Object.create(null),A=i.__||it.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:[]},P=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,E=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(i.array||[]).filter(Boolean).forEach(function(h){let w=typeof h=="object"?h.key:h,v=Object.keys(h).map(function(x){return{boolean:"bools",string:"strings",number:"numbers"}[x]}).filter(Boolean).pop();v&&(m[v][w]=!0),m.arrays[w]=!0,m.keys.push(w)}),[].concat(i.boolean||[]).filter(Boolean).forEach(function(h){m.bools[h]=!0,m.keys.push(h)}),[].concat(i.string||[]).filter(Boolean).forEach(function(h){m.strings[h]=!0,m.keys.push(h)}),[].concat(i.number||[]).filter(Boolean).forEach(function(h){m.numbers[h]=!0,m.keys.push(h)}),[].concat(i.count||[]).filter(Boolean).forEach(function(h){m.counts[h]=!0,m.keys.push(h)}),[].concat(i.normalize||[]).filter(Boolean).forEach(function(h){m.normalize[h]=!0,m.keys.push(h)}),typeof i.narg=="object"&&Object.entries(i.narg).forEach(([h,w])=>{typeof w=="number"&&(m.nargs[h]=w,m.keys.push(h))}),typeof i.coerce=="object"&&Object.entries(i.coerce).forEach(([h,w])=>{typeof w=="function"&&(m.coercions[h]=w,m.keys.push(h))}),typeof i.config!="undefined"&&(Array.isArray(i.config)||typeof i.config=="string"?[].concat(i.config).filter(Boolean).forEach(function(h){m.configs[h]=!0}):typeof i.config=="object"&&Object.entries(i.config).forEach(([h,w])=>{(typeof w=="boolean"||typeof w=="function")&&(m.configs[h]=w)})),Ft(i.key,s,i.default,m.arrays),Object.keys(l).forEach(function(h){(m.aliases[h]||[]).forEach(function(w){l[w]=l[h]})});let G=null;kn();let B=[],V=Object.assign(Object.create(null),{_:[]}),lt={};for(let h=0;h<r.length;h++){let w=r[h],v=w.replace(/^-{3,}/,"---"),x,b,F,S,D,pe;if(w!=="--"&&ie(w))Be(w);else if(v.match(/---+(=|$)/)){Be(w);continue}else if(w.match(/^--.+=/)||!a["short-option-groups"]&&w.match(/^-.+=/))S=w.match(/^--?([^=]+)=([\s\S]*)$/),S!==null&&Array.isArray(S)&&S.length>=3&&(R(S[1],m.arrays)?h=It(h,S[1],r,S[2]):R(S[1],m.nargs)!==!1?h=en(h,S[1],r,S[2]):K(S[1],S[2],!0));else if(w.match(E)&&a["boolean-negation"])S=w.match(E),S!==null&&Array.isArray(S)&&S.length>=2&&(b=S[1],K(b,R(b,m.arrays)?[!1]:!1));else if(w.match(/^--.+/)||!a["short-option-groups"]&&w.match(/^-[^-]+/))S=w.match(/^--?(.+)/),S!==null&&Array.isArray(S)&&S.length>=2&&(b=S[1],R(b,m.arrays)?h=It(h,b,r):R(b,m.nargs)!==!1?h=en(h,b,r):(D=r[h+1],D!==void 0&&(!D.match(/^-/)||D.match(P))&&!R(b,m.bools)&&!R(b,m.counts)||/^(true|false)$/.test(D)?(K(b,D),h++):K(b,re(b))));else if(w.match(/^-.\..+=/))S=w.match(/^-([^=]+)=([\s\S]*)$/),S!==null&&Array.isArray(S)&&S.length>=3&&K(S[1],S[2]);else if(w.match(/^-.\..+/)&&!w.match(P))D=r[h+1],S=w.match(/^-(.\..+)/),S!==null&&Array.isArray(S)&&S.length>=2&&(b=S[1],D!==void 0&&!D.match(/^-/)&&!R(b,m.bools)&&!R(b,m.counts)?(K(b,D),h++):K(b,re(b)));else if(w.match(/^-[^-]+/)&&!w.match(P)){F=w.slice(1,-1).split(""),x=!1;for(let Se=0;Se<F.length;Se++){if(D=w.slice(Se+2),F[Se+1]&&F[Se+1]==="="){pe=w.slice(Se+3),b=F[Se],R(b,m.arrays)?h=It(h,b,r,pe):R(b,m.nargs)!==!1?h=en(h,b,r,pe):K(b,pe),x=!0;break}if(D==="-"){K(F[Se],D);continue}if(/[A-Za-z]/.test(F[Se])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(D)&&R(D,m.bools)===!1){K(F[Se],D),x=!0;break}if(F[Se+1]&&F[Se+1].match(/\W/)){K(F[Se],D),x=!0;break}else K(F[Se],re(F[Se]))}b=w.slice(-1)[0],!x&&b!=="-"&&(R(b,m.arrays)?h=It(h,b,r):R(b,m.nargs)!==!1?h=en(h,b,r):(D=r[h+1],D!==void 0&&(!/^(-|--)[^-]/.test(D)||D.match(P))&&!R(b,m.bools)&&!R(b,m.counts)||/^(true|false)$/.test(D)?(K(b,D),h++):K(b,re(b))))}else if(w.match(/^-[0-9]$/)&&w.match(P)&&R(w.slice(1),m.bools))b=w.slice(1),K(b,re(b));else if(w==="--"){B=r.slice(h+1);break}else if(a["halt-at-non-option"]){B=r.slice(h);break}else Be(w)}z(V,!0),z(V,!1),H(V),se(),ne(V,m.aliases,l,!0),ue(V),a["set-placeholder-key"]&&Mt(V),Object.keys(m.counts).forEach(function(h){tt(V,h.split("."))||K(h,0)}),f&&B.length&&(V[p]=[]),B.forEach(function(h){V[p].push(h)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(V).filter(h=>h!=="--"&&h.includes("-")).forEach(h=>{delete V[h]}),a["strip-aliased"]&&[].concat(...Object.keys(s).map(h=>s[h])).forEach(h=>{a["camel-case-expansion"]&&h.includes("-")&&delete V[h.split(".").map(w=>Lt(w)).join(".")],delete V[h]});function Be(h){let w=T("_",h);(typeof w=="string"||typeof w=="number")&&V._.push(w)}function en(h,w,v,x){let b,F=R(w,m.nargs);if(F=typeof F!="number"||isNaN(F)?1:F,F===0)return ze(x)||(G=Error(A("Argument unexpected for: %s",w))),K(w,re(w)),h;let S=ze(x)?0:1;if(a["nargs-eats-options"])v.length-(h+1)+S<F&&(G=Error(A("Not enough arguments following: %s",w))),S=F;else{for(b=h+1;b<v.length&&(!v[b].match(/^-[^0-9]/)||v[b].match(P)||ie(v[b]));b++)S++;S<F&&(G=Error(A("Not enough arguments following: %s",w)))}let D=Math.min(S,F);for(!ze(x)&&D>0&&(K(w,x),D--),b=h+1;b<D+h+1;b++)K(w,v[b]);return h+D}function It(h,w,v,x){let b=[],F=x||v[h+1],S=R(w,m.nargs);if(R(w,m.bools)&&!/^(true|false)$/.test(F))b.push(!0);else if(ze(F)||ze(x)&&/^-/.test(F)&&!P.test(F)&&!ie(F)){if(l[w]!==void 0){let D=l[w];b=Array.isArray(D)?D:[D]}}else{ze(x)||b.push(_(w,x,!0));for(let D=h+1;D<v.length&&!(!a["greedy-arrays"]&&b.length>0||S&&typeof S=="number"&&b.length>=S||(F=v[D],/^-/.test(F)&&!P.test(F)&&!ie(F)));D++)h=D,b.push(_(w,F,o))}return typeof S=="number"&&(S&&b.length<S||isNaN(S)&&b.length===0)&&(G=Error(A("Not enough arguments following: %s",w))),K(w,b),h}function K(h,w,v=o){if(/-/.test(h)&&a["camel-case-expansion"]){let F=h.split(".").map(function(S){return Lt(S)}).join(".");M(h,F)}let x=_(h,w,v),b=h.split(".");nt(V,b,x),m.aliases[h]&&m.aliases[h].forEach(function(F){let S=F.split(".");nt(V,S,x)}),b.length>1&&a["dot-notation"]&&(m.aliases[b[0]]||[]).forEach(function(F){let S=F.split("."),D=[].concat(b);D.shift(),S=S.concat(D),(m.aliases[h]||[]).includes(S.join("."))||nt(V,S,x)}),R(h,m.normalize)&&!R(h,m.arrays)&&[h].concat(m.aliases[h]||[]).forEach(function(S){Object.defineProperty(lt,S,{enumerable:!0,get(){return w},set(D){w=typeof D=="string"?it.normalize(D):D}})})}function M(h,w){m.aliases[h]&&m.aliases[h].length||(m.aliases[h]=[w],y[w]=!0),m.aliases[w]&&m.aliases[w].length||M(w,h)}function _(h,w,v){v&&(w=Rl(w)),(R(h,m.bools)||R(h,m.counts))&&typeof w=="string"&&(w=w==="true");let x=Array.isArray(w)?w.map(function(b){return T(h,b)}):T(h,w);return R(h,m.counts)&&(ze(x)||typeof x=="boolean")&&(x=Ni()),R(h,m.normalize)&&R(h,m.arrays)&&(Array.isArray(w)?x=w.map(b=>it.normalize(b)):x=it.normalize(w)),x}function T(h,w){return!a["parse-positional-numbers"]&&h==="_"||!R(h,m.strings)&&!R(h,m.bools)&&!Array.isArray(w)&&(qn(w)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${w}`)))||!ze(w)&&R(h,m.numbers))&&(w=Number(w)),w}function H(h){let w=Object.create(null);ne(w,m.aliases,l),Object.keys(m.configs).forEach(function(v){let x=h[v]||w[v];if(x)try{let b=null,F=it.resolve(it.cwd(),x),S=m.configs[v];if(typeof S=="function"){try{b=S(F)}catch(D){b=D}if(b instanceof Error){G=b;return}}else b=it.require(F);J(b)}catch(b){b.name==="PermissionDenied"?G=b:h[v]&&(G=Error(A("Invalid JSON config file: %s",x)))}})}function J(h,w){Object.keys(h).forEach(function(v){let x=h[v],b=w?w+"."+v:v;typeof x=="object"&&x!==null&&!Array.isArray(x)&&a["dot-notation"]?J(x,b):(!tt(V,b.split("."))||R(b,m.arrays)&&a["combine-arrays"])&&K(b,x)})}function se(){typeof u!="undefined"&&u.forEach(function(h){J(h)})}function z(h,w){if(typeof d=="undefined")return;let v=typeof d=="string"?d:"",x=it.env();Object.keys(x).forEach(function(b){if(v===""||b.lastIndexOf(v,0)===0){let F=b.split("__").map(function(S,D){return D===0&&(S=S.substring(v.length)),Lt(S)});(w&&m.configs[F.join(".")]||!w)&&!tt(h,F)&&K(F.join("."),x[b])}})}function ue(h){let w,v=new Set;Object.keys(h).forEach(function(x){if(!v.has(x)&&(w=R(x,m.coercions),typeof w=="function"))try{let b=T(x,w(h[x]));[].concat(m.aliases[x]||[],x).forEach(F=>{v.add(F),h[F]=b})}catch(b){G=b}})}function Mt(h){return m.keys.forEach(w=>{~w.indexOf(".")||typeof h[w]=="undefined"&&(h[w]=void 0)}),h}function ne(h,w,v,x=!1){Object.keys(v).forEach(function(b){tt(h,b.split("."))||(nt(h,b.split("."),v[b]),x&&(C[b]=!0),(w[b]||[]).forEach(function(F){tt(h,F.split("."))||nt(h,F.split("."),v[b])}))})}function tt(h,w){let v=h;a["dot-notation"]||(w=[w.join(".")]),w.slice(0,-1).forEach(function(b){v=v[b]||{}});let x=w[w.length-1];return typeof v!="object"?!1:x in v}function nt(h,w,v){let x=h;a["dot-notation"]||(w=[w.join(".")]),w.slice(0,-1).forEach(function(pe){pe=$r(pe),typeof x=="object"&&x[pe]===void 0&&(x[pe]={}),typeof x[pe]!="object"||Array.isArray(x[pe])?(Array.isArray(x[pe])?x[pe].push({}):x[pe]=[x[pe],{}],x=x[pe][x[pe].length-1]):x=x[pe]});let b=$r(w[w.length-1]),F=R(w.join("."),m.arrays),S=Array.isArray(v),D=a["duplicate-arguments-array"];!D&&R(b,m.nargs)&&(D=!0,(!ze(x[b])&&m.nargs[b]===1||Array.isArray(x[b])&&x[b].length===m.nargs[b])&&(x[b]=void 0)),v===Ni()?x[b]=Ni(x[b]):Array.isArray(x[b])?D&&F&&S?x[b]=a["flatten-duplicate-arrays"]?x[b].concat(v):(Array.isArray(x[b][0])?x[b]:[x[b]]).concat([v]):!D&&Boolean(F)===Boolean(S)?x[b]=v:x[b]=x[b].concat([v]):x[b]===void 0&&F?x[b]=S?v:[v]:D&&!(x[b]===void 0||R(b,m.counts)||R(b,m.bools))?x[b]=[x[b],v]:x[b]=v}function Ft(...h){h.forEach(function(w){Object.keys(w||{}).forEach(function(v){m.aliases[v]||(m.aliases[v]=[].concat(s[v]||[]),m.aliases[v].concat(v).forEach(function(x){if(/-/.test(x)&&a["camel-case-expansion"]){let b=Lt(x);b!==v&&m.aliases[v].indexOf(b)===-1&&(m.aliases[v].push(b),y[b]=!0)}}),m.aliases[v].concat(v).forEach(function(x){if(x.length>1&&/[A-Z]/.test(x)&&a["camel-case-expansion"]){let b=Bn(x,"-");b!==v&&m.aliases[v].indexOf(b)===-1&&(m.aliases[v].push(b),y[b]=!0)}}),m.aliases[v].forEach(function(x){m.aliases[x]=[v].concat(m.aliases[v].filter(function(b){return x!==b}))}))})})}function R(h,w){let v=[].concat(m.aliases[h]||[],h),x=Object.keys(w),b=v.find(F=>x.includes(F));return b?w[b]:!1}function Mi(h){let w=Object.keys(m);return[].concat(w.map(x=>m[x])).some(function(x){return Array.isArray(x)?x.includes(h):x[h]})}function U(h,...w){return[].concat(...w).some(function(x){let b=h.match(x);return b&&Mi(b[1])})}function ee(h){if(h.match(P)||!h.match(/^-[^-]+/))return!1;let w=!0,v,x=h.slice(1).split("");for(let b=0;b<x.length;b++){if(v=h.slice(b+2),!Mi(x[b])){w=!1;break}if(x[b+1]&&x[b+1]==="="||v==="-"||/[A-Za-z]/.test(x[b])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(v)||x[b+1]&&x[b+1].match(/\W/))break}return w}function ie(h){return a["unknown-options-as-args"]&&q(h)}function q(h){return h=h.replace(/^-{3,}/,"--"),h.match(P)||ee(h)?!1:!U(h,/^-+([^=]+?)=[\s\S]*$/,E,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function re(h){return!R(h,m.bools)&&!R(h,m.counts)&&`${h}`in l?l[h]:ae(qe(h))}function ae(h){return{[$e.BOOLEAN]:!0,[$e.STRING]:"",[$e.NUMBER]:void 0,[$e.ARRAY]:[]}[h]}function qe(h){let w=$e.BOOLEAN;return R(h,m.strings)?w=$e.STRING:R(h,m.numbers)?w=$e.NUMBER:R(h,m.bools)?w=$e.BOOLEAN:R(h,m.arrays)&&(w=$e.ARRAY),w}function ze(h){return h===void 0}function kn(){Object.keys(m.counts).find(h=>R(h,m.arrays)?(G=Error(A("Invalid configuration: %s, opts.count excludes opts.array.",h)),!0):R(h,m.nargs)?(G=Error(A("Invalid configuration: %s, opts.count excludes opts.narg.",h)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(lt,V),configuration:a,defaulted:Object.assign({},C),error:G,newAliases:Object.assign({},y)}}};function Ul(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 o=r+1;o<t.length;o++)if(t[r].filter(function(a){return t[o].indexOf(a)!==-1}).length){t[r]=t[r].concat(t[o]),t.splice(o,1),i=!0;break}}return t.forEach(function(r){r=r.filter(function(s,a,l){return l.indexOf(s)===a});let o=r.pop();o!==void 0&&typeof o=="string"&&(n[o]=r)}),n}function Ni(e){return e!==void 0?e+1:1}function $r(e){return e==="__proto__"?"___proto___":e}function Rl(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}var kr=require("fs");var Hr=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1])<Hr)throw Error(`yargs parser supports a minimum Node.js version of ${Hr}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var $l=process?process.env:{},Yr=new Di({cwd:process.cwd,env:()=>$l,format:Wr.format,normalize:zn.normalize,resolve:zn.resolve,require:e=>{if(typeof require!="undefined")return require(e);if(e.match(/\.json$/))return JSON.parse((0,kr.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),Cn=function(t,n){return Yr.parse(t.slice(),n).argv};Cn.detailed=function(e,t){return Yr.parse(e.slice(),t)};Cn.camelCase=Lt;Cn.decamelize=Bn;Cn.looksLikeNumber=qn;var Gr=Cn;var Ke=require("path");g();function Wl(){return kl()?0:1}function kl(){return Hl()&&!process.defaultApp}function Hl(){return!!process.versions.electron}function Br(){return process.argv[Wl()]}g();var Z=class extends Error{constructor(t){super(t||"yargs error");this.name="YError",Error.captureStackTrace(this,Z)}};g();g();var nn=require("fs"),qr=require("util"),zr=require("path"),Vr={fs:{readFileSync:nn.readFileSync,writeFile:nn.writeFile},format:qr.format,resolve:zr.resolve,exists:e=>{try{return(0,nn.statSync)(e).isFile()}catch(t){return!1}}};g();var Qe,Qr=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(),Qe.format.apply(Qe.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(),o=function(){};typeof t[t.length-1]=="function"&&(o=t.pop()),this.cache[this.locale]||this._readLocaleFile();let s=r===1?n:i;this.cache[this.locale][n]&&(s=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:o})):o();let a=[s];return~s.indexOf("%d")&&a.push(r),Qe.format.apply(Qe.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,o){let s=n[o+1];i+=r,typeof s!="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,o=n.cb,s=this._resolveLocaleFile(i,r),a=JSON.stringify(this.cache[r],null,2);Qe.fs.writeFile(s,a,"utf-8",function(l){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),o(l)})}_readLocaleFile(){let t={},n=this._resolveLocaleFile(this.directory,this.locale);try{Qe.fs.readFileSync&&(t=JSON.parse(Qe.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=Qe.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(i)&&~n.lastIndexOf("_")){let r=Qe.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(r)&&(i=r)}return i}_fileExistsSync(t){return Qe.exists(t)}};function Kr(e,t){Qe=t;let n=new Qr(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 Yl=e=>Kr(e,Vr),Jr=Yl;var Gl="require is not supported by ESM",to="loading a directory of commands is not supported yet for ESM",Qn;try{Qn=(0,eo.fileURLToPath)(O)}catch(e){Qn=process.cwd()}var Bl=Qn.split("node_modules")[0],no={assert:{notStrictEqual:Vn.notStrictEqual,strictEqual:Vn.strictEqual},cliui:Li,findUp:Ur,getEnv:e=>process.env[e],inspect:Zr.inspect,getCallerFile:()=>{throw new Z(to)},getProcessArgvBin:Br,mainFilename:Bl||process.cwd(),Parser:Gr,path:{basename:Ke.basename,dirname:Ke.dirname,extname:Ke.extname,relative:Ke.relative,resolve:Ke.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:Xr.readFileSync,require:()=>{throw new Z(Gl)},requireDirectory:()=>{throw new Z(to)},stringWidth:e=>[...e].length,y18n:Jr({directory:(0,Ke.resolve)(Qn,"../../../locales"),updateFiles:!1})};g();g();g();function Pe(e,t,n,i){n.assert.notStrictEqual(e,t,i)}function Ti(e,t){t.assert.strictEqual(typeof e,"string")}function rn(e){return Object.keys(e)}g();function te(e){return!!e&&!!e.then&&typeof e.then=="function"}g();g();g();function ct(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 o={cmd:r.replace(i,""),demanded:[],optional:[]};return n.forEach((s,a)=>{let l=!1;s=s.replace(/\s/g,""),/\.+[\]>]/.test(s)&&a===n.length-1&&(l=!0),/^\[/.test(s)?o.optional.push({cmd:s.replace(i,"").split("|"),variadic:l}):o.demanded.push({cmd:s.replace(i,"").split("|"),variadic:l})}),o}var ql=["first","second","third","fourth","fifth","sixth"];function j(e,t,n){function i(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[ct(`cmd ${e}`),t,n]}try{let r=0,[o,s,a]=i(),l=[].slice.call(s);for(;l.length&&l[l.length-1]===void 0;)l.pop();let u=a||l.length;if(u<o.demanded.length)throw new Z(`Not enough arguments provided. Expected ${o.demanded.length} but received ${l.length}.`);let d=o.demanded.length+o.optional.length;if(u>d)throw new Z(`Too many arguments provided. Expected max ${d} but received ${u}.`);o.demanded.forEach(f=>{let p=l.shift(),y=io(p);f.cmd.filter(A=>A===y||A==="*").length===0&&ro(y,f.cmd,r),r+=1}),o.optional.forEach(f=>{if(l.length===0)return;let p=l.shift(),y=io(p);f.cmd.filter(A=>A===y||A==="*").length===0&&ro(y,f.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function io(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function ro(e,t,n){throw new Z(`Invalid ${ql[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var Ui=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,i=!0,r=!1){if(j("<array|function> [boolean] [boolean] [boolean]",[t,n,i],arguments.length),Array.isArray(t)){for(let o=0;o<t.length;o++){if(typeof t[o]!="function")throw Error("middleware must be a function");let s=t[o];s.applyBeforeValidation=n,s.global=i}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let o=t;o.applyBeforeValidation=n,o.global=i,o.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 o=[...i[n]||[],n];return r.option?!o.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 oo(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function Dt(e,t,n,i){return n.reduce((r,o)=>{if(o.applyBeforeValidation!==i)return r;if(o.mutates){if(o.applied)return r;o.applied=!0}if(te(r))return r.then(s=>Promise.all([s,o(s,t)])).then(([s,a])=>Object.assign(s,a));{let s=o(r,t);return te(s)?s.then(a=>Object.assign(r,a)):Object.assign(r,s)}},e)}g();function Nt(e,t,n=i=>{throw i}){try{let i=zl(e)?e():e;return te(i)?i.then(r=>t(r)):t(i)}catch(i){return n(i)}}function zl(e){return typeof e=="function"}g();function Ri(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 on=/(^\*)|(^\$0)/,so=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 o=typeof r.visit=="function"?r.visit:s=>s;r.visit=(s,a,l)=>{let u=o(s,a,l);if(u){if(this.requireCache.has(a))return u;this.requireCache.add(a),this.addHandler(u)}return u},this.shim.requireDirectory({require:n,filename:i},t,r)}addHandler(t,n,i,r,o,s){let a=[],l=oo(o);if(r=r||(()=>{}),Array.isArray(t))if(Vl(t))[t,...a]=t;else for(let u of t)this.addHandler(u);else if(Kl(t)){let u=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(u=[].concat(u).concat(t.aliases)),this.addHandler(u,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(lo(i)){this.addHandler([t].concat(a),n,i.builder,i.handler,i.middlewares,i.deprecated);return}if(typeof t=="string"){let u=ct(t);a=a.map(p=>ct(p).cmd);let d=!1,f=[u.cmd].concat(a).filter(p=>on.test(p)?(d=!0,!1):!0);f.length===0&&d&&f.push("$0"),d&&(u.cmd=f[0],a=f.slice(1),t=t.replace(on,u.cmd)),a.forEach(p=>{this.aliasMap[p]=u.cmd}),n!==!1&&this.usage.command(t,n,d,a,s),this.handlers[u.cmd]={original:t,description:n,handler:r,builder:i||{},middlewares:l,deprecated:s,demanded:u.demanded,optional:u.optional},d&&(this.defaultCommand=this.handlers[u.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,o,s){let a=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,l=n.getInternalMethods().getContext(),u=l.commands.slice(),d=!t;t&&(l.commands.push(t),l.fullCommands.push(a.original));let f=this.applyBuilderUpdateUsageAndParse(d,a,n,i.aliases,u,r,o,s);return te(f)?f.then(p=>this.applyMiddlewareAndGetResult(d,a,p.innerArgv,l,o,p.aliases,n)):this.applyMiddlewareAndGetResult(d,a,f.innerArgv,l,o,f.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,i,r,o,s,a,l){let u=n.builder,d=i;if(Kn(u)){let f=u(i.getInternalMethods().reset(r),l);if(te(f))return f.then(p=>(d=co(p)?p:i,this.parseAndUpdateUsage(t,n,d,o,s,a)))}else Ql(u)&&(d=i.getInternalMethods().reset(r),Object.keys(n.builder).forEach(f=>{d.option(f,u[f])}));return this.parseAndUpdateUsage(t,n,d,o,s,a)}parseAndUpdateUsage(t,n,i,r,o,s){t&&i.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(i)&&i.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,n),n.description);let a=i.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,s);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=on.test(n.original)?n.original.replace(on,"").trim():n.original,r=t.filter(o=>!on.test(o));return r.push(i),`$0 ${r.join(" ")}`}applyMiddlewareAndGetResult(t,n,i,r,o,s,a){let l={};if(o)return i;a.getInternalMethods().getHasOutput()||(l=this.populatePositionals(n,i,r,a));let u=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares);if(i=Dt(i,a,u,!0),!a.getInternalMethods().getHasOutput()){let d=a.getInternalMethods().runValidation(s,l,a.parsed.error,t);i=Nt(i,f=>(d(f),f))}if(n.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let d=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(i,d,!1,!1),i=Dt(i,a,u,!1),i=Nt(i,f=>{let p=n.handler(f);return te(p)?p.then(()=>f):f}),t||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),te(i)&&!a.getInternalMethods().hasParseCallback()&&i.catch(f=>{try{a.getInternalMethods().getUsageInstance().fail(null,f)}catch(p){}})}return t||(r.commands.pop(),r.fullCommands.pop()),i}populatePositionals(t,n,i,r){n._=n._.slice(i.commands.length);let o=t.demanded.slice(0),s=t.optional.slice(0),a={};for(this.validation.positionalCount(o.length,n._.length);o.length;){let l=o.shift();this.populatePositional(l,n,a)}for(;s.length;){let l=s.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=ct(t);return i.demanded.forEach(r=>{let[o,...s]=r.cmd;r.variadic&&(n.array.push(o),n.default[o]=[]),n.alias[o]=s,n.demand[o]=!0}),i.optional.forEach(r=>{let[o,...s]=r.cmd;r.variadic&&(n.array.push(o),n.default[o]=[]),n.alias[o]=s}),n}postProcessPositionals(t,n,i,r){let o=Object.assign({},r.getOptions());o.default=Object.assign(i.default,o.default);for(let u of Object.keys(i.alias))o.alias[u]=(o.alias[u]||[]).concat(i.alias[u]);o.array=o.array.concat(i.array),o.config={};let s=[];if(Object.keys(n).forEach(u=>{n[u].map(d=>{o.configuration["unknown-options-as-args"]&&(o.key[u]=!0),s.push(`--${u}`),s.push(d)})}),!s.length)return;let a=Object.assign({},o.configuration,{"populate--":!1}),l=this.shim.Parser.detailed(s,Object.assign({},o,{configuration:a}));if(l.error)r.getInternalMethods().getUsageInstance().fail(l.error.message,l.error);else{let u=Object.keys(n);Object.keys(n).forEach(f=>{u.push(...l.aliases[f])});let d=r.getOptions().default;Object.keys(l.argv).forEach(f=>{u.includes(f)&&(n[f]||(n[f]=l.argv[f]),!Object.prototype.hasOwnProperty.call(d,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])})}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let i=on.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(Kn(n))return n(t,!0);lo(n)||Object.keys(n).forEach(i=>{t.option(i,n[i])})}moduleName(t){let n=Ri(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;Pe(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();Pe(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 ao(e,t,n,i){return new so(e,t,n,i)}function lo(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function Vl(e){return e.every(t=>typeof t=="string")}function Kn(e){return typeof e=="function"}function Ql(e){return typeof e=="object"}function Kl(e){return typeof e=="object"&&!Array.isArray(e)}g();g();function ft(e={},t=()=>!0){let n={};return rn(e).forEach(i=>{t(i,e[i])&&(n[i]=e[i])}),n}g();function ut(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 Jl(e){return typeof e=="boolean"}function fo(e,t){let n=t.y18n.__,i={},r=[];i.failFn=function(_){r.push(_)};let o=null,s=!0;i.showHelpOnFail=function(_=!0,T){function H(){return typeof _=="string"?[!0,_]:[_,T]}let[J,se]=H();return o=se,s=J,i};let a=!1;i.fail=function(_,T){let H=e.getInternalMethods().getLoggerInstance();if(r.length)for(let J=r.length-1;J>=0;--J){let se=r[J];if(Jl(se)){if(T)throw T;if(_)throw Error(_)}else se(_,T,i)}else{if(e.getExitProcess()&&ut(!0),a||(a=!0,s&&(e.showHelp("error"),H.error()),(_||T)&&H.error(_||T),o&&((_||T)&&H.error(""),H.error(o))),T=T||new Z(_),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,T);throw T}};let l=[],u=!1;i.usage=(M,_)=>M===null?(u=!0,l=[],i):(u=!1,l.push([M,_||""]),i),i.getUsage=()=>l,i.getUsageDisabled=()=>u,i.getPositionalGroupName=()=>n("Positionals:");let d=[];i.example=(M,_)=>{d.push([M,_||""])};let f=[];i.command=function(_,T,H,J,se=!1){H&&(f=f.map(z=>(z[2]=!1,z))),f.push([_,T||"",H,J,se])},i.getCommands=()=>f;let p={};i.describe=function(_,T){Array.isArray(_)?_.forEach(H=>{i.describe(H,T)}):typeof _=="object"?Object.keys(_).forEach(H=>{i.describe(H,_[H])}):p[_]=T},i.getDescriptions=()=>p;let y=[];i.epilog=M=>{y.push(M)};let C=!1,A;i.wrap=M=>{C=!0,A=M};function m(){return C||(A=en(),C=!0),A}let P="__yargsString__:";i.deferY18nLookup=M=>P+M,i.help=function(){if(B)return B;G();let _=e.customScriptName?e.$0:t.path.basename(e.$0),T=e.getDemandedOptions(),H=e.getDemandedCommands(),J=e.getDeprecatedOptions(),se=e.getGroups(),z=e.getOptions(),ue=[];ue=ue.concat(Object.keys(p)),ue=ue.concat(Object.keys(T)),ue=ue.concat(Object.keys(H)),ue=ue.concat(Object.keys(z.default)),ue=ue.filter(lt),ue=Object.keys(ue.reduce((U,ee)=>(ee!=="_"&&(U[ee]=!0),U),{}));let Mt=m(),ne=t.cliui({width:Mt,wrap:!!Mt});if(!u){if(l.length)l.forEach(U=>{ne.div({text:`${U[0].replace(/\$0/g,_)}`}),U[1]&&ne.div({text:`${U[1]}`,padding:[1,0,0,0]})}),ne.div();else if(f.length){let U=null;H._?U=`${_} <${n("command")}>
7
+ `:U=`${_} [${n("command")}]
8
+ `,ne.div(`${U}`)}}if(f.length>1||f.length===1&&!f[0][2]){ne.div(n("Commands:"));let U=e.getInternalMethods().getContext(),ee=U.commands.length?`${U.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(f=f.sort((q,re)=>q[0].localeCompare(re[0])));let ie=_?`${_} `:"";f.forEach(q=>{let re=`${ie}${ee}${q[0].replace(/^\$0 ?/,"")}`;ne.span({text:re,padding:[0,2,0,2],width:E(f,Mt,`${_}${ee}`)+4},{text:q[1]});let ae=[];q[2]&&ae.push(`[${n("default")}]`),q[3]&&q[3].length&&ae.push(`[${n("aliases:")} ${q[3].join(", ")}]`),q[4]&&(typeof q[4]=="string"?ae.push(`[${n("deprecated: %s",q[4])}]`):ae.push(`[${n("deprecated")}]`)),ae.length?ne.div({text:ae.join(" "),padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}let tt=(Object.keys(z.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);ue=ue.filter(U=>!e.parsed.newAliases[U]&&tt.every(ee=>(z.alias[ee]||[]).indexOf(U)===-1));let nt=n("Options:");se[nt]||(se[nt]=[]),V(ue,z.alias,se,nt);let Ft=U=>/^--/.test(Jn(U)),R=Object.keys(se).filter(U=>se[U].length>0).map(U=>{let ee=se[U].filter(lt).map(ie=>{if(tt.includes(ie))return ie;for(let q=0,re;(re=tt[q])!==void 0;q++)if((z.alias[re]||[]).includes(ie))return re;return ie});return{groupName:U,normalizedKeys:ee}}).filter(({normalizedKeys:U})=>U.length>0).map(({groupName:U,normalizedKeys:ee})=>{let ie=ee.reduce((q,re)=>(q[re]=[re].concat(z.alias[re]||[]).map(ae=>U===i.getPositionalGroupName()?ae:(/^[0-9]$/.test(ae)?z.boolean.includes(re)?"-":"--":ae.length>1?"--":"-")+ae).sort((ae,qe)=>Ft(ae)===Ft(qe)?0:Ft(ae)?1:-1).join(", "),q),{});return{groupName:U,normalizedKeys:ee,switches:ie}});if(R.filter(({groupName:U})=>U!==i.getPositionalGroupName()).some(({normalizedKeys:U,switches:ee})=>!U.every(ie=>Ft(ee[ie])))&&R.filter(({groupName:U})=>U!==i.getPositionalGroupName()).forEach(({normalizedKeys:U,switches:ee})=>{U.forEach(ie=>{Ft(ee[ie])&&(ee[ie]=Zl(ee[ie],"-x, ".length))})}),R.forEach(({groupName:U,normalizedKeys:ee,switches:ie})=>{ne.div(U),ee.forEach(q=>{let re=ie[q],ae=p[q]||"",qe=null;ae.includes(P)&&(ae=n(ae.substring(P.length))),z.boolean.includes(q)&&(qe=`[${n("boolean")}]`),z.count.includes(q)&&(qe=`[${n("count")}]`),z.string.includes(q)&&(qe=`[${n("string")}]`),z.normalize.includes(q)&&(qe=`[${n("string")}]`),z.array.includes(q)&&(qe=`[${n("array")}]`),z.number.includes(q)&&(qe=`[${n("number")}]`);let ze=h=>typeof h=="string"?`[${n("deprecated: %s",h)}]`:`[${n("deprecated")}]`,kn=[q in J?ze(J[q]):null,qe,q in T?`[${n("required")}]`:null,z.choices&&z.choices[q]?`[${n("choices:")} ${i.stringifiedValues(z.choices[q])}]`:null,Be(z.default[q],z.defaultDescription[q])].filter(Boolean).join(" ");ne.span({text:Jn(re),padding:[0,2,0,2+uo(re)],width:E(ie,Mt)+4},ae),kn?ne.div({text:kn,padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}),d.length&&(ne.div(n("Examples:")),d.forEach(U=>{U[0]=U[0].replace(/\$0/g,_)}),d.forEach(U=>{U[1]===""?ne.div({text:U[0],padding:[0,2,0,2]}):ne.div({text:U[0],padding:[0,2,0,2],width:E(d,Mt)+4},{text:U[1]})}),ne.div()),y.length>0){let U=y.map(ee=>ee.replace(/\$0/g,_)).join(`
9
+ `);ne.div(`${U}
10
+ `)}return ne.toString().replace(/\s*$/,"")};function E(M,_,T){let H=0;return Array.isArray(M)||(M=Object.values(M).map(J=>[J])),M.forEach(J=>{H=Math.max(t.stringWidth(T?`${T} ${Jn(J[0])}`:Jn(J[0]))+uo(J[0]),H)}),_&&(H=Math.min(H,parseInt((_*.5).toString(),10))),H}function G(){let M=e.getDemandedOptions(),_=e.getOptions();(Object.keys(_.alias)||[]).forEach(T=>{_.alias[T].forEach(H=>{p[H]&&i.describe(T,p[H]),H in M&&e.demandOption(T,M[H]),_.boolean.includes(H)&&e.boolean(T),_.count.includes(H)&&e.count(T),_.string.includes(H)&&e.string(T),_.normalize.includes(H)&&e.normalize(T),_.array.includes(H)&&e.array(T),_.number.includes(H)&&e.number(T)})})}let B;i.cacheHelpMessage=function(){B=this.help()},i.clearCachedHelpMessage=function(){B=void 0},i.hasCachedHelpMessage=function(){return!!B};function V(M,_,T,H){let J=[],se=null;return Object.keys(T).forEach(z=>{J=J.concat(T[z])}),M.forEach(z=>{se=[z].concat(_[z]),se.some(ue=>J.indexOf(ue)!==-1)||T[H].push(z)}),J}function lt(M){return e.getOptions().hiddenOptions.indexOf(M)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}i.showHelp=M=>{let _=e.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:_[M])(i.help())},i.functionDescription=M=>{let _=M.name?t.Parser.decamelize(M.name,"-"):n("generated-value");return["(",_,")"].join("")},i.stringifiedValues=function(_,T){let H="",J=T||", ",se=[].concat(_);return!_||!se.length||se.forEach(z=>{H.length&&(H+=J),H+=JSON.stringify(z)}),H};function Be(M,_){let T=`[${n("default:")} `;if(M===void 0&&!_)return null;if(_)T+=_;else switch(typeof M){case"string":T+=`"${M}"`;break;case"object":T+=JSON.stringify(M);break;default:T+=M}return`${T}]`}function en(){let M=80;return t.process.stdColumns?Math.min(M,t.process.stdColumns):M}let It=null;i.version=M=>{It=M},i.showVersion=M=>{let _=e.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:_[M])(It)},i.reset=function(_){return o=null,a=!1,l=[],u=!1,y=[],d=[],f=[],p=ft(p,T=>!_[T]),i};let K=[];return i.freeze=function(){K.push({failMessage:o,failureOutput:a,usages:l,usageDisabled:u,epilogs:y,examples:d,commands:f,descriptions:p})},i.unfreeze=function(){let _=K.pop();!_||({failMessage:o,failureOutput:a,usages:l,usageDisabled:u,epilogs:y,examples:d,commands:f,descriptions:p}=_)},i}function $i(e){return typeof e=="object"}function Zl(e,t){return $i(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function uo(e){return $i(e)?e.indentation:0}function Jn(e){return $i(e)?e.text:e}g();g();var po=`###-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
- `,Bn=`#compdef {{app_name}}
38
+ `,ho=`#compdef {{app_name}}
39
39
  ###-begin-{{app_name}}-completions-###
40
40
  #
41
41
  # yargs command completion script
@@ -54,16 +54,50 @@ _{{app_name}}_yargs_completions()
54
54
  }
55
55
  compdef _{{app_name}}_yargs_completions {{app_name}}
56
56
  ###-end-{{app_name}}-completions-###
57
- `;var Gn=class{constructor(t,e,n,i){var o,a,c;this.yargs=t,this.usage=e,this.command=n,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.zshShell=(c=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((a=this.shim.getEnv("ZSH_NAME"))===null||a===void 0?void 0:a.includes("zsh")))!==null&&c!==void 0?c:!1}defaultCompletion(t,e,n,i){let o=this.command.getCommandHandlers();for(let c=0,p=t.length;c<p;++c)if(o[t[c]]&&o[t[c]].builder){let O=o[t[c]].builder;if(we(O)){let b=this.yargs.getInternalMethods().reset();return O(b,!0),b.argv}}let a=[];this.commandCompletions(a,t,n),this.optionCompletions(a,t,e,n),this.choicesCompletions(a,t,e,n),i(null,a)}commandCompletions(t,e,n){let i=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&i[i.length-1]!==n&&!this.previousArgHasChoices(e)&&this.usage.getCommands().forEach(o=>{let a=Mt(o[0]).cmd;if(e.indexOf(a)===-1)if(!this.zshShell)t.push(a);else{let c=o[1]||"";t.push(a.replace(/:/g,"\\:")+":"+c)}})}optionCompletions(t,e,n,i){if((i.match(/^-/)||i===""&&t.length===0)&&!this.previousArgHasChoices(e)){let o=this.yargs.getOptions(),a=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(o.key).forEach(c=>{let p=!!o.configuration["boolean-negation"]&&o.boolean.includes(c);!a.includes(c)&&!this.argsContainKey(e,n,c,p)&&(this.completeOptionKey(c,t,i),p&&!!o.default[c]&&this.completeOptionKey(`no-${c}`,t,i))})}}choicesCompletions(t,e,n,i){if(this.previousArgHasChoices(e)){let o=this.getPreviousArgChoices(e);o&&o.length>0&&t.push(...o)}}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],n="";if(!e.startsWith("--")&&t.length>1&&(n=e,e=t[t.length-2]),!e.startsWith("--"))return;let i=e.replace(/-/g,""),o=this.yargs.getOptions();if(Object.keys(o.key).some(a=>a===i)&&Array.isArray(o.choices[i]))return o.choices[i].filter(a=>!n||a.startsWith(n))}previousArgHasChoices(t){let e=this.getPreviousArgChoices(t);return e!==void 0&&e.length>0}argsContainKey(t,e,n,i){if(t.indexOf(`--${n}`)!==-1||i&&t.indexOf(`--no-${n}`)!==-1)return!0;if(this.aliases){for(let o of this.aliases[n])if(e[o]!==void 0)return!0}return!1}completeOptionKey(t,e,n){let i=this.usage.getDescriptions(),o=p=>/^--/.test(p),a=p=>/^[^0-9]$/.test(p),c=!o(n)&&a(t)?"-":"--";if(!this.zshShell)e.push(c+t);else{let p=i[t]||"";e.push(c+`${t.replace(/:/g,"\\:")}:${p.replace("__yargsString__:","")}`)}}customCompletion(t,e,n,i){if(at(this.customCompletionFunction,null,this.shim),es(this.customCompletionFunction)){let o=this.customCompletionFunction(n,e);return J(o)?o.then(a=>{this.shim.process.nextTick(()=>{i(null,a)})}).catch(a=>{this.shim.process.nextTick(()=>{i(a,void 0)})}):i(null,o)}else return ns(this.customCompletionFunction)?this.customCompletionFunction(n,e,(o=i)=>this.defaultCompletion(t,e,n,o),o=>{i(null,o)}):this.customCompletionFunction(n,e,o=>{i(null,o)})}getCompletion(t,e){let n=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),o=this.customCompletionFunction?a=>this.customCompletion(t,a,n,e):a=>this.defaultCompletion(t,a,n,e);return J(i)?i.then(o):o(i)}generateCompletionScript(t,e){let n=this.zshShell?Bn:Yn,i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,e),n.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}};function Vn(s,t,e,n){return new Gn(s,t,e,n)}function es(s){return s.length<3}function ns(s){return s.length>3}function qn(s,t){if(s.length===0)return t.length;if(t.length===0)return s.length;let e=[],n;for(n=0;n<=t.length;n++)e[n]=[n];let i;for(i=0;i<=s.length;i++)e[0][i]=i;for(n=1;n<=t.length;n++)for(i=1;i<=s.length;i++)t.charAt(n-1)===s.charAt(i-1)?e[n][i]=e[n-1][i-1]:n>1&&i>1&&t.charAt(n-2)===s.charAt(i-1)&&t.charAt(n-1)===s.charAt(i-2)?e[n][i]=e[n-2][i-2]+1:e[n][i]=Math.min(e[n-1][i-1]+1,Math.min(e[n][i-1]+1,e[n-1][i]+1));return e[t.length][s.length]}var Kn=["$0","--","_"];function Jn(s,t,e){let n=e.y18n.__,i=e.y18n.__n,o={};o.nonOptionCount=function(f){let g=s.getDemandedCommands(),S=f._.length+(f["--"]?f["--"].length:0)-s.getInternalMethods().getContext().commands.length;g._&&(S<g._.min||S>g._.max)&&(S<g._.min?g._.minMsg!==void 0?t.fail(g._.minMsg?g._.minMsg.replace(/\$0/g,S.toString()).replace(/\$1/,g._.min.toString()):null):t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",S,S.toString(),g._.min.toString())):S>g._.max&&(g._.maxMsg!==void 0?t.fail(g._.maxMsg?g._.maxMsg.replace(/\$0/g,S.toString()).replace(/\$1/,g._.max.toString()):null):t.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",S,S.toString(),g._.max.toString()))))},o.positionalCount=function(f,g){g<f&&t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",g,g+"",f+""))},o.requiredArguments=function(f,g){let w=null;for(let S of Object.keys(g))(!Object.prototype.hasOwnProperty.call(f,S)||typeof f[S]=="undefined")&&(w=w||{},w[S]=g[S]);if(w){let S=[];for(let d of Object.keys(w)){let W=w[d];W&&S.indexOf(W)<0&&S.push(W)}let y=S.length?`
58
- ${S.join(`
59
- `)}`:"";t.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(w).length,Object.keys(w).join(", ")+y))}},o.unknownArguments=function(f,g,w,S,y=!0){var d;let W=s.getInternalMethods().getCommandInstance().getCommands(),T=[],Y=s.getInternalMethods().getContext();if(Object.keys(f).forEach(v=>{!Kn.includes(v)&&!Object.prototype.hasOwnProperty.call(w,v)&&!Object.prototype.hasOwnProperty.call(s.getInternalMethods().getParseContext(),v)&&!o.isValidAndSomeAliasIsNotNew(v,g)&&T.push(v)}),y&&(Y.commands.length>0||W.length>0||S)&&f._.slice(Y.commands.length).forEach(v=>{W.includes(""+v)||T.push(""+v)}),y){let B=((d=s.getDemandedCommands()._)===null||d===void 0?void 0:d.max)||0,Pt=Y.commands.length+B;Pt<f._.length&&f._.slice(Pt).forEach(bt=>{bt=String(bt),!Y.commands.includes(bt)&&!T.includes(bt)&&T.push(bt)})}T.length&&t.fail(i("Unknown argument: %s","Unknown arguments: %s",T.length,T.join(", ")))},o.unknownCommands=function(f){let g=s.getInternalMethods().getCommandInstance().getCommands(),w=[],S=s.getInternalMethods().getContext();return(S.commands.length>0||g.length>0)&&f._.slice(S.commands.length).forEach(y=>{g.includes(""+y)||w.push(""+y)}),w.length>0?(t.fail(i("Unknown command: %s","Unknown commands: %s",w.length,w.join(", "))),!0):!1},o.isValidAndSomeAliasIsNotNew=function(f,g){if(!Object.prototype.hasOwnProperty.call(g,f))return!1;let w=s.parsed.newAliases;return[f,...g[f]].some(S=>!Object.prototype.hasOwnProperty.call(w,S)||!w[f])},o.limitedChoices=function(f){let g=s.getOptions(),w={};if(!Object.keys(g.choices).length)return;Object.keys(f).forEach(d=>{Kn.indexOf(d)===-1&&Object.prototype.hasOwnProperty.call(g.choices,d)&&[].concat(f[d]).forEach(W=>{g.choices[d].indexOf(W)===-1&&W!==void 0&&(w[d]=(w[d]||[]).concat(W))})});let S=Object.keys(w);if(!S.length)return;let y=n("Invalid values:");S.forEach(d=>{y+=`
60
- ${n("Argument: %s, Given: %s, Choices: %s",d,t.stringifiedValues(w[d]),t.stringifiedValues(g.choices[d]))}`}),t.fail(y)};let a={};o.implies=function(f,g){E("<string|object> [array|number|string]",[f,g],arguments.length),typeof f=="object"?Object.keys(f).forEach(w=>{o.implies(w,f[w])}):(s.global(f),a[f]||(a[f]=[]),Array.isArray(g)?g.forEach(w=>o.implies(f,w)):(at(g,void 0,e),a[f].push(g)))},o.getImplied=function(){return a};function c(b,f){let g=Number(f);return f=isNaN(g)?f:g,typeof f=="number"?f=b._.length>=f:f.match(/^--no-.+/)?(f=f.match(/^--no-(.+)/)[1],f=!Object.prototype.hasOwnProperty.call(b,f)):f=Object.prototype.hasOwnProperty.call(b,f),f}o.implications=function(f){let g=[];if(Object.keys(a).forEach(w=>{let S=w;(a[w]||[]).forEach(y=>{let d=S,W=y;d=c(f,d),y=c(f,y),d&&!y&&g.push(` ${S} -> ${W}`)})}),g.length){let w=`${n("Implications failed:")}
61
- `;g.forEach(S=>{w+=S}),t.fail(w)}};let p={};o.conflicts=function(f,g){E("<string|object> [array|string]",[f,g],arguments.length),typeof f=="object"?Object.keys(f).forEach(w=>{o.conflicts(w,f[w])}):(s.global(f),p[f]||(p[f]=[]),Array.isArray(g)?g.forEach(w=>o.conflicts(f,w)):p[f].push(g))},o.getConflicting=()=>p,o.conflicting=function(f){Object.keys(f).forEach(g=>{p[g]&&p[g].forEach(w=>{w&&f[g]!==void 0&&f[w]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",g,w))})}),s.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(p).forEach(g=>{p[g].forEach(w=>{w&&f[e.Parser.camelCase(g)]!==void 0&&f[e.Parser.camelCase(w)]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",g,w))})})},o.recommendCommands=function(f,g){let w=3;g=g.sort((d,W)=>W.length-d.length);let S=null,y=1/0;for(let d=0,W;(W=g[d])!==void 0;d++){let T=qn(f,W);T<=w&&T<y&&(y=T,S=W)}S&&t.fail(n("Did you mean %s?",S))},o.reset=function(f){return a=St(a,g=>!f[g]),p=St(p,g=>!f[g]),o};let O=[];return o.freeze=function(){O.push({implied:a,conflicting:p})},o.unfreeze=function(){let f=O.pop();at(f,void 0,e),{implied:a,conflicting:p}=f},o}var Ye=[],ae;function Ce(s,t,e,n){ae=n;let i={};if(Object.prototype.hasOwnProperty.call(s,"extends")){if(typeof s.extends!="string")return i;let o=/\.json|\..*rc$/.test(s.extends),a=null;if(o)a=ss(t,s.extends);else try{a=require.resolve(s.extends)}catch(c){return s}is(a),Ye.push(a),i=o?JSON.parse(ae.readFileSync(a,"utf8")):require(s.extends),delete s.extends,i=Ce(i,ae.path.dirname(a),e,ae)}return Ye=[],e?Qn(i,s):Object.assign({},i,s)}function is(s){if(Ye.indexOf(s)>-1)throw new q(`Circular extended configurations: '${s}'.`)}function ss(s,t){return ae.path.resolve(s,t)}function Qn(s,t){let e={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(e,s);for(let i of Object.keys(t))n(t[i])&&n(e[i])?e[i]=Qn(s[i],t[i]):e[i]=t[i];return e}var x=function(s,t,e,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?s!==t||!i:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(s,e):i?i.value=e:t.set(s,e),e},r=function(s,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?s!==t||!n:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(s):n?n.value:t.get(s)},nt,Tt,le,dt,ct,je,$t,Ht,Ee,pt,xe,mt,Ct,ft,gt,ne,rt,M,Ae,Pe,ht,vt,ie,Yt,Nt,Me,L,Bt,Gt,Vt,D,jt,k;function Zn(s){return(t=[],e=s.process.cwd(),n)=>{let i=new mi(t,e,n,s);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Xn=Symbol("copyDoubleDash"),kn=Symbol("copyDoubleDash"),Be=Symbol("deleteFromParserHintObject"),ti=Symbol("emitWarning"),ei=Symbol("freeze"),ni=Symbol("getDollarZero"),qt=Symbol("getParserConfiguration"),Ge=Symbol("guessLocale"),ii=Symbol("guessVersion"),si=Symbol("parsePositionalNumbers"),Ve=Symbol("pkgUp"),Ft=Symbol("populateParserHintArray"),se=Symbol("populateParserHintSingleValueDictionary"),qe=Symbol("populateParserHintArrayDictionary"),Ke=Symbol("populateParserHintDictionary"),Je=Symbol("sanitizeKey"),Qe=Symbol("setKey"),Ze=Symbol("unfreeze"),ri=Symbol("validateAsync"),oi=Symbol("getCommandInstance"),ai=Symbol("getContext"),li=Symbol("getHasOutput"),ci=Symbol("getLoggerInstance"),fi=Symbol("getParseContext"),hi=Symbol("getUsageInstance"),ui=Symbol("getValidationInstance"),Se=Symbol("hasParseCallback"),Kt=Symbol("postProcess"),di=Symbol("rebase"),Xe=Symbol("reset"),ce=Symbol("runYargsParserAndExecuteCommands"),ke=Symbol("runValidation"),pi=Symbol("setHasOutput"),Jt=Symbol("kTrackManuallySetKeys"),mi=class{constructor(t=[],e,n,i){this.customScriptName=!1,this.parsed=!1,nt.set(this,void 0),Tt.set(this,void 0),le.set(this,{commands:[],fullCommands:[]}),dt.set(this,null),ct.set(this,null),je.set(this,"show-hidden"),$t.set(this,null),Ht.set(this,!0),Ee.set(this,{}),pt.set(this,!0),xe.set(this,[]),mt.set(this,void 0),Ct.set(this,{}),ft.set(this,!1),gt.set(this,null),ne.set(this,void 0),rt.set(this,""),M.set(this,void 0),Ae.set(this,void 0),Pe.set(this,{}),ht.set(this,null),vt.set(this,null),ie.set(this,{}),Yt.set(this,{}),Nt.set(this,void 0),Me.set(this,!1),L.set(this,void 0),Bt.set(this,!1),Gt.set(this,!1),Vt.set(this,!1),D.set(this,void 0),jt.set(this,null),k.set(this,void 0),x(this,L,i,"f"),x(this,Nt,t,"f"),x(this,Tt,e,"f"),x(this,Ae,n,"f"),x(this,mt,new Te(this),"f"),this.$0=this[ni](),this[Xe](),x(this,nt,r(this,nt,"f"),"f"),x(this,D,r(this,D,"f"),"f"),x(this,k,r(this,k,"f"),"f"),x(this,M,r(this,M,"f"),"f"),r(this,M,"f").showHiddenOpt=r(this,je,"f"),x(this,ne,this[kn](),"f")}addHelpOpt(t,e){let n="help";return E("[string|boolean] [string]",[t,e],arguments.length),r(this,gt,"f")&&(this[Be](r(this,gt,"f")),x(this,gt,null,"f")),t===!1&&e===void 0?this:(x(this,gt,typeof t=="string"?t:n,"f"),this.boolean(r(this,gt,"f")),this.describe(r(this,gt,"f"),e||r(this,D,"f").deferY18nLookup("Show help")),this)}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(E("[string|boolean] [string]",[t,e],arguments.length),t===!1&&e===void 0)return this;let n=typeof t=="string"?t:r(this,je,"f");return this.boolean(n),this.describe(n,e||r(this,D,"f").deferY18nLookup("Show hidden options")),r(this,M,"f").showHiddenOpt=n,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return E("<object|string|array> [string|array]",[t,e],arguments.length),this[qe](this.alias.bind(this),"alias",t,e),this}array(t){return E("<array|string>",[t],arguments.length),this[Ft]("array",t),this[Jt](t),this}boolean(t){return E("<array|string>",[t],arguments.length),this[Ft]("boolean",t),this[Jt](t),this}check(t,e){return E("<function> [boolean]",[t,e],arguments.length),this.middleware((n,i)=>zt(()=>t(n,i.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&r(this,D,"f").fail(o.toString(),o):r(this,D,"f").fail(r(this,L,"f").y18n.__("Argument check failed: %s",t.toString())),n),o=>(r(this,D,"f").fail(o.message?o.message:o.toString(),o),n)),!1,e),this}choices(t,e){return E("<object|string|array> [string|array]",[t,e],arguments.length),this[qe](this.choices.bind(this),"choices",t,e),this}coerce(t,e){if(E("<object|string|array> [function]",[t,e],arguments.length),Array.isArray(t)){if(!e)throw new q("coerce callback must be provided");for(let n of t)this.coerce(n,e);return this}else if(typeof t=="object"){for(let n of Object.keys(t))this.coerce(n,t[n]);return this}if(!e)throw new q("coerce callback must be provided");return r(this,M,"f").key[t]=!0,r(this,mt,"f").addCoerceMiddleware((n,i)=>{let o;return zt(()=>(o=i.getAliases(),e(n[t])),a=>{if(n[t]=a,o[t])for(let c of o[t])n[c]=a;return n},a=>{throw new q(a.message)})},t),this}conflicts(t,e){return E("<string|object> [string|array]",[t,e],arguments.length),r(this,k,"f").conflicts(t,e),this}config(t="config",e,n){return E("[object|string] [string|function] [function]",[t,e,n],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=Ce(t,r(this,Tt,"f"),this[qt]()["deep-merge-config"]||!1,r(this,L,"f")),r(this,M,"f").configObjects=(r(this,M,"f").configObjects||[]).concat(t),this):(typeof e=="function"&&(n=e,e=void 0),this.describe(t,e||r(this,D,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{r(this,M,"f").config[i]=n||!0}),this)}completion(t,e,n){return E("[string] [string|boolean|function] [function]",[t,e,n],arguments.length),typeof e=="function"&&(n=e,e=void 0),x(this,ct,t||r(this,ct,"f")||"completion","f"),!e&&e!==!1&&(e="generate completion script"),this.command(r(this,ct,"f"),e),n&&r(this,dt,"f").registerFunction(n),this}command(t,e,n,i,o,a){return E("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,n,i,o,a],arguments.length),r(this,nt,"f").addHandler(t,e,n,i,o,a),this}commands(t,e,n,i,o,a){return this.command(t,e,n,i,o,a)}commandDir(t,e){E("<string> [object]",[t,e],arguments.length);let n=r(this,Ae,"f")||r(this,L,"f").require;return r(this,nt,"f").addDirectory(t,n,r(this,L,"f").getCallerFile(),e),this}count(t){return E("<array|string>",[t],arguments.length),this[Ft]("count",t),this[Jt](t),this}default(t,e,n){return E("<object|string|array> [*] [string]",[t,e,n],arguments.length),n&&(ze(t,r(this,L,"f")),r(this,M,"f").defaultDescription[t]=n),typeof e=="function"&&(ze(t,r(this,L,"f")),r(this,M,"f").defaultDescription[t]||(r(this,M,"f").defaultDescription[t]=r(this,D,"f").functionDescription(e)),e=e.call()),this[se](this.default.bind(this),"default",t,e),this}defaults(t,e,n){return this.default(t,e,n)}demandCommand(t=1,e,n,i){return E("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,n,i],arguments.length),typeof e!="number"&&(n=e,e=1/0),this.global("_",!1),r(this,M,"f").demandedCommands._={min:t,max:e,minMsg:n,maxMsg:i},this}demand(t,e,n){return Array.isArray(e)?(e.forEach(i=>{at(n,!0,r(this,L,"f")),this.demandOption(i,n)}),e=1/0):typeof e!="number"&&(n=e,e=1/0),typeof t=="number"?(at(n,!0,r(this,L,"f")),this.demandCommand(t,e,n,n)):Array.isArray(t)?t.forEach(i=>{at(n,!0,r(this,L,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(t,n):(n===!0||typeof n=="undefined")&&this.demandOption(t),this}demandOption(t,e){return E("<object|string|array> [string]",[t,e],arguments.length),this[se](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return E("<string> [string|boolean]",[t,e],arguments.length),r(this,M,"f").deprecatedOptions[t]=e,this}describe(t,e){return E("<object|string|array> [string]",[t,e],arguments.length),this[Qe](t,!0),r(this,D,"f").describe(t,e),this}detectLocale(t){return E("<boolean>",[t],arguments.length),x(this,Ht,t,"f"),this}env(t){return E("[string|boolean]",[t],arguments.length),t===!1?delete r(this,M,"f").envPrefix:r(this,M,"f").envPrefix=t||"",this}epilogue(t){return E("<string>",[t],arguments.length),r(this,D,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return E("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach(n=>this.example(...n)):r(this,D,"f").example(t,e),this}exit(t,e){x(this,ft,!0,"f"),x(this,$t,e,"f"),r(this,pt,"f")&&r(this,L,"f").process.exit(t)}exitProcess(t=!0){return E("[boolean]",[t],arguments.length),x(this,pt,t,"f"),this}fail(t){if(E("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new q("Invalid first argument. Expected function or boolean 'false'");return r(this,D,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return E("<array> [function]",[t,e],arguments.length),e?r(this,dt,"f").getCompletion(t,e):new Promise((n,i)=>{r(this,dt,"f").getCompletion(t,(o,a)=>{o?i(o):n(a)})})}getDemandedOptions(){return E([],0),r(this,M,"f").demandedOptions}getDemandedCommands(){return E([],0),r(this,M,"f").demandedCommands}getDeprecatedOptions(){return E([],0),r(this,M,"f").deprecatedOptions}getDetectLocale(){return r(this,Ht,"f")}getExitProcess(){return r(this,pt,"f")}getGroups(){return Object.assign({},r(this,Ct,"f"),r(this,Yt,"f"))}getHelp(){if(x(this,ft,!0,"f"),!r(this,D,"f").hasCachedHelpMessage()){if(!this.parsed){let e=this[ce](r(this,Nt,"f"),void 0,void 0,0,!0);if(J(e))return e.then(()=>r(this,D,"f").help())}let t=r(this,nt,"f").runDefaultBuilderOn(this);if(J(t))return t.then(()=>r(this,D,"f").help())}return Promise.resolve(r(this,D,"f").help())}getOptions(){return r(this,M,"f")}getStrict(){return r(this,Bt,"f")}getStrictCommands(){return r(this,Gt,"f")}getStrictOptions(){return r(this,Vt,"f")}global(t,e){return E("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),e!==!1?r(this,M,"f").local=r(this,M,"f").local.filter(n=>t.indexOf(n)===-1):t.forEach(n=>{r(this,M,"f").local.includes(n)||r(this,M,"f").local.push(n)}),this}group(t,e){E("<string|array> <string>",[t,e],arguments.length);let n=r(this,Yt,"f")[e]||r(this,Ct,"f")[e];r(this,Yt,"f")[e]&&delete r(this,Yt,"f")[e];let i={};return r(this,Ct,"f")[e]=(n||[]).concat(t).filter(o=>i[o]?!1:i[o]=!0),this}hide(t){return E("<string>",[t],arguments.length),r(this,M,"f").hiddenOptions.push(t),this}implies(t,e){return E("<string|object> [number|string|array]",[t,e],arguments.length),r(this,k,"f").implies(t,e),this}locale(t){return E("[string]",[t],arguments.length),t?(x(this,Ht,!1,"f"),r(this,L,"f").y18n.setLocale(t),this):(this[Ge](),r(this,L,"f").y18n.getLocale())}middleware(t,e,n){return r(this,mt,"f").addMiddleware(t,!!e,n)}nargs(t,e){return E("<string|object|array> [number]",[t,e],arguments.length),this[se](this.nargs.bind(this),"narg",t,e),this}normalize(t){return E("<array|string>",[t],arguments.length),this[Ft]("normalize",t),this}number(t){return E("<array|string>",[t],arguments.length),this[Ft]("number",t),this[Jt](t),this}option(t,e){if(E("<string|object> [object]",[t,e],arguments.length),typeof t=="object")Object.keys(t).forEach(n=>{this.options(n,t[n])});else{typeof e!="object"&&(e={}),this[Jt](t),r(this,jt,"f")&&(t==="version"||(e==null?void 0:e.alias)==="version")&&this[ti](['"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"),r(this,M,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);let n=e.deprecate||e.deprecated;n&&this.deprecateOption(t,n);let i=e.demand||e.required||e.require;i&&this.demand(t,i),e.demandOption&&this.demandOption(t,typeof e.demandOption=="string"?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),e.implies!==void 0&&this.implies(t,e.implies),e.nargs!==void 0&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||e.type==="boolean")&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||e.type==="array")&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||e.type==="number")&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||e.type==="string")&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||e.type==="count")&&this.count(t),typeof e.global=="boolean"&&this.global(t,e.global),e.defaultDescription&&(r(this,M,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);let o=e.describe||e.description||e.desc;this.describe(t,o),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,n){E("[string|array] [function|boolean|object] [function]",[t,e,n],arguments.length),this[ei](),typeof t=="undefined"&&(t=r(this,Nt,"f")),typeof e=="object"&&(x(this,vt,e,"f"),e=n),typeof e=="function"&&(x(this,ht,e,"f"),e=!1),e||x(this,Nt,t,"f"),r(this,ht,"f")&&x(this,pt,!1,"f");let i=this[ce](t,!!e),o=this.parsed;return r(this,dt,"f").setParsed(this.parsed),J(i)?i.then(a=>(r(this,ht,"f")&&r(this,ht,"f").call(this,r(this,$t,"f"),a,r(this,rt,"f")),a)).catch(a=>{throw r(this,ht,"f")&&r(this,ht,"f")(a,this.parsed.argv,r(this,rt,"f")),a}).finally(()=>{this[Ze](),this.parsed=o}):(r(this,ht,"f")&&r(this,ht,"f").call(this,r(this,$t,"f"),i,r(this,rt,"f")),this[Ze](),this.parsed=o,i)}parseAsync(t,e,n){let i=this.parse(t,e,n);return J(i)?i:Promise.resolve(i)}parseSync(t,e,n){let i=this.parse(t,e,n);if(J(i))throw new q(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return E("<object>",[t],arguments.length),x(this,Pe,t,"f"),this}pkgConf(t,e){E("<string> [string]",[t,e],arguments.length);let n=null,i=this[Ve](e||r(this,Tt,"f"));return i[t]&&typeof i[t]=="object"&&(n=Ce(i[t],e||r(this,Tt,"f"),this[qt]()["deep-merge-config"]||!1,r(this,L,"f")),r(this,M,"f").configObjects=(r(this,M,"f").configObjects||[]).concat(n)),this}positional(t,e){E("<string> <object>",[t,e],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=St(e,(a,c)=>a==="type"&&!["string","number","boolean"].includes(c)?!1:n.includes(a));let i=r(this,le,"f").fullCommands[r(this,le,"f").fullCommands.length-1],o=i?r(this,nt,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return te(o).forEach(a=>{let c=o[a];Array.isArray(c)?c.indexOf(t)!==-1&&(e[a]=!0):c[t]&&!(a in e)&&(e[a]=c[t])}),this.group(t,r(this,D,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return E("[boolean]",[t],arguments.length),x(this,Me,t,"f"),this}required(t,e,n){return this.demand(t,e,n)}require(t,e,n){return this.demand(t,e,n)}requiresArg(t){return E("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&r(this,M,"f").narg[t]?this:(this[se](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,e){return E("[string] [string]",[t,e],arguments.length),t=t||this.$0,r(this,ne,"f").log(r(this,dt,"f").generateCompletionScript(t,e||r(this,ct,"f")||"completion")),this}showHelp(t){if(E("[string|function]",[t],arguments.length),x(this,ft,!0,"f"),!r(this,D,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[ce](r(this,Nt,"f"),void 0,void 0,0,!0);if(J(n))return n.then(()=>{r(this,D,"f").showHelp(t)}),this}let e=r(this,nt,"f").runDefaultBuilderOn(this);if(J(e))return e.then(()=>{r(this,D,"f").showHelp(t)}),this}return r(this,D,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return E("[boolean|string] [string]",[t,e],arguments.length),r(this,D,"f").showHelpOnFail(t,e),this}showVersion(t){return E("[string|function]",[t],arguments.length),r(this,D,"f").showVersion(t),this}skipValidation(t){return E("<array|string>",[t],arguments.length),this[Ft]("skipValidation",t),this}strict(t){return E("[boolean]",[t],arguments.length),x(this,Bt,t!==!1,"f"),this}strictCommands(t){return E("[boolean]",[t],arguments.length),x(this,Gt,t!==!1,"f"),this}strictOptions(t){return E("[boolean]",[t],arguments.length),x(this,Vt,t!==!1,"f"),this}string(t){return E("<array|string>",[t],arguments.length),this[Ft]("string",t),this[Jt](t),this}terminalWidth(){return E([],0),r(this,L,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return E("<object>",[t],arguments.length),x(this,Ht,!1,"f"),r(this,L,"f").y18n.updateLocale(t),this}usage(t,e,n,i){if(E("<string|null|undefined> [string|boolean] [function|object] [function]",[t,e,n,i],arguments.length),e!==void 0){if(at(t,null,r(this,L,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,e,n,i);throw new q(".usage() description must start with $0 if being used as alias for .command()")}else return r(this,D,"f").usage(t),this}version(t,e,n){let i="version";if(E("[boolean|string] [string] [string]",[t,e,n],arguments.length),r(this,jt,"f")&&(this[Be](r(this,jt,"f")),r(this,D,"f").version(void 0),x(this,jt,null,"f")),arguments.length===0)n=this[ii](),t=i;else if(arguments.length===1){if(t===!1)return this;n=t,t=i}else arguments.length===2&&(n=e,e=void 0);return x(this,jt,typeof t=="string"?t:i,"f"),e=e||r(this,D,"f").deferY18nLookup("Show version number"),r(this,D,"f").version(n||void 0),this.boolean(r(this,jt,"f")),this.describe(r(this,jt,"f"),e),this}wrap(t){return E("<number|null|undefined>",[t],arguments.length),r(this,D,"f").wrap(t),this}[(nt=new WeakMap,Tt=new WeakMap,le=new WeakMap,dt=new WeakMap,ct=new WeakMap,je=new WeakMap,$t=new WeakMap,Ht=new WeakMap,Ee=new WeakMap,pt=new WeakMap,xe=new WeakMap,mt=new WeakMap,Ct=new WeakMap,ft=new WeakMap,gt=new WeakMap,ne=new WeakMap,rt=new WeakMap,M=new WeakMap,Ae=new WeakMap,Pe=new WeakMap,ht=new WeakMap,vt=new WeakMap,ie=new WeakMap,Yt=new WeakMap,Nt=new WeakMap,Me=new WeakMap,L=new WeakMap,Bt=new WeakMap,Gt=new WeakMap,Vt=new WeakMap,D=new WeakMap,jt=new WeakMap,k=new WeakMap,Xn)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(e){}return t}[kn](){return{log:(...t)=>{this[Se]()||console.log(...t),x(this,ft,!0,"f"),r(this,rt,"f").length&&x(this,rt,r(this,rt,"f")+`
63
- `,"f"),x(this,rt,r(this,rt,"f")+t.join(" "),"f")},error:(...t)=>{this[Se]()||console.error(...t),x(this,ft,!0,"f"),r(this,rt,"f").length&&x(this,rt,r(this,rt,"f")+`
64
- `,"f"),x(this,rt,r(this,rt,"f")+t.join(" "),"f")}}}[Be](t){te(r(this,M,"f")).forEach(e=>{if((i=>i==="configObjects")(e))return;let n=r(this,M,"f")[e];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete r(this,D,"f").getDescriptions()[t]}[ti](t,e,n){r(this,Ee,"f")[n]||(r(this,L,"f").process.emitWarning(t,e),r(this,Ee,"f")[n]=!0)}[ei](){r(this,xe,"f").push({options:r(this,M,"f"),configObjects:r(this,M,"f").configObjects.slice(0),exitProcess:r(this,pt,"f"),groups:r(this,Ct,"f"),strict:r(this,Bt,"f"),strictCommands:r(this,Gt,"f"),strictOptions:r(this,Vt,"f"),completionCommand:r(this,ct,"f"),output:r(this,rt,"f"),exitError:r(this,$t,"f"),hasOutput:r(this,ft,"f"),parsed:this.parsed,parseFn:r(this,ht,"f"),parseContext:r(this,vt,"f")}),r(this,D,"f").freeze(),r(this,k,"f").freeze(),r(this,nt,"f").freeze(),r(this,mt,"f").freeze()}[ni](){let t="",e;return/\b(node|iojs|electron)(\.exe)?$/.test(r(this,L,"f").process.argv()[0])?e=r(this,L,"f").process.argv().slice(1,2):e=r(this,L,"f").process.argv().slice(0,1),t=e.map(n=>{let i=this[di](r(this,Tt,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),r(this,L,"f").getEnv("_")&&r(this,L,"f").getProcessArgvBin()===r(this,L,"f").getEnv("_")&&(t=r(this,L,"f").getEnv("_").replace(`${r(this,L,"f").path.dirname(r(this,L,"f").process.execPath())}/`,"")),t}[qt](){return r(this,Pe,"f")}[Ge](){if(!r(this,Ht,"f"))return;let t=r(this,L,"f").getEnv("LC_ALL")||r(this,L,"f").getEnv("LC_MESSAGES")||r(this,L,"f").getEnv("LANG")||r(this,L,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[ii](){return this[Ve]().version||"unknown"}[si](t){let e=t["--"]?t["--"]:t._;for(let n=0,i;(i=e[n])!==void 0;n++)r(this,L,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(e[n]=Number(i));return t}[Ve](t){let e=t||"*";if(r(this,ie,"f")[e])return r(this,ie,"f")[e];let n={};try{let i=t||r(this,L,"f").mainFilename;!t&&r(this,L,"f").path.extname(i)&&(i=r(this,L,"f").path.dirname(i));let o=r(this,L,"f").findUp(i,(a,c)=>{if(c.includes("package.json"))return"package.json"});at(o,void 0,r(this,L,"f")),n=JSON.parse(r(this,L,"f").readFileSync(o,"utf8"))}catch(i){}return r(this,ie,"f")[e]=n||{},r(this,ie,"f")[e]}[Ft](t,e){e=[].concat(e),e.forEach(n=>{n=this[Je](n),r(this,M,"f")[t].push(n)})}[se](t,e,n,i){this[Ke](t,e,n,i,(o,a,c)=>{r(this,M,"f")[o][a]=c})}[qe](t,e,n,i){this[Ke](t,e,n,i,(o,a,c)=>{r(this,M,"f")[o][a]=(r(this,M,"f")[o][a]||[]).concat(c)})}[Ke](t,e,n,i,o){if(Array.isArray(n))n.forEach(a=>{t(a,i)});else if((a=>typeof a=="object")(n))for(let a of te(n))t(a,n[a]);else o(e,this[Je](n),i)}[Je](t){return t==="__proto__"?"___proto___":t}[Qe](t,e){return this[se](this[Qe].bind(this),"key",t,e),this}[Ze](){var t,e,n,i,o,a,c,p,O,b,f,g;let w=r(this,xe,"f").pop();at(w,void 0,r(this,L,"f"));let S;t=this,e=this,n=this,i=this,o=this,a=this,c=this,p=this,O=this,b=this,f=this,g=this,{options:{set value(y){x(t,M,y,"f")}}.value,configObjects:S,exitProcess:{set value(y){x(e,pt,y,"f")}}.value,groups:{set value(y){x(n,Ct,y,"f")}}.value,output:{set value(y){x(i,rt,y,"f")}}.value,exitError:{set value(y){x(o,$t,y,"f")}}.value,hasOutput:{set value(y){x(a,ft,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){x(c,Bt,y,"f")}}.value,strictCommands:{set value(y){x(p,Gt,y,"f")}}.value,strictOptions:{set value(y){x(O,Vt,y,"f")}}.value,completionCommand:{set value(y){x(b,ct,y,"f")}}.value,parseFn:{set value(y){x(f,ht,y,"f")}}.value,parseContext:{set value(y){x(g,vt,y,"f")}}.value}=w,r(this,M,"f").configObjects=S,r(this,D,"f").unfreeze(),r(this,k,"f").unfreeze(),r(this,nt,"f").unfreeze(),r(this,mt,"f").unfreeze()}[ri](t,e){return zt(e,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[oi].bind(this),getContext:this[ai].bind(this),getHasOutput:this[li].bind(this),getLoggerInstance:this[ci].bind(this),getParseContext:this[fi].bind(this),getParserConfiguration:this[qt].bind(this),getUsageInstance:this[hi].bind(this),getValidationInstance:this[ui].bind(this),hasParseCallback:this[Se].bind(this),postProcess:this[Kt].bind(this),reset:this[Xe].bind(this),runValidation:this[ke].bind(this),runYargsParserAndExecuteCommands:this[ce].bind(this),setHasOutput:this[pi].bind(this)}}[oi](){return r(this,nt,"f")}[ai](){return r(this,le,"f")}[li](){return r(this,ft,"f")}[ci](){return r(this,ne,"f")}[fi](){return r(this,vt,"f")||{}}[hi](){return r(this,D,"f")}[ui](){return r(this,k,"f")}[Se](){return!!r(this,ht,"f")}[Kt](t,e,n,i){return n||J(t)||(e||(t=this[Xn](t)),(this[qt]()["parse-positional-numbers"]||this[qt]()["parse-positional-numbers"]===void 0)&&(t=this[si](t)),i&&(t=Wt(t,this,r(this,mt,"f").getMiddleware(),!1))),t}[Xe](t={}){x(this,M,r(this,M,"f")||{},"f");let e={};e.local=r(this,M,"f").local||[],e.configObjects=r(this,M,"f").configObjects||[];let n={};e.local.forEach(a=>{n[a]=!0,(t[a]||[]).forEach(c=>{n[c]=!0})}),Object.assign(r(this,Yt,"f"),Object.keys(r(this,Ct,"f")).reduce((a,c)=>{let p=r(this,Ct,"f")[c].filter(O=>!(O in n));return p.length>0&&(a[c]=p),a},{})),x(this,Ct,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(a=>{e[a]=(r(this,M,"f")[a]||[]).filter(c=>!n[c])}),o.forEach(a=>{e[a]=St(r(this,M,"f")[a],c=>!n[c])}),e.envPrefix=r(this,M,"f").envPrefix,x(this,M,e,"f"),x(this,D,r(this,D,"f")?r(this,D,"f").reset(n):Hn(this,r(this,L,"f")),"f"),x(this,k,r(this,k,"f")?r(this,k,"f").reset(n):Jn(this,r(this,D,"f"),r(this,L,"f")),"f"),x(this,nt,r(this,nt,"f")?r(this,nt,"f").reset():Wn(r(this,D,"f"),r(this,k,"f"),r(this,mt,"f"),r(this,L,"f")),"f"),r(this,dt,"f")||x(this,dt,Vn(this,r(this,D,"f"),r(this,nt,"f"),r(this,L,"f")),"f"),r(this,mt,"f").reset(),x(this,ct,null,"f"),x(this,rt,"","f"),x(this,$t,null,"f"),x(this,ft,!1,"f"),this.parsed=!1,this}[di](t,e){return r(this,L,"f").path.relative(t,e)}[ce](t,e,n,i=0,o=!1){let a=!!n||o;t=t||r(this,Nt,"f"),r(this,M,"f").__=r(this,L,"f").y18n.__,r(this,M,"f").configuration=this[qt]();let c=!!r(this,M,"f").configuration["populate--"],p=Object.assign({},r(this,M,"f").configuration,{"populate--":!0}),O=r(this,L,"f").Parser.detailed(t,Object.assign({},r(this,M,"f"),{configuration:{"parse-positional-numbers":!1,...p}})),b=Object.assign(O.argv,r(this,vt,"f")),f,g=O.aliases,w=!1,S=!1;Object.keys(b).forEach(y=>{y===r(this,gt,"f")&&b[y]?w=!0:y===r(this,jt,"f")&&b[y]&&(S=!0)}),b.$0=this.$0,this.parsed=O,i===0&&r(this,D,"f").clearCachedHelpMessage();try{if(this[Ge](),e)return this[Kt](b,c,!!n,!1);r(this,gt,"f")&&[r(this,gt,"f")].concat(g[r(this,gt,"f")]||[]).filter(Y=>Y.length>1).includes(""+b._[b._.length-1])&&(b._.pop(),w=!0);let y=r(this,nt,"f").getCommands(),d=r(this,dt,"f").completionKey in b,W=w||d||o;if(b._.length){if(y.length){let T;for(let Y=i||0,v;b._[Y]!==void 0;Y++)if(v=String(b._[Y]),y.includes(v)&&v!==r(this,ct,"f")){let B=r(this,nt,"f").runCommand(v,this,O,Y+1,o,w||S||o);return this[Kt](B,c,!!n,!1)}else if(!T&&v!==r(this,ct,"f")){T=v;break}!r(this,nt,"f").hasDefaultCommand()&&r(this,Me,"f")&&T&&!W&&r(this,k,"f").recommendCommands(T,y)}r(this,ct,"f")&&b._.includes(r(this,ct,"f"))&&!d&&(r(this,pt,"f")&&It(!0),this.showCompletionScript(),this.exit(0))}if(r(this,nt,"f").hasDefaultCommand()&&!W){let T=r(this,nt,"f").runCommand(null,this,O,0,o,w||S||o);return this[Kt](T,c,!!n,!1)}if(d){r(this,pt,"f")&&It(!0),t=[].concat(t);let T=t.slice(t.indexOf(`--${r(this,dt,"f").completionKey}`)+1);return r(this,dt,"f").getCompletion(T,(Y,v)=>{if(Y)throw new q(Y.message);(v||[]).forEach(B=>{r(this,ne,"f").log(B)}),this.exit(0)}),this[Kt](b,!c,!!n,!1)}if(r(this,ft,"f")||(w?(r(this,pt,"f")&&It(!0),a=!0,this.showHelp("log"),this.exit(0)):S&&(r(this,pt,"f")&&It(!0),a=!0,r(this,D,"f").showVersion("log"),this.exit(0))),!a&&r(this,M,"f").skipValidation.length>0&&(a=Object.keys(b).some(T=>r(this,M,"f").skipValidation.indexOf(T)>=0&&b[T]===!0)),!a){if(O.error)throw new q(O.error.message);if(!d){let T=this[ke](g,{},O.error);n||(f=Wt(b,this,r(this,mt,"f").getMiddleware(),!0)),f=this[ri](T,f!=null?f:b),J(f)&&!n&&(f=f.then(()=>Wt(b,this,r(this,mt,"f").getMiddleware(),!1)))}}}catch(y){if(y instanceof q)r(this,D,"f").fail(y.message,y);else throw y}return this[Kt](f!=null?f:b,c,!!n,!0)}[ke](t,e,n,i){let o={...this.getDemandedOptions()};return a=>{if(n)throw new q(n.message);r(this,k,"f").nonOptionCount(a),r(this,k,"f").requiredArguments(a,o);let c=!1;r(this,Gt,"f")&&(c=r(this,k,"f").unknownCommands(a)),r(this,Bt,"f")&&!c?r(this,k,"f").unknownArguments(a,t,e,!!i):r(this,Vt,"f")&&r(this,k,"f").unknownArguments(a,t,{},!1,!1),r(this,k,"f").limitedChoices(a),r(this,k,"f").implications(a),r(this,k,"f").conflicting(a)}}[pi](){x(this,ft,!0,"f")}[Jt](t){if(typeof t=="string")r(this,M,"f").key[t]=!0;else for(let e of t)r(this,M,"f").key[e]=!0}};function Tn(s){return!!s&&typeof s.getInternalMethods=="function"}var rs=Zn(Fn),Ie=rs;var fe=rn(require("chalk")),bi=require("fs"),Oi=rn(require("isomorphic-unfetch")),Fe=require("process");var gi=async s=>await s(),Qt=class extends Error{constructor(t,e,n,i,o){super(`${t}
65
- ${i}${o?" "+o:""} (${e} ${n})`);this.errorMessage=t;this.fetchMethod=e;this.fetchUri=n;this.statusCode=i;this.statusText=o;Object.setPrototypeOf(this,Qt.prototype)}};var tn=class{constructor(t){on(this,"options");var e,n,i,o,a,c;if(!t.apiKey&&!t.bearerToken)throw new Error("You must provide an API key or a bearer token");this.options={...t,fetch:(e=t.fetch)!=null?e:fetch,apiHost:(n=t.apiHost)!=null?n:"https://uniform.app",apiKey:(i=t.apiKey)!=null?i:null,projectId:(o=t.projectId)!=null?o:null,bearerToken:(a=t.bearerToken)!=null?a:null,limitPolicy:(c=t.limitPolicy)!=null?c:gi}}async apiClient(t,e){return this.options.limitPolicy(async()=>{var o;let n=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},i=await fetch(t.toString(),{...e,headers:{...e==null?void 0:e.headers,...n}});if(!i.ok){let a="";try{let c=await i.text();try{let p=JSON.parse(c);p.errorMessage?a=Array.isArray(p.errorMessage)?p.errorMessage.join(", "):p.errorMessage:a=c}catch(p){a=c}}catch(c){a="General error"}throw new Qt(a,(o=e==null?void 0:e.method)!=null?o:"GET",t.toString(),i.status)}return(e==null?void 0:e.expectNoContent)?null:await i.json()})}createUrl(t,e){let n=new URL(`${this.options.apiHost}${t}`);return Object.entries(e!=null?e:{}).forEach(([i,o])=>{var a;typeof o!==void 0&&o!==null&&n.searchParams.append(i,(a=o==null?void 0:o.toString())!=null?a:"")}),n}};var Ne,en=class extends tn{constructor(t){super(t)}async get(t){let{projectId:e}=this.options,n=this.createUrl(an(en,Ne),{...t,projectId:e});return await this.apiClient(n)}},$e=en;Ne=new WeakMap,ln($e,Ne,"/api/v2/manifest");var _i={command:"get [output]",aliases:["dl","download"],describe:"Download the Uniform Context manifest for a project",builder:s=>{var t,e,n;return s.option("apiKey",{alias:"k",demandOption:!0,string:!0,default:(t=process.env.UNIFORM_API_KEY)!=null?t:"",describe:"Uniform API key to use. Defaults to UNIFORM_API_KEY env if set."}).option("project",{describe:"Uniform project ID. Defaults to UCTX_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",demandOption:!0,default:(n=(e=process.env.UCTX_CLI_PROJECT_ID)!=null?e:process.env.UNIFORM_PROJECT_ID)!=null?n:"",type:"string",alias:["p"]}).option("preview",{describe:"If set, fetches the unpublished preview manifest (The API key must have permission)",default:!1,type:"boolean",alias:["d"]}).option("output",{string:!0,alias:"o",default:process.env.UNIFORM_MANIFEST_PATH,describe:"Path to write manifest to. Defaults to UNIFORM_MANIFEST_PATH env if set."})},handler:async({apiKey:s,output:t,project:e,preview:n})=>{e||(console.error(fe.default.red("You must specify the project ID")),(0,Fe.exit)(1));let i=os(),o=new $e({apiHost:i,projectId:e,apiKey:s,fetch:Oi.default});try{let a=await o.get({preview:n}),c=JSON.stringify(a,null,2);t?(0,bi.writeFile)(t,c,p=>{p&&(console.error(`Error writing file to ${t}
66
- `,p),(0,Fe.exit)(1)),console.log(fe.default.green(`\u2705 ${t} has been updated from ${i}`))}):console.log(c)}catch(a){let c;a instanceof Qt?(a.statusCode===403&&(c=`The API key ${s} did not have permissions to fetch the manifest. Ensure ${n?"Context > Read Drafts":"Context > Manifest > Read"} permissions are granted.`),c=a.message):c=a.toString(),console.error(fe.default.red("\u26A0 Error fetching Context manifest")),console.error(fe.default.gray(` \u2757 ${c}`)),(0,Fe.exit)(1)}}},os=()=>process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app";var wi={command:"manifest <command>",describe:"Commands for Uniform Context",aliases:["man"],builder:s=>s.command(_i).demandCommand(),handler:()=>{Ie.help()}};var as={commands:[{command:"context <command>",aliases:["ctx"],describe:"Uniform Context commands",builder:s=>s.command(wi).demandCommand(),handler:()=>{Ie.showHelp()}}]};module.exports=Mi(ls);0&&(module.exports={uniformCLI});
57
+ `;var mo=class{constructor(t,n,i,r){var o,s,a;this.yargs=t,this.usage=n,this.command=i,this.shim=r,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.zshShell=(a=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((s=this.shim.getEnv("ZSH_NAME"))===null||s===void 0?void 0:s.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(t,n,i,r){let o=this.command.getCommandHandlers();for(let a=0,l=t.length;a<l;++a)if(o[t[a]]&&o[t[a]].builder){let u=o[t[a]].builder;if(Kn(u)){let d=this.yargs.getInternalMethods().reset();return u(d,!0),d.argv}}let s=[];this.commandCompletions(s,t,i),this.optionCompletions(s,t,n,i),this.choicesCompletions(s,t,n,i),r(null,s)}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(o=>{let s=ct(o[0]).cmd;if(n.indexOf(s)===-1)if(!this.zshShell)t.push(s);else{let a=o[1]||"";t.push(s.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(t,n,i,r){if((r.match(/^-/)||r===""&&t.length===0)&&!this.previousArgHasChoices(n)){let o=this.yargs.getOptions(),s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(o.key).forEach(a=>{let l=!!o.configuration["boolean-negation"]&&o.boolean.includes(a);!s.includes(a)&&!this.argsContainKey(n,i,a,l)&&(this.completeOptionKey(a,t,r),l&&!!o.default[a]&&this.completeOptionKey(`no-${a}`,t,r))})}}choicesCompletions(t,n,i,r){if(this.previousArgHasChoices(n)){let o=this.getPreviousArgChoices(n);o&&o.length>0&&t.push(...o)}}getPreviousArgChoices(t){if(t.length<1)return;let n=t[t.length-1],i="";if(!n.startsWith("--")&&t.length>1&&(i=n,n=t[t.length-2]),!n.startsWith("--"))return;let r=n.replace(/-/g,""),o=this.yargs.getOptions();if(Object.keys(o.key).some(s=>s===r)&&Array.isArray(o.choices[r]))return o.choices[r].filter(s=>!i||s.startsWith(i))}previousArgHasChoices(t){let n=this.getPreviousArgChoices(t);return n!==void 0&&n.length>0}argsContainKey(t,n,i,r){if(t.indexOf(`--${i}`)!==-1||r&&t.indexOf(`--no-${i}`)!==-1)return!0;if(this.aliases){for(let o of this.aliases[i])if(n[o]!==void 0)return!0}return!1}completeOptionKey(t,n,i){let r=this.usage.getDescriptions(),o=l=>/^--/.test(l),s=l=>/^[^0-9]$/.test(l),a=!o(i)&&s(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(Pe(this.customCompletionFunction,null,this.shim),ec(this.customCompletionFunction)){let o=this.customCompletionFunction(i,n);return te(o)?o.then(s=>{this.shim.process.nextTick(()=>{r(null,s)})}).catch(s=>{this.shim.process.nextTick(()=>{r(s,void 0)})}):r(null,o)}else return tc(this.customCompletionFunction)?this.customCompletionFunction(i,n,(o=r)=>this.defaultCompletion(t,n,i,o),o=>{r(null,o)}):this.customCompletionFunction(i,n,o=>{r(null,o)})}getCompletion(t,n){let i=t.length?t[t.length-1]:"",r=this.yargs.parse(t,!0),o=this.customCompletionFunction?s=>this.customCompletion(t,s,i,n):s=>this.defaultCompletion(t,s,i,n);return te(r)?r.then(o):o(r)}generateCompletionScript(t,n){let i=this.zshShell?ho:po,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 go(e,t,n,i){return new mo(e,t,n,i)}function ec(e){return e.length<3}function tc(e){return e.length>3}g();g();function yo(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 bo=["$0","--","_"];function wo(e,t,n){let i=n.y18n.__,r=n.y18n.__n,o={};o.nonOptionCount=function(f){let p=e.getDemandedCommands(),C=f._.length+(f["--"]?f["--"].length:0)-e.getInternalMethods().getContext().commands.length;p._&&(C<p._.min||C>p._.max)&&(C<p._.min?p._.minMsg!==void 0?t.fail(p._.minMsg?p._.minMsg.replace(/\$0/g,C.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",C,C.toString(),p._.min.toString())):C>p._.max&&(p._.maxMsg!==void 0?t.fail(p._.maxMsg?p._.maxMsg.replace(/\$0/g,C.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",C,C.toString(),p._.max.toString()))))},o.positionalCount=function(f,p){p<f&&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+"",f+""))},o.requiredArguments=function(f,p){let y=null;for(let C of Object.keys(p))(!Object.prototype.hasOwnProperty.call(f,C)||typeof f[C]=="undefined")&&(y=y||{},y[C]=p[C]);if(y){let C=[];for(let m of Object.keys(y)){let P=y[m];P&&C.indexOf(P)<0&&C.push(P)}let A=C.length?`
58
+ ${C.join(`
59
+ `)}`:"";t.fail(r("Missing required argument: %s","Missing required arguments: %s",Object.keys(y).length,Object.keys(y).join(", ")+A))}},o.unknownArguments=function(f,p,y,C,A=!0){var m;let P=e.getInternalMethods().getCommandInstance().getCommands(),E=[],G=e.getInternalMethods().getContext();if(Object.keys(f).forEach(B=>{!bo.includes(B)&&!Object.prototype.hasOwnProperty.call(y,B)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),B)&&!o.isValidAndSomeAliasIsNotNew(B,p)&&E.push(B)}),A&&(G.commands.length>0||P.length>0||C)&&f._.slice(G.commands.length).forEach(B=>{P.includes(""+B)||E.push(""+B)}),A){let V=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,lt=G.commands.length+V;lt<f._.length&&f._.slice(lt).forEach(Be=>{Be=String(Be),!G.commands.includes(Be)&&!E.includes(Be)&&E.push(Be)})}E.length&&t.fail(r("Unknown argument: %s","Unknown arguments: %s",E.length,E.join(", ")))},o.unknownCommands=function(f){let p=e.getInternalMethods().getCommandInstance().getCommands(),y=[],C=e.getInternalMethods().getContext();return(C.commands.length>0||p.length>0)&&f._.slice(C.commands.length).forEach(A=>{p.includes(""+A)||y.push(""+A)}),y.length>0?(t.fail(r("Unknown command: %s","Unknown commands: %s",y.length,y.join(", "))),!0):!1},o.isValidAndSomeAliasIsNotNew=function(f,p){if(!Object.prototype.hasOwnProperty.call(p,f))return!1;let y=e.parsed.newAliases;return[f,...p[f]].some(C=>!Object.prototype.hasOwnProperty.call(y,C)||!y[f])},o.limitedChoices=function(f){let p=e.getOptions(),y={};if(!Object.keys(p.choices).length)return;Object.keys(f).forEach(m=>{bo.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(p.choices,m)&&[].concat(f[m]).forEach(P=>{p.choices[m].indexOf(P)===-1&&P!==void 0&&(y[m]=(y[m]||[]).concat(P))})});let C=Object.keys(y);if(!C.length)return;let A=i("Invalid values:");C.forEach(m=>{A+=`
60
+ ${i("Argument: %s, Given: %s, Choices: %s",m,t.stringifiedValues(y[m]),t.stringifiedValues(p.choices[m]))}`}),t.fail(A)};let s={};o.implies=function(f,p){j("<string|object> [array|number|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(y=>{o.implies(y,f[y])}):(e.global(f),s[f]||(s[f]=[]),Array.isArray(p)?p.forEach(y=>o.implies(f,y)):(Pe(p,void 0,n),s[f].push(p)))},o.getImplied=function(){return s};function a(d,f){let p=Number(f);return f=isNaN(p)?f:p,typeof f=="number"?f=d._.length>=f:f.match(/^--no-.+/)?(f=f.match(/^--no-(.+)/)[1],f=!Object.prototype.hasOwnProperty.call(d,f)):f=Object.prototype.hasOwnProperty.call(d,f),f}o.implications=function(f){let p=[];if(Object.keys(s).forEach(y=>{let C=y;(s[y]||[]).forEach(A=>{let m=C,P=A;m=a(f,m),A=a(f,A),m&&!A&&p.push(` ${C} -> ${P}`)})}),p.length){let y=`${i("Implications failed:")}
61
+ `;p.forEach(C=>{y+=C}),t.fail(y)}};let l={};o.conflicts=function(f,p){j("<string|object> [array|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(y=>{o.conflicts(y,f[y])}):(e.global(f),l[f]||(l[f]=[]),Array.isArray(p)?p.forEach(y=>o.conflicts(f,y)):l[f].push(p))},o.getConflicting=()=>l,o.conflicting=function(f){Object.keys(f).forEach(p=>{l[p]&&l[p].forEach(y=>{y&&f[p]!==void 0&&f[y]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,y))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(p=>{l[p].forEach(y=>{y&&f[n.Parser.camelCase(p)]!==void 0&&f[n.Parser.camelCase(y)]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,y))})})},o.recommendCommands=function(f,p){let y=3;p=p.sort((m,P)=>P.length-m.length);let C=null,A=1/0;for(let m=0,P;(P=p[m])!==void 0;m++){let E=yo(f,P);E<=y&&E<A&&(A=E,C=P)}C&&t.fail(i("Did you mean %s?",C))},o.reset=function(f){return s=ft(s,p=>!f[p]),l=ft(l,p=>!f[p]),o};let u=[];return o.freeze=function(){u.push({implied:s,conflicting:l})},o.unfreeze=function(){let f=u.pop();Pe(f,void 0,n),{implied:s,conflicting:l}=f},o}g();var Wi=[],On;function Zn(e,t,n,i){On=i;let r={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return r;let o=/\.json|\..*rc$/.test(e.extends),s=null;if(o)s=ic(t,e.extends);else try{s=require.resolve(e.extends)}catch(a){return e}nc(s),Wi.push(s),r=o?JSON.parse(On.readFileSync(s,"utf8")):require(e.extends),delete e.extends,r=Zn(r,On.path.dirname(s),n,On)}return Wi=[],n?Ao(r,e):Object.assign({},r,e)}function nc(e){if(Wi.indexOf(e)>-1)throw new Z(`Circular extended configurations: '${e}'.`)}function ic(e,t){return On.path.resolve(e,t)}function Ao(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]=Ao(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},c=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)},le,Tt,vn,We,Ne,Xn,dt,Ut,ei,ke,ti,He,Ze,Te,Ye,sn,he,L,ni,ii,Ue,Rt,an,$t,pt,ri,$,Wt,kt,Ht,Y,Xe,oe;function xo(e){return(t=[],n=e.process.cwd(),i)=>{let r=new $o(t,n,i,e);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Co=Symbol("copyDoubleDash"),Oo=Symbol("copyDoubleDash"),ki=Symbol("deleteFromParserHintObject"),vo=Symbol("emitWarning"),Eo=Symbol("freeze"),_o=Symbol("getDollarZero"),Yt=Symbol("getParserConfiguration"),Hi=Symbol("guessLocale"),So=Symbol("guessVersion"),Po=Symbol("parsePositionalNumbers"),Yi=Symbol("pkgUp"),ht=Symbol("populateParserHintArray"),ln=Symbol("populateParserHintSingleValueDictionary"),Gi=Symbol("populateParserHintArrayDictionary"),Bi=Symbol("populateParserHintDictionary"),qi=Symbol("sanitizeKey"),zi=Symbol("setKey"),Vi=Symbol("unfreeze"),jo=Symbol("validateAsync"),Io=Symbol("getCommandInstance"),Mo=Symbol("getContext"),Fo=Symbol("getHasOutput"),Lo=Symbol("getLoggerInstance"),Do=Symbol("getParseContext"),No=Symbol("getUsageInstance"),To=Symbol("getValidationInstance"),oi=Symbol("hasParseCallback"),Gt=Symbol("postProcess"),Uo=Symbol("rebase"),Qi=Symbol("reset"),En=Symbol("runYargsParserAndExecuteCommands"),Ki=Symbol("runValidation"),Ro=Symbol("setHasOutput"),Bt=Symbol("kTrackManuallySetKeys"),$o=class{constructor(t=[],n,i,r){this.customScriptName=!1,this.parsed=!1,le.set(this,void 0),Tt.set(this,void 0),vn.set(this,{commands:[],fullCommands:[]}),We.set(this,null),Ne.set(this,null),Xn.set(this,"show-hidden"),dt.set(this,null),Ut.set(this,!0),ei.set(this,{}),ke.set(this,!0),ti.set(this,[]),He.set(this,void 0),Ze.set(this,{}),Te.set(this,!1),Ye.set(this,null),sn.set(this,void 0),he.set(this,""),L.set(this,void 0),ni.set(this,void 0),ii.set(this,{}),Ue.set(this,null),Rt.set(this,null),an.set(this,{}),$t.set(this,{}),pt.set(this,void 0),ri.set(this,!1),$.set(this,void 0),Wt.set(this,!1),kt.set(this,!1),Ht.set(this,!1),Y.set(this,void 0),Xe.set(this,null),oe.set(this,void 0),I(this,$,r,"f"),I(this,pt,t,"f"),I(this,Tt,n,"f"),I(this,ni,i,"f"),I(this,He,new Ui(this),"f"),this.$0=this[_o](),this[Qi](),I(this,le,c(this,le,"f"),"f"),I(this,Y,c(this,Y,"f"),"f"),I(this,oe,c(this,oe,"f"),"f"),I(this,L,c(this,L,"f"),"f"),c(this,L,"f").showHiddenOpt=c(this,Xn,"f"),I(this,sn,this[Oo](),"f")}addHelpOpt(t,n){let i="help";return j("[string|boolean] [string]",[t,n],arguments.length),c(this,Ye,"f")&&(this[ki](c(this,Ye,"f")),I(this,Ye,null,"f")),t===!1&&n===void 0?this:(I(this,Ye,typeof t=="string"?t:i,"f"),this.boolean(c(this,Ye,"f")),this.describe(c(this,Ye,"f"),n||c(this,Y,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(j("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let i=typeof t=="string"?t:c(this,Xn,"f");return this.boolean(i),this.describe(i,n||c(this,Y,"f").deferY18nLookup("Show hidden options")),c(this,L,"f").showHiddenOpt=i,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return j("<object|string|array> [string|array]",[t,n],arguments.length),this[Gi](this.alias.bind(this),"alias",t,n),this}array(t){return j("<array|string>",[t],arguments.length),this[ht]("array",t),this[Bt](t),this}boolean(t){return j("<array|string>",[t],arguments.length),this[ht]("boolean",t),this[Bt](t),this}check(t,n){return j("<function> [boolean]",[t,n],arguments.length),this.middleware((i,r)=>Nt(()=>t(i,r.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&c(this,Y,"f").fail(o.toString(),o):c(this,Y,"f").fail(c(this,$,"f").y18n.__("Argument check failed: %s",t.toString())),i),o=>(c(this,Y,"f").fail(o.message?o.message:o.toString(),o),i)),!1,n),this}choices(t,n){return j("<object|string|array> [string|array]",[t,n],arguments.length),this[Gi](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(j("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new Z("coerce callback must be provided");for(let i of t)this.coerce(i,n);return this}else if(typeof t=="object"){for(let i of Object.keys(t))this.coerce(i,t[i]);return this}if(!n)throw new Z("coerce callback must be provided");return c(this,L,"f").key[t]=!0,c(this,He,"f").addCoerceMiddleware((i,r)=>{let o;return Nt(()=>(o=r.getAliases(),n(i[t])),s=>{if(i[t]=s,o[t])for(let a of o[t])i[a]=s;return i},s=>{throw new Z(s.message)})},t),this}conflicts(t,n){return j("<string|object> [string|array]",[t,n],arguments.length),c(this,oe,"f").conflicts(t,n),this}config(t="config",n,i){return j("[object|string] [string|function] [function]",[t,n,i],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=Zn(t,c(this,Tt,"f"),this[Yt]()["deep-merge-config"]||!1,c(this,$,"f")),c(this,L,"f").configObjects=(c(this,L,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(i=n,n=void 0),this.describe(t,n||c(this,Y,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(r=>{c(this,L,"f").config[r]=i||!0}),this)}completion(t,n,i){return j("[string] [string|boolean|function] [function]",[t,n,i],arguments.length),typeof n=="function"&&(i=n,n=void 0),I(this,Ne,t||c(this,Ne,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(c(this,Ne,"f"),n),i&&c(this,We,"f").registerFunction(i),this}command(t,n,i,r,o,s){return j("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,i,r,o,s],arguments.length),c(this,le,"f").addHandler(t,n,i,r,o,s),this}commands(t,n,i,r,o,s){return this.command(t,n,i,r,o,s)}commandDir(t,n){j("<string> [object]",[t,n],arguments.length);let i=c(this,ni,"f")||c(this,$,"f").require;return c(this,le,"f").addDirectory(t,i,c(this,$,"f").getCallerFile(),n),this}count(t){return j("<array|string>",[t],arguments.length),this[ht]("count",t),this[Bt](t),this}default(t,n,i){return j("<object|string|array> [*] [string]",[t,n,i],arguments.length),i&&(Ti(t,c(this,$,"f")),c(this,L,"f").defaultDescription[t]=i),typeof n=="function"&&(Ti(t,c(this,$,"f")),c(this,L,"f").defaultDescription[t]||(c(this,L,"f").defaultDescription[t]=c(this,Y,"f").functionDescription(n)),n=n.call()),this[ln](this.default.bind(this),"default",t,n),this}defaults(t,n,i){return this.default(t,n,i)}demandCommand(t=1,n,i,r){return j("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,n,i,r],arguments.length),typeof n!="number"&&(i=n,n=1/0),this.global("_",!1),c(this,L,"f").demandedCommands._={min:t,max:n,minMsg:i,maxMsg:r},this}demand(t,n,i){return Array.isArray(n)?(n.forEach(r=>{Pe(i,!0,c(this,$,"f")),this.demandOption(r,i)}),n=1/0):typeof n!="number"&&(i=n,n=1/0),typeof t=="number"?(Pe(i,!0,c(this,$,"f")),this.demandCommand(t,n,i,i)):Array.isArray(t)?t.forEach(r=>{Pe(i,!0,c(this,$,"f")),this.demandOption(r,i)}):typeof i=="string"?this.demandOption(t,i):(i===!0||typeof i=="undefined")&&this.demandOption(t),this}demandOption(t,n){return j("<object|string|array> [string]",[t,n],arguments.length),this[ln](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return j("<string> [string|boolean]",[t,n],arguments.length),c(this,L,"f").deprecatedOptions[t]=n,this}describe(t,n){return j("<object|string|array> [string]",[t,n],arguments.length),this[zi](t,!0),c(this,Y,"f").describe(t,n),this}detectLocale(t){return j("<boolean>",[t],arguments.length),I(this,Ut,t,"f"),this}env(t){return j("[string|boolean]",[t],arguments.length),t===!1?delete c(this,L,"f").envPrefix:c(this,L,"f").envPrefix=t||"",this}epilogue(t){return j("<string>",[t],arguments.length),c(this,Y,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return j("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(i=>this.example(...i)):c(this,Y,"f").example(t,n),this}exit(t,n){I(this,Te,!0,"f"),I(this,dt,n,"f"),c(this,ke,"f")&&c(this,$,"f").process.exit(t)}exitProcess(t=!0){return j("[boolean]",[t],arguments.length),I(this,ke,t,"f"),this}fail(t){if(j("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new Z("Invalid first argument. Expected function or boolean 'false'");return c(this,Y,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return j("<array> [function]",[t,n],arguments.length),n?c(this,We,"f").getCompletion(t,n):new Promise((i,r)=>{c(this,We,"f").getCompletion(t,(o,s)=>{o?r(o):i(s)})})}getDemandedOptions(){return j([],0),c(this,L,"f").demandedOptions}getDemandedCommands(){return j([],0),c(this,L,"f").demandedCommands}getDeprecatedOptions(){return j([],0),c(this,L,"f").deprecatedOptions}getDetectLocale(){return c(this,Ut,"f")}getExitProcess(){return c(this,ke,"f")}getGroups(){return Object.assign({},c(this,Ze,"f"),c(this,$t,"f"))}getHelp(){if(I(this,Te,!0,"f"),!c(this,Y,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[En](c(this,pt,"f"),void 0,void 0,0,!0);if(te(n))return n.then(()=>c(this,Y,"f").help())}let t=c(this,le,"f").runDefaultBuilderOn(this);if(te(t))return t.then(()=>c(this,Y,"f").help())}return Promise.resolve(c(this,Y,"f").help())}getOptions(){return c(this,L,"f")}getStrict(){return c(this,Wt,"f")}getStrictCommands(){return c(this,kt,"f")}getStrictOptions(){return c(this,Ht,"f")}global(t,n){return j("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?c(this,L,"f").local=c(this,L,"f").local.filter(i=>t.indexOf(i)===-1):t.forEach(i=>{c(this,L,"f").local.includes(i)||c(this,L,"f").local.push(i)}),this}group(t,n){j("<string|array> <string>",[t,n],arguments.length);let i=c(this,$t,"f")[n]||c(this,Ze,"f")[n];c(this,$t,"f")[n]&&delete c(this,$t,"f")[n];let r={};return c(this,Ze,"f")[n]=(i||[]).concat(t).filter(o=>r[o]?!1:r[o]=!0),this}hide(t){return j("<string>",[t],arguments.length),c(this,L,"f").hiddenOptions.push(t),this}implies(t,n){return j("<string|object> [number|string|array]",[t,n],arguments.length),c(this,oe,"f").implies(t,n),this}locale(t){return j("[string]",[t],arguments.length),t?(I(this,Ut,!1,"f"),c(this,$,"f").y18n.setLocale(t),this):(this[Hi](),c(this,$,"f").y18n.getLocale())}middleware(t,n,i){return c(this,He,"f").addMiddleware(t,!!n,i)}nargs(t,n){return j("<string|object|array> [number]",[t,n],arguments.length),this[ln](this.nargs.bind(this),"narg",t,n),this}normalize(t){return j("<array|string>",[t],arguments.length),this[ht]("normalize",t),this}number(t){return j("<array|string>",[t],arguments.length),this[ht]("number",t),this[Bt](t),this}option(t,n){if(j("<string|object> [object]",[t,n],arguments.length),typeof t=="object")Object.keys(t).forEach(i=>{this.options(i,t[i])});else{typeof n!="object"&&(n={}),this[Bt](t),c(this,Xe,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[vo](['"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"),c(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&&(c(this,L,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let o=n.describe||n.description||n.desc;this.describe(t,o),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,i){j("[string|array] [function|boolean|object] [function]",[t,n,i],arguments.length),this[Eo](),typeof t=="undefined"&&(t=c(this,pt,"f")),typeof n=="object"&&(I(this,Rt,n,"f"),n=i),typeof n=="function"&&(I(this,Ue,n,"f"),n=!1),n||I(this,pt,t,"f"),c(this,Ue,"f")&&I(this,ke,!1,"f");let r=this[En](t,!!n),o=this.parsed;return c(this,We,"f").setParsed(this.parsed),te(r)?r.then(s=>(c(this,Ue,"f")&&c(this,Ue,"f").call(this,c(this,dt,"f"),s,c(this,he,"f")),s)).catch(s=>{throw c(this,Ue,"f")&&c(this,Ue,"f")(s,this.parsed.argv,c(this,he,"f")),s}).finally(()=>{this[Vi](),this.parsed=o}):(c(this,Ue,"f")&&c(this,Ue,"f").call(this,c(this,dt,"f"),r,c(this,he,"f")),this[Vi](),this.parsed=o,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 Z(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(t){return j("<object>",[t],arguments.length),I(this,ii,t,"f"),this}pkgConf(t,n){j("<string> [string]",[t,n],arguments.length);let i=null,r=this[Yi](n||c(this,Tt,"f"));return r[t]&&typeof r[t]=="object"&&(i=Zn(r[t],n||c(this,Tt,"f"),this[Yt]()["deep-merge-config"]||!1,c(this,$,"f")),c(this,L,"f").configObjects=(c(this,L,"f").configObjects||[]).concat(i)),this}positional(t,n){j("<string> <object>",[t,n],arguments.length);let i=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=ft(n,(s,a)=>s==="type"&&!["string","number","boolean"].includes(a)?!1:i.includes(s));let r=c(this,vn,"f").fullCommands[c(this,vn,"f").fullCommands.length-1],o=r?c(this,le,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return rn(o).forEach(s=>{let a=o[s];Array.isArray(a)?a.indexOf(t)!==-1&&(n[s]=!0):a[t]&&!(s in n)&&(n[s]=a[t])}),this.group(t,c(this,Y,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return j("[boolean]",[t],arguments.length),I(this,ri,t,"f"),this}required(t,n,i){return this.demand(t,n,i)}require(t,n,i){return this.demand(t,n,i)}requiresArg(t){return j("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&c(this,L,"f").narg[t]?this:(this[ln](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return j("[string] [string]",[t,n],arguments.length),t=t||this.$0,c(this,sn,"f").log(c(this,We,"f").generateCompletionScript(t,n||c(this,Ne,"f")||"completion")),this}showHelp(t){if(j("[string|function]",[t],arguments.length),I(this,Te,!0,"f"),!c(this,Y,"f").hasCachedHelpMessage()){if(!this.parsed){let i=this[En](c(this,pt,"f"),void 0,void 0,0,!0);if(te(i))return i.then(()=>{c(this,Y,"f").showHelp(t)}),this}let n=c(this,le,"f").runDefaultBuilderOn(this);if(te(n))return n.then(()=>{c(this,Y,"f").showHelp(t)}),this}return c(this,Y,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return j("[boolean|string] [string]",[t,n],arguments.length),c(this,Y,"f").showHelpOnFail(t,n),this}showVersion(t){return j("[string|function]",[t],arguments.length),c(this,Y,"f").showVersion(t),this}skipValidation(t){return j("<array|string>",[t],arguments.length),this[ht]("skipValidation",t),this}strict(t){return j("[boolean]",[t],arguments.length),I(this,Wt,t!==!1,"f"),this}strictCommands(t){return j("[boolean]",[t],arguments.length),I(this,kt,t!==!1,"f"),this}strictOptions(t){return j("[boolean]",[t],arguments.length),I(this,Ht,t!==!1,"f"),this}string(t){return j("<array|string>",[t],arguments.length),this[ht]("string",t),this[Bt](t),this}terminalWidth(){return j([],0),c(this,$,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return j("<object>",[t],arguments.length),I(this,Ut,!1,"f"),c(this,$,"f").y18n.updateLocale(t),this}usage(t,n,i,r){if(j("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,i,r],arguments.length),n!==void 0){if(Pe(t,null,c(this,$,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,i,r);throw new Z(".usage() description must start with $0 if being used as alias for .command()")}else return c(this,Y,"f").usage(t),this}version(t,n,i){let r="version";if(j("[boolean|string] [string] [string]",[t,n,i],arguments.length),c(this,Xe,"f")&&(this[ki](c(this,Xe,"f")),c(this,Y,"f").version(void 0),I(this,Xe,null,"f")),arguments.length===0)i=this[So](),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,Xe,typeof t=="string"?t:r,"f"),n=n||c(this,Y,"f").deferY18nLookup("Show version number"),c(this,Y,"f").version(i||void 0),this.boolean(c(this,Xe,"f")),this.describe(c(this,Xe,"f"),n),this}wrap(t){return j("<number|null|undefined>",[t],arguments.length),c(this,Y,"f").wrap(t),this}[(le=new WeakMap,Tt=new WeakMap,vn=new WeakMap,We=new WeakMap,Ne=new WeakMap,Xn=new WeakMap,dt=new WeakMap,Ut=new WeakMap,ei=new WeakMap,ke=new WeakMap,ti=new WeakMap,He=new WeakMap,Ze=new WeakMap,Te=new WeakMap,Ye=new WeakMap,sn=new WeakMap,he=new WeakMap,L=new WeakMap,ni=new WeakMap,ii=new WeakMap,Ue=new WeakMap,Rt=new WeakMap,an=new WeakMap,$t=new WeakMap,pt=new WeakMap,ri=new WeakMap,$=new WeakMap,Wt=new WeakMap,kt=new WeakMap,Ht=new WeakMap,Y=new WeakMap,Xe=new WeakMap,oe=new WeakMap,Co)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[Oo](){return{log:(...t)=>{this[oi]()||console.log(...t),I(this,Te,!0,"f"),c(this,he,"f").length&&I(this,he,c(this,he,"f")+`
63
+ `,"f"),I(this,he,c(this,he,"f")+t.join(" "),"f")},error:(...t)=>{this[oi]()||console.error(...t),I(this,Te,!0,"f"),c(this,he,"f").length&&I(this,he,c(this,he,"f")+`
64
+ `,"f"),I(this,he,c(this,he,"f")+t.join(" "),"f")}}}[ki](t){rn(c(this,L,"f")).forEach(n=>{if((r=>r==="configObjects")(n))return;let i=c(this,L,"f")[n];Array.isArray(i)?i.includes(t)&&i.splice(i.indexOf(t),1):typeof i=="object"&&delete i[t]}),delete c(this,Y,"f").getDescriptions()[t]}[vo](t,n,i){c(this,ei,"f")[i]||(c(this,$,"f").process.emitWarning(t,n),c(this,ei,"f")[i]=!0)}[Eo](){c(this,ti,"f").push({options:c(this,L,"f"),configObjects:c(this,L,"f").configObjects.slice(0),exitProcess:c(this,ke,"f"),groups:c(this,Ze,"f"),strict:c(this,Wt,"f"),strictCommands:c(this,kt,"f"),strictOptions:c(this,Ht,"f"),completionCommand:c(this,Ne,"f"),output:c(this,he,"f"),exitError:c(this,dt,"f"),hasOutput:c(this,Te,"f"),parsed:this.parsed,parseFn:c(this,Ue,"f"),parseContext:c(this,Rt,"f")}),c(this,Y,"f").freeze(),c(this,oe,"f").freeze(),c(this,le,"f").freeze(),c(this,He,"f").freeze()}[_o](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(c(this,$,"f").process.argv()[0])?n=c(this,$,"f").process.argv().slice(1,2):n=c(this,$,"f").process.argv().slice(0,1),t=n.map(i=>{let r=this[Uo](c(this,Tt,"f"),i);return i.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<i.length?r:i}).join(" ").trim(),c(this,$,"f").getEnv("_")&&c(this,$,"f").getProcessArgvBin()===c(this,$,"f").getEnv("_")&&(t=c(this,$,"f").getEnv("_").replace(`${c(this,$,"f").path.dirname(c(this,$,"f").process.execPath())}/`,"")),t}[Yt](){return c(this,ii,"f")}[Hi](){if(!c(this,Ut,"f"))return;let t=c(this,$,"f").getEnv("LC_ALL")||c(this,$,"f").getEnv("LC_MESSAGES")||c(this,$,"f").getEnv("LANG")||c(this,$,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[So](){return this[Yi]().version||"unknown"}[Po](t){let n=t["--"]?t["--"]:t._;for(let i=0,r;(r=n[i])!==void 0;i++)c(this,$,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(n[i]=Number(r));return t}[Yi](t){let n=t||"*";if(c(this,an,"f")[n])return c(this,an,"f")[n];let i={};try{let r=t||c(this,$,"f").mainFilename;!t&&c(this,$,"f").path.extname(r)&&(r=c(this,$,"f").path.dirname(r));let o=c(this,$,"f").findUp(r,(s,a)=>{if(a.includes("package.json"))return"package.json"});Pe(o,void 0,c(this,$,"f")),i=JSON.parse(c(this,$,"f").readFileSync(o,"utf8"))}catch(r){}return c(this,an,"f")[n]=i||{},c(this,an,"f")[n]}[ht](t,n){n=[].concat(n),n.forEach(i=>{i=this[qi](i),c(this,L,"f")[t].push(i)})}[ln](t,n,i,r){this[Bi](t,n,i,r,(o,s,a)=>{c(this,L,"f")[o][s]=a})}[Gi](t,n,i,r){this[Bi](t,n,i,r,(o,s,a)=>{c(this,L,"f")[o][s]=(c(this,L,"f")[o][s]||[]).concat(a)})}[Bi](t,n,i,r,o){if(Array.isArray(i))i.forEach(s=>{t(s,r)});else if((s=>typeof s=="object")(i))for(let s of rn(i))t(s,i[s]);else o(n,this[qi](i),r)}[qi](t){return t==="__proto__"?"___proto___":t}[zi](t,n){return this[ln](this[zi].bind(this),"key",t,n),this}[Vi](){var t,n,i,r,o,s,a,l,u,d,f,p;let y=c(this,ti,"f").pop();Pe(y,void 0,c(this,$,"f"));let C;t=this,n=this,i=this,r=this,o=this,s=this,a=this,l=this,u=this,d=this,f=this,p=this,{options:{set value(A){I(t,L,A,"f")}}.value,configObjects:C,exitProcess:{set value(A){I(n,ke,A,"f")}}.value,groups:{set value(A){I(i,Ze,A,"f")}}.value,output:{set value(A){I(r,he,A,"f")}}.value,exitError:{set value(A){I(o,dt,A,"f")}}.value,hasOutput:{set value(A){I(s,Te,A,"f")}}.value,parsed:this.parsed,strict:{set value(A){I(a,Wt,A,"f")}}.value,strictCommands:{set value(A){I(l,kt,A,"f")}}.value,strictOptions:{set value(A){I(u,Ht,A,"f")}}.value,completionCommand:{set value(A){I(d,Ne,A,"f")}}.value,parseFn:{set value(A){I(f,Ue,A,"f")}}.value,parseContext:{set value(A){I(p,Rt,A,"f")}}.value}=y,c(this,L,"f").configObjects=C,c(this,Y,"f").unfreeze(),c(this,oe,"f").unfreeze(),c(this,le,"f").unfreeze(),c(this,He,"f").unfreeze()}[jo](t,n){return Nt(n,i=>(t(i),i))}getInternalMethods(){return{getCommandInstance:this[Io].bind(this),getContext:this[Mo].bind(this),getHasOutput:this[Fo].bind(this),getLoggerInstance:this[Lo].bind(this),getParseContext:this[Do].bind(this),getParserConfiguration:this[Yt].bind(this),getUsageInstance:this[No].bind(this),getValidationInstance:this[To].bind(this),hasParseCallback:this[oi].bind(this),postProcess:this[Gt].bind(this),reset:this[Qi].bind(this),runValidation:this[Ki].bind(this),runYargsParserAndExecuteCommands:this[En].bind(this),setHasOutput:this[Ro].bind(this)}}[Io](){return c(this,le,"f")}[Mo](){return c(this,vn,"f")}[Fo](){return c(this,Te,"f")}[Lo](){return c(this,sn,"f")}[Do](){return c(this,Rt,"f")||{}}[No](){return c(this,Y,"f")}[To](){return c(this,oe,"f")}[oi](){return!!c(this,Ue,"f")}[Gt](t,n,i,r){return i||te(t)||(n||(t=this[Co](t)),(this[Yt]()["parse-positional-numbers"]||this[Yt]()["parse-positional-numbers"]===void 0)&&(t=this[Po](t)),r&&(t=Dt(t,this,c(this,He,"f").getMiddleware(),!1))),t}[Qi](t={}){I(this,L,c(this,L,"f")||{},"f");let n={};n.local=c(this,L,"f").local||[],n.configObjects=c(this,L,"f").configObjects||[];let i={};n.local.forEach(s=>{i[s]=!0,(t[s]||[]).forEach(a=>{i[a]=!0})}),Object.assign(c(this,$t,"f"),Object.keys(c(this,Ze,"f")).reduce((s,a)=>{let l=c(this,Ze,"f")[a].filter(u=>!(u in i));return l.length>0&&(s[a]=l),s},{})),I(this,Ze,{},"f");let r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return r.forEach(s=>{n[s]=(c(this,L,"f")[s]||[]).filter(a=>!i[a])}),o.forEach(s=>{n[s]=ft(c(this,L,"f")[s],a=>!i[a])}),n.envPrefix=c(this,L,"f").envPrefix,I(this,L,n,"f"),I(this,Y,c(this,Y,"f")?c(this,Y,"f").reset(i):fo(this,c(this,$,"f")),"f"),I(this,oe,c(this,oe,"f")?c(this,oe,"f").reset(i):wo(this,c(this,Y,"f"),c(this,$,"f")),"f"),I(this,le,c(this,le,"f")?c(this,le,"f").reset():ao(c(this,Y,"f"),c(this,oe,"f"),c(this,He,"f"),c(this,$,"f")),"f"),c(this,We,"f")||I(this,We,go(this,c(this,Y,"f"),c(this,le,"f"),c(this,$,"f")),"f"),c(this,He,"f").reset(),I(this,Ne,null,"f"),I(this,he,"","f"),I(this,dt,null,"f"),I(this,Te,!1,"f"),this.parsed=!1,this}[Uo](t,n){return c(this,$,"f").path.relative(t,n)}[En](t,n,i,r=0,o=!1){let s=!!i||o;t=t||c(this,pt,"f"),c(this,L,"f").__=c(this,$,"f").y18n.__,c(this,L,"f").configuration=this[Yt]();let a=!!c(this,L,"f").configuration["populate--"],l=Object.assign({},c(this,L,"f").configuration,{"populate--":!0}),u=c(this,$,"f").Parser.detailed(t,Object.assign({},c(this,L,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),d=Object.assign(u.argv,c(this,Rt,"f")),f,p=u.aliases,y=!1,C=!1;Object.keys(d).forEach(A=>{A===c(this,Ye,"f")&&d[A]?y=!0:A===c(this,Xe,"f")&&d[A]&&(C=!0)}),d.$0=this.$0,this.parsed=u,r===0&&c(this,Y,"f").clearCachedHelpMessage();try{if(this[Hi](),n)return this[Gt](d,a,!!i,!1);c(this,Ye,"f")&&[c(this,Ye,"f")].concat(p[c(this,Ye,"f")]||[]).filter(G=>G.length>1).includes(""+d._[d._.length-1])&&(d._.pop(),y=!0);let A=c(this,le,"f").getCommands(),m=c(this,We,"f").completionKey in d,P=y||m||o;if(d._.length){if(A.length){let E;for(let G=r||0,B;d._[G]!==void 0;G++)if(B=String(d._[G]),A.includes(B)&&B!==c(this,Ne,"f")){let V=c(this,le,"f").runCommand(B,this,u,G+1,o,y||C||o);return this[Gt](V,a,!!i,!1)}else if(!E&&B!==c(this,Ne,"f")){E=B;break}!c(this,le,"f").hasDefaultCommand()&&c(this,ri,"f")&&E&&!P&&c(this,oe,"f").recommendCommands(E,A)}c(this,Ne,"f")&&d._.includes(c(this,Ne,"f"))&&!m&&(c(this,ke,"f")&&ut(!0),this.showCompletionScript(),this.exit(0))}if(c(this,le,"f").hasDefaultCommand()&&!P){let E=c(this,le,"f").runCommand(null,this,u,0,o,y||C||o);return this[Gt](E,a,!!i,!1)}if(m){c(this,ke,"f")&&ut(!0),t=[].concat(t);let E=t.slice(t.indexOf(`--${c(this,We,"f").completionKey}`)+1);return c(this,We,"f").getCompletion(E,(G,B)=>{if(G)throw new Z(G.message);(B||[]).forEach(V=>{c(this,sn,"f").log(V)}),this.exit(0)}),this[Gt](d,!a,!!i,!1)}if(c(this,Te,"f")||(y?(c(this,ke,"f")&&ut(!0),s=!0,this.showHelp("log"),this.exit(0)):C&&(c(this,ke,"f")&&ut(!0),s=!0,c(this,Y,"f").showVersion("log"),this.exit(0))),!s&&c(this,L,"f").skipValidation.length>0&&(s=Object.keys(d).some(E=>c(this,L,"f").skipValidation.indexOf(E)>=0&&d[E]===!0)),!s){if(u.error)throw new Z(u.error.message);if(!m){let E=this[Ki](p,{},u.error);i||(f=Dt(d,this,c(this,He,"f").getMiddleware(),!0)),f=this[jo](E,f!=null?f:d),te(f)&&!i&&(f=f.then(()=>Dt(d,this,c(this,He,"f").getMiddleware(),!1)))}}}catch(A){if(A instanceof Z)c(this,Y,"f").fail(A.message,A);else throw A}return this[Gt](f!=null?f:d,a,!!i,!0)}[Ki](t,n,i,r){let o={...this.getDemandedOptions()};return s=>{if(i)throw new Z(i.message);c(this,oe,"f").nonOptionCount(s),c(this,oe,"f").requiredArguments(s,o);let a=!1;c(this,kt,"f")&&(a=c(this,oe,"f").unknownCommands(s)),c(this,Wt,"f")&&!a?c(this,oe,"f").unknownArguments(s,t,n,!!r):c(this,Ht,"f")&&c(this,oe,"f").unknownArguments(s,t,{},!1,!1),c(this,oe,"f").limitedChoices(s),c(this,oe,"f").implications(s),c(this,oe,"f").conflicting(s)}}[Ro](){I(this,Te,!0,"f")}[Bt](t){if(typeof t=="string")c(this,L,"f").key[t]=!0;else for(let n of t)c(this,L,"f").key[n]=!0}};function co(e){return!!e&&typeof e.getInternalMethods=="function"}var rc=xo(no),Ge=rc;g();g();var ga=Q(require("isomorphic-unfetch"));g();var la=Q(require("chalk"),1),Ci=require("fs"),Oi=require("fs/promises"),Nn=require("path");g();function Wo(e){return typeof e=="undefined"||e===null}function oc(e){return typeof e=="object"&&e!==null}function sc(e){return Array.isArray(e)?e:Wo(e)?[]:[e]}function ac(e,t){var n,i,r,o;if(t)for(o=Object.keys(t),n=0,i=o.length;n<i;n+=1)r=o[n],e[r]=t[r];return e}function lc(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function cc(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var fc=Wo,uc=oc,dc=sc,pc=lc,hc=cc,mc=ac,de={isNothing:fc,isObject:uc,toArray:dc,repeat:pc,isNegativeZero:hc,extend:mc};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+=`
65
+
66
+ `+e.mark.snippet),i+" "+n):i}function _n(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||""}_n.prototype=Object.create(Error.prototype);_n.prototype.constructor=_n;_n.prototype.toString=function(t){return this.name+": "+ko(this,t)};var je=_n;function Ji(e,t,n,i,r){var o="",s="",a=Math.floor(r/2)-1;return i-t>a&&(o=" ... ",t=i-a+o.length),n-i>a&&(s=" ...",n=i+a-s.length),{str:o+e.slice(t,n).replace(/\t/g,"\u2192")+s,pos:i-t+o.length}}function Zi(e,t){return de.repeat(" ",t-e.length)+e}function gc(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=[],o,s=-1;o=n.exec(e.buffer);)r.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var a="",l,u,d=Math.min(e.line+t.linesAfter,r.length).toString().length,f=t.maxLength-(t.indent+d+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)u=Ji(e.buffer,i[s-l],r[s-l],e.position-(i[s]-i[s-l]),f),a=de.repeat(" ",t.indent)+Zi((e.line-l+1).toString(),d)+" | "+u.str+`
67
+ `+a;for(u=Ji(e.buffer,i[s],r[s],e.position,f),a+=de.repeat(" ",t.indent)+Zi((e.line+1).toString(),d)+" | "+u.str+`
68
+ `,a+=de.repeat("-",t.indent+d+3+u.pos)+`^
69
+ `,l=1;l<=t.linesAfter&&!(s+l>=r.length);l++)u=Ji(e.buffer,i[s+l],r[s+l],e.position-(i[s]-i[s+l]),f),a+=de.repeat(" ",t.indent)+Zi((e.line+l+1).toString(),d)+" | "+u.str+`
70
+ `;return a.replace(/\n$/,"")}var yc=gc,bc=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],wc=["scalar","sequence","mapping"];function Ac(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function xc(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(bc.indexOf(n)===-1)throw new je('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=Ac(t.styleAliases||null),wc.indexOf(this.kind)===-1)throw new je('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var be=xc;function Ho(e,t){var n=[];return e[t].forEach(function(i){var r=n.length;n.forEach(function(o,s){o.tag===i.tag&&o.kind===i.kind&&o.multi===i.multi&&(r=s)}),n[r]=i}),n}function Cc(){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 Xi(e){return this.extend(e)}Xi.prototype.extend=function(t){var n=[],i=[];if(t instanceof be)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 je("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof be))throw new je("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new je("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new je("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(o){if(!(o instanceof be))throw new je("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(Xi.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=Ho(r,"implicit"),r.compiledExplicit=Ho(r,"explicit"),r.compiledTypeMap=Cc(r.compiledImplicit,r.compiledExplicit),r};var Oc=Xi,vc=new be("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Ec=new be("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),_c=new be("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Sc=new Oc({explicit:[vc,Ec,_c]});function Pc(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function jc(){return null}function Ic(e){return e===null}var Mc=new be("tag:yaml.org,2002:null",{kind:"scalar",resolve:Pc,construct:jc,predicate:Ic,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Fc(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 Lc(e){return e==="true"||e==="True"||e==="TRUE"}function Dc(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Nc=new be("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Fc,construct:Lc,predicate:Dc,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 Tc(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Uc(e){return 48<=e&&e<=55}function Rc(e){return 48<=e&&e<=57}function $c(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(!Tc(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Uc(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 Wc(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 kc(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!de.isNegativeZero(e)}var Hc=new be("tag:yaml.org,2002:int",{kind:"scalar",resolve:$c,construct:Wc,predicate:kc,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"]}}),Yc=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Gc(e){return!(e===null||!Yc.test(e)||e[e.length-1]==="_")}function Bc(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 qc=/^[-+]?[0-9]+e/;function zc(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(de.isNegativeZero(e))return"-0.0";return n=e.toString(10),qc.test(n)?n.replace("e",".e"):n}function Vc(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||de.isNegativeZero(e))}var Qc=new be("tag:yaml.org,2002:float",{kind:"scalar",resolve:Gc,construct:Bc,predicate:Vc,represent:zc,defaultStyle:"lowercase"}),Kc=Sc.extend({implicit:[Mc,Nc,Hc,Qc]}),Jc=Kc,Yo=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Go=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 Zc(e){return e===null?!1:Yo.exec(e)!==null||Go.exec(e)!==null}function Xc(e){var t,n,i,r,o,s,a,l=0,u=null,d,f,p;if(t=Yo.exec(e),t===null&&(t=Go.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(o=+t[4],s=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(d=+t[10],f=+(t[11]||0),u=(d*60+f)*6e4,t[9]==="-"&&(u=-u)),p=new Date(Date.UTC(n,i,r,o,s,a,l)),u&&p.setTime(p.getTime()-u),p}function ef(e){return e.toISOString()}var tf=new be("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Zc,construct:Xc,instanceOf:Date,represent:ef});function nf(e){return e==="<<"||e===null}var rf=new be("tag:yaml.org,2002:merge",{kind:"scalar",resolve:nf}),er=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
71
+ \r`;function of(e){if(e===null)return!1;var t,n,i=0,r=e.length,o=er;for(n=0;n<r;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function sf(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=er,s=0,a=[];for(t=0;t<r;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|o.indexOf(i.charAt(t));return n=r%4*6,n===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):n===18?(a.push(s>>10&255),a.push(s>>2&255)):n===12&&a.push(s>>4&255),new Uint8Array(a)}function af(e){var t="",n=0,i,r,o=e.length,s=er;for(i=0;i<o;i++)i%3===0&&i&&(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[i];return r=o%3,r===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):r===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):r===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function lf(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var cf=new be("tag:yaml.org,2002:binary",{kind:"scalar",resolve:of,construct:sf,predicate:lf,represent:af}),ff=Object.prototype.hasOwnProperty,uf=Object.prototype.toString;function df(e){if(e===null)return!0;var t=[],n,i,r,o,s,a=e;for(n=0,i=a.length;n<i;n+=1){if(r=a[n],s=!1,uf.call(r)!=="[object Object]")return!1;for(o in r)if(ff.call(r,o))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function pf(e){return e!==null?e:[]}var hf=new be("tag:yaml.org,2002:omap",{kind:"sequence",resolve:df,construct:pf}),mf=Object.prototype.toString;function gf(e){if(e===null)return!0;var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(i=s[t],mf.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;o[t]=[r[0],i[r[0]]]}return!0}function yf(e){if(e===null)return[];var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1)i=s[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}var bf=new be("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:gf,construct:yf}),wf=Object.prototype.hasOwnProperty;function Af(e){if(e===null)return!0;var t,n=e;for(t in n)if(wf.call(n,t)&&n[t]!==null)return!1;return!0}function xf(e){return e!==null?e:{}}var Cf=new be("tag:yaml.org,2002:set",{kind:"mapping",resolve:Af,construct:xf}),Bo=Jc.extend({implicit:[tf,rf],explicit:[cf,hf,bf,Cf]}),mt=Object.prototype.hasOwnProperty,si=1,qo=2,zo=3,ai=4,tr=1,Of=2,Vo=3,vf=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ef=/[\x85\u2028\u2029]/,_f=/[,\[\]\{\}]/,Qo=/^(?:!|!!|![a-z\-]+!)$/i,Ko=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Jo(e){return Object.prototype.toString.call(e)}function et(e){return e===10||e===13}function qt(e){return e===9||e===32}function Ie(e){return e===9||e===32||e===10||e===13}function cn(e){return e===44||e===91||e===93||e===123||e===125}function Sf(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Pf(e){return e===120?2:e===117?4:e===85?8:0}function jf(e){return 48<=e&&e<=57?e-48:-1}function Zo(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
72
+ `: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 If(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Xo=new Array(256),es=new Array(256);for(zt=0;zt<256;zt++)Xo[zt]=Zo(zt)?1:0,es[zt]=Zo(zt);var zt;function Mf(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Bo,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 ts(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=yc(n),new je(t,n)}function N(e,t){throw ts(e,t)}function li(e,t){e.onWarning&&e.onWarning.call(null,ts(e,t))}var ns={YAML:function(t,n,i){var r,o,s;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"),o=parseInt(r[1],10),s=parseInt(r[2],10),o!==1&&N(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&li(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,o;i.length!==2&&N(t,"TAG directive accepts exactly two arguments"),r=i[0],o=i[1],Qo.test(r)||N(t,"ill-formed tag handle (first argument) of the TAG directive"),mt.call(t.tagMap,r)&&N(t,'there is a previously declared suffix for "'+r+'" tag handle'),Ko.test(o)||N(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch(s){N(t,"tag prefix is malformed: "+o)}t.tagMap[r]=o}};function gt(e,t,n,i){var r,o,s,a;if(t<n){if(a=e.input.slice(t,n),i)for(r=0,o=a.length;r<o;r+=1)s=a.charCodeAt(r),s===9||32<=s&&s<=1114111||N(e,"expected valid JSON character");else vf.test(a)&&N(e,"the stream contains non-printable characters");e.result+=a}}function is(e,t,n,i){var r,o,s,a;for(de.isObject(n)||N(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),s=0,a=r.length;s<a;s+=1)o=r[s],mt.call(t,o)||(t[o]=n[o],i[o]=!0)}function fn(e,t,n,i,r,o,s,a,l){var u,d;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),u=0,d=r.length;u<d;u+=1)Array.isArray(r[u])&&N(e,"nested arrays are not supported inside keys"),typeof r=="object"&&Jo(r[u])==="[object Object]"&&(r[u]="[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(o))for(u=0,d=o.length;u<d;u+=1)is(e,t,o[u],n);else is(e,t,o,n);else!e.json&&!mt.call(n,r)&&mt.call(t,r)&&(e.line=s||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:o}):t[r]=o,delete n[r];return t}function nr(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 fe(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);r!==0;){for(;qt(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(et(r))for(nr(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&&li(e,"deficient indentation"),i}function ci(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||Ie(n)))}function ir(e,t){t===1?e.result+=" ":t>1&&(e.result+=de.repeat(`
73
+ `,t-1))}function Ff(e,t,n){var i,r,o,s,a,l,u,d,f=e.kind,p=e.result,y;if(y=e.input.charCodeAt(e.position),Ie(y)||cn(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(r=e.input.charCodeAt(e.position+1),Ie(r)||n&&cn(r)))return!1;for(e.kind="scalar",e.result="",o=s=e.position,a=!1;y!==0;){if(y===58){if(r=e.input.charCodeAt(e.position+1),Ie(r)||n&&cn(r))break}else if(y===35){if(i=e.input.charCodeAt(e.position-1),Ie(i))break}else{if(e.position===e.lineStart&&ci(e)||n&&cn(y))break;if(et(y))if(l=e.line,u=e.lineStart,d=e.lineIndent,fe(e,!1,-1),e.lineIndent>=t){a=!0,y=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=u,e.lineIndent=d;break}}a&&(gt(e,o,s,!1),ir(e,e.line-l),o=s=e.position,a=!1),qt(y)||(s=e.position+1),y=e.input.charCodeAt(++e.position)}return gt(e,o,s,!1),e.result?!0:(e.kind=f,e.result=p,!1)}function Lf(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(gt(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 et(n)?(gt(e,i,r,!0),ir(e,fe(e,!1,t)),i=r=e.position):e.position===e.lineStart&&ci(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 Df(e,t){var n,i,r,o,s,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 gt(e,n,e.position,!0),e.position++,!0;if(a===92){if(gt(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),et(a))fe(e,!1,t);else if(a<256&&Xo[a])e.result+=es[a],e.position++;else if((s=Pf(a))>0){for(r=s,o=0;r>0;r--)a=e.input.charCodeAt(++e.position),(s=Sf(a))>=0?o=(o<<4)+s:N(e,"expected hexadecimal character");e.result+=If(o),e.position++}else N(e,"unknown escape sequence");n=i=e.position}else et(a)?(gt(e,n,i,!0),ir(e,fe(e,!1,t)),n=i=e.position):e.position===e.lineStart&&ci(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 Nf(e,t){var n=!0,i,r,o,s=e.tag,a,l=e.anchor,u,d,f,p,y,C=Object.create(null),A,m,P,E;if(E=e.input.charCodeAt(e.position),E===91)d=93,y=!1,a=[];else if(E===123)d=125,y=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),E=e.input.charCodeAt(++e.position);E!==0;){if(fe(e,!0,t),E=e.input.charCodeAt(e.position),E===d)return e.position++,e.tag=s,e.anchor=l,e.kind=y?"mapping":"sequence",e.result=a,!0;n?E===44&&N(e,"expected the node content, but found ','"):N(e,"missed comma between flow collection entries"),m=A=P=null,f=p=!1,E===63&&(u=e.input.charCodeAt(e.position+1),Ie(u)&&(f=p=!0,e.position++,fe(e,!0,t))),i=e.line,r=e.lineStart,o=e.position,un(e,t,si,!1,!0),m=e.tag,A=e.result,fe(e,!0,t),E=e.input.charCodeAt(e.position),(p||e.line===i)&&E===58&&(f=!0,E=e.input.charCodeAt(++e.position),fe(e,!0,t),un(e,t,si,!1,!0),P=e.result),y?fn(e,a,C,m,A,P,i,r,o):f?a.push(fn(e,null,C,m,A,P,i,r,o)):a.push(A),fe(e,!0,t),E=e.input.charCodeAt(e.position),E===44?(n=!0,E=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=tr,o=!1,s=!1,a=t,l=0,u=!1,d,f;if(f=e.input.charCodeAt(e.position),f===124)i=!1;else if(f===62)i=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)tr===r?r=f===43?Vo:Of:N(e,"repeat of a chomping mode identifier");else if((d=jf(f))>=0)d===0?N(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?N(e,"repeat of an indentation width identifier"):(a=t+d-1,s=!0);else break;if(qt(f)){do f=e.input.charCodeAt(++e.position);while(qt(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!et(f)&&f!==0)}for(;f!==0;){for(nr(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),et(f)){l++;continue}if(e.lineIndent<a){r===Vo?e.result+=de.repeat(`
74
+ `,o?1+l:l):r===tr&&o&&(e.result+=`
75
+ `);break}for(i?qt(f)?(u=!0,e.result+=de.repeat(`
76
+ `,o?1+l:l)):u?(u=!1,e.result+=de.repeat(`
77
+ `,l+1)):l===0?o&&(e.result+=" "):e.result+=de.repeat(`
78
+ `,l):e.result+=de.repeat(`
79
+ `,o?1+l:l),o=!0,s=!0,l=0,n=e.position;!et(f)&&f!==0;)f=e.input.charCodeAt(++e.position);gt(e,n,e.position,!1)}return!0}function rs(e,t){var n,i=e.tag,r=e.anchor,o=[],s,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),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||(s=e.input.charCodeAt(e.position+1),!Ie(s))));){if(a=!0,e.position++,fe(e,!0,-1)&&e.lineIndent<=t){o.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,un(e,t,zo,!1,!0),o.push(e.result),fe(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=o,!0):!1}function Uf(e,t,n){var i,r,o,s,a,l,u=e.tag,d=e.anchor,f={},p=Object.create(null),y=null,C=null,A=null,m=!1,P=!1,E;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),E=e.input.charCodeAt(e.position);E!==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),o=e.line,(E===63||E===58)&&Ie(i))E===63?(m&&(fn(e,f,p,y,C,null,s,a,l),y=C=A=null),P=!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,E=i;else{if(s=e.line,a=e.lineStart,l=e.position,!un(e,n,qo,!1,!0))break;if(e.line===o){for(E=e.input.charCodeAt(e.position);qt(E);)E=e.input.charCodeAt(++e.position);if(E===58)E=e.input.charCodeAt(++e.position),Ie(E)||N(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(fn(e,f,p,y,C,null,s,a,l),y=C=A=null),P=!0,m=!1,r=!1,y=e.tag,C=e.result;else if(P)N(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=d,!0}else if(P)N(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=d,!0}if((e.line===o||e.lineIndent>t)&&(m&&(s=e.line,a=e.lineStart,l=e.position),un(e,t,ai,!0,r)&&(m?C=e.result:A=e.result),m||(fn(e,f,p,y,C,A,s,a,l),y=C=A=null),fe(e,!0,-1),E=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&E!==0)N(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&fn(e,f,p,y,C,null,s,a,l),P&&(e.tag=u,e.anchor=d,e.kind="mapping",e.result=f),P}function Rf(e){var t,n=!1,i=!1,r,o,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&N(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(n=!0,s=e.input.charCodeAt(++e.position)):s===33?(i=!0,r="!!",s=e.input.charCodeAt(++e.position)):r="!",t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(o=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):N(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Ie(s);)s===33&&(i?N(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),Qo.test(r)||N(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),_f.test(o)&&N(e,"tag suffix cannot contain flow indicator characters")}o&&!Ko.test(o)&&N(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch(a){N(e,"tag name is malformed: "+o)}return n?e.tag=o:mt.call(e.tagMap,r)?e.tag=e.tagMap[r]+o:r==="!"?e.tag="!"+o:r==="!!"?e.tag="tag:yaml.org,2002:"+o:N(e,'undeclared tag handle "'+r+'"'),!0}function $f(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&&!Ie(n)&&!cn(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 Wf(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&&!Ie(i)&&!cn(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),mt.call(e.anchorMap,n)||N(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],fe(e,!0,-1),!0}function un(e,t,n,i,r){var o,s,a,l=1,u=!1,d=!1,f,p,y,C,A,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=a=ai===n||zo===n,i&&fe(e,!0,-1)&&(u=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Rf(e)||$f(e);)fe(e,!0,-1)?(u=!0,a=o,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=u||r),(l===1||ai===n)&&(si===n||qo===n?A=t:A=t+1,m=e.position-e.lineStart,l===1?a&&(rs(e,m)||Uf(e,m,A))||Nf(e,A)?d=!0:(s&&Tf(e,A)||Lf(e,A)||Df(e,A)?d=!0:Wf(e)?(d=!0,(e.tag!==null||e.anchor!==null)&&N(e,"alias node should not have any properties")):Ff(e,A,si===n)&&(d=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(d=a&&rs(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+'"'),f=0,p=e.implicitTypes.length;f<p;f+=1)if(C=e.implicitTypes[f],C.resolve(e.result)){e.result=C.construct(e.result),e.tag=C.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(mt.call(e.typeMap[e.kind||"fallback"],e.tag))C=e.typeMap[e.kind||"fallback"][e.tag];else for(C=null,y=e.typeMap.multi[e.kind||"fallback"],f=0,p=y.length;f<p;f+=1)if(e.tag.slice(0,y[f].tag.length)===y[f].tag){C=y[f];break}C||N(e,"unknown tag !<"+e.tag+">"),e.result!==null&&C.kind!==e.kind&&N(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+C.kind+'", not "'+e.kind+'"'),C.resolve(e.result,e.tag)?(e.result=C.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||d}function kf(e){var t=e.position,n,i,r,o=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(fe(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(o=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!Ie(s);)s=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");s!==0;){for(;qt(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!et(s));break}if(et(s))break;for(n=e.position;s!==0&&!Ie(s);)s=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}s!==0&&nr(e),mt.call(ns,i)?ns[i](e,i,r):li(e,'unknown document directive "'+i+'"')}if(fe(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,fe(e,!0,-1)):o&&N(e,"directives end mark is expected"),un(e,e.lineIndent-1,ai,!1,!0),fe(e,!0,-1),e.checkLineBreaks&&Ef.test(e.input.slice(t,e.position))&&li(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ci(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,fe(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 os(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
80
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Mf(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;)kf(n);return n.documents}function Hf(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var i=os(e,n);if(typeof t!="function")return i;for(var r=0,o=i.length;r<o;r+=1)t(i[r])}function Yf(e,t){var n=os(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new je("expected a single document in the stream, but found more")}}var Gf=Hf,Bf=Yf,ss={loadAll:Gf,load:Bf},as=Object.prototype.toString,ls=Object.prototype.hasOwnProperty,rr=65279,qf=9,Sn=10,zf=13,Vf=32,Qf=33,Kf=34,or=35,Jf=37,Zf=38,Xf=39,eu=42,cs=44,tu=45,fi=58,nu=61,iu=62,ru=63,ou=64,fs=91,us=93,su=96,ds=123,au=124,ps=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 lu=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],cu=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function fu(e,t){var n,i,r,o,s,a,l;if(t===null)return{};for(n={},i=Object.keys(t),r=0,o=i.length;r<o;r+=1)s=i[r],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),l=e.compiledTypeMap.fallback[s],l&&ls.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[s]=a;return n}function uu(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 je("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+de.repeat("0",i-t.length)+t}var du=1,Pn=2;function pu(e){this.schema=e.schema||Bo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=de.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=fu(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==='"'?Pn:du,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 hs(e,t){for(var n=de.repeat(" ",t),i=0,r=-1,o="",s,a=e.length;i<a;)r=e.indexOf(`
81
+ `,i),r===-1?(s=e.slice(i),i=a):(s=e.slice(i,r+1),i=r+1),s.length&&s!==`
82
+ `&&(o+=n),o+=s;return o}function sr(e,t){return`
83
+ `+de.repeat(" ",e.indent*t)}function hu(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 ui(e){return e===Vf||e===qf}function jn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==rr||65536<=e&&e<=1114111}function ms(e){return jn(e)&&e!==rr&&e!==zf&&e!==Sn}function gs(e,t,n){var i=ms(e),r=i&&!ui(e);return(n?i:i&&e!==cs&&e!==fs&&e!==us&&e!==ds&&e!==ps)&&e!==or&&!(t===fi&&!r)||ms(t)&&!ui(t)&&e===or||t===fi&&r}function mu(e){return jn(e)&&e!==rr&&!ui(e)&&e!==tu&&e!==ru&&e!==fi&&e!==cs&&e!==fs&&e!==us&&e!==ds&&e!==ps&&e!==or&&e!==Zf&&e!==eu&&e!==Qf&&e!==au&&e!==nu&&e!==iu&&e!==Xf&&e!==Kf&&e!==Jf&&e!==ou&&e!==su}function gu(e){return!ui(e)&&e!==fi}function In(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 ys(e){var t=/^\n* /;return t.test(e)}var bs=1,ar=2,ws=3,As=4,dn=5;function yu(e,t,n,i,r,o,s,a){var l,u=0,d=null,f=!1,p=!1,y=i!==-1,C=-1,A=mu(In(e,0))&&gu(In(e,e.length-1));if(t||s)for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=In(e,l),!jn(u))return dn;A=A&&gs(u,d,a),d=u}else{for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=In(e,l),u===Sn)f=!0,y&&(p=p||l-C-1>i&&e[C+1]!==" ",C=l);else if(!jn(u))return dn;A=A&&gs(u,d,a),d=u}p=p||y&&l-C-1>i&&e[C+1]!==" "}return!f&&!p?A&&!s&&!r(e)?bs:o===Pn?dn:ar:n>9&&ys(e)?dn:s?o===Pn?dn:ar:p?As:ws}function bu(e,t,n,i,r){e.dump=function(){if(t.length===0)return e.quotingType===Pn?'""':"''";if(!e.noCompatMode&&(lu.indexOf(t)!==-1||cu.test(t)))return e.quotingType===Pn?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=i||e.flowLevel>-1&&n>=e.flowLevel;function l(u){return hu(e,u)}switch(yu(t,a,e.indent,s,l,e.quotingType,e.forceQuotes&&!i,r)){case bs:return t;case ar:return"'"+t.replace(/'/g,"''")+"'";case ws:return"|"+xs(t,e.indent)+Cs(hs(t,o));case As:return">"+xs(t,e.indent)+Cs(hs(wu(t,s),o));case dn:return'"'+Au(t)+'"';default:throw new je("impossible error: invalid scalar style")}}()}function xs(e,t){var n=ys(e)?String(t):"",i=e[e.length-1]===`
84
+ `,r=i&&(e[e.length-2]===`
85
+ `||e===`
86
+ `),o=r?"+":i?"":"-";return n+o+`
87
+ `}function Cs(e){return e[e.length-1]===`
88
+ `?e.slice(0,-1):e}function wu(e,t){for(var n=/(\n+)([^\n]*)/g,i=function(){var u=e.indexOf(`
89
+ `);return u=u!==-1?u:e.length,n.lastIndex=u,Os(e.slice(0,u),t)}(),r=e[0]===`
90
+ `||e[0]===" ",o,s;s=n.exec(e);){var a=s[1],l=s[2];o=l[0]===" ",i+=a+(!r&&!o&&l!==""?`
91
+ `:"")+Os(l,t),r=o}return i}function Os(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,i,r=0,o,s=0,a=0,l="";i=n.exec(e);)a=i.index,a-r>t&&(o=s>r?s:a,l+=`
92
+ `+e.slice(r,o),r=o+1),s=a;return l+=`
93
+ `,e.length-r>t&&s>r?l+=e.slice(r,s)+`
94
+ `+e.slice(s+1):l+=e.slice(r),l.slice(1)}function Au(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=In(e,r),i=we[n],!i&&jn(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||uu(n);return t}function xu(e,t,n){var i="",r=e.tag,o,s,a;for(o=0,s=n.length;o<s;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(rt(e,t,a,!1,!1)||typeof a=="undefined"&&rt(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function vs(e,t,n,i){var r="",o=e.tag,s,a,l;for(s=0,a=n.length;s<a;s+=1)l=n[s],e.replacer&&(l=e.replacer.call(n,String(s),l)),(rt(e,t+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&rt(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=sr(e,t)),e.dump&&Sn===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=o,e.dump=r||"[]"}function Cu(e,t,n){var i="",r=e.tag,o=Object.keys(n),s,a,l,u,d;for(s=0,a=o.length;s<a;s+=1)d="",i!==""&&(d+=", "),e.condenseFlow&&(d+='"'),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),!!rt(e,t,l,!1,!1)&&(e.dump.length>1024&&(d+="? "),d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),!!rt(e,t,u,!1,!1)&&(d+=e.dump,i+=d));e.tag=r,e.dump="{"+i+"}"}function Ou(e,t,n,i){var r="",o=e.tag,s=Object.keys(n),a,l,u,d,f,p;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new je("sortKeys must be a boolean or a function");for(a=0,l=s.length;a<l;a+=1)p="",(!i||r!=="")&&(p+=sr(e,t)),u=s[a],d=n[u],e.replacer&&(d=e.replacer.call(n,u,d)),!!rt(e,t+1,u,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Sn===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,f&&(p+=sr(e,t)),!!rt(e,t+1,d,!0,f)&&(e.dump&&Sn===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,r+=p));e.tag=o,e.dump=r||"{}"}function Es(e,t,n){var i,r,o,s,a,l;for(r=n?e.explicitTypes:e.implicitTypes,o=0,s=r.length;o<s;o+=1)if(a=r[o],(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,as.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(ls.call(a.represent,l))i=a.represent[l](t,l);else throw new je("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function rt(e,t,n,i,r,o,s){e.tag=null,e.dump=n,Es(e,n,!1)||Es(e,n,!0);var a=as.call(e.dump),l=i,u;i&&(i=e.flowLevel<0||e.flowLevel>t);var d=a==="[object Object]"||a==="[object Array]",f,p;if(d&&(f=e.duplicates.indexOf(n),p=f!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(r=!1),p&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(d&&p&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(Ou(e,t,e.dump,r),p&&(e.dump="&ref_"+f+e.dump)):(Cu(e,t,e.dump),p&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?vs(e,t-1,e.dump,r):vs(e,t,e.dump,r),p&&(e.dump="&ref_"+f+e.dump)):(xu(e,t,e.dump),p&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&bu(e,e.dump,t,o,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new je("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function vu(e,t){var n=[],i=[],r,o;for(lr(e,n,i),r=0,o=i.length;r<o;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(o)}function lr(e,t,n){var i,r,o;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,o=e.length;r<o;r+=1)lr(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;r<o;r+=1)lr(e[i[r]],t,n)}function Eu(e,t){t=t||{};var n=new pu(t);n.noRefs||vu(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),rt(n,0,i,!0,!0)?n.dump+`
95
+ `:""}var _u=Eu,Su={dump:_u};function cr(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 _s=ss.load,Th=ss.loadAll,Ss=Su.dump;var Uh=cr("safeLoad","load"),Rh=cr("safeLoadAll","loadAll"),$h=cr("safeDump","dump");var ca=require("fs"),Sr=require("path"),fa=require("fs"),ua=Q(require("fs"),1);g();function ot(){}ot.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 o=this;function s(A){return r?(setTimeout(function(){r(void 0,A)},0),!0):A}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,u=1,d=a+l,f=[{newPos:-1,components:[]}],p=this.extractCommon(f[0],n,t,0);if(f[0].newPos+1>=a&&p+1>=l)return s([{value:this.join(n),count:n.length}]);function y(){for(var A=-1*u;A<=u;A+=2){var m=void 0,P=f[A-1],E=f[A+1],G=(E?E.newPos:0)-A;P&&(f[A-1]=void 0);var B=P&&P.newPos+1<a,V=E&&0<=G&&G<l;if(!B&&!V){f[A]=void 0;continue}if(!B||V&&P.newPos<E.newPos?(m=ju(E),o.pushComponent(m.components,void 0,!0)):(m=P,m.newPos++,o.pushComponent(m.components,!0,void 0)),G=o.extractCommon(m,n,t,A),m.newPos+1>=a&&G+1>=l)return s(Pu(o,m.components,n,t,o.useLongestToken));f[A]=m}u++}if(r)(function A(){setTimeout(function(){if(u>d)return r();y()||A()},0)})();else for(;u<=d;){var C=y();if(C)return C}},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 o=n.length,s=i.length,a=t.newPos,l=a-r,u=0;a+1<o&&l+1<s&&this.equals(n[a+1],i[l+1]);)a++,l++,u++;return u&&t.components.push({count:u}),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 Pu(e,t,n,i,r){for(var o=0,s=t.length,a=0,l=0;o<s;o++){var u=t[o];if(u.removed){if(u.value=e.join(i.slice(l,l+u.count)),l+=u.count,o&&t[o-1].added){var f=t[o-1];t[o-1]=t[o],t[o]=f}}else{if(!u.added&&r){var d=n.slice(a,a+u.count);d=d.map(function(y,C){var A=i[l+C];return A.length>y.length?A:y}),u.value=e.join(d)}else u.value=e.join(n.slice(a,a+u.count));a+=u.count,u.added||(l+=u.count)}}var p=t[s-1];return s>1&&typeof p.value=="string"&&(p.added||p.removed)&&e.equals("",p.value)&&(t[s-2].value+=p.value,t.pop()),t}function ju(e){return{newPos:e.newPos,components:e.components.slice(0)}}var kh=new ot;var Ps=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,js=/\S/,Is=new ot;Is.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!js.test(e)&&!js.test(t)};Is.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]&&Ps.test(t[n])&&Ps.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var fr=new ot;fr.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 ur(e,t,n){return fr.diff(e,t,n)}var Iu=new ot;Iu.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Mu=new ot;Mu.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function di(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?di=function(t){return typeof t}:di=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},di(e)}var Fu=Object.prototype.toString,pn=new ot;pn.useLongestToken=!0;pn.tokenize=fr.tokenize;pn.castInput=function(e){var t=this.options,n=t.undefinedReplacement,i=t.stringifyReplacer,r=i===void 0?function(o,s){return typeof s=="undefined"?n:s}:i;return typeof e=="string"?e:JSON.stringify(dr(e,null,null,r),r," ")};pn.equals=function(e,t){return ot.prototype.equals.call(pn,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Ms(e,t,n){return pn.diff(e,t,n)}function dr(e,t,n,i,r){t=t||[],n=n||[],i&&(e=i(r,e));var o;for(o=0;o<t.length;o+=1)if(t[o]===e)return n[o];var s;if(Fu.call(e)==="[object Array]"){for(t.push(e),s=new Array(e.length),n.push(s),o=0;o<e.length;o+=1)s[o]=dr(e[o],t,n,i,r);return t.pop(),n.pop(),s}if(e&&e.toJSON&&(e=e.toJSON()),di(e)==="object"&&e!==null){t.push(e),s={},n.push(s);var a=[],l;for(l in e)e.hasOwnProperty(l)&&a.push(l);for(a.sort(),o=0;o<a.length;o+=1)l=a[o],s[l]=dr(e[l],t,n,i,l);t.pop(),n.pop()}else s=e;return s}var pr=new ot;pr.tokenize=function(e){return e.slice()};pr.join=pr.removeEmpty=function(e){return e};var ha=Q(aa(),1),Jt=Q(require("chalk"),1);async function Ae({objects:e,selectIdentifier:t,selectDisplayName:n=t,onSyncComplete:i}){let r=e.reduce((a,l)=>{let u=t(l);if(a[u])throw new Error(`Identifier ${u} was not unique.`);return a[u]={id:u,object:l,providerId:u,displayName:n(l)},a},{});async function*o(){for(let a of Object.values(r))yield a}function s(){return Object.entries(r).sort((a,l)=>a[0].localeCompare(l[0])).map(a=>a[1].object)}return{objects:o(),deleteObject:async a=>{delete r[a]},writeObject:async a=>{let l=t(a.object);r[l]=a},extractCurrent:s,onSyncComplete:i?a=>i(a,s()):void 0}}function W(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 k(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 xe(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 Ce(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 Oe(e){let t=(0,Sr.extname)(e);return t===".yaml"||t===".yml"||t===".json"}function me(e,t,n){let i;if(n&&!t){let r=(0,Sr.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=Ss(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?(0,ca.writeFileSync)(n,i,"utf8"):console.log(i)}function At(e){let t=(0,fa.readFileSync)(e,"utf8");return _s(t,{filename:e,json:!0})}async function ve({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:i=n}){(0,Ci.existsSync)(e)||(0,Ci.mkdirSync)(e,{recursive:!0});let r=await(0,Oi.readdir)(e,"utf-8"),o=new Set(r.filter(l=>{let u=(0,Nn.extname)(l);return u===".json"||u===".yaml"||u===".yml"})),s=l=>(0,Nn.join)(e,`${l}.${t}`);async function*a(){for(let l of o){let u=(0,Nn.join)(e,l);try{let d=await At(u);yield{id:n(d),displayName:i(d),providerId:u,object:d}}catch(d){throw console.error(la.default.red(`Failed to read ${u}, data is likely invalid.
96
+ ${d==null?void 0:d.message}`)),d}}}return{objects:a(),deleteObject:async l=>{await(0,Oi.unlink)(l)},writeObject:async l=>{me(l.object,t,s(l.id))}}}function da(e,t){if(!t&&!ua.default.existsSync(e))return{};let n=At(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function pa(e,t){me(t,void 0,e)}async function ge({source:e,target:t,compareContents:n=(a,l)=>(0,ha.default)(a.object,l.object,(u,d,f)=>f==="created"||f==="modified"?!0:void 0),mode:i,allowEmptySource:r=!1,whatIf:o=!1,log:s=()=>{}}){var a,l;let u=new Map;for await(let p of t.objects)u.set(p.id,p);let d=[],f=!1;for await(let p of e.objects){f=!0;let y=p.id,C=u.get(y);if(C){if(!n(p,C)&&(i==="createOrUpdate"||i==="mirror")){let A=async(m,P)=>{var E;o||await t.writeObject(m,P),s({action:"update",id:y,providerId:m.providerId,displayName:(E=m.displayName)!=null?E:m.providerId,whatIf:o,diff:Ms(P.object,m.object)})};d.push(A(p,C))}u.delete(y)}else{let A=async(m,P)=>{var E;o||await t.writeObject(m),s({action:"create",id:P,providerId:P,displayName:(E=m.displayName)!=null?E:m.providerId,whatIf:o,diff:ur("",JSON.stringify(m.object,null,2))})};d.push(A(p,y))}}if(await Promise.all(d),i==="mirror"){if(!f&&!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=[];u.forEach(async y=>{let C=async A=>{var m;o||await t.deleteObject(A.providerId),s({action:"delete",id:A.id,providerId:A.providerId,displayName:(m=A.displayName)!=null?m:A.providerId,whatIf:o,diff:ur(JSON.stringify(A.object,null,2),"")})};p.push(C(y))}),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)])}function ye(e){let{diffMode:t="off",indent:n,prefix:i}=e!=null?e:{};return function({action:r,displayName:o,whatIf:s,diff:a}){let l="";switch(r){case"create":l=Jt.default.green("[A]");break;case"update":l=Jt.default.white("[U]");break;case"delete":l=Jt.default.yellow("[D]");break}let u="";(t==="on"||t==="update"&&r==="update")&&(u=`
97
+ `+a.map(d=>d.added?Jt.default.green(d.value):d.removed?Jt.default.red(d.value):d.value).join("")),console.log(`${n!=null?n:""}${s?Jt.default.gray("[WHATIF]"):""}${l}${i!=null?i:""} ${o}${u}`)}}g();g();g();var ma=async e=>await e(),Zt=class extends Error{constructor(t,n,i,r,o){super(`${t}
98
+ ${r}${o?" "+o:""} (${n} ${i})`);this.errorMessage=t;this.fetchMethod=n;this.fetchUri=i;this.statusCode=r;this.statusText=o;Object.setPrototypeOf(this,Zt.prototype)}};var Je=class{constructor(t){Mr(this,"options");var n,i,r,o,s,a;if(!t.apiKey&&!t.bearerToken)throw new Error("You must provide an API key or a bearer token");this.options={...t,fetch:(n=t.fetch)!=null?n:fetch,apiHost:(i=t.apiHost)!=null?i:"https://uniform.app",apiKey:(r=t.apiKey)!=null?r:null,projectId:(o=t.projectId)!=null?o:null,bearerToken:(s=t.bearerToken)!=null?s:null,limitPolicy:(a=t.limitPolicy)!=null?a:ma}}async apiClient(t,n){return this.options.limitPolicy(async()=>{var o;let i=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},r=await fetch(t.toString(),{...n,headers:{...n==null?void 0:n.headers,...i}});if(!r.ok){let s="";try{let a=await r.text();try{let l=JSON.parse(a);l.errorMessage?s=Array.isArray(l.errorMessage)?l.errorMessage.join(", "):l.errorMessage:s=a}catch(l){s=a}}catch(a){s="General error"}throw new Zt(s,(o=n==null?void 0:n.method)!=null?o:"GET",t.toString(),r.status)}return(n==null?void 0: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,o])=>{var s;typeof o!="undefined"&&o!==null&&i.searchParams.append(r,(s=o==null?void 0:o.toString())!=null?s:"")}),i}};var yn,Tn=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce(Tn,yn),{...t,projectId:n});return await this.apiClient(i)}async upsert(t){let n=this.createUrl(ce(Tn,yn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(ce(Tn,yn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Me=Tn;yn=new WeakMap,Ve(Me,yn,"/api/v2/aggregate");var ya={command:"get <id>",describe:"Fetch an aggregate",builder:e=>xe(W(k(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:o})=>{let a=await new Me({apiKey:t,apiHost:e,fetch:ga.default,projectId:r}).get({aggregateId:n});a.aggregates.length===0?(console.error("Aggregate did not exist"),process.exit(1)):me(a.aggregates[0],i,o)}};g();var ba=Q(require("isomorphic-unfetch"));var wa={command:"list",describe:"List aggregates",aliases:["ls"],builder:e=>xe(W(k(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r})=>{let s=await new Me({apiKey:t,apiHost:e,fetch:ba.default,projectId:r}).get({});me(s.aggregates,n,i)}};g();var xa=Q(require("isomorphic-unfetch"));g();var xt=e=>e.id,Ct=e=>`${e.name} (pid: ${e.id})`;g();function Ee(e,t){return da(e,t)}function Ot(e,t){pa(e,t)}g();var Aa=Q(require("p-limit")),_e=(0,Aa.default)(8);g();function vi({client:e,type:t}){async function*n(){let i=(await e.get({type:t})).aggregates;for await(let r of i)yield{id:xt(r),displayName:Ct(r),providerId:r.id,object:r}}return{objects:n(),deleteObject:async i=>{await e.remove({aggregateId:i})},writeObject:async i=>{await e.upsert({aggregate:i.object})}}}var Ca={command:"pull <directory>",describe:"Pulls all aggregates to local files in a directory",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to save the aggregates 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:o,project:s,diff:a})=>{var p;let l=new Me({apiKey:t,apiHost:e,fetch:xa.default,projectId:s,limitPolicy:_e}),u=vi({client:l}),d;if(Oe(n)){let y=Ee(n,!1);d=await Ae({objects:(p=y.aggregates)!=null?p:[],selectIdentifier:xt,selectDisplayName:Ct,onSyncComplete:async(C,A)=>{y.aggregates=A,Ot(n,y)}})}else d=await ve({directory:n,selectIdentifier:xt,selectDisplayName:Ct,format:i});await ge({source:u,target:d,mode:r,whatIf:o,log:ye({diffMode:a})})}};g();var Oa=Q(require("isomorphic-unfetch"));var va={command:"push <directory>",describe:"Pushes all aggregates from files in a directory or package to Uniform",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to read the aggregates 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:o,diff:s})=>{var f;let a=new Me({apiKey:t,apiHost:e,fetch:Oa.default,projectId:o,limitPolicy:_e}),l;if(Oe(n)){let p=Ee(n,!0);l=await Ae({objects:(f=p.aggregates)!=null?f:[],selectIdentifier:xt,selectDisplayName:Ct})}else l=await ve({directory:n,selectIdentifier:xt,selectDisplayName:Ct});let d=vi({client:a});await ge({source:l,target:d,mode:i,whatIf:r,log:ye({diffMode:s})})}};g();var Ea=Q(require("isomorphic-unfetch"));var _a={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an aggregate",builder:e=>W(k(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Me({apiKey:t,apiHost:e,fetch:Ea.default,projectId:i}).remove({aggregateId:n})}};g();var Sa=Q(require("isomorphic-unfetch"));var Pa={command:"update <filename>",aliases:["put"],describe:"Insert or update an aggregate",builder:e=>W(k(e.positional("filename",{demandOption:!0,describe:"Aggregate file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new Me({apiKey:t,apiHost:e,fetch:Sa.default,projectId:i}),o=At(n);await r.upsert({aggregate:o})}};var ja={command:"aggregate <command>",aliases:["agg","intent","audience"],describe:"Commands for Context aggregates (intents, audiences)",builder:e=>e.command(Ca).command(va).command(ya).command(_a).command(wa).command(Pa).demandCommand(),handler:()=>{Ge.help()}};g();g();var Ia=Q(require("isomorphic-unfetch"));g();var bn,Un,Xt=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce(Xt,bn),{...t,projectId:n});return await this.apiClient(i)}async upsertCategory(t){let n=this.createUrl(ce(Xt,bn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeCategory(t){let n=this.createUrl(ce(Xt,bn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async upsertValue(t){let n=this.createUrl(ce(Xt,Un));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeValue(t){let n=this.createUrl(ce(Xt,Un));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Re=Xt;bn=new WeakMap,Un=new WeakMap,Ve(Re,bn,"/api/v1/enrichments"),Ve(Re,Un,"/api/v1/enrichment-values");var Ma={command:"get <id>",describe:"Fetch an enrichment category and its values",builder:e=>xe(W(k(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:o})=>{var l,u;let a=(u=(l=await new Re({apiKey:t,apiHost:e,fetch:Ia.default,projectId:r}).get())==null?void 0:l.enrichments)==null?void 0:u.filter(d=>d.id===n);a.length===0?(console.error("Enrichment did not exist"),process.exit(1)):me(a[0],i,o)}};g();var Fa=Q(require("isomorphic-unfetch"));var La={command:"list",describe:"List enrichments",aliases:["ls"],builder:e=>xe(W(k(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r})=>{let s=await new Re({apiKey:t,apiHost:e,fetch:Fa.default,projectId:r}).get();me(s.enrichments,n,i)}};g();var Na=Q(require("isomorphic-unfetch"));g();var vt=e=>e.id,Et=e=>`${e.name} (pid: ${e.id})`;g();function Ei({client:e}){async function*t(){let n=(await e.get()).enrichments;for await(let i of n)yield{id:vt(i),displayName:Et(i),providerId:i.id,object:i}}return{objects:t(),deleteObject:async n=>{await e.removeCategory({enrichmentId:n})},writeObject:async(n,i)=>{var s,a;await e.upsertCategory({enrichment:n.object});let r=Da({categoryId:n.id,values:n.object.values}),o=Da({categoryId:n.id,values:(a=(s=i==null?void 0:i.object)==null?void 0:s.values)!=null?a:[],client:e});await ge({source:r,target:o,mode:"mirror",whatIf:!1,log:ye({diffMode:"off",prefix:` ${n.displayName} value`,indent:"> "})})}}}var Da=({client:e,categoryId:t,values:n})=>({objects:async function*(){for(let r of n)yield{id:r.id,providerId:r.id,object:r,displayName:`${r.value} (pid: ${r.id})`}}(),deleteObject:async r=>{if(!e)throw new Error("Provider is read only");await e.removeValue({enrichmentId:t,enrichmentValueId:r})},writeObject:async r=>{if(!e)throw new Error("Provider is read only");await e.upsertValue({enrichmentId:t,enrichmentValue:r.object})}});var Ta={command:"pull <directory>",describe:"Pulls all enrichments to local files in a directory",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to save the enrichments 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:o,project:s,diff:a})=>{var p;let l=new Re({apiKey:t,apiHost:e,fetch:Na.default,projectId:s,limitPolicy:_e}),u=Ei({client:l}),d;if(Oe(n)){let y=Ee(n,!1);d=await Ae({objects:(p=y.enrichments)!=null?p:[],selectIdentifier:vt,selectDisplayName:Et,onSyncComplete:async(C,A)=>{y.enrichments=A,Ot(n,y)}})}else d=await ve({directory:n,selectIdentifier:vt,selectDisplayName:Et,format:i});await ge({source:u,target:d,mode:r,whatIf:o,log:ye({diffMode:a})})}};g();var Ua=Q(require("isomorphic-unfetch"));var Ra={command:"push <directory>",describe:"Pushes all enrichments from files in a directory or package to Uniform",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to read the enrichments 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:o,diff:s})=>{var f;let a=new Re({apiKey:t,apiHost:e,fetch:Ua.default,projectId:o,limitPolicy:_e}),l;if(Oe(n)){let p=Ee(n,!0);l=await Ae({objects:(f=p.enrichments)!=null?f:[],selectIdentifier:vt,selectDisplayName:Et})}else l=await ve({directory:n,selectIdentifier:vt,selectDisplayName:Et});let d=Ei({client:a});await ge({source:l,target:d,mode:i,whatIf:r,log:ye({diffMode:s})})}};g();var $a=Q(require("isomorphic-unfetch"));var Wa={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an enrichment category and its values",builder:e=>W(k(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Re({apiKey:t,apiHost:e,fetch:$a.default,projectId:i}).removeCategory({enrichmentId:n})}};var ka={command:"enrichment <command>",aliases:["enr"],describe:"Commands for Context enrichments",builder:e=>e.command(Ta).command(Ra).command(Ma).command(Wa).command(La).demandCommand(),handler:()=>{Ge.help()}};g();g();var Rn=Q(require("chalk")),Ha=require("fs"),Ya=Q(require("isomorphic-unfetch")),Pi=require("process");g();var Si,Pr=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce(Pr,Si),{...t,projectId:n});return await this.apiClient(i)}},_i=Pr;Si=new WeakMap,Ve(_i,Si,"/api/v2/manifest");var Ga={command:"get [output]",aliases:["dl","download"],describe:"Download the Uniform Context manifest for a project",builder:e=>{var t,n,i;return e.option("apiKey",{alias:"k",demandOption:!0,string:!0,default:(t=process.env.UNIFORM_API_KEY)!=null?t:"",describe:"Uniform API key to use. Defaults to UNIFORM_API_KEY env if set."}).option("project",{describe:"Uniform project ID. Defaults to UCTX_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",demandOption:!0,default:(i=(n=process.env.UCTX_CLI_PROJECT_ID)!=null?n:process.env.UNIFORM_PROJECT_ID)!=null?i:"",type:"string",alias:["p"]}).option("preview",{describe:"If set, fetches the unpublished preview manifest (The API key must have permission)",default:!1,type:"boolean",alias:["d"]}).option("output",{string:!0,alias:"o",default:process.env.UNIFORM_MANIFEST_PATH,describe:"Path to write manifest to. Defaults to UNIFORM_MANIFEST_PATH env if set."})},handler:async({apiKey:e,output:t,project:n,preview:i})=>{n||(console.error(Rn.default.red("You must specify the project ID")),(0,Pi.exit)(1));let r=Zd(),o=new _i({apiHost:r,projectId:n,apiKey:e,fetch:Ya.default});try{let s=await o.get({preview:i}),a=JSON.stringify(s,null,2);t?(0,Ha.writeFile)(t,a,l=>{l&&(console.error(`Error writing file to ${t}
99
+ `,l),(0,Pi.exit)(1)),console.log(Rn.default.green(`\u2705 ${t} has been updated from ${r}`))}):console.log(a)}catch(s){let a;s instanceof Zt?(s.statusCode===403&&(a=`The API key ${e} did not have permissions to fetch the manifest. Ensure ${i?"Context > Read Drafts":"Context > Manifest > Read"} permissions are granted.`),a=s.message):a=s.toString(),console.error(Rn.default.red("\u26A0 Error fetching Context manifest")),console.error(Rn.default.gray(` \u2757 ${a}`)),(0,Pi.exit)(1)}}},Zd=()=>process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app";var Ba={command:"manifest <command>",describe:"Commands for context manifests",aliases:["man"],builder:e=>e.command(Ga).demandCommand(),handler:()=>{Ge.help()}};g();g();var qa=Q(require("isomorphic-unfetch"));g();var wn,$n=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce($n,wn),{...t,projectId:n});return await this.apiClient(i)}async upsert(t){let n=this.createUrl(ce($n,wn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(ce($n,wn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Fe=$n;wn=new WeakMap,Ve(Fe,wn,"/api/v2/quirk");var za={command:"get <id>",describe:"Fetch a quirk",builder:e=>xe(W(k(e.positional("id",{demandOption:!0,describe:"Quirk public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:o})=>{let a=await new Fe({apiKey:t,apiHost:e,fetch:qa.default,projectId:r}).get({quirkId:n,withIntegrations:!0});a.quirks.length===0?(console.error("Quirk did not exist"),process.exit(1)):me(a.quirks[0],i,o)}};g();var Va=Q(require("isomorphic-unfetch"));var Qa={command:"list",describe:"List quirks",aliases:["ls"],builder:e=>xe(W(k(e.option("withIntegrations",{alias:["i"],describe:"Whether to include meta-quirks created by integrations in the list. Defaults to false.",type:"boolean"})))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r,withIntegrations:o})=>{let a=await new Fe({apiKey:t,apiHost:e,fetch:Va.default,projectId:r}).get({withIntegrations:o});me(a.quirks,n,i)}};g();var Ka=Q(require("isomorphic-unfetch"));g();var _t=e=>e.id,St=e=>`${e.name} (pid: ${e.id})`;g();function ji({client:e}){async function*t(){let n=(await e.get({withIntegrations:!1})).quirks;for await(let i of n)yield{id:_t(i),displayName:St(i),providerId:i.id,object:i}}return{objects:t(),deleteObject:async n=>{await e.remove({quirkId:n})},writeObject:async n=>{await e.upsert({quirk:n.object})}}}var Ja={command:"pull <directory>",describe:"Pulls all quirks to local files in a directory",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to save the quirks 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:o,project:s,diff:a})=>{var p;let l=new Fe({apiKey:t,apiHost:e,fetch:Ka.default,projectId:s,limitPolicy:_e}),u=ji({client:l}),d;if(Oe(n)){let y=Ee(n,!1);d=await Ae({objects:(p=y.quirks)!=null?p:[],selectIdentifier:_t,selectDisplayName:St,onSyncComplete:async(C,A)=>{y.quirks=A,Ot(n,y)}})}else d=await ve({directory:n,selectIdentifier:_t,selectDisplayName:St,format:i});await ge({source:u,target:d,mode:r,whatIf:o,log:ye({diffMode:a})})}};g();var Za=Q(require("isomorphic-unfetch"));var Xa={command:"push <directory>",describe:"Pushes all quirks from files in a directory or package to Uniform",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to read the quirks 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:o,diff:s})=>{var f;let a=new Fe({apiKey:t,apiHost:e,fetch:Za.default,projectId:o,limitPolicy:_e}),l;if(Oe(n)){let p=Ee(n,!0);l=await Ae({objects:(f=p.quirks)!=null?f:[],selectIdentifier:_t,selectDisplayName:St})}else l=await ve({directory:n,selectIdentifier:_t,selectDisplayName:St});let d=ji({client:a});await ge({source:l,target:d,mode:i,whatIf:r,log:ye({diffMode:s})})}};g();var el=Q(require("isomorphic-unfetch"));var tl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a quirk",builder:e=>W(k(e.positional("id",{demandOption:!0,describe:"Quirk public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Fe({apiKey:t,apiHost:e,fetch:el.default,projectId:i}).remove({quirkId:n})}};g();var nl=Q(require("isomorphic-unfetch"));var il={command:"update <filename>",aliases:["put"],describe:"Insert or update a quirk",builder:e=>W(k(e.positional("filename",{demandOption:!0,describe:"Quirk file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new Fe({apiKey:t,apiHost:e,fetch:nl.default,projectId:i}),o=At(n);await r.upsert({quirk:o})}};var rl={command:"quirk <command>",aliases:["qk"],describe:"Commands for Context quirks",builder:e=>e.command(Ja).command(Xa).command(za).command(tl).command(Qa).command(il).demandCommand(),handler:()=>{Ge.help()}};g();g();var ol=Q(require("isomorphic-unfetch"));g();var An,Wn=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce(Wn,An),{...t,projectId:n});return await this.apiClient(i)}async upsert(t){let n=this.createUrl(ce(Wn,An));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(ce(Wn,An));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Le=Wn;An=new WeakMap,Ve(Le,An,"/api/v2/signal");var sl={command:"get <id>",describe:"Fetch a signal",builder:e=>xe(W(k(e.positional("id",{demandOption:!0,describe:"Signal public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:o})=>{let a=await new Le({apiKey:t,apiHost:e,fetch:ol.default,projectId:r}).get({signalId:n});a.signals.length===0?(console.error("Signal did not exist"),process.exit(1)):me(a.signals[0],i,o)}};g();var al=Q(require("isomorphic-unfetch"));var ll={command:"list",describe:"List signals",aliases:["ls"],builder:e=>xe(W(k(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r})=>{let s=await new Le({apiKey:t,apiHost:e,fetch:al.default,projectId:r}).get();me(s.signals,n,i)}};g();var cl=Q(require("isomorphic-unfetch"));g();var Pt=e=>e.id,jt=e=>`${e.name} (pid: ${e.id})`;g();function Ii({client:e}){async function*t(){let n=(await e.get()).signals;for await(let i of n)yield{id:Pt(i),displayName:jt(i),providerId:i.id,object:i}}return{objects:t(),deleteObject:async n=>{await e.remove({signalId:n})},writeObject:async n=>{await e.upsert({signal:n.object})}}}var fl={command:"pull <directory>",describe:"Pulls all signals to local files in a directory",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to save the signals 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:o,project:s,diff:a})=>{var p;let l=new Le({apiKey:t,apiHost:e,fetch:cl.default,projectId:s,limitPolicy:_e}),u=Ii({client:l}),d;if(Oe(n)){let y=Ee(n,!1);d=await Ae({objects:(p=y.signals)!=null?p:[],selectIdentifier:Pt,selectDisplayName:jt,onSyncComplete:async(C,A)=>{y.signals=A,Ot(n,y)}})}else d=await ve({directory:n,selectIdentifier:Pt,selectDisplayName:jt,format:i});await ge({source:u,target:d,mode:r,whatIf:o,log:ye({diffMode:a})})}};g();var ul=Q(require("isomorphic-unfetch"));var dl={command:"push <directory>",describe:"Pushes all signals from files in a directory or package to Uniform",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to read the signals 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:o,diff:s})=>{var f;let a=new Le({apiKey:t,apiHost:e,fetch:ul.default,projectId:o,limitPolicy:_e}),l;if(Oe(n)){let p=Ee(n,!0);l=await Ae({objects:(f=p.signals)!=null?f:[],selectIdentifier:Pt,selectDisplayName:jt})}else l=await ve({directory:n,selectIdentifier:Pt,selectDisplayName:jt});let d=Ii({client:a});await ge({source:l,target:d,mode:i,whatIf:r,log:ye({diffMode:s})})}};g();var pl=Q(require("isomorphic-unfetch"));var hl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a signal",builder:e=>W(k(e.positional("id",{demandOption:!0,describe:"Signal public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Le({apiKey:t,apiHost:e,fetch:pl.default,projectId:i}).remove({signalId:n})}};g();var ml=Q(require("isomorphic-unfetch"));var gl={command:"update <filename>",aliases:["put"],describe:"Insert or update a signal",builder:e=>W(k(e.positional("filename",{demandOption:!0,describe:"Signal file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new Le({apiKey:t,apiHost:e,fetch:ml.default,projectId:i}),o=At(n);await r.upsert({signal:o})}};var yl={command:"signal <command>",aliases:["sig"],describe:"Commands for Context signals",builder:e=>e.command(fl).command(dl).command(sl).command(hl).command(ll).command(gl).demandCommand(),handler:()=>{Ge.help()}};var Xd={commands:[{command:"context <command>",aliases:["ctx"],describe:"Uniform Context commands",builder:e=>e.command(Ba).command(yl).command(ka).command(ja).command(rl).demandCommand(),handler:()=>{Ge.showHelp()}}]};module.exports=Sl(ep);0&&(module.exports={uniformCLI});
100
+ /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
67
101
  /**
68
102
  * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
69
103
  * CJS and ESM environments.