@uniformdev/canvas 13.0.0 → 13.0.1-alpha.271
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/LICENSE.txt +1 -1
- package/README.md +5 -5
- package/dist/chunk-WWAAEBQ3.mjs +2 -0
- package/dist/cli/cli.d.ts +3 -2
- package/dist/cli/cli.js +118 -4
- package/dist/cli/cli.mjs +117 -3
- package/dist/{createEventBus-ada6f4ff.d.ts → createEventBus-ca90547e.d.ts} +123 -92
- package/dist/index.d.ts +22 -8
- package/dist/index.esm.js +2 -2
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/package.json +10 -32
- package/dist/chunk-Y7BBT5AF.mjs +0 -2
package/dist/cli/cli.js
CHANGED
@@ -1,4 +1,118 @@
|
|
1
|
-
var We=Object.create;var H=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var He=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var oe=e=>H(e,"__esModule",{value:!0});var ze=(e,t)=>{oe(e);for(var o in t)H(e,o,{get:t[o],enumerable:!0})},qe=(e,t,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Je(t))!Ke.call(e,n)&&n!=="default"&&H(e,n,{get:()=>t[n],enumerable:!(o=Ge(t,n))||o.enumerable});return e},m=e=>qe(oe(H(e!=null?We(He(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);ze(exports,{readCanvasPackage:()=>j,uniformCLI:()=>Ye,writeCanvasPackage:()=>G});var Ve=m(require("yargs"));var we=m(require("yargs"));var ne=m(require("p-throttle")),ie=m(require("p-retry"));function re({throttle:e={interval:1e3,limit:10},retry:t={retries:1,factor:1.66}}){let o=e?(0,ne.default)(e):null;return function(i){let r=async()=>await i();if(o&&(r=o(r)),t){let a=r;r=()=>(0,ie.default)(a,t)}return r()}}var K=class extends Error{constructor(t,o,n,i,r){super(`${t}
|
2
|
-
|
3
|
-
|
4
|
-
`+r.map(c=>c.added?F.default.green(c.value):c.removed?F.default.red(c.value):c.value).join("")),console.log(`${i?F.default.gray("[WHATIF]"):""}${a} ${n}${s}`)}}var ye=m(require("fs"));function j(e,t){if(!t&&!ye.default.existsSync(e))return{};let o=E(e);if(typeof o!="object")throw new Error(`Package ${e} does not appear valid.`);return o}function G(e,t){O(t,void 0,e)}async function _({objects:e,selectIdentifier:t,selectDisplayName:o=t,onSyncComplete:n}){let i=e.reduce((s,c)=>{let p=t(c);if(s[p])throw new Error(`Identifier ${p} was not unique.`);return s[p]={id:p,object:c,providerId:p,displayName:o(c)},s},{});async function*r(){for(let s of Object.values(i))yield s}function a(){return Object.entries(i).sort((s,c)=>s[0].localeCompare(c[0])).map(s=>s[1].object)}return{objects:r(),deleteObject:async s=>{delete i[s]},writeObject:async s=>{let c=t(s.object);i[c]=s},extractCurrent:a,onSyncComplete:n?s=>n(s,a()):void 0}}var he={command:"pull <directory>",describe:"Pulls all component definitions to local files in a directory",builder:e=>f(u(I(e.positional("directory",{describe:"Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:o,format:n,mode:i,whatIf:r,project:a,diff:s})=>{var g;let c=new d({apiKey:t,apiHost:e,fetch:Ce.default,projectId:a,limitPolicy:T}),p=Q({client:c}),y;if(D(o)){let h=j(o,!1);y=await _({objects:(g=h.components)!=null?g:[],selectIdentifier:R,selectDisplayName:L,onSyncComplete:async(S,b)=>{h.components=b,G(o,h)}})}else y=await M({directory:o,selectIdentifier:R,selectDisplayName:L,format:n});await x({source:p,target:y,mode:i,whatIf:r,log:k({diffMode:s})})}};var Ae=m(require("isomorphic-unfetch"));var be={command:"push <directory>",describe:"Pushes all component definitions from files in a directory to Uniform Optimize",builder:e=>f(u(I(e.positional("directory",{describe:"Directory to read the component definitions from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:o,mode:n,whatIf:i,project:r,diff:a})=>{var C;let s=new d({apiKey:t,apiHost:e,fetch:Ae.default,projectId:r,limitPolicy:T}),c;if(D(o)){let g=j(o,!0);c=await _({objects:(C=g.components)!=null?C:[],selectIdentifier:R,selectDisplayName:L})}else c=await M({directory:o,selectIdentifier:R,selectDisplayName:L});let y=Q({client:s});await x({source:c,target:y,mode:n,whatIf:i,log:k({diffMode:a})})}};var Se=m(require("isomorphic-unfetch")),Oe={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a component definition",builder:e=>f(u(e.positional("id",{demandOption:!0,describe:"Component definition public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:o,project:n})=>{await new d({apiKey:t,apiHost:e,fetch:Se.default,projectId:n}).removeComponentDefinition({componentId:o})}};var Pe=m(require("isomorphic-unfetch")),je={command:"update <filename>",aliases:["put"],describe:"Insert or update a component definition",builder:e=>f(u(e.positional("filename",{demandOption:!0,describe:"Component definition file to put"}))),handler:async({apiHost:e,apiKey:t,filename:o,project:n})=>{let i=new d({apiKey:t,apiHost:e,fetch:Pe.default,projectId:n}),r=E(o);await i.updateComponentDefinition({componentDefinition:r})}};var Ie={command:"component <command>",aliases:["def"],describe:"Commands for Canvas component definitions",builder:e=>e.command(he).command(be).command(le).command(Oe).command(fe).command(je).demandCommand(),handler:()=>we.default.help()};var Fe=m(require("yargs"));var De=m(require("isomorphic-unfetch")),Ee={command:"get <id>",describe:"Fetch a composition",builder:e=>w(f(u(P(e.positional("id",{demandOption:!0,describe:"Composition public ID to fetch"}).option({resolvePatterns:{type:"boolean",default:!1,describe:"Resolve pattern references in the composition"}}))))),handler:async({apiHost:e,apiKey:t,id:o,format:n,filename:i,state:r,project:a,resolvePatterns:s})=>{let c=new d({apiKey:t,apiHost:e,fetch:De.default,projectId:a}),p=q(await c.getCompositionById({compositionId:o,state:v(r),skipPatternResolution:!s}));O(p,n,i)}};var ve=m(require("isomorphic-unfetch")),Te={command:"list",describe:"List compositions",aliases:["ls"],builder:e=>w(f(u(P(e.options({offset:{describe:"Number of rows to skip before fetching",type:"number",default:0},limit:{describe:"Number of rows to fetch",type:"number",default:20},resolvePatterns:{type:"boolean",default:!1,describe:"Resolve pattern references in the composition"}}))))),handler:async({apiHost:e,apiKey:t,limit:o,offset:n,format:i,filename:r,project:a,state:s,resolvePatterns:c})=>{let y=await new d({apiKey:t,apiHost:e,fetch:ve.default,projectId:a}).getCompositionList({limit:o,offset:n,state:v(s),skipPatternResolution:!c});O(y.compositions,i,r)}};var xe=m(require("isomorphic-unfetch"));var N=e=>e.composition._id,U=e=>{var t,o;return`${(o=(t=e.composition._name)!=null?t:e.composition._slug)!=null?o:e.composition._id} (pid: ${e.composition._id})`};function X({client:e,state:t}){let o=v(t);async function*n(){let i=Y(async(r,a)=>(await e.getCompositionList({limit:a,offset:r,state:o,skipPatternResolution:!0})).compositions,{pageSize:100});for await(let r of i)yield{id:N(r),displayName:U(r),providerId:r.composition._id,object:q(r)}}return{objects:n(),deleteObject:async i=>{await e.removeComposition({compositionId:i})},writeObject:async i=>{await e.updateComposition({...i.object,state:o})}}}var Me={command:"pull <directory>",describe:"Pulls all compositions to local files in a directory",builder:e=>f(u(P(I(e.positional("directory",{describe:"Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"}))))),handler:async({apiHost:e,apiKey:t,directory:o,format:n,mode:i,whatIf:r,state:a,project:s,diff:c})=>{var h;let p=new d({apiKey:t,apiHost:e,fetch:xe.default,projectId:s,limitPolicy:T}),y=X({client:p,state:a}),C=D(o),g;if(C){let S=j(o,!1);g=await _({objects:(h=S==null?void 0:S.compositions)!=null?h:[],selectIdentifier:N,selectDisplayName:U,onSyncComplete:async(b,A)=>{S.compositions=A,G(o,S)}})}else g=await M({directory:o,selectIdentifier:N,selectDisplayName:U,format:n});await x({source:y,target:g,mode:i,whatIf:r,log:k({diffMode:c})})}};var Re=m(require("isomorphic-unfetch"));var Le={command:"push <directory>",describe:"Pushes all compositions from files in a directory to Uniform Optimize",builder:e=>f(u(P(I(e.positional("directory",{describe:"Directory to read the component definitions from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"}))))),handler:async({apiHost:e,apiKey:t,directory:o,mode:n,whatIf:i,state:r,project:a,diff:s})=>{var g;let c=new d({apiKey:t,apiHost:e,fetch:Re.default,projectId:a,limitPolicy:T}),p;if(D(o)){let h=j(o,!0);p=await _({objects:(g=h.compositions)!=null?g:[],selectIdentifier:N,selectDisplayName:U})}else p=await M({directory:o,selectIdentifier:N,selectDisplayName:U});let C=X({client:c,state:r});await x({source:p,target:C,mode:n,whatIf:i,log:k({diffMode:s})})}};var ke=m(require("isomorphic-unfetch")),_e={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a composition",builder:e=>f(u(e.positional("id",{demandOption:!0,describe:"Composition public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:o,project:n})=>{await new d({apiKey:t,apiHost:e,fetch:ke.default,projectId:n}).removeComposition({compositionId:o})}};var Ne=m(require("isomorphic-unfetch")),Ue={command:"update <filename>",aliases:["put"],describe:"Insert or update a composition",builder:e=>f(u(P(e.positional("filename",{demandOption:!0,describe:"Composition file to put"})))),handler:async({apiHost:e,apiKey:t,filename:o,project:n,state:i})=>{let r=new d({apiKey:t,apiHost:e,fetch:Ne.default,projectId:n}),a=E(o);await r.updateComposition({...a,state:v(i)})}};var $e={command:"composition <command>",describe:"Commands for Canvas compositions",aliases:["comp"],builder:e=>e.command(Me).command(Le).command(Ee).command(_e).command(Te).command(Ue).demandCommand(),handler:()=>Fe.default.help()};var Ye={commands:[{command:"canvas <command>",aliases:["cv","pm","presentation"],describe:"Uniform Canvas commands",builder:e=>e.command($e).command(Ie).demandCommand(),handler:()=>{Ve.default.showHelp()}}]};0&&(module.exports={readCanvasPackage,uniformCLI,writeCanvasPackage});
|
1
|
+
var Fa=Object.create;var On=Object.defineProperty;var Da=Object.getOwnPropertyDescriptor;var Ta=Object.getOwnPropertyNames;var Na=Object.getPrototypeOf,Ra=Object.prototype.hasOwnProperty;var $a=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ua=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ha=(e,t)=>{for(var n in t)On(e,n,{get:t[n],enumerable:!0})},wr=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ta(t))!Ra.call(e,r)&&r!==n&&On(e,r,{get:()=>t[r],enumerable:!(i=Da(t,r))||i.enumerable});return e};var Ce=(e,t,n)=>(n=e!=null?Fa(Na(e)):{},wr(t||!e||!e.__esModule?On(n,"default",{value:e,enumerable:!0}):n,e)),Ba=e=>wr(On({},"__esModule",{value:!0}),e);var Wa,P,A=$a(()=>{Wa=()=>typeof document=="undefined"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,P=Wa()});var Xs=Ua((yn,nn)=>{A();var uu=200,hr="__lodash_hash_undefined__",Ds=1,ri=2,Ts=9007199254740991,Xn="[object Arguments]",sr="[object Array]",Ns="[object Boolean]",Rs="[object Date]",$s="[object Error]",Us="[object Function]",pu="[object GeneratorFunction]",ei="[object Map]",Hs="[object Number]",tn="[object Object]",Os="[object Promise]",Bs="[object RegExp]",ti="[object Set]",Ws="[object String]",du="[object Symbol]",ar="[object WeakMap]",ks="[object ArrayBuffer]",ni="[object DataView]",hu="[object Float32Array]",mu="[object Float64Array]",gu="[object Int8Array]",bu="[object Int16Array]",yu="[object Int32Array]",wu="[object Uint8Array]",Cu="[object Uint8ClampedArray]",Au="[object Uint16Array]",xu="[object Uint32Array]",vu=/[\\^$.*+?()[\]{}|]/g,Ou=/^\[object .+?Constructor\]$/,_u=/^(?:0|[1-9]\d*)$/,ie={};ie[hu]=ie[mu]=ie[gu]=ie[bu]=ie[yu]=ie[wu]=ie[Cu]=ie[Au]=ie[xu]=!0;ie[Xn]=ie[sr]=ie[ks]=ie[Ns]=ie[ni]=ie[Rs]=ie[$s]=ie[Us]=ie[ei]=ie[Hs]=ie[tn]=ie[Bs]=ie[ti]=ie[Ws]=ie[ar]=!1;var Ys=typeof global=="object"&&global&&global.Object===Object&&global,Eu=typeof self=="object"&&self&&self.Object===Object&&self,ct=Ys||Eu||Function("return this")(),qs=typeof yn=="object"&&yn&&!yn.nodeType&&yn,_s=qs&&typeof nn=="object"&&nn&&!nn.nodeType&&nn,Su=_s&&_s.exports===qs,Es=Su&&Ys.process,Ss=function(){try{return Es&&Es.binding("util")}catch(e){}}(),Is=Ss&&Ss.isTypedArray;function Iu(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 Pu(e){return function(t){return e(t)}}function Mu(e,t){return e==null?void 0:e[t]}function lr(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function Lu(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function Fu(e,t){return function(n){return e(t(n))}}function Du(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var Tu=Array.prototype,Nu=Function.prototype,oi=Object.prototype,rr=ct["__core-js_shared__"],js=function(){var e=/[^.]+$/.exec(rr&&rr.keys&&rr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),zs=Nu.toString,Ve=oi.hasOwnProperty,An=oi.toString,Ru=RegExp("^"+zs.call(Ve).replace(vu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ps=ct.Symbol,Ms=ct.Uint8Array,$u=oi.propertyIsEnumerable,Uu=Tu.splice,Hu=Fu(Object.keys,Object),cr=rn(ct,"DataView"),wn=rn(ct,"Map"),fr=rn(ct,"Promise"),ur=rn(ct,"Set"),pr=rn(ct,"WeakMap"),Cn=rn(Object,"create"),Bu=Ht(cr),Wu=Ht(wn),ku=Ht(fr),Yu=Ht(ur),qu=Ht(pr),Ls=Ps?Ps.prototype:void 0,or=Ls?Ls.valueOf:void 0;function $t(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function zu(){this.__data__=Cn?Cn(null):{}}function Gu(e){return this.has(e)&&delete this.__data__[e]}function Ku(e){var t=this.__data__;if(Cn){var n=t[e];return n===hr?void 0:n}return Ve.call(t,e)?t[e]:void 0}function Vu(e){var t=this.__data__;return Cn?t[e]!==void 0:Ve.call(t,e)}function Ju(e,t){var n=this.__data__;return n[e]=Cn&&t===void 0?hr:t,this}$t.prototype.clear=zu;$t.prototype.delete=Gu;$t.prototype.get=Ku;$t.prototype.has=Vu;$t.prototype.set=Ju;function Je(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Qu(){this.__data__=[]}function Zu(e){var t=this.__data__,n=si(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():Uu.call(t,n,1),!0}function Xu(e){var t=this.__data__,n=si(t,e);return n<0?void 0:t[n][1]}function ep(e){return si(this.__data__,e)>-1}function tp(e,t){var n=this.__data__,i=si(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}Je.prototype.clear=Qu;Je.prototype.delete=Zu;Je.prototype.get=Xu;Je.prototype.has=ep;Je.prototype.set=tp;function Ut(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function np(){this.__data__={hash:new $t,map:new(wn||Je),string:new $t}}function ip(e){return ai(this,e).delete(e)}function rp(e){return ai(this,e).get(e)}function op(e){return ai(this,e).has(e)}function sp(e,t){return ai(this,e).set(e,t),this}Ut.prototype.clear=np;Ut.prototype.delete=ip;Ut.prototype.get=rp;Ut.prototype.has=op;Ut.prototype.set=sp;function ii(e){var t=-1,n=e?e.length:0;for(this.__data__=new Ut;++t<n;)this.add(e[t])}function ap(e){return this.__data__.set(e,hr),this}function lp(e){return this.__data__.has(e)}ii.prototype.add=ii.prototype.push=ap;ii.prototype.has=lp;function lt(e){this.__data__=new Je(e)}function cp(){this.__data__=new Je}function fp(e){return this.__data__.delete(e)}function up(e){return this.__data__.get(e)}function pp(e){return this.__data__.has(e)}function dp(e,t){var n=this.__data__;if(n instanceof Je){var i=n.__data__;if(!wn||i.length<uu-1)return i.push([e,t]),this;n=this.__data__=new Ut(i)}return n.set(e,t),this}lt.prototype.clear=cp;lt.prototype.delete=fp;lt.prototype.get=up;lt.prototype.has=pp;lt.prototype.set=dp;function hp(e,t){var n=dr(e)||Ep(e)?ju(e.length,String):[],i=n.length,r=!!i;for(var s in e)(t||Ve.call(e,s))&&!(r&&(s=="length"||xp(s,i)))&&n.push(s);return n}function si(e,t){for(var n=e.length;n--;)if(Vs(e[n][0],t))return n;return-1}function mp(e){return An.call(e)}function Gs(e,t,n,i,r){return e===t?!0:e==null||t==null||!mr(e)&&!gr(t)?e!==e&&t!==t:gp(e,t,Gs,n,i,r)}function gp(e,t,n,i,r,s){var o=dr(e),a=dr(t),l=sr,f=sr;o||(l=at(e),l=l==Xn?tn:l),a||(f=at(t),f=f==Xn?tn:f);var u=l==tn&&!lr(e),c=f==tn&&!lr(t),p=l==f;if(p&&!u)return s||(s=new lt),o||jp(e)?Ks(e,t,n,i,r,s):Cp(e,t,l,n,i,r,s);if(!(r&ri)){var h=u&&Ve.call(e,"__wrapped__"),g=c&&Ve.call(t,"__wrapped__");if(h||g){var b=h?e.value():e,m=g?t.value():t;return s||(s=new lt),n(b,m,i,r,s)}}return p?(s||(s=new lt),Ap(e,t,n,i,r,s)):!1}function bp(e){if(!mr(e)||Op(e))return!1;var t=Qs(e)||lr(e)?Ru:Ou;return t.test(Ht(e))}function yp(e){return gr(e)&&Zs(e.length)&&!!ie[An.call(e)]}function wp(e){if(!_p(e))return Hu(e);var t=[];for(var n in Object(e))Ve.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ks(e,t,n,i,r,s){var o=r&ri,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var f=s.get(e);if(f&&s.get(t))return f==t;var u=-1,c=!0,p=r&Ds?new ii:void 0;for(s.set(e,t),s.set(t,e);++u<a;){var h=e[u],g=t[u];if(i)var b=o?i(g,h,u,t,e,s):i(h,g,u,e,t,s);if(b!==void 0){if(b)continue;c=!1;break}if(p){if(!Iu(t,function(m,v){if(!p.has(v)&&(h===m||n(h,m,i,r,s)))return p.add(v)})){c=!1;break}}else if(!(h===g||n(h,g,i,r,s))){c=!1;break}}return s.delete(e),s.delete(t),c}function Cp(e,t,n,i,r,s,o){switch(n){case ni:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ks:return!(e.byteLength!=t.byteLength||!i(new Ms(e),new Ms(t)));case Ns:case Rs:case Hs:return Vs(+e,+t);case $s:return e.name==t.name&&e.message==t.message;case Bs:case Ws:return e==t+"";case ei:var a=Lu;case ti:var l=s&ri;if(a||(a=Du),e.size!=t.size&&!l)return!1;var f=o.get(e);if(f)return f==t;s|=Ds,o.set(e,t);var u=Ks(a(e),a(t),i,r,s,o);return o.delete(e),u;case du:if(or)return or.call(e)==or.call(t)}return!1}function Ap(e,t,n,i,r,s){var o=r&ri,a=Fs(e),l=a.length,f=Fs(t),u=f.length;if(l!=u&&!o)return!1;for(var c=l;c--;){var p=a[c];if(!(o?p in t:Ve.call(t,p)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var g=!0;s.set(e,t),s.set(t,e);for(var b=o;++c<l;){p=a[c];var m=e[p],v=t[p];if(i)var O=o?i(v,m,p,t,e,s):i(m,v,p,e,t,s);if(!(O===void 0?m===v||n(m,v,i,r,s):O)){g=!1;break}b||(b=p=="constructor")}if(g&&!b){var T=e.constructor,q=t.constructor;T!=q&&"constructor"in e&&"constructor"in t&&!(typeof T=="function"&&T instanceof T&&typeof q=="function"&&q instanceof q)&&(g=!1)}return s.delete(e),s.delete(t),g}function ai(e,t){var n=e.__data__;return vp(t)?n[typeof t=="string"?"string":"hash"]:n.map}function rn(e,t){var n=Mu(e,t);return bp(n)?n:void 0}var at=mp;(cr&&at(new cr(new ArrayBuffer(1)))!=ni||wn&&at(new wn)!=ei||fr&&at(fr.resolve())!=Os||ur&&at(new ur)!=ti||pr&&at(new pr)!=ar)&&(at=function(e){var t=An.call(e),n=t==tn?e.constructor:void 0,i=n?Ht(n):void 0;if(i)switch(i){case Bu:return ni;case Wu:return ei;case ku:return Os;case Yu:return ti;case qu:return ar}return t});function xp(e,t){return t=t==null?Ts:t,!!t&&(typeof e=="number"||_u.test(e))&&e>-1&&e%1==0&&e<t}function vp(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Op(e){return!!js&&js in e}function _p(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||oi;return e===n}function Ht(e){if(e!=null){try{return zs.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Vs(e,t){return e===t||e!==e&&t!==t}function Ep(e){return Sp(e)&&Ve.call(e,"callee")&&(!$u.call(e,"callee")||An.call(e)==Xn)}var dr=Array.isArray;function Js(e){return e!=null&&Zs(e.length)&&!Qs(e)}function Sp(e){return gr(e)&&Js(e)}function Ip(e,t,n){n=typeof n=="function"?n:void 0;var i=n?n(e,t):void 0;return i===void 0?Gs(e,t,n):!!i}function Qs(e){var t=mr(e)?An.call(e):"";return t==Us||t==pu}function Zs(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ts}function mr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function gr(e){return!!e&&typeof e=="object"}var jp=Is?Pu(Is):yp;function Fs(e){return Js(e)?hp(e):wp(e)}nn.exports=Ip});var Fp={};Ha(Fp,{readCanvasPackage:()=>Qe,uniformCLI:()=>Lp,writeCanvasPackage:()=>vn});module.exports=Ba(Fp);A();A();A();var Fn=require("assert");A();A();var ka={right:Ka,center:Va},Ya=0,_n=1,qa=2,En=3,gi=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&&Ie.stringWidth(r[0])>i&&(i=Math.min(Math.floor(this.width*.5),Ie.stringWidth(r[0])))}),n.forEach(r=>{this.div(...r.map((s,o)=>({text:s.trim(),padding:this.measurePadding(s),width:o===0&&r.length>1?i:void 0})))}),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){let n=Ie.stripAnsi(t);return[0,n.match(/\s*$/)[0].length,0,n.match(/^\s*/)[0].length]}toString(){let t=[];return this.rows.forEach(n=>{this.rowToString(n,t)}),t.filter(n=>!n.hidden).map(n=>n.text).join(`
|
3
|
+
`)}rowToString(t,n){return this.rasterize(t).forEach((i,r)=>{let s="";i.forEach((o,a)=>{let{width:l}=t[a],f=this.negatePadding(t[a]),u=o;f>Ie.stringWidth(o)&&(u+=" ".repeat(f-Ie.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap&&(u=ka[t[a].align](u,f),Ie.stringWidth(u)<f&&(u+=" ".repeat((l||0)-Ie.stringWidth(u)-1)));let c=t[a].padding||[0,0,0,0];c[En]&&(s+=" ".repeat(c[En])),s+=Cr(t[a],u,"| "),s+=u,s+=Cr(t[a],u," |"),c[_n]&&(s+=" ".repeat(c[_n])),r===0&&n.length>0&&(s=this.renderInline(s,n[n.length-1]))}),n.push({text:s.replace(/ +$/,""),span:t.span})}),n}renderInline(t,n){let i=t.match(/^ */),r=i?i[0].length:0,s=n.text,o=Ie.stringWidth(s.trimRight());return n.span?this.wrap?r<o?t:(n.hidden=!0,s.trimRight()+" ".repeat(r-o)+t.trimLeft()):(n.hidden=!0,s+t):t}rasterize(t){let n=[],i=this.columnWidths(t),r;return t.forEach((s,o)=>{s.width=i[o],this.wrap?r=Ie.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
|
4
|
+
`):r=s.text.split(`
|
5
|
+
`),s.border&&(r.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),r.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(r.unshift(...new Array(s.padding[Ya]||0).fill("")),r.push(...new Array(s.padding[qa]||0).fill(""))),r.forEach((a,l)=>{n[l]||n.push([]);let f=n[l];for(let u=0;u<o;u++)f[u]===void 0&&f.push("");f.push(a)})}),n}negatePadding(t){let n=t.width||0;return t.padding&&(n-=(t.padding[En]||0)+(t.padding[_n]||0)),t.border&&(n-=4),n}columnWidths(t){if(!this.wrap)return t.map(o=>o.width||Ie.stringWidth(o.text));let n=t.length,i=this.width,r=t.map(o=>{if(o.width)return n--,i-=o.width,o.width}),s=n?Math.floor(i/n):0;return r.map((o,a)=>o===void 0?Math.max(s,za(t[a])):o)}};function Cr(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function za(e){let t=e.padding||[],n=1+(t[En]||0)+(t[_n]||0);return e.border?n+4:n}function Ga(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Ka(e,t){e=e.trim();let n=Ie.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function Va(e,t){e=e.trim();let n=Ie.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var Ie;function Ar(e,t){return Ie=t,new gi({width:(e==null?void 0:e.width)||Ga(),wrap:e==null?void 0:e.wrap})}A();var xr=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function bi(e){return e.replace(xr,"")}function vr(e,t){let[n,i]=e.match(xr)||["",""];e=bi(e);let r="";for(let s=0;s<e.length;s++)s!==0&&s%t===0&&(r+=`
|
6
|
+
`),r+=e.charAt(s);return n&&i&&(r=`${n}${r}${i}`),r}function yi(e){return Ar(e,{stringWidth:t=>[...t].length,stripAnsi:bi,wrap:vr})}A();var Wt=require("path"),Sn=require("fs");function Or(e,t){let n=(0,Wt.resolve)(".",e),i;for((0,Sn.statSync)(n).isDirectory()||(n=(0,Wt.dirname)(n));;){if(i=t(n,(0,Sn.readdirSync)(n)),i)return(0,Wt.resolve)(n,i);if(n=(0,Wt.dirname)(i=n),i===n)break}}var Ur=require("util"),Hr=require("fs"),Br=require("url");A();var Ir=require("util"),Mn=require("path");A();function vt(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let n="",i=!1,r=e.match(/^-+/);for(let s=r?r[0].length:0;s<e.length;s++){let o=e.charAt(s);i&&(i=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?i=!0:o!=="-"&&o!=="_"&&(n+=o)}return n}}function In(e,t){let n=e.toLowerCase();t=t||"-";let i="";for(let r=0;r<e.length;r++){let s=n.charAt(r),o=e.charAt(r);s!==o&&r>0?i+=`${t}${n.charAt(r)}`:i+=o}return i}function jn(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}A();A();function _r(e){if(Array.isArray(e))return e.map(o=>typeof o!="string"?o+"":o);e=e.trim();let t=0,n=null,i=null,r=null,s=[];for(let o=0;o<e.length;o++){if(n=i,i=e.charAt(o),i===" "&&!r){n!==" "&&t++;continue}i===r?r=null:(i==="'"||i==='"')&&!r&&(r=i),s[t]||(s[t]=""),s[t]+=i}return s}A();var Le;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(Le||(Le={}));var ze,Pn=class{constructor(t){ze=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=_r(t),s=typeof t=="string",o=Ja(Object.assign(Object.create(null),i.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},i.configuration),l=Object.assign(Object.create(null),i.default),f=i.configObjects||[],u=i.envPrefix,c=a["populate--"],p=c?"--":"_",h=Object.create(null),g=Object.create(null),b=i.__||ze.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},v=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,O=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(i.array||[]).filter(Boolean).forEach(function(y){let C=typeof y=="object"?y.key:y,_=Object.keys(y).map(function(x){return{boolean:"bools",string:"strings",number:"numbers"}[x]}).filter(Boolean).pop();_&&(m[_][C]=!0),m.arrays[C]=!0,m.keys.push(C)}),[].concat(i.boolean||[]).filter(Boolean).forEach(function(y){m.bools[y]=!0,m.keys.push(y)}),[].concat(i.string||[]).filter(Boolean).forEach(function(y){m.strings[y]=!0,m.keys.push(y)}),[].concat(i.number||[]).filter(Boolean).forEach(function(y){m.numbers[y]=!0,m.keys.push(y)}),[].concat(i.count||[]).filter(Boolean).forEach(function(y){m.counts[y]=!0,m.keys.push(y)}),[].concat(i.normalize||[]).filter(Boolean).forEach(function(y){m.normalize[y]=!0,m.keys.push(y)}),typeof i.narg=="object"&&Object.entries(i.narg).forEach(([y,C])=>{typeof C=="number"&&(m.nargs[y]=C,m.keys.push(y))}),typeof i.coerce=="object"&&Object.entries(i.coerce).forEach(([y,C])=>{typeof C=="function"&&(m.coercions[y]=C,m.keys.push(y))}),typeof i.config!="undefined"&&(Array.isArray(i.config)||typeof i.config=="string"?[].concat(i.config).filter(Boolean).forEach(function(y){m.configs[y]=!0}):typeof i.config=="object"&&Object.entries(i.config).forEach(([y,C])=>{(typeof C=="boolean"||typeof C=="function")&&(m.configs[y]=C)})),an(i.key,o,i.default,m.arrays),Object.keys(l).forEach(function(y){(m.aliases[y]||[]).forEach(function(C){l[C]=l[y]})});let T=null;mi();let q=[],G=Object.assign(Object.create(null),{_:[]}),Y={};for(let y=0;y<r.length;y++){let C=r[y],_=C.replace(/^-{3,}/,"---"),x,w,M,S,R,ge;if(C!=="--"&&ee(C))N(C);else if(_.match(/---+(=|$)/)){N(C);continue}else if(C.match(/^--.+=/)||!a["short-option-groups"]&&C.match(/^-.+=/))S=C.match(/^--?([^=]+)=([\s\S]*)$/),S!==null&&Array.isArray(S)&&S.length>=3&&(U(S[1],m.arrays)?y=Z(y,S[1],r,S[2]):U(S[1],m.nargs)!==!1?y=V(y,S[1],r,S[2]):W(S[1],S[2],!0));else if(C.match(O)&&a["boolean-negation"])S=C.match(O),S!==null&&Array.isArray(S)&&S.length>=2&&(w=S[1],W(w,U(w,m.arrays)?[!1]:!1));else if(C.match(/^--.+/)||!a["short-option-groups"]&&C.match(/^-[^-]+/))S=C.match(/^--?(.+)/),S!==null&&Array.isArray(S)&&S.length>=2&&(w=S[1],U(w,m.arrays)?y=Z(y,w,r):U(w,m.nargs)!==!1?y=V(y,w,r):(R=r[y+1],R!==void 0&&(!R.match(/^-/)||R.match(v))&&!U(w,m.bools)&&!U(w,m.counts)||/^(true|false)$/.test(R)?(W(w,R),y++):W(w,K(w))));else if(C.match(/^-.\..+=/))S=C.match(/^-([^=]+)=([\s\S]*)$/),S!==null&&Array.isArray(S)&&S.length>=3&&W(S[1],S[2]);else if(C.match(/^-.\..+/)&&!C.match(v))R=r[y+1],S=C.match(/^-(.\..+)/),S!==null&&Array.isArray(S)&&S.length>=2&&(w=S[1],R!==void 0&&!R.match(/^-/)&&!U(w,m.bools)&&!U(w,m.counts)?(W(w,R),y++):W(w,K(w)));else if(C.match(/^-[^-]+/)&&!C.match(v)){M=C.slice(1,-1).split(""),x=!1;for(let ve=0;ve<M.length;ve++){if(R=C.slice(ve+2),M[ve+1]&&M[ve+1]==="="){ge=C.slice(ve+3),w=M[ve],U(w,m.arrays)?y=Z(y,w,r,ge):U(w,m.nargs)!==!1?y=V(y,w,r,ge):W(w,ge),x=!0;break}if(R==="-"){W(M[ve],R);continue}if(/[A-Za-z]/.test(M[ve])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(R)&&U(R,m.bools)===!1){W(M[ve],R),x=!0;break}if(M[ve+1]&&M[ve+1].match(/\W/)){W(M[ve],R),x=!0;break}else W(M[ve],K(M[ve]))}w=C.slice(-1)[0],!x&&w!=="-"&&(U(w,m.arrays)?y=Z(y,w,r):U(w,m.nargs)!==!1?y=V(y,w,r):(R=r[y+1],R!==void 0&&(!/^(-|--)[^-]/.test(R)||R.match(v))&&!U(w,m.bools)&&!U(w,m.counts)||/^(true|false)$/.test(R)?(W(w,R),y++):W(w,K(w))))}else if(C.match(/^-[0-9]$/)&&C.match(v)&&U(C.slice(1),m.bools))w=C.slice(1),W(w,K(w));else if(C==="--"){q=r.slice(y+1);break}else if(a["halt-at-non-option"]){q=r.slice(y);break}else N(C)}fe(G,!0),fe(G,!1),F(G),Q(),Ze(G,m.aliases,l,!0),J(G),a["set-placeholder-key"]&&pe(G),Object.keys(m.counts).forEach(function(y){ne(G,y.split("."))||W(y,0)}),c&&q.length&&(G[p]=[]),q.forEach(function(y){G[p].push(y)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(G).filter(y=>y!=="--"&&y.includes("-")).forEach(y=>{delete G[y]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(y=>o[y])).forEach(y=>{a["camel-case-expansion"]&&y.includes("-")&&delete G[y.split(".").map(C=>vt(C)).join(".")],delete G[y]});function N(y){let C=E("_",y);(typeof C=="string"||typeof C=="number")&&G._.push(C)}function V(y,C,_,x){let w,M=U(C,m.nargs);if(M=typeof M!="number"||isNaN(M)?1:M,M===0)return he(x)||(T=Error(b("Argument unexpected for: %s",C))),W(C,K(C)),y;let S=he(x)?0:1;if(a["nargs-eats-options"])_.length-(y+1)+S<M&&(T=Error(b("Not enough arguments following: %s",C))),S=M;else{for(w=y+1;w<_.length&&(!_[w].match(/^-[^0-9]/)||_[w].match(v)||ee(_[w]));w++)S++;S<M&&(T=Error(b("Not enough arguments following: %s",C)))}let R=Math.min(S,M);for(!he(x)&&R>0&&(W(C,x),R--),w=y+1;w<R+y+1;w++)W(C,_[w]);return y+R}function Z(y,C,_,x){let w=[],M=x||_[y+1],S=U(C,m.nargs);if(U(C,m.bools)&&!/^(true|false)$/.test(M))w.push(!0);else if(he(M)||he(x)&&/^-/.test(M)&&!v.test(M)&&!ee(M)){if(l[C]!==void 0){let R=l[C];w=Array.isArray(R)?R:[R]}}else{he(x)||w.push(L(C,x,!0));for(let R=y+1;R<_.length&&!(!a["greedy-arrays"]&&w.length>0||S&&typeof S=="number"&&w.length>=S||(M=_[R],/^-/.test(M)&&!v.test(M)&&!ee(M)));R++)y=R,w.push(L(C,M,s))}return typeof S=="number"&&(S&&w.length<S||isNaN(S)&&w.length===0)&&(T=Error(b("Not enough arguments following: %s",C))),W(C,w),y}function W(y,C,_=s){if(/-/.test(y)&&a["camel-case-expansion"]){let M=y.split(".").map(function(S){return vt(S)}).join(".");Se(y,M)}let x=L(y,C,_),w=y.split(".");qe(G,w,x),m.aliases[y]&&m.aliases[y].forEach(function(M){let S=M.split(".");qe(G,S,x)}),w.length>1&&a["dot-notation"]&&(m.aliases[w[0]]||[]).forEach(function(M){let S=M.split("."),R=[].concat(w);R.shift(),S=S.concat(R),(m.aliases[y]||[]).includes(S.join("."))||qe(G,S,x)}),U(y,m.normalize)&&!U(y,m.arrays)&&[y].concat(m.aliases[y]||[]).forEach(function(S){Object.defineProperty(Y,S,{enumerable:!0,get(){return C},set(R){C=typeof R=="string"?ze.normalize(R):R}})})}function Se(y,C){m.aliases[y]&&m.aliases[y].length||(m.aliases[y]=[C],h[C]=!0),m.aliases[C]&&m.aliases[C].length||Se(C,y)}function L(y,C,_){_&&(C=Qa(C)),(U(y,m.bools)||U(y,m.counts))&&typeof C=="string"&&(C=C==="true");let x=Array.isArray(C)?C.map(function(w){return E(y,w)}):E(y,C);return U(y,m.counts)&&(he(x)||typeof x=="boolean")&&(x=wi()),U(y,m.normalize)&&U(y,m.arrays)&&(Array.isArray(C)?x=C.map(w=>ze.normalize(w)):x=ze.normalize(C)),x}function E(y,C){return!a["parse-positional-numbers"]&&y==="_"||!U(y,m.strings)&&!U(y,m.bools)&&!Array.isArray(C)&&(jn(C)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${C}`)))||!he(C)&&U(y,m.numbers))&&(C=Number(C)),C}function F(y){let C=Object.create(null);Ze(C,m.aliases,l),Object.keys(m.configs).forEach(function(_){let x=y[_]||C[_];if(x)try{let w=null,M=ze.resolve(ze.cwd(),x),S=m.configs[_];if(typeof S=="function"){try{w=S(M)}catch(R){w=R}if(w instanceof Error){T=w;return}}else w=ze.require(M);k(w)}catch(w){w.name==="PermissionDenied"?T=w:y[_]&&(T=Error(b("Invalid JSON config file: %s",x)))}})}function k(y,C){Object.keys(y).forEach(function(_){let x=y[_],w=C?C+"."+_:_;typeof x=="object"&&x!==null&&!Array.isArray(x)&&a["dot-notation"]?k(x,w):(!ne(G,w.split("."))||U(w,m.arrays)&&a["combine-arrays"])&&W(w,x)})}function Q(){typeof f!="undefined"&&f.forEach(function(y){k(y)})}function fe(y,C){if(typeof u=="undefined")return;let _=typeof u=="string"?u:"",x=ze.env();Object.keys(x).forEach(function(w){if(_===""||w.lastIndexOf(_,0)===0){let M=w.split("__").map(function(S,R){return R===0&&(S=S.substring(_.length)),vt(S)});(C&&m.configs[M.join(".")]||!C)&&!ne(y,M)&&W(M.join("."),x[w])}})}function J(y){let C,_=new Set;Object.keys(y).forEach(function(x){if(!_.has(x)&&(C=U(x,m.coercions),typeof C=="function"))try{let w=E(x,C(y[x]));[].concat(m.aliases[x]||[],x).forEach(M=>{_.add(M),y[M]=w})}catch(w){T=w}})}function pe(y){return m.keys.forEach(C=>{~C.indexOf(".")||typeof y[C]=="undefined"&&(y[C]=void 0)}),y}function Ze(y,C,_,x=!1){Object.keys(_).forEach(function(w){ne(y,w.split("."))||(qe(y,w.split("."),_[w]),x&&(g[w]=!0),(C[w]||[]).forEach(function(M){ne(y,M.split("."))||qe(y,M.split("."),_[w])}))})}function ne(y,C){let _=y;a["dot-notation"]||(C=[C.join(".")]),C.slice(0,-1).forEach(function(w){_=_[w]||{}});let x=C[C.length-1];return typeof _!="object"?!1:x in _}function qe(y,C,_){let x=y;a["dot-notation"]||(C=[C.join(".")]),C.slice(0,-1).forEach(function(ge){ge=Er(ge),typeof x=="object"&&x[ge]===void 0&&(x[ge]={}),typeof x[ge]!="object"||Array.isArray(x[ge])?(Array.isArray(x[ge])?x[ge].push({}):x[ge]=[x[ge],{}],x=x[ge][x[ge].length-1]):x=x[ge]});let w=Er(C[C.length-1]),M=U(C.join("."),m.arrays),S=Array.isArray(_),R=a["duplicate-arguments-array"];!R&&U(w,m.nargs)&&(R=!0,(!he(x[w])&&m.nargs[w]===1||Array.isArray(x[w])&&x[w].length===m.nargs[w])&&(x[w]=void 0)),_===wi()?x[w]=wi(x[w]):Array.isArray(x[w])?R&&M&&S?x[w]=a["flatten-duplicate-arrays"]?x[w].concat(_):(Array.isArray(x[w][0])?x[w]:[x[w]]).concat([_]):!R&&Boolean(M)===Boolean(S)?x[w]=_:x[w]=x[w].concat([_]):x[w]===void 0&&M?x[w]=S?_:[_]:R&&!(x[w]===void 0||U(w,m.counts)||U(w,m.bools))?x[w]=[x[w],_]:x[w]=_}function an(...y){y.forEach(function(C){Object.keys(C||{}).forEach(function(_){m.aliases[_]||(m.aliases[_]=[].concat(o[_]||[]),m.aliases[_].concat(_).forEach(function(x){if(/-/.test(x)&&a["camel-case-expansion"]){let w=vt(x);w!==_&&m.aliases[_].indexOf(w)===-1&&(m.aliases[_].push(w),h[w]=!0)}}),m.aliases[_].concat(_).forEach(function(x){if(x.length>1&&/[A-Z]/.test(x)&&a["camel-case-expansion"]){let w=In(x,"-");w!==_&&m.aliases[_].indexOf(w)===-1&&(m.aliases[_].push(w),h[w]=!0)}}),m.aliases[_].forEach(function(x){m.aliases[x]=[_].concat(m.aliases[_].filter(function(w){return x!==w}))}))})})}function U(y,C){let _=[].concat(m.aliases[y]||[],y),x=Object.keys(C),w=_.find(M=>x.includes(M));return w?C[w]:!1}function Bt(y){let C=Object.keys(m);return[].concat(C.map(x=>m[x])).some(function(x){return Array.isArray(x)?x.includes(y):x[y]})}function yr(y,...C){return[].concat(...C).some(function(x){let w=y.match(x);return w&&Bt(w[1])})}function H(y){if(y.match(v)||!y.match(/^-[^-]+/))return!1;let C=!0,_,x=y.slice(1).split("");for(let w=0;w<x.length;w++){if(_=y.slice(w+2),!Bt(x[w])){C=!1;break}if(x[w+1]&&x[w+1]==="="||_==="-"||/[A-Za-z]/.test(x[w])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(_)||x[w+1]&&x[w+1].match(/\W/))break}return C}function ee(y){return a["unknown-options-as-args"]&&de(y)}function de(y){return y=y.replace(/^-{3,}/,"--"),y.match(v)||H(y)?!1:!yr(y,/^-+([^=]+?)=[\s\S]*$/,O,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function K(y){return!U(y,m.bools)&&!U(y,m.counts)&&`${y}`in l?l[y]:we(le(y))}function we(y){return{[Le.BOOLEAN]:!0,[Le.STRING]:"",[Le.NUMBER]:void 0,[Le.ARRAY]:[]}[y]}function le(y){let C=Le.BOOLEAN;return U(y,m.strings)?C=Le.STRING:U(y,m.numbers)?C=Le.NUMBER:U(y,m.bools)?C=Le.BOOLEAN:U(y,m.arrays)&&(C=Le.ARRAY),C}function he(y){return y===void 0}function mi(){Object.keys(m.counts).find(y=>U(y,m.arrays)?(T=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",y)),!0):U(y,m.nargs)?(T=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",y)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(Y,G),configuration:a,defaulted:Object.assign({},g),error:T,newAliases:Object.assign({},h)}}};function Ja(e){let t=[],n=Object.create(null),i=!0;for(Object.keys(e).forEach(function(r){t.push([].concat(e[r],r))});i;){i=!1;for(let r=0;r<t.length;r++)for(let s=r+1;s<t.length;s++)if(t[r].filter(function(a){return t[s].indexOf(a)!==-1}).length){t[r]=t[r].concat(t[s]),t.splice(s,1),i=!0;break}}return t.forEach(function(r){r=r.filter(function(o,a,l){return l.indexOf(o)===a});let s=r.pop();s!==void 0&&typeof s=="string"&&(n[s]=r)}),n}function wi(e){return e!==void 0?e+1:1}function Er(e){return e==="__proto__"?"___proto___":e}function Qa(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}var jr=require("fs");var Sr=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])<Sr)throw Error(`yargs parser supports a minimum Node.js version of ${Sr}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Za=process?process.env:{},Pr=new Pn({cwd:process.cwd,env:()=>Za,format:Ir.format,normalize:Mn.normalize,resolve:Mn.resolve,require:e=>{if(typeof require!="undefined")return require(e);if(e.match(/\.json$/))return JSON.parse((0,jr.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),ln=function(t,n){return Pr.parse(t.slice(),n).argv};ln.detailed=function(e,t){return Pr.parse(e.slice(),t)};ln.camelCase=vt;ln.decamelize=In;ln.looksLikeNumber=jn;var Mr=ln;var $e=require("path");A();function Xa(){return el()?0:1}function el(){return tl()&&!process.defaultApp}function tl(){return!!process.versions.electron}function Lr(){return process.argv[Xa()]}A();var te=class extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace(this,te)}};A();A();var kt=require("fs"),Fr=require("util"),Dr=require("path"),Tr={fs:{readFileSync:kt.readFileSync,writeFile:kt.writeFile},format:Fr.format,resolve:Dr.resolve,exists:e=>{try{return(0,kt.statSync)(e).isFile()}catch(t){return!1}}};A();var Re,Ci=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(),Re.format.apply(Re.format,[this.cache[this.locale][n]||n].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),n=t.shift(),i=t.shift(),r=t.shift(),s=function(){};typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let o=r===1?n:i;this.cache[this.locale][n]&&(o=this.cache[this.locale][n][r===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:i},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[o];return~o.indexOf("%d")&&a.push(r),Re.format.apply(Re.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this.cache[this.locale][n]=t[n])}_taggedLiteral(t,...n){let i="";return t.forEach(function(r,s){let o=n[s+1];i+=r,typeof o!="undefined"&&(i+="%s")}),this.__.apply(this,[i].concat([].slice.call(n,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,n=this.writeQueue[0],i=n.directory,r=n.locale,s=n.cb,o=this._resolveLocaleFile(i,r),a=JSON.stringify(this.cache[r],null,2);Re.fs.writeFile(o,a,"utf-8",function(l){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(l)})}_readLocaleFile(){let t={},n=this._resolveLocaleFile(this.directory,this.locale);try{Re.fs.readFileSync&&(t=JSON.parse(Re.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=Re.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(i)&&~n.lastIndexOf("_")){let r=Re.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(r)&&(i=r)}return i}_fileExistsSync(t){return Re.exists(t)}};function Nr(e,t){Re=t;let n=new Ci(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 nl=e=>Nr(e,Tr),Rr=nl;var il="require is not supported by ESM",$r="loading a directory of commands is not supported yet for ESM",Ln;try{Ln=(0,Br.fileURLToPath)(P)}catch(e){Ln=process.cwd()}var rl=Ln.split("node_modules")[0],Wr={assert:{notStrictEqual:Fn.notStrictEqual,strictEqual:Fn.strictEqual},cliui:yi,findUp:Or,getEnv:e=>process.env[e],inspect:Ur.inspect,getCallerFile:()=>{throw new te($r)},getProcessArgvBin:Lr,mainFilename:rl||process.cwd(),Parser:Mr,path:{basename:$e.basename,dirname:$e.dirname,extname:$e.extname,relative:$e.relative,resolve:$e.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:Hr.readFileSync,require:()=>{throw new te(il)},requireDirectory:()=>{throw new te($r)},stringWidth:e=>[...e].length,y18n:Rr({directory:(0,$e.resolve)(Ln,"../../../locales"),updateFiles:!1})};A();A();A();function Oe(e,t,n,i){n.assert.notStrictEqual(e,t,i)}function Ai(e,t){t.assert.strictEqual(typeof e,"string")}function Yt(e){return Object.keys(e)}A();function re(e){return!!e&&!!e.then&&typeof e.then=="function"}A();A();A();function Xe(e){let n=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),i=/\.*[\][<>]/g,r=n.shift();if(!r)throw new Error(`No command found in: ${e}`);let s={cmd:r.replace(i,""),demanded:[],optional:[]};return n.forEach((o,a)=>{let l=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===n.length-1&&(l=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(i,"").split("|"),variadic:l}):s.demanded.push({cmd:o.replace(i,"").split("|"),variadic:l})}),s}var ol=["first","second","third","fourth","fifth","sixth"];function I(e,t,n){function i(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[Xe(`cmd ${e}`),t,n]}try{let r=0,[s,o,a]=i(),l=[].slice.call(o);for(;l.length&&l[l.length-1]===void 0;)l.pop();let f=a||l.length;if(f<s.demanded.length)throw new te(`Not enough arguments provided. Expected ${s.demanded.length} but received ${l.length}.`);let u=s.demanded.length+s.optional.length;if(f>u)throw new te(`Too many arguments provided. Expected max ${u} but received ${f}.`);s.demanded.forEach(c=>{let p=l.shift(),h=kr(p);c.cmd.filter(b=>b===h||b==="*").length===0&&Yr(h,c.cmd,r),r+=1}),s.optional.forEach(c=>{if(l.length===0)return;let p=l.shift(),h=kr(p);c.cmd.filter(b=>b===h||b==="*").length===0&&Yr(h,c.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function kr(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function Yr(e,t,n){throw new te(`Invalid ${ol[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var Dn=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,i=!0,r=!1){if(I("<array|function> [boolean] [boolean] [boolean]",[t,n,i],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let o=t[s];o.applyBeforeValidation=n,o.global=i}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=n,s.global=i,s.mutates=r,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,n){let i=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(r=>{let s=[...i[n]||[],n];return r.option?!s.includes(r.option):!0}),t.option=n,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function qr(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function Ot(e,t,n,i){return n.reduce((r,s)=>{if(s.applyBeforeValidation!==i)return r;if(s.mutates){if(s.applied)return r;s.applied=!0}if(re(r))return r.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(r,t);return re(o)?o.then(a=>Object.assign(r,a)):Object.assign(r,o)}},e)}A();function _t(e,t,n=i=>{throw i}){try{let i=sl(e)?e():e;return re(i)?i.then(r=>t(r)):t(i)}catch(i){return n(i)}}function sl(e){return typeof e=="function"}A();function xi(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 qt=/(^\*)|(^\$0)/,vi=class{constructor(t,n,i,r){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=r,this.usage=t,this.globalMiddleware=i,this.validation=n}addDirectory(t,n,i,r){r=r||{},typeof r.recurse!="boolean"&&(r.recurse=!1),Array.isArray(r.extensions)||(r.extensions=["js"]);let s=typeof r.visit=="function"?r.visit:o=>o;r.visit=(o,a,l)=>{let f=s(o,a,l);if(f){if(this.requireCache.has(a))return f;this.requireCache.add(a),this.addHandler(f)}return f},this.shim.requireDirectory({require:n,filename:i},t,r)}addHandler(t,n,i,r,s,o){let a=[],l=qr(s);if(r=r||(()=>{}),Array.isArray(t))if(al(t))[t,...a]=t;else for(let f of t)this.addHandler(f);else if(cl(t)){let f=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(f=[].concat(f).concat(t.aliases)),this.addHandler(f,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(zr(i)){this.addHandler([t].concat(a),n,i.builder,i.handler,i.middlewares,i.deprecated);return}if(typeof t=="string"){let f=Xe(t);a=a.map(p=>Xe(p).cmd);let u=!1,c=[f.cmd].concat(a).filter(p=>qt.test(p)?(u=!0,!1):!0);c.length===0&&u&&c.push("$0"),u&&(f.cmd=c[0],a=c.slice(1),t=t.replace(qt,f.cmd)),a.forEach(p=>{this.aliasMap[p]=f.cmd}),n!==!1&&this.usage.command(t,n,u,a,o),this.handlers[f.cmd]={original:t,description:n,handler:r,builder:i||{},middlewares:l,deprecated:o,demanded:f.demanded,optional:f.optional},u&&(this.defaultCommand=this.handlers[f.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,n,i,r,s,o){let a=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,l=n.getInternalMethods().getContext(),f=l.commands.slice(),u=!t;t&&(l.commands.push(t),l.fullCommands.push(a.original));let c=this.applyBuilderUpdateUsageAndParse(u,a,n,i.aliases,f,r,s,o);return re(c)?c.then(p=>this.applyMiddlewareAndGetResult(u,a,p.innerArgv,l,s,p.aliases,n)):this.applyMiddlewareAndGetResult(u,a,c.innerArgv,l,s,c.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,i,r,s,o,a,l){let f=n.builder,u=i;if(Tn(f)){let c=f(i.getInternalMethods().reset(r),l);if(re(c))return c.then(p=>(u=Kr(p)?p:i,this.parseAndUpdateUsage(t,n,u,s,o,a)))}else ll(f)&&(u=i.getInternalMethods().reset(r),Object.keys(n.builder).forEach(c=>{u.option(c,f[c])}));return this.parseAndUpdateUsage(t,n,u,s,o,a)}parseAndUpdateUsage(t,n,i,r,s,o){t&&i.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(i)&&i.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,n),n.description);let a=i.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return re(a)?a.then(l=>({aliases:i.parsed.aliases,innerArgv:l})):{aliases:i.parsed.aliases,innerArgv:a}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,n){let i=qt.test(n.original)?n.original.replace(qt,"").trim():n.original,r=t.filter(s=>!qt.test(s));return r.push(i),`$0 ${r.join(" ")}`}applyMiddlewareAndGetResult(t,n,i,r,s,o,a){let l={};if(s)return i;a.getInternalMethods().getHasOutput()||(l=this.populatePositionals(n,i,r,a));let f=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares);if(i=Ot(i,a,f,!0),!a.getInternalMethods().getHasOutput()){let u=a.getInternalMethods().runValidation(o,l,a.parsed.error,t);i=_t(i,c=>(u(c),c))}if(n.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let u=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(i,u,!1,!1),i=Ot(i,a,f,!1),i=_t(i,c=>{let p=n.handler(c);return re(p)?p.then(()=>c):c}),t||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),re(i)&&!a.getInternalMethods().hasParseCallback()&&i.catch(c=>{try{a.getInternalMethods().getUsageInstance().fail(null,c)}catch(p){}})}return t||(r.commands.pop(),r.fullCommands.pop()),i}populatePositionals(t,n,i,r){n._=n._.slice(i.commands.length);let s=t.demanded.slice(0),o=t.optional.slice(0),a={};for(this.validation.positionalCount(s.length,n._.length);s.length;){let l=s.shift();this.populatePositional(l,n,a)}for(;o.length;){let l=o.shift();this.populatePositional(l,n,a)}return n._=i.commands.concat(n._.map(l=>""+l)),this.postProcessPositionals(n,a,this.cmdToParseOptions(t.original),r),a}populatePositional(t,n,i){let r=t.cmd[0];t.variadic?i[r]=n._.splice(0).map(String):n._.length&&(i[r]=[String(n._.shift())])}cmdToParseOptions(t){let n={array:[],default:{},alias:{},demand:{}},i=Xe(t);return i.demanded.forEach(r=>{let[s,...o]=r.cmd;r.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o,n.demand[s]=!0}),i.optional.forEach(r=>{let[s,...o]=r.cmd;r.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o}),n}postProcessPositionals(t,n,i,r){let s=Object.assign({},r.getOptions());s.default=Object.assign(i.default,s.default);for(let f of Object.keys(i.alias))s.alias[f]=(s.alias[f]||[]).concat(i.alias[f]);s.array=s.array.concat(i.array),s.config={};let o=[];if(Object.keys(n).forEach(f=>{n[f].map(u=>{s.configuration["unknown-options-as-args"]&&(s.key[f]=!0),o.push(`--${f}`),o.push(u)})}),!o.length)return;let a=Object.assign({},s.configuration,{"populate--":!1}),l=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:a}));if(l.error)r.getInternalMethods().getUsageInstance().fail(l.error.message,l.error);else{let f=Object.keys(n);Object.keys(n).forEach(c=>{f.push(...l.aliases[c])});let u=r.getOptions().default;Object.keys(l.argv).forEach(c=>{f.includes(c)&&(n[c]||(n[c]=l.argv[c]),!Object.hasOwnProperty.call(u,c)&&Object.hasOwnProperty.call(t,c)&&Object.hasOwnProperty.call(l.argv,c)&&(Array.isArray(t[c])||Array.isArray(l.argv[c]))?t[c]=[].concat(t[c],l.argv[c]):t[c]=l.argv[c])})}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let i=qt.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(Tn(n))return n(t,!0);zr(n)||Object.keys(n).forEach(i=>{t.option(i,n[i])})}moduleName(t){let n=xi(t);if(!n)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(n.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:n,desc:i}){for(let r of[t,n,i]){if(typeof r=="string"||r===!1)return r;Oe(r,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();Oe(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function Gr(e,t,n,i){return new vi(e,t,n,i)}function zr(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function al(e){return e.every(t=>typeof t=="string")}function Tn(e){return typeof e=="function"}function ll(e){return typeof e=="object"}function cl(e){return typeof e=="object"&&!Array.isArray(e)}A();A();function et(e={},t=()=>!0){let n={};return Yt(e).forEach(i=>{t(i,e[i])&&(n[i]=e[i])}),n}A();function tt(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 fl(e){return typeof e=="boolean"}function Jr(e,t){let n=t.y18n.__,i={},r=[];i.failFn=function(E){r.push(E)};let s=null,o=null,a=!0;i.showHelpOnFail=function(E=!0,F){let[k,Q]=typeof E=="string"?[!0,E]:[E,F];return e.getInternalMethods().isGlobalContext()&&(o=Q),s=Q,a=k,i};let l=!1;i.fail=function(E,F){let k=e.getInternalMethods().getLoggerInstance();if(r.length)for(let Q=r.length-1;Q>=0;--Q){let fe=r[Q];if(fl(fe)){if(F)throw F;if(E)throw Error(E)}else fe(E,F,i)}else{if(e.getExitProcess()&&tt(!0),!l){l=!0,a&&(e.showHelp("error"),k.error()),(E||F)&&k.error(E||F);let Q=s||o;Q&&((E||F)&&k.error(""),k.error(Q))}if(F=F||new te(E),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,F);throw F}};let f=[],u=!1;i.usage=(L,E)=>L===null?(u=!0,f=[],i):(u=!1,f.push([L,E||""]),i),i.getUsage=()=>f,i.getUsageDisabled=()=>u,i.getPositionalGroupName=()=>n("Positionals:");let c=[];i.example=(L,E)=>{c.push([L,E||""])};let p=[];i.command=function(E,F,k,Q,fe=!1){k&&(p=p.map(J=>(J[2]=!1,J))),p.push([E,F||"",k,Q,fe])},i.getCommands=()=>p;let h={};i.describe=function(E,F){Array.isArray(E)?E.forEach(k=>{i.describe(k,F)}):typeof E=="object"?Object.keys(E).forEach(k=>{i.describe(k,E[k])}):h[E]=F},i.getDescriptions=()=>h;let g=[];i.epilog=L=>{g.push(L)};let b=!1,m;i.wrap=L=>{b=!0,m=L};function v(){return b||(m=Z(),b=!0),m}let O="__yargsString__:";i.deferY18nLookup=L=>O+L,i.help=function(){if(G)return G;q();let E=e.customScriptName?e.$0:t.path.basename(e.$0),F=e.getDemandedOptions(),k=e.getDemandedCommands(),Q=e.getDeprecatedOptions(),fe=e.getGroups(),J=e.getOptions(),pe=[];pe=pe.concat(Object.keys(h)),pe=pe.concat(Object.keys(F)),pe=pe.concat(Object.keys(k)),pe=pe.concat(Object.keys(J.default)),pe=pe.filter(N),pe=Object.keys(pe.reduce((H,ee)=>(ee!=="_"&&(H[ee]=!0),H),{}));let Ze=v(),ne=t.cliui({width:Ze,wrap:!!Ze});if(!u){if(f.length)f.forEach(H=>{ne.div({text:`${H[0].replace(/\$0/g,E)}`}),H[1]&&ne.div({text:`${H[1]}`,padding:[1,0,0,0]})}),ne.div();else if(p.length){let H=null;k._?H=`${E} <${n("command")}>
|
7
|
+
`:H=`${E} [${n("command")}]
|
8
|
+
`,ne.div(`${H}`)}}if(p.length>1||p.length===1&&!p[0][2]){ne.div(n("Commands:"));let H=e.getInternalMethods().getContext(),ee=H.commands.length?`${H.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(p=p.sort((K,we)=>K[0].localeCompare(we[0])));let de=E?`${E} `:"";p.forEach(K=>{let we=`${de}${ee}${K[0].replace(/^\$0 ?/,"")}`;ne.span({text:we,padding:[0,2,0,2],width:T(p,Ze,`${E}${ee}`)+4},{text:K[1]});let le=[];K[2]&&le.push(`[${n("default")}]`),K[3]&&K[3].length&&le.push(`[${n("aliases:")} ${K[3].join(", ")}]`),K[4]&&(typeof K[4]=="string"?le.push(`[${n("deprecated: %s",K[4])}]`):le.push(`[${n("deprecated")}]`)),le.length?ne.div({text:le.join(" "),padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}let qe=(Object.keys(J.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);pe=pe.filter(H=>!e.parsed.newAliases[H]&&qe.every(ee=>(J.alias[ee]||[]).indexOf(H)===-1));let an=n("Options:");fe[an]||(fe[an]=[]),Y(pe,J.alias,fe,an);let U=H=>/^--/.test(Nn(H)),Bt=Object.keys(fe).filter(H=>fe[H].length>0).map(H=>{let ee=fe[H].filter(N).map(de=>{if(qe.includes(de))return de;for(let K=0,we;(we=qe[K])!==void 0;K++)if((J.alias[we]||[]).includes(de))return we;return de});return{groupName:H,normalizedKeys:ee}}).filter(({normalizedKeys:H})=>H.length>0).map(({groupName:H,normalizedKeys:ee})=>{let de=ee.reduce((K,we)=>(K[we]=[we].concat(J.alias[we]||[]).map(le=>H===i.getPositionalGroupName()?le:(/^[0-9]$/.test(le)?J.boolean.includes(we)?"-":"--":le.length>1?"--":"-")+le).sort((le,he)=>U(le)===U(he)?0:U(le)?1:-1).join(", "),K),{});return{groupName:H,normalizedKeys:ee,switches:de}});if(Bt.filter(({groupName:H})=>H!==i.getPositionalGroupName()).some(({normalizedKeys:H,switches:ee})=>!H.every(de=>U(ee[de])))&&Bt.filter(({groupName:H})=>H!==i.getPositionalGroupName()).forEach(({normalizedKeys:H,switches:ee})=>{H.forEach(de=>{U(ee[de])&&(ee[de]=ul(ee[de],4))})}),Bt.forEach(({groupName:H,normalizedKeys:ee,switches:de})=>{ne.div(H),ee.forEach(K=>{let we=de[K],le=h[K]||"",he=null;le.includes(O)&&(le=n(le.substring(O.length))),J.boolean.includes(K)&&(he=`[${n("boolean")}]`),J.count.includes(K)&&(he=`[${n("count")}]`),J.string.includes(K)&&(he=`[${n("string")}]`),J.normalize.includes(K)&&(he=`[${n("string")}]`),J.array.includes(K)&&(he=`[${n("array")}]`),J.number.includes(K)&&(he=`[${n("number")}]`);let mi=C=>typeof C=="string"?`[${n("deprecated: %s",C)}]`:`[${n("deprecated")}]`,y=[K in Q?mi(Q[K]):null,he,K in F?`[${n("required")}]`:null,J.choices&&J.choices[K]?`[${n("choices:")} ${i.stringifiedValues(J.choices[K])}]`:null,V(J.default[K],J.defaultDescription[K])].filter(Boolean).join(" ");ne.span({text:Nn(we),padding:[0,2,0,2+Vr(we)],width:T(de,Ze)+4},le),y?ne.div({text:y,padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}),c.length&&(ne.div(n("Examples:")),c.forEach(H=>{H[0]=H[0].replace(/\$0/g,E)}),c.forEach(H=>{H[1]===""?ne.div({text:H[0],padding:[0,2,0,2]}):ne.div({text:H[0],padding:[0,2,0,2],width:T(c,Ze)+4},{text:H[1]})}),ne.div()),g.length>0){let H=g.map(ee=>ee.replace(/\$0/g,E)).join(`
|
9
|
+
`);ne.div(`${H}
|
10
|
+
`)}return ne.toString().replace(/\s*$/,"")};function T(L,E,F){let k=0;return Array.isArray(L)||(L=Object.values(L).map(Q=>[Q])),L.forEach(Q=>{k=Math.max(t.stringWidth(F?`${F} ${Nn(Q[0])}`:Nn(Q[0]))+Vr(Q[0]),k)}),E&&(k=Math.min(k,parseInt((E*.5).toString(),10))),k}function q(){let L=e.getDemandedOptions(),E=e.getOptions();(Object.keys(E.alias)||[]).forEach(F=>{E.alias[F].forEach(k=>{h[k]&&i.describe(F,h[k]),k in L&&e.demandOption(F,L[k]),E.boolean.includes(k)&&e.boolean(F),E.count.includes(k)&&e.count(F),E.string.includes(k)&&e.string(F),E.normalize.includes(k)&&e.normalize(F),E.array.includes(k)&&e.array(F),E.number.includes(k)&&e.number(F)})})}let G;i.cacheHelpMessage=function(){G=this.help()},i.clearCachedHelpMessage=function(){G=void 0},i.hasCachedHelpMessage=function(){return!!G};function Y(L,E,F,k){let Q=[],fe=null;return Object.keys(F).forEach(J=>{Q=Q.concat(F[J])}),L.forEach(J=>{fe=[J].concat(E[J]),fe.some(pe=>Q.indexOf(pe)!==-1)||F[k].push(J)}),Q}function N(L){return e.getOptions().hiddenOptions.indexOf(L)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}i.showHelp=L=>{let E=e.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:E[L])(i.help())},i.functionDescription=L=>{let E=L.name?t.Parser.decamelize(L.name,"-"):n("generated-value");return["(",E,")"].join("")},i.stringifiedValues=function(E,F){let k="",Q=F||", ",fe=[].concat(E);return!E||!fe.length||fe.forEach(J=>{k.length&&(k+=Q),k+=JSON.stringify(J)}),k};function V(L,E){let F=`[${n("default:")} `;if(L===void 0&&!E)return null;if(E)F+=E;else switch(typeof L){case"string":F+=`"${L}"`;break;case"object":F+=JSON.stringify(L);break;default:F+=L}return`${F}]`}function Z(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let W=null;i.version=L=>{W=L},i.showVersion=L=>{let E=e.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:E[L])(W)},i.reset=function(E){return s=null,l=!1,f=[],u=!1,g=[],c=[],p=[],h=et(h,F=>!E[F]),i};let Se=[];return i.freeze=function(){Se.push({failMessage:s,failureOutput:l,usages:f,usageDisabled:u,epilogs:g,examples:c,commands:p,descriptions:h})},i.unfreeze=function(E=!1){let F=Se.pop();!F||(E?(h={...F.descriptions,...h},p=[...F.commands,...p],f=[...F.usages,...f],c=[...F.examples,...c],g=[...F.epilogs,...g]):{failMessage:s,failureOutput:l,usages:f,usageDisabled:u,epilogs:g,examples:c,commands:p,descriptions:h}=F)},i}function Oi(e){return typeof e=="object"}function ul(e,t){return Oi(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function Vr(e){return Oi(e)?e.indentation:0}function Nn(e){return Oi(e)?e.text:e}A();A();var Qr=`###-begin-{{app_name}}-completions-###
|
11
|
+
#
|
12
|
+
# yargs command completion script
|
13
|
+
#
|
14
|
+
# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
|
15
|
+
# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
|
16
|
+
#
|
17
|
+
_{{app_name}}_yargs_completions()
|
18
|
+
{
|
19
|
+
local cur_word args type_list
|
20
|
+
|
21
|
+
cur_word="\${COMP_WORDS[COMP_CWORD]}"
|
22
|
+
args=("\${COMP_WORDS[@]}")
|
23
|
+
|
24
|
+
# ask yargs to generate completions.
|
25
|
+
type_list=$({{app_path}} --get-yargs-completions "\${args[@]}")
|
26
|
+
|
27
|
+
COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) )
|
28
|
+
|
29
|
+
# if no match was found, fall back to filename completion
|
30
|
+
if [ \${#COMPREPLY[@]} -eq 0 ]; then
|
31
|
+
COMPREPLY=()
|
32
|
+
fi
|
33
|
+
|
34
|
+
return 0
|
35
|
+
}
|
36
|
+
complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
|
37
|
+
###-end-{{app_name}}-completions-###
|
38
|
+
`,Zr=`#compdef {{app_name}}
|
39
|
+
###-begin-{{app_name}}-completions-###
|
40
|
+
#
|
41
|
+
# yargs command completion script
|
42
|
+
#
|
43
|
+
# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
|
44
|
+
# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX.
|
45
|
+
#
|
46
|
+
_{{app_name}}_yargs_completions()
|
47
|
+
{
|
48
|
+
local reply
|
49
|
+
local si=$IFS
|
50
|
+
IFS=$'
|
51
|
+
' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
|
52
|
+
IFS=$si
|
53
|
+
_describe 'values' reply
|
54
|
+
}
|
55
|
+
compdef _{{app_name}}_yargs_completions {{app_name}}
|
56
|
+
###-end-{{app_name}}-completions-###
|
57
|
+
`;var _i=class{constructor(t,n,i,r){var s,o,a;this.yargs=t,this.usage=n,this.command=i,this.shim=r,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(t,n,i,r){let s=this.command.getCommandHandlers();for(let a=0,l=t.length;a<l;++a)if(s[t[a]]&&s[t[a]].builder){let f=s[t[a]].builder;if(Tn(f)){this.indexAfterLastReset=a+1;let u=this.yargs.getInternalMethods().reset();return f(u,!0),u.argv}}let o=[];this.commandCompletions(o,t,i),this.optionCompletions(o,t,n,i),this.choicesFromOptionsCompletions(o,t,n,i),this.choicesFromPositionalsCompletions(o,t,n,i),r(null,o)}commandCompletions(t,n,i){let r=this.yargs.getInternalMethods().getContext().commands;!i.match(/^-/)&&r[r.length-1]!==i&&!this.previousArgHasChoices(n)&&this.usage.getCommands().forEach(s=>{let o=Xe(s[0]).cmd;if(n.indexOf(o)===-1)if(!this.zshShell)t.push(o);else{let a=s[1]||"";t.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(t,n,i,r){if((r.match(/^-/)||r===""&&t.length===0)&&!this.previousArgHasChoices(n)){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(a=>{let l=!!s.configuration["boolean-negation"]&&s.boolean.includes(a);!o.includes(a)&&!s.hiddenOptions.includes(a)&&!this.argsContainKey(n,i,a,l)&&(this.completeOptionKey(a,t,r),l&&!!s.default[a]&&this.completeOptionKey(`no-${a}`,t,r))})}}choicesFromOptionsCompletions(t,n,i,r){if(this.previousArgHasChoices(n)){let s=this.getPreviousArgChoices(n);s&&s.length>0&&t.push(...s.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(t,n,i,r){if(r===""&&t.length>0&&this.previousArgHasChoices(n))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=s[i._.length-o-1];if(!a)return;let l=this.yargs.getOptions().choices[a]||[];for(let f of l)f.startsWith(r)&&t.push(f.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let n=t[t.length-1],i="";if(!n.startsWith("-")&&t.length>1&&(i=n,n=t[t.length-2]),!n.startsWith("-"))return;let r=n.replace(/^-+/,""),s=this.yargs.getOptions(),o=[r,...this.yargs.getAliases()[r]||[]],a;for(let l of o)if(Object.prototype.hasOwnProperty.call(s.key,l)&&Array.isArray(s.choices[l])){a=s.choices[l];break}if(a)return a.filter(l=>!i||l.startsWith(i))}previousArgHasChoices(t){let n=this.getPreviousArgChoices(t);return n!==void 0&&n.length>0}argsContainKey(t,n,i,r){if(t.indexOf(`--${i}`)!==-1||r&&t.indexOf(`--no-${i}`)!==-1)return!0;if(this.aliases){for(let s of this.aliases[i])if(n[s]!==void 0)return!0}return!1}completeOptionKey(t,n,i){let r=this.usage.getDescriptions(),s=l=>/^--/.test(l),o=l=>/^[^0-9]$/.test(l),a=!s(i)&&o(t)?"-":"--";if(!this.zshShell)n.push(a+t);else{let l=r[t]||"";n.push(a+`${t.replace(/:/g,"\\:")}:${l.replace("__yargsString__:","")}`)}}customCompletion(t,n,i,r){if(Oe(this.customCompletionFunction,null,this.shim),dl(this.customCompletionFunction)){let s=this.customCompletionFunction(i,n);return re(s)?s.then(o=>{this.shim.process.nextTick(()=>{r(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{r(o,void 0)})}):r(null,s)}else return hl(this.customCompletionFunction)?this.customCompletionFunction(i,n,(s=r)=>this.defaultCompletion(t,n,i,s),s=>{r(null,s)}):this.customCompletionFunction(i,n,s=>{r(null,s)})}getCompletion(t,n){let i=t.length?t[t.length-1]:"",r=this.yargs.parse(t,!0),s=this.customCompletionFunction?o=>this.customCompletion(t,o,i,n):o=>this.defaultCompletion(t,o,i,n);return re(r)?r.then(s):s(r)}generateCompletionScript(t,n){let i=this.zshShell?Zr:Qr,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 Xr(e,t,n,i){return new _i(e,t,n,i)}function dl(e){return e.length<3}function hl(e){return e.length>3}A();A();function eo(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 to=["$0","--","_"];function no(e,t,n){let i=n.y18n.__,r=n.y18n.__n,s={};s.nonOptionCount=function(c){let p=e.getDemandedCommands(),g=c._.length+(c["--"]?c["--"].length:0)-e.getInternalMethods().getContext().commands.length;p._&&(g<p._.min||g>p._.max)&&(g<p._.min?p._.minMsg!==void 0?t.fail(p._.minMsg?p._.minMsg.replace(/\$0/g,g.toString()).replace(/\$1/,p._.min.toString()):null):t.fail(r("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",g,g.toString(),p._.min.toString())):g>p._.max&&(p._.maxMsg!==void 0?t.fail(p._.maxMsg?p._.maxMsg.replace(/\$0/g,g.toString()).replace(/\$1/,p._.max.toString()):null):t.fail(r("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",g,g.toString(),p._.max.toString()))))},s.positionalCount=function(c,p){p<c&&t.fail(r("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",p,p+"",c+""))},s.requiredArguments=function(c,p){let h=null;for(let g of Object.keys(p))(!Object.prototype.hasOwnProperty.call(c,g)||typeof c[g]=="undefined")&&(h=h||{},h[g]=p[g]);if(h){let g=[];for(let m of Object.keys(h)){let v=h[m];v&&g.indexOf(v)<0&&g.push(v)}let b=g.length?`
|
58
|
+
${g.join(`
|
59
|
+
`)}`:"";t.fail(r("Missing required argument: %s","Missing required arguments: %s",Object.keys(h).length,Object.keys(h).join(", ")+b))}},s.unknownArguments=function(c,p,h,g,b=!0){var m;let v=e.getInternalMethods().getCommandInstance().getCommands(),O=[],T=e.getInternalMethods().getContext();if(Object.keys(c).forEach(q=>{!to.includes(q)&&!Object.prototype.hasOwnProperty.call(h,q)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),q)&&!s.isValidAndSomeAliasIsNotNew(q,p)&&O.push(q)}),b&&(T.commands.length>0||v.length>0||g)&&c._.slice(T.commands.length).forEach(q=>{v.includes(""+q)||O.push(""+q)}),b){let G=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,Y=T.commands.length+G;Y<c._.length&&c._.slice(Y).forEach(N=>{N=String(N),!T.commands.includes(N)&&!O.includes(N)&&O.push(N)})}O.length&&t.fail(r("Unknown argument: %s","Unknown arguments: %s",O.length,O.map(q=>q.trim()?q:`"${q}"`).join(", ")))},s.unknownCommands=function(c){let p=e.getInternalMethods().getCommandInstance().getCommands(),h=[],g=e.getInternalMethods().getContext();return(g.commands.length>0||p.length>0)&&c._.slice(g.commands.length).forEach(b=>{p.includes(""+b)||h.push(""+b)}),h.length>0?(t.fail(r("Unknown command: %s","Unknown commands: %s",h.length,h.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(c,p){if(!Object.prototype.hasOwnProperty.call(p,c))return!1;let h=e.parsed.newAliases;return[c,...p[c]].some(g=>!Object.prototype.hasOwnProperty.call(h,g)||!h[c])},s.limitedChoices=function(c){let p=e.getOptions(),h={};if(!Object.keys(p.choices).length)return;Object.keys(c).forEach(m=>{to.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(p.choices,m)&&[].concat(c[m]).forEach(v=>{p.choices[m].indexOf(v)===-1&&v!==void 0&&(h[m]=(h[m]||[]).concat(v))})});let g=Object.keys(h);if(!g.length)return;let b=i("Invalid values:");g.forEach(m=>{b+=`
|
60
|
+
${i("Argument: %s, Given: %s, Choices: %s",m,t.stringifiedValues(h[m]),t.stringifiedValues(p.choices[m]))}`}),t.fail(b)};let o={};s.implies=function(c,p){I("<string|object> [array|number|string]",[c,p],arguments.length),typeof c=="object"?Object.keys(c).forEach(h=>{s.implies(h,c[h])}):(e.global(c),o[c]||(o[c]=[]),Array.isArray(p)?p.forEach(h=>s.implies(c,h)):(Oe(p,void 0,n),o[c].push(p)))},s.getImplied=function(){return o};function a(u,c){let p=Number(c);return c=isNaN(p)?c:p,typeof c=="number"?c=u._.length>=c:c.match(/^--no-.+/)?(c=c.match(/^--no-(.+)/)[1],c=!Object.prototype.hasOwnProperty.call(u,c)):c=Object.prototype.hasOwnProperty.call(u,c),c}s.implications=function(c){let p=[];if(Object.keys(o).forEach(h=>{let g=h;(o[h]||[]).forEach(b=>{let m=g,v=b;m=a(c,m),b=a(c,b),m&&!b&&p.push(` ${g} -> ${v}`)})}),p.length){let h=`${i("Implications failed:")}
|
61
|
+
`;p.forEach(g=>{h+=g}),t.fail(h)}};let l={};s.conflicts=function(c,p){I("<string|object> [array|string]",[c,p],arguments.length),typeof c=="object"?Object.keys(c).forEach(h=>{s.conflicts(h,c[h])}):(e.global(c),l[c]||(l[c]=[]),Array.isArray(p)?p.forEach(h=>s.conflicts(c,h)):l[c].push(p))},s.getConflicting=()=>l,s.conflicting=function(c){Object.keys(c).forEach(p=>{l[p]&&l[p].forEach(h=>{h&&c[p]!==void 0&&c[h]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,h))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(p=>{l[p].forEach(h=>{h&&c[n.Parser.camelCase(p)]!==void 0&&c[n.Parser.camelCase(h)]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,h))})})},s.recommendCommands=function(c,p){p=p.sort((m,v)=>v.length-m.length);let g=null,b=1/0;for(let m=0,v;(v=p[m])!==void 0;m++){let O=eo(c,v);O<=3&&O<b&&(b=O,g=v)}g&&t.fail(i("Did you mean %s?",g))},s.reset=function(c){return o=et(o,p=>!c[p]),l=et(l,p=>!c[p]),s};let f=[];return s.freeze=function(){f.push({implied:o,conflicting:l})},s.unfreeze=function(){let c=f.pop();Oe(c,void 0,n),{implied:o,conflicting:l}=c},s}A();var Ei=[],cn;function Rn(e,t,n,i){cn=i;let r={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return r;let s=/\.json|\..*rc$/.test(e.extends),o=null;if(s)o=gl(t,e.extends);else try{o=require.resolve(e.extends)}catch(a){return e}ml(o),Ei.push(o),r=s?JSON.parse(cn.readFileSync(o,"utf8")):require(e.extends),delete e.extends,r=Rn(r,cn.path.dirname(o),n,cn)}return Ei=[],n?io(r,e):Object.assign({},r,e)}function ml(e){if(Ei.indexOf(e)>-1)throw new te(`Circular extended configurations: '${e}'.`)}function gl(e,t){return cn.path.resolve(e,t)}function io(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]=io(e[r],t[r]):n[r]=t[r];return n}var j=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},d=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},ce,Et,fn,Fe,je,$n,nt,St,Un,De,Hn,Te,Ue,Pe,Ne,Bn,zt,be,D,Wn,kn,Me,It,Gt,jt,it,Yn,B,Pt,Mt,Lt,z,He,ae;function vo(e){return(t=[],n=e.process.cwd(),i)=>{let r=new Ri(t,n,i,e);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var ro=Symbol("copyDoubleDash"),oo=Symbol("copyDoubleDash"),Si=Symbol("deleteFromParserHintObject"),so=Symbol("emitWarning"),ao=Symbol("freeze"),lo=Symbol("getDollarZero"),Ft=Symbol("getParserConfiguration"),Ii=Symbol("guessLocale"),co=Symbol("guessVersion"),fo=Symbol("parsePositionalNumbers"),ji=Symbol("pkgUp"),rt=Symbol("populateParserHintArray"),Kt=Symbol("populateParserHintSingleValueDictionary"),Pi=Symbol("populateParserHintArrayDictionary"),Mi=Symbol("populateParserHintDictionary"),Li=Symbol("sanitizeKey"),Fi=Symbol("setKey"),Di=Symbol("unfreeze"),uo=Symbol("validateAsync"),po=Symbol("getCommandInstance"),ho=Symbol("getContext"),mo=Symbol("getHasOutput"),go=Symbol("getLoggerInstance"),bo=Symbol("getParseContext"),yo=Symbol("getUsageInstance"),wo=Symbol("getValidationInstance"),qn=Symbol("hasParseCallback"),Co=Symbol("isGlobalContext"),Dt=Symbol("postProcess"),Ao=Symbol("rebase"),Ti=Symbol("reset"),un=Symbol("runYargsParserAndExecuteCommands"),Ni=Symbol("runValidation"),xo=Symbol("setHasOutput"),Tt=Symbol("kTrackManuallySetKeys"),Ri=class{constructor(t=[],n,i,r){this.customScriptName=!1,this.parsed=!1,ce.set(this,void 0),Et.set(this,void 0),fn.set(this,{commands:[],fullCommands:[]}),Fe.set(this,null),je.set(this,null),$n.set(this,"show-hidden"),nt.set(this,null),St.set(this,!0),Un.set(this,{}),De.set(this,!0),Hn.set(this,[]),Te.set(this,void 0),Ue.set(this,{}),Pe.set(this,!1),Ne.set(this,null),Bn.set(this,!0),zt.set(this,void 0),be.set(this,""),D.set(this,void 0),Wn.set(this,void 0),kn.set(this,{}),Me.set(this,null),It.set(this,null),Gt.set(this,{}),jt.set(this,{}),it.set(this,void 0),Yn.set(this,!1),B.set(this,void 0),Pt.set(this,!1),Mt.set(this,!1),Lt.set(this,!1),z.set(this,void 0),He.set(this,null),ae.set(this,void 0),j(this,B,r,"f"),j(this,it,t,"f"),j(this,Et,n,"f"),j(this,Wn,i,"f"),j(this,Te,new Dn(this),"f"),this.$0=this[lo](),this[Ti](),j(this,ce,d(this,ce,"f"),"f"),j(this,z,d(this,z,"f"),"f"),j(this,ae,d(this,ae,"f"),"f"),j(this,D,d(this,D,"f"),"f"),d(this,D,"f").showHiddenOpt=d(this,$n,"f"),j(this,zt,this[oo](),"f")}addHelpOpt(t,n){let i="help";return I("[string|boolean] [string]",[t,n],arguments.length),d(this,Ne,"f")&&(this[Si](d(this,Ne,"f")),j(this,Ne,null,"f")),t===!1&&n===void 0?this:(j(this,Ne,typeof t=="string"?t:i,"f"),this.boolean(d(this,Ne,"f")),this.describe(d(this,Ne,"f"),n||d(this,z,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(I("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let i=typeof t=="string"?t:d(this,$n,"f");return this.boolean(i),this.describe(i,n||d(this,z,"f").deferY18nLookup("Show hidden options")),d(this,D,"f").showHiddenOpt=i,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return I("<object|string|array> [string|array]",[t,n],arguments.length),this[Pi](this.alias.bind(this),"alias",t,n),this}array(t){return I("<array|string>",[t],arguments.length),this[rt]("array",t),this[Tt](t),this}boolean(t){return I("<array|string>",[t],arguments.length),this[rt]("boolean",t),this[Tt](t),this}check(t,n){return I("<function> [boolean]",[t,n],arguments.length),this.middleware((i,r)=>_t(()=>t(i,r.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&d(this,z,"f").fail(s.toString(),s):d(this,z,"f").fail(d(this,B,"f").y18n.__("Argument check failed: %s",t.toString())),i),s=>(d(this,z,"f").fail(s.message?s.message:s.toString(),s),i)),!1,n),this}choices(t,n){return I("<object|string|array> [string|array]",[t,n],arguments.length),this[Pi](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(I("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new te("coerce callback must be provided");for(let i of t)this.coerce(i,n);return this}else if(typeof t=="object"){for(let i of Object.keys(t))this.coerce(i,t[i]);return this}if(!n)throw new te("coerce callback must be provided");return d(this,D,"f").key[t]=!0,d(this,Te,"f").addCoerceMiddleware((i,r)=>{let s;return Object.hasOwnProperty.call(i,t)?_t(()=>(s=r.getAliases(),n(i[t])),a=>{i[t]=a;let l=r.getInternalMethods().getParserConfiguration()["strip-aliased"];if(s[t]&&l!==!0)for(let f of s[t])i[f]=a;return i},a=>{throw new te(a.message)}):i},t),this}conflicts(t,n){return I("<string|object> [string|array]",[t,n],arguments.length),d(this,ae,"f").conflicts(t,n),this}config(t="config",n,i){return I("[object|string] [string|function] [function]",[t,n,i],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=Rn(t,d(this,Et,"f"),this[Ft]()["deep-merge-config"]||!1,d(this,B,"f")),d(this,D,"f").configObjects=(d(this,D,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(i=n,n=void 0),this.describe(t,n||d(this,z,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(r=>{d(this,D,"f").config[r]=i||!0}),this)}completion(t,n,i){return I("[string] [string|boolean|function] [function]",[t,n,i],arguments.length),typeof n=="function"&&(i=n,n=void 0),j(this,je,t||d(this,je,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(d(this,je,"f"),n),i&&d(this,Fe,"f").registerFunction(i),this}command(t,n,i,r,s,o){return I("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,i,r,s,o],arguments.length),d(this,ce,"f").addHandler(t,n,i,r,s,o),this}commands(t,n,i,r,s,o){return this.command(t,n,i,r,s,o)}commandDir(t,n){I("<string> [object]",[t,n],arguments.length);let i=d(this,Wn,"f")||d(this,B,"f").require;return d(this,ce,"f").addDirectory(t,i,d(this,B,"f").getCallerFile(),n),this}count(t){return I("<array|string>",[t],arguments.length),this[rt]("count",t),this[Tt](t),this}default(t,n,i){return I("<object|string|array> [*] [string]",[t,n,i],arguments.length),i&&(Ai(t,d(this,B,"f")),d(this,D,"f").defaultDescription[t]=i),typeof n=="function"&&(Ai(t,d(this,B,"f")),d(this,D,"f").defaultDescription[t]||(d(this,D,"f").defaultDescription[t]=d(this,z,"f").functionDescription(n)),n=n.call()),this[Kt](this.default.bind(this),"default",t,n),this}defaults(t,n,i){return this.default(t,n,i)}demandCommand(t=1,n,i,r){return I("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,n,i,r],arguments.length),typeof n!="number"&&(i=n,n=1/0),this.global("_",!1),d(this,D,"f").demandedCommands._={min:t,max:n,minMsg:i,maxMsg:r},this}demand(t,n,i){return Array.isArray(n)?(n.forEach(r=>{Oe(i,!0,d(this,B,"f")),this.demandOption(r,i)}),n=1/0):typeof n!="number"&&(i=n,n=1/0),typeof t=="number"?(Oe(i,!0,d(this,B,"f")),this.demandCommand(t,n,i,i)):Array.isArray(t)?t.forEach(r=>{Oe(i,!0,d(this,B,"f")),this.demandOption(r,i)}):typeof i=="string"?this.demandOption(t,i):(i===!0||typeof i=="undefined")&&this.demandOption(t),this}demandOption(t,n){return I("<object|string|array> [string]",[t,n],arguments.length),this[Kt](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return I("<string> [string|boolean]",[t,n],arguments.length),d(this,D,"f").deprecatedOptions[t]=n,this}describe(t,n){return I("<object|string|array> [string]",[t,n],arguments.length),this[Fi](t,!0),d(this,z,"f").describe(t,n),this}detectLocale(t){return I("<boolean>",[t],arguments.length),j(this,St,t,"f"),this}env(t){return I("[string|boolean]",[t],arguments.length),t===!1?delete d(this,D,"f").envPrefix:d(this,D,"f").envPrefix=t||"",this}epilogue(t){return I("<string>",[t],arguments.length),d(this,z,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return I("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(i=>this.example(...i)):d(this,z,"f").example(t,n),this}exit(t,n){j(this,Pe,!0,"f"),j(this,nt,n,"f"),d(this,De,"f")&&d(this,B,"f").process.exit(t)}exitProcess(t=!0){return I("[boolean]",[t],arguments.length),j(this,De,t,"f"),this}fail(t){if(I("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new te("Invalid first argument. Expected function or boolean 'false'");return d(this,z,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return I("<array> [function]",[t,n],arguments.length),n?d(this,Fe,"f").getCompletion(t,n):new Promise((i,r)=>{d(this,Fe,"f").getCompletion(t,(s,o)=>{s?r(s):i(o)})})}getDemandedOptions(){return I([],0),d(this,D,"f").demandedOptions}getDemandedCommands(){return I([],0),d(this,D,"f").demandedCommands}getDeprecatedOptions(){return I([],0),d(this,D,"f").deprecatedOptions}getDetectLocale(){return d(this,St,"f")}getExitProcess(){return d(this,De,"f")}getGroups(){return Object.assign({},d(this,Ue,"f"),d(this,jt,"f"))}getHelp(){if(j(this,Pe,!0,"f"),!d(this,z,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[un](d(this,it,"f"),void 0,void 0,0,!0);if(re(n))return n.then(()=>d(this,z,"f").help())}let t=d(this,ce,"f").runDefaultBuilderOn(this);if(re(t))return t.then(()=>d(this,z,"f").help())}return Promise.resolve(d(this,z,"f").help())}getOptions(){return d(this,D,"f")}getStrict(){return d(this,Pt,"f")}getStrictCommands(){return d(this,Mt,"f")}getStrictOptions(){return d(this,Lt,"f")}global(t,n){return I("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?d(this,D,"f").local=d(this,D,"f").local.filter(i=>t.indexOf(i)===-1):t.forEach(i=>{d(this,D,"f").local.includes(i)||d(this,D,"f").local.push(i)}),this}group(t,n){I("<string|array> <string>",[t,n],arguments.length);let i=d(this,jt,"f")[n]||d(this,Ue,"f")[n];d(this,jt,"f")[n]&&delete d(this,jt,"f")[n];let r={};return d(this,Ue,"f")[n]=(i||[]).concat(t).filter(s=>r[s]?!1:r[s]=!0),this}hide(t){return I("<string>",[t],arguments.length),d(this,D,"f").hiddenOptions.push(t),this}implies(t,n){return I("<string|object> [number|string|array]",[t,n],arguments.length),d(this,ae,"f").implies(t,n),this}locale(t){return I("[string]",[t],arguments.length),t?(j(this,St,!1,"f"),d(this,B,"f").y18n.setLocale(t),this):(this[Ii](),d(this,B,"f").y18n.getLocale())}middleware(t,n,i){return d(this,Te,"f").addMiddleware(t,!!n,i)}nargs(t,n){return I("<string|object|array> [number]",[t,n],arguments.length),this[Kt](this.nargs.bind(this),"narg",t,n),this}normalize(t){return I("<array|string>",[t],arguments.length),this[rt]("normalize",t),this}number(t){return I("<array|string>",[t],arguments.length),this[rt]("number",t),this[Tt](t),this}option(t,n){if(I("<string|object> [object]",[t,n],arguments.length),typeof t=="object")Object.keys(t).forEach(i=>{this.options(i,t[i])});else{typeof n!="object"&&(n={}),this[Tt](t),d(this,He,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[so](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
62
|
+
`),void 0,"versionWarning"),d(this,D,"f").key[t]=!0,n.alias&&this.alias(t,n.alias);let i=n.deprecate||n.deprecated;i&&this.deprecateOption(t,i);let r=n.demand||n.required||n.require;r&&this.demand(t,r),n.demandOption&&this.demandOption(t,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),"default"in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(t),typeof n.global=="boolean"&&this.global(t,n.global),n.defaultDescription&&(d(this,D,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let s=n.describe||n.description||n.desc;this.describe(t,s),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,i){I("[string|array] [function|boolean|object] [function]",[t,n,i],arguments.length),this[ao](),typeof t=="undefined"&&(t=d(this,it,"f")),typeof n=="object"&&(j(this,It,n,"f"),n=i),typeof n=="function"&&(j(this,Me,n,"f"),n=!1),n||j(this,it,t,"f"),d(this,Me,"f")&&j(this,De,!1,"f");let r=this[un](t,!!n),s=this.parsed;return d(this,Fe,"f").setParsed(this.parsed),re(r)?r.then(o=>(d(this,Me,"f")&&d(this,Me,"f").call(this,d(this,nt,"f"),o,d(this,be,"f")),o)).catch(o=>{throw d(this,Me,"f")&&d(this,Me,"f")(o,this.parsed.argv,d(this,be,"f")),o}).finally(()=>{this[Di](),this.parsed=s}):(d(this,Me,"f")&&d(this,Me,"f").call(this,d(this,nt,"f"),r,d(this,be,"f")),this[Di](),this.parsed=s,r)}parseAsync(t,n,i){let r=this.parse(t,n,i);return re(r)?r:Promise.resolve(r)}parseSync(t,n,i){let r=this.parse(t,n,i);if(re(r))throw new te(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(t){return I("<object>",[t],arguments.length),j(this,kn,t,"f"),this}pkgConf(t,n){I("<string> [string]",[t,n],arguments.length);let i=null,r=this[ji](n||d(this,Et,"f"));return r[t]&&typeof r[t]=="object"&&(i=Rn(r[t],n||d(this,Et,"f"),this[Ft]()["deep-merge-config"]||!1,d(this,B,"f")),d(this,D,"f").configObjects=(d(this,D,"f").configObjects||[]).concat(i)),this}positional(t,n){I("<string> <object>",[t,n],arguments.length);let i=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=et(n,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:i.includes(o));let r=d(this,fn,"f").fullCommands[d(this,fn,"f").fullCommands.length-1],s=r?d(this,ce,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return Yt(s).forEach(o=>{let a=s[o];Array.isArray(a)?a.indexOf(t)!==-1&&(n[o]=!0):a[t]&&!(o in n)&&(n[o]=a[t])}),this.group(t,d(this,z,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return I("[boolean]",[t],arguments.length),j(this,Yn,t,"f"),this}required(t,n,i){return this.demand(t,n,i)}require(t,n,i){return this.demand(t,n,i)}requiresArg(t){return I("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&d(this,D,"f").narg[t]?this:(this[Kt](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return I("[string] [string]",[t,n],arguments.length),t=t||this.$0,d(this,zt,"f").log(d(this,Fe,"f").generateCompletionScript(t,n||d(this,je,"f")||"completion")),this}showHelp(t){if(I("[string|function]",[t],arguments.length),j(this,Pe,!0,"f"),!d(this,z,"f").hasCachedHelpMessage()){if(!this.parsed){let i=this[un](d(this,it,"f"),void 0,void 0,0,!0);if(re(i))return i.then(()=>{d(this,z,"f").showHelp(t)}),this}let n=d(this,ce,"f").runDefaultBuilderOn(this);if(re(n))return n.then(()=>{d(this,z,"f").showHelp(t)}),this}return d(this,z,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return I("[boolean|string] [string]",[t,n],arguments.length),d(this,z,"f").showHelpOnFail(t,n),this}showVersion(t){return I("[string|function]",[t],arguments.length),d(this,z,"f").showVersion(t),this}skipValidation(t){return I("<array|string>",[t],arguments.length),this[rt]("skipValidation",t),this}strict(t){return I("[boolean]",[t],arguments.length),j(this,Pt,t!==!1,"f"),this}strictCommands(t){return I("[boolean]",[t],arguments.length),j(this,Mt,t!==!1,"f"),this}strictOptions(t){return I("[boolean]",[t],arguments.length),j(this,Lt,t!==!1,"f"),this}string(t){return I("<array|string>",[t],arguments.length),this[rt]("string",t),this[Tt](t),this}terminalWidth(){return I([],0),d(this,B,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return I("<object>",[t],arguments.length),j(this,St,!1,"f"),d(this,B,"f").y18n.updateLocale(t),this}usage(t,n,i,r){if(I("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,i,r],arguments.length),n!==void 0){if(Oe(t,null,d(this,B,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,i,r);throw new te(".usage() description must start with $0 if being used as alias for .command()")}else return d(this,z,"f").usage(t),this}version(t,n,i){let r="version";if(I("[boolean|string] [string] [string]",[t,n,i],arguments.length),d(this,He,"f")&&(this[Si](d(this,He,"f")),d(this,z,"f").version(void 0),j(this,He,null,"f")),arguments.length===0)i=this[co](),t=r;else if(arguments.length===1){if(t===!1)return this;i=t,t=r}else arguments.length===2&&(i=n,n=void 0);return j(this,He,typeof t=="string"?t:r,"f"),n=n||d(this,z,"f").deferY18nLookup("Show version number"),d(this,z,"f").version(i||void 0),this.boolean(d(this,He,"f")),this.describe(d(this,He,"f"),n),this}wrap(t){return I("<number|null|undefined>",[t],arguments.length),d(this,z,"f").wrap(t),this}[(ce=new WeakMap,Et=new WeakMap,fn=new WeakMap,Fe=new WeakMap,je=new WeakMap,$n=new WeakMap,nt=new WeakMap,St=new WeakMap,Un=new WeakMap,De=new WeakMap,Hn=new WeakMap,Te=new WeakMap,Ue=new WeakMap,Pe=new WeakMap,Ne=new WeakMap,Bn=new WeakMap,zt=new WeakMap,be=new WeakMap,D=new WeakMap,Wn=new WeakMap,kn=new WeakMap,Me=new WeakMap,It=new WeakMap,Gt=new WeakMap,jt=new WeakMap,it=new WeakMap,Yn=new WeakMap,B=new WeakMap,Pt=new WeakMap,Mt=new WeakMap,Lt=new WeakMap,z=new WeakMap,He=new WeakMap,ae=new WeakMap,ro)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[oo](){return{log:(...t)=>{this[qn]()||console.log(...t),j(this,Pe,!0,"f"),d(this,be,"f").length&&j(this,be,d(this,be,"f")+`
|
63
|
+
`,"f"),j(this,be,d(this,be,"f")+t.join(" "),"f")},error:(...t)=>{this[qn]()||console.error(...t),j(this,Pe,!0,"f"),d(this,be,"f").length&&j(this,be,d(this,be,"f")+`
|
64
|
+
`,"f"),j(this,be,d(this,be,"f")+t.join(" "),"f")}}}[Si](t){Yt(d(this,D,"f")).forEach(n=>{if((r=>r==="configObjects")(n))return;let i=d(this,D,"f")[n];Array.isArray(i)?i.includes(t)&&i.splice(i.indexOf(t),1):typeof i=="object"&&delete i[t]}),delete d(this,z,"f").getDescriptions()[t]}[so](t,n,i){d(this,Un,"f")[i]||(d(this,B,"f").process.emitWarning(t,n),d(this,Un,"f")[i]=!0)}[ao](){d(this,Hn,"f").push({options:d(this,D,"f"),configObjects:d(this,D,"f").configObjects.slice(0),exitProcess:d(this,De,"f"),groups:d(this,Ue,"f"),strict:d(this,Pt,"f"),strictCommands:d(this,Mt,"f"),strictOptions:d(this,Lt,"f"),completionCommand:d(this,je,"f"),output:d(this,be,"f"),exitError:d(this,nt,"f"),hasOutput:d(this,Pe,"f"),parsed:this.parsed,parseFn:d(this,Me,"f"),parseContext:d(this,It,"f")}),d(this,z,"f").freeze(),d(this,ae,"f").freeze(),d(this,ce,"f").freeze(),d(this,Te,"f").freeze()}[lo](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(d(this,B,"f").process.argv()[0])?n=d(this,B,"f").process.argv().slice(1,2):n=d(this,B,"f").process.argv().slice(0,1),t=n.map(i=>{let r=this[Ao](d(this,Et,"f"),i);return i.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<i.length?r:i}).join(" ").trim(),d(this,B,"f").getEnv("_")&&d(this,B,"f").getProcessArgvBin()===d(this,B,"f").getEnv("_")&&(t=d(this,B,"f").getEnv("_").replace(`${d(this,B,"f").path.dirname(d(this,B,"f").process.execPath())}/`,"")),t}[Ft](){return d(this,kn,"f")}[Ii](){if(!d(this,St,"f"))return;let t=d(this,B,"f").getEnv("LC_ALL")||d(this,B,"f").getEnv("LC_MESSAGES")||d(this,B,"f").getEnv("LANG")||d(this,B,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[co](){return this[ji]().version||"unknown"}[fo](t){let n=t["--"]?t["--"]:t._;for(let i=0,r;(r=n[i])!==void 0;i++)d(this,B,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(n[i]=Number(r));return t}[ji](t){let n=t||"*";if(d(this,Gt,"f")[n])return d(this,Gt,"f")[n];let i={};try{let r=t||d(this,B,"f").mainFilename;!t&&d(this,B,"f").path.extname(r)&&(r=d(this,B,"f").path.dirname(r));let s=d(this,B,"f").findUp(r,(o,a)=>{if(a.includes("package.json"))return"package.json"});Oe(s,void 0,d(this,B,"f")),i=JSON.parse(d(this,B,"f").readFileSync(s,"utf8"))}catch(r){}return d(this,Gt,"f")[n]=i||{},d(this,Gt,"f")[n]}[rt](t,n){n=[].concat(n),n.forEach(i=>{i=this[Li](i),d(this,D,"f")[t].push(i)})}[Kt](t,n,i,r){this[Mi](t,n,i,r,(s,o,a)=>{d(this,D,"f")[s][o]=a})}[Pi](t,n,i,r){this[Mi](t,n,i,r,(s,o,a)=>{d(this,D,"f")[s][o]=(d(this,D,"f")[s][o]||[]).concat(a)})}[Mi](t,n,i,r,s){if(Array.isArray(i))i.forEach(o=>{t(o,r)});else if((o=>typeof o=="object")(i))for(let o of Yt(i))t(o,i[o]);else s(n,this[Li](i),r)}[Li](t){return t==="__proto__"?"___proto___":t}[Fi](t,n){return this[Kt](this[Fi].bind(this),"key",t,n),this}[Di](){var t,n,i,r,s,o,a,l,f,u,c,p;let h=d(this,Hn,"f").pop();Oe(h,void 0,d(this,B,"f"));let g;t=this,n=this,i=this,r=this,s=this,o=this,a=this,l=this,f=this,u=this,c=this,p=this,{options:{set value(b){j(t,D,b,"f")}}.value,configObjects:g,exitProcess:{set value(b){j(n,De,b,"f")}}.value,groups:{set value(b){j(i,Ue,b,"f")}}.value,output:{set value(b){j(r,be,b,"f")}}.value,exitError:{set value(b){j(s,nt,b,"f")}}.value,hasOutput:{set value(b){j(o,Pe,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){j(a,Pt,b,"f")}}.value,strictCommands:{set value(b){j(l,Mt,b,"f")}}.value,strictOptions:{set value(b){j(f,Lt,b,"f")}}.value,completionCommand:{set value(b){j(u,je,b,"f")}}.value,parseFn:{set value(b){j(c,Me,b,"f")}}.value,parseContext:{set value(b){j(p,It,b,"f")}}.value}=h,d(this,D,"f").configObjects=g,d(this,z,"f").unfreeze(),d(this,ae,"f").unfreeze(),d(this,ce,"f").unfreeze(),d(this,Te,"f").unfreeze()}[uo](t,n){return _t(n,i=>(t(i),i))}getInternalMethods(){return{getCommandInstance:this[po].bind(this),getContext:this[ho].bind(this),getHasOutput:this[mo].bind(this),getLoggerInstance:this[go].bind(this),getParseContext:this[bo].bind(this),getParserConfiguration:this[Ft].bind(this),getUsageInstance:this[yo].bind(this),getValidationInstance:this[wo].bind(this),hasParseCallback:this[qn].bind(this),isGlobalContext:this[Co].bind(this),postProcess:this[Dt].bind(this),reset:this[Ti].bind(this),runValidation:this[Ni].bind(this),runYargsParserAndExecuteCommands:this[un].bind(this),setHasOutput:this[xo].bind(this)}}[po](){return d(this,ce,"f")}[ho](){return d(this,fn,"f")}[mo](){return d(this,Pe,"f")}[go](){return d(this,zt,"f")}[bo](){return d(this,It,"f")||{}}[yo](){return d(this,z,"f")}[wo](){return d(this,ae,"f")}[qn](){return!!d(this,Me,"f")}[Co](){return d(this,Bn,"f")}[Dt](t,n,i,r){return i||re(t)||(n||(t=this[ro](t)),(this[Ft]()["parse-positional-numbers"]||this[Ft]()["parse-positional-numbers"]===void 0)&&(t=this[fo](t)),r&&(t=Ot(t,this,d(this,Te,"f").getMiddleware(),!1))),t}[Ti](t={}){j(this,D,d(this,D,"f")||{},"f");let n={};n.local=d(this,D,"f").local||[],n.configObjects=d(this,D,"f").configObjects||[];let i={};n.local.forEach(o=>{i[o]=!0,(t[o]||[]).forEach(a=>{i[a]=!0})}),Object.assign(d(this,jt,"f"),Object.keys(d(this,Ue,"f")).reduce((o,a)=>{let l=d(this,Ue,"f")[a].filter(f=>!(f in i));return l.length>0&&(o[a]=l),o},{})),j(this,Ue,{},"f");let r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return r.forEach(o=>{n[o]=(d(this,D,"f")[o]||[]).filter(a=>!i[a])}),s.forEach(o=>{n[o]=et(d(this,D,"f")[o],a=>!i[a])}),n.envPrefix=d(this,D,"f").envPrefix,j(this,D,n,"f"),j(this,z,d(this,z,"f")?d(this,z,"f").reset(i):Jr(this,d(this,B,"f")),"f"),j(this,ae,d(this,ae,"f")?d(this,ae,"f").reset(i):no(this,d(this,z,"f"),d(this,B,"f")),"f"),j(this,ce,d(this,ce,"f")?d(this,ce,"f").reset():Gr(d(this,z,"f"),d(this,ae,"f"),d(this,Te,"f"),d(this,B,"f")),"f"),d(this,Fe,"f")||j(this,Fe,Xr(this,d(this,z,"f"),d(this,ce,"f"),d(this,B,"f")),"f"),d(this,Te,"f").reset(),j(this,je,null,"f"),j(this,be,"","f"),j(this,nt,null,"f"),j(this,Pe,!1,"f"),this.parsed=!1,this}[Ao](t,n){return d(this,B,"f").path.relative(t,n)}[un](t,n,i,r=0,s=!1){let o=!!i||s;t=t||d(this,it,"f"),d(this,D,"f").__=d(this,B,"f").y18n.__,d(this,D,"f").configuration=this[Ft]();let a=!!d(this,D,"f").configuration["populate--"],l=Object.assign({},d(this,D,"f").configuration,{"populate--":!0}),f=d(this,B,"f").Parser.detailed(t,Object.assign({},d(this,D,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),u=Object.assign(f.argv,d(this,It,"f")),c,p=f.aliases,h=!1,g=!1;Object.keys(u).forEach(b=>{b===d(this,Ne,"f")&&u[b]?h=!0:b===d(this,He,"f")&&u[b]&&(g=!0)}),u.$0=this.$0,this.parsed=f,r===0&&d(this,z,"f").clearCachedHelpMessage();try{if(this[Ii](),n)return this[Dt](u,a,!!i,!1);d(this,Ne,"f")&&[d(this,Ne,"f")].concat(p[d(this,Ne,"f")]||[]).filter(T=>T.length>1).includes(""+u._[u._.length-1])&&(u._.pop(),h=!0),j(this,Bn,!1,"f");let b=d(this,ce,"f").getCommands(),m=d(this,Fe,"f").completionKey in u,v=h||m||s;if(u._.length){if(b.length){let O;for(let T=r||0,q;u._[T]!==void 0;T++)if(q=String(u._[T]),b.includes(q)&&q!==d(this,je,"f")){let G=d(this,ce,"f").runCommand(q,this,f,T+1,s,h||g||s);return this[Dt](G,a,!!i,!1)}else if(!O&&q!==d(this,je,"f")){O=q;break}!d(this,ce,"f").hasDefaultCommand()&&d(this,Yn,"f")&&O&&!v&&d(this,ae,"f").recommendCommands(O,b)}d(this,je,"f")&&u._.includes(d(this,je,"f"))&&!m&&(d(this,De,"f")&&tt(!0),this.showCompletionScript(),this.exit(0))}if(d(this,ce,"f").hasDefaultCommand()&&!v){let O=d(this,ce,"f").runCommand(null,this,f,0,s,h||g||s);return this[Dt](O,a,!!i,!1)}if(m){d(this,De,"f")&&tt(!0),t=[].concat(t);let O=t.slice(t.indexOf(`--${d(this,Fe,"f").completionKey}`)+1);return d(this,Fe,"f").getCompletion(O,(T,q)=>{if(T)throw new te(T.message);(q||[]).forEach(G=>{d(this,zt,"f").log(G)}),this.exit(0)}),this[Dt](u,!a,!!i,!1)}if(d(this,Pe,"f")||(h?(d(this,De,"f")&&tt(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(d(this,De,"f")&&tt(!0),o=!0,d(this,z,"f").showVersion("log"),this.exit(0))),!o&&d(this,D,"f").skipValidation.length>0&&(o=Object.keys(u).some(O=>d(this,D,"f").skipValidation.indexOf(O)>=0&&u[O]===!0)),!o){if(f.error)throw new te(f.error.message);if(!m){let O=this[Ni](p,{},f.error);i||(c=Ot(u,this,d(this,Te,"f").getMiddleware(),!0)),c=this[uo](O,c!=null?c:u),re(c)&&!i&&(c=c.then(()=>Ot(u,this,d(this,Te,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof te)d(this,z,"f").fail(b.message,b);else throw b}return this[Dt](c!=null?c:u,a,!!i,!0)}[Ni](t,n,i,r){let s={...this.getDemandedOptions()};return o=>{if(i)throw new te(i.message);d(this,ae,"f").nonOptionCount(o),d(this,ae,"f").requiredArguments(o,s);let a=!1;d(this,Mt,"f")&&(a=d(this,ae,"f").unknownCommands(o)),d(this,Pt,"f")&&!a?d(this,ae,"f").unknownArguments(o,t,n,!!r):d(this,Lt,"f")&&d(this,ae,"f").unknownArguments(o,t,{},!1,!1),d(this,ae,"f").limitedChoices(o),d(this,ae,"f").implications(o),d(this,ae,"f").conflicting(o)}}[xo](){j(this,Pe,!0,"f")}[Tt](t){if(typeof t=="string")d(this,D,"f").key[t]=!0;else for(let n of t)d(this,D,"f").key[n]=!0}};function Kr(e){return!!e&&typeof e.getInternalMethods=="function"}var bl=vo(Wr),Vt=bl;A();A();A();A();var Oo=Ce(require("p-throttle")),_o=Ce(require("p-retry"));function Eo({throttle:e={interval:1e3,limit:10},retry:t={retries:1,factor:1.66}}){let n=e?(0,Oo.default)(e):null;return function(r){let s=async()=>await r();if(n&&(s=n(s)),t){let o=s;s=()=>(0,_o.default)(o,t)}return s()}}var pn=class extends Error{constructor(n,i,r,s,o,a){super(`${n}
|
65
|
+
${s}${o?" "+o:""} (${i} ${r}${a?` Request ID: ${a}`:""})`);this.errorMessage=n;this.fetchMethod=i;this.fetchUri=r;this.statusCode=s;this.statusText=o;this.requestId=a;Object.setPrototypeOf(this,pn.prototype)}},X=class{constructor(t){var i,r,s,o,a;if(!t.apiKey&&!t.bearerToken)throw new Error("You must provide an API key or a bearer token");let n=t.fetch;if(!n)if(typeof window!="undefined")n=window.fetch.bind(window);else if(typeof fetch!="undefined")n=fetch;else throw new Error("You must provide or polyfill a fetch implementation when not in a browser");this.options={...t,fetch:n,apiHost:(i=t.apiHost)!=null?i:"https://uniform.app",apiKey:(r=t.apiKey)!=null?r:null,projectId:(s=t.projectId)!=null?s:null,bearerToken:(o=t.bearerToken)!=null?o:null,limitPolicy:(a=t.limitPolicy)!=null?a:Eo({})}}async getCompositionList(t){let{projectId:n}=this.options,i=this.createUrl("/api/v1/canvas",{...t,projectId:n});return await this.apiClient(i)}async getCompositionBySlug(t){let{projectId:n}=this.options,i=this.createUrl("/api/v1/canvas",{...t,projectId:n});return await this.apiClient(i)}async getCompositionById(t){let{projectId:n}=this.options,i=this.createUrl("/api/v1/canvas",{...t,projectId:n});return await this.apiClient(i)}async updateComposition(t){let n=this.createUrl("/api/v1/canvas");await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeComposition(t){let n=this.createUrl("/api/v1/canvas");await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async getComponentDefinitions(t){let{projectId:n}=this.options,i=this.createUrl("/api/v1/canvas-definitions",{...t,projectId:n});return await this.apiClient(i)}async updateComponentDefinition(t){let n=this.createUrl("/api/v1/canvas-definitions");await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeComponentDefinition(t){let n=this.createUrl("/api/v1/canvas-definitions");await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async apiClient(t,n){return this.options.limitPolicy(async()=>{var s;let i=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},r=await this.options.fetch(t.toString(),{...n,headers:{...n==null?void 0:n.headers,...i}});if(!r.ok){let o="";try{let a=await r.text();try{let l=JSON.parse(a);l.errorMessage?o=Array.isArray(l.errorMessage)?l.errorMessage.join(", "):l.errorMessage:o=a}catch(l){o=a}}catch(a){o="General error"}throw new pn(o,(s=n==null?void 0:n.method)!=null?s:"GET",t.toString(),r.status,r.statusText,X.getRequestId(r))}return n!=null&&n.expectNoContent?null:await r.json()})}createUrl(t,n){let i=new URL(`${this.options.apiHost}${t}`);return Object.entries(n!=null?n:{}).forEach(([r,s])=>{var o;typeof s!==void 0&&s!==null&&i.searchParams.append(r,(o=s==null?void 0:s.toString())!=null?o:"")}),i}static getRequestId(t){let n=t.headers.get("x-nf-request-id");if(n)return n}};var sa=Ce(require("isomorphic-unfetch"));A();A();var yl=Object.create,$i=Object.defineProperty,wl=Object.defineProperties,Cl=Object.getOwnPropertyDescriptor,Al=Object.getOwnPropertyDescriptors,xl=Object.getOwnPropertyNames,So=Object.getOwnPropertySymbols,vl=Object.getPrototypeOf,Po=Object.prototype.hasOwnProperty,Ol=Object.prototype.propertyIsEnumerable,Io=(e,t,n)=>t in e?$i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_l=(e,t)=>{for(var n in t||(t={}))Po.call(t,n)&&Io(e,n,t[n]);if(So)for(var n of So(t))Ol.call(t,n)&&Io(e,n,t[n]);return e},El=(e,t)=>wl(e,Al(t)),jo=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),Sl=(e,t)=>()=>(e&&(t=e(e=0)),t),Be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Il=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xl(t))!Po.call(e,r)&&r!==n&&$i(e,r,{get:()=>t[r],enumerable:!(i=Cl(t,r))||i.enumerable});return e},Ui=(e,t,n)=>(n=e!=null?yl(vl(e)):{},Il(t||!e||!e.__esModule?$i(n,"default",{value:e,enumerable:!0}):n,e)),ye=Sl(()=>{}),jl=Be((e,t)=>{"use strict";ye(),t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),Mo=Be((e,t)=>{ye();var n=jl(),i={};for(let o of Object.keys(n))i[n[o]]=o;var r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};t.exports=r;for(let o of Object.keys(r)){if(!("channels"in r[o]))throw new Error("missing channels property: "+o);if(!("labels"in r[o]))throw new Error("missing channel labels property: "+o);if(r[o].labels.length!==r[o].channels)throw new Error("channel and label counts mismatch: "+o);let{channels:a,labels:l}=r[o];delete r[o].channels,delete r[o].labels,Object.defineProperty(r[o],"channels",{value:a}),Object.defineProperty(r[o],"labels",{value:l})}r.rgb.hsl=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255,u=Math.min(a,l,f),c=Math.max(a,l,f),p=c-u,h,g;c===u?h=0:a===c?h=(l-f)/p:l===c?h=2+(f-a)/p:f===c&&(h=4+(a-l)/p),h=Math.min(h*60,360),h<0&&(h+=360);let b=(u+c)/2;return c===u?g=0:b<=.5?g=p/(c+u):g=p/(2-c-u),[h,g*100,b*100]},r.rgb.hsv=function(o){let a,l,f,u,c,p=o[0]/255,h=o[1]/255,g=o[2]/255,b=Math.max(p,h,g),m=b-Math.min(p,h,g),v=function(O){return(b-O)/6/m+1/2};return m===0?(u=0,c=0):(c=m/b,a=v(p),l=v(h),f=v(g),p===b?u=f-l:h===b?u=1/3+a-f:g===b&&(u=2/3+l-a),u<0?u+=1:u>1&&(u-=1)),[u*360,c*100,b*100]},r.rgb.hwb=function(o){let a=o[0],l=o[1],f=o[2],u=r.rgb.hsl(o)[0],c=1/255*Math.min(a,Math.min(l,f));return f=1-1/255*Math.max(a,Math.max(l,f)),[u,c*100,f*100]},r.rgb.cmyk=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255,u=Math.min(1-a,1-l,1-f),c=(1-a-u)/(1-u)||0,p=(1-l-u)/(1-u)||0,h=(1-f-u)/(1-u)||0;return[c*100,p*100,h*100,u*100]};function s(o,a){return(o[0]-a[0])**2+(o[1]-a[1])**2+(o[2]-a[2])**2}r.rgb.keyword=function(o){let a=i[o];if(a)return a;let l=1/0,f;for(let u of Object.keys(n)){let c=n[u],p=s(o,c);p<l&&(l=p,f=u)}return f},r.keyword.rgb=function(o){return n[o]},r.rgb.xyz=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255;a=a>.04045?((a+.055)/1.055)**2.4:a/12.92,l=l>.04045?((l+.055)/1.055)**2.4:l/12.92,f=f>.04045?((f+.055)/1.055)**2.4:f/12.92;let u=a*.4124+l*.3576+f*.1805,c=a*.2126+l*.7152+f*.0722,p=a*.0193+l*.1192+f*.9505;return[u*100,c*100,p*100]},r.rgb.lab=function(o){let a=r.rgb.xyz(o),l=a[0],f=a[1],u=a[2];l/=95.047,f/=100,u/=108.883,l=l>.008856?l**(1/3):7.787*l+16/116,f=f>.008856?f**(1/3):7.787*f+16/116,u=u>.008856?u**(1/3):7.787*u+16/116;let c=116*f-16,p=500*(l-f),h=200*(f-u);return[c,p,h]},r.hsl.rgb=function(o){let a=o[0]/360,l=o[1]/100,f=o[2]/100,u,c,p;if(l===0)return p=f*255,[p,p,p];f<.5?u=f*(1+l):u=f+l-f*l;let h=2*f-u,g=[0,0,0];for(let b=0;b<3;b++)c=a+1/3*-(b-1),c<0&&c++,c>1&&c--,6*c<1?p=h+(u-h)*6*c:2*c<1?p=u:3*c<2?p=h+(u-h)*(2/3-c)*6:p=h,g[b]=p*255;return g},r.hsl.hsv=function(o){let a=o[0],l=o[1]/100,f=o[2]/100,u=l,c=Math.max(f,.01);f*=2,l*=f<=1?f:2-f,u*=c<=1?c:2-c;let p=(f+l)/2,h=f===0?2*u/(c+u):2*l/(f+l);return[a,h*100,p*100]},r.hsv.rgb=function(o){let a=o[0]/60,l=o[1]/100,f=o[2]/100,u=Math.floor(a)%6,c=a-Math.floor(a),p=255*f*(1-l),h=255*f*(1-l*c),g=255*f*(1-l*(1-c));switch(f*=255,u){case 0:return[f,g,p];case 1:return[h,f,p];case 2:return[p,f,g];case 3:return[p,h,f];case 4:return[g,p,f];case 5:return[f,p,h]}},r.hsv.hsl=function(o){let a=o[0],l=o[1]/100,f=o[2]/100,u=Math.max(f,.01),c,p;p=(2-l)*f;let h=(2-l)*u;return c=l*u,c/=h<=1?h:2-h,c=c||0,p/=2,[a,c*100,p*100]},r.hwb.rgb=function(o){let a=o[0]/360,l=o[1]/100,f=o[2]/100,u=l+f,c;u>1&&(l/=u,f/=u);let p=Math.floor(6*a),h=1-f;c=6*a-p,(p&1)!==0&&(c=1-c);let g=l+c*(h-l),b,m,v;switch(p){default:case 6:case 0:b=h,m=g,v=l;break;case 1:b=g,m=h,v=l;break;case 2:b=l,m=h,v=g;break;case 3:b=l,m=g,v=h;break;case 4:b=g,m=l,v=h;break;case 5:b=h,m=l,v=g;break}return[b*255,m*255,v*255]},r.cmyk.rgb=function(o){let a=o[0]/100,l=o[1]/100,f=o[2]/100,u=o[3]/100,c=1-Math.min(1,a*(1-u)+u),p=1-Math.min(1,l*(1-u)+u),h=1-Math.min(1,f*(1-u)+u);return[c*255,p*255,h*255]},r.xyz.rgb=function(o){let a=o[0]/100,l=o[1]/100,f=o[2]/100,u,c,p;return u=a*3.2406+l*-1.5372+f*-.4986,c=a*-.9689+l*1.8758+f*.0415,p=a*.0557+l*-.204+f*1.057,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,p=p>.0031308?1.055*p**(1/2.4)-.055:p*12.92,u=Math.min(Math.max(0,u),1),c=Math.min(Math.max(0,c),1),p=Math.min(Math.max(0,p),1),[u*255,c*255,p*255]},r.xyz.lab=function(o){let a=o[0],l=o[1],f=o[2];a/=95.047,l/=100,f/=108.883,a=a>.008856?a**(1/3):7.787*a+16/116,l=l>.008856?l**(1/3):7.787*l+16/116,f=f>.008856?f**(1/3):7.787*f+16/116;let u=116*l-16,c=500*(a-l),p=200*(l-f);return[u,c,p]},r.lab.xyz=function(o){let a=o[0],l=o[1],f=o[2],u,c,p;c=(a+16)/116,u=l/500+c,p=c-f/200;let h=c**3,g=u**3,b=p**3;return c=h>.008856?h:(c-16/116)/7.787,u=g>.008856?g:(u-16/116)/7.787,p=b>.008856?b:(p-16/116)/7.787,u*=95.047,c*=100,p*=108.883,[u,c,p]},r.lab.lch=function(o){let a=o[0],l=o[1],f=o[2],u;u=Math.atan2(f,l)*360/2/Math.PI,u<0&&(u+=360);let c=Math.sqrt(l*l+f*f);return[a,c,u]},r.lch.lab=function(o){let a=o[0],l=o[1],f=o[2]/360*2*Math.PI,u=l*Math.cos(f),c=l*Math.sin(f);return[a,u,c]},r.rgb.ansi16=function(o,a=null){let[l,f,u]=o,c=a===null?r.rgb.hsv(o)[2]:a;if(c=Math.round(c/50),c===0)return 30;let p=30+(Math.round(u/255)<<2|Math.round(f/255)<<1|Math.round(l/255));return c===2&&(p+=60),p},r.hsv.ansi16=function(o){return r.rgb.ansi16(r.hsv.rgb(o),o[2])},r.rgb.ansi256=function(o){let a=o[0],l=o[1],f=o[2];return a===l&&l===f?a<8?16:a>248?231:Math.round((a-8)/247*24)+232:16+36*Math.round(a/255*5)+6*Math.round(l/255*5)+Math.round(f/255*5)},r.ansi16.rgb=function(o){let a=o%10;if(a===0||a===7)return o>50&&(a+=3.5),a=a/10.5*255,[a,a,a];let l=(~~(o>50)+1)*.5,f=(a&1)*l*255,u=(a>>1&1)*l*255,c=(a>>2&1)*l*255;return[f,u,c]},r.ansi256.rgb=function(o){if(o>=232){let c=(o-232)*10+8;return[c,c,c]}o-=16;let a,l=Math.floor(o/36)/5*255,f=Math.floor((a=o%36)/6)/5*255,u=a%6/5*255;return[l,f,u]},r.rgb.hex=function(o){let a=(((Math.round(o[0])&255)<<16)+((Math.round(o[1])&255)<<8)+(Math.round(o[2])&255)).toString(16).toUpperCase();return"000000".substring(a.length)+a},r.hex.rgb=function(o){let a=o.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!a)return[0,0,0];let l=a[0];a[0].length===3&&(l=l.split("").map(h=>h+h).join(""));let f=parseInt(l,16),u=f>>16&255,c=f>>8&255,p=f&255;return[u,c,p]},r.rgb.hcg=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255,u=Math.max(Math.max(a,l),f),c=Math.min(Math.min(a,l),f),p=u-c,h,g;return p<1?h=c/(1-p):h=0,p<=0?g=0:u===a?g=(l-f)/p%6:u===l?g=2+(f-a)/p:g=4+(a-l)/p,g/=6,g%=1,[g*360,p*100,h*100]},r.hsl.hcg=function(o){let a=o[1]/100,l=o[2]/100,f=l<.5?2*a*l:2*a*(1-l),u=0;return f<1&&(u=(l-.5*f)/(1-f)),[o[0],f*100,u*100]},r.hsv.hcg=function(o){let a=o[1]/100,l=o[2]/100,f=a*l,u=0;return f<1&&(u=(l-f)/(1-f)),[o[0],f*100,u*100]},r.hcg.rgb=function(o){let a=o[0]/360,l=o[1]/100,f=o[2]/100;if(l===0)return[f*255,f*255,f*255];let u=[0,0,0],c=a%1*6,p=c%1,h=1-p,g=0;switch(Math.floor(c)){case 0:u[0]=1,u[1]=p,u[2]=0;break;case 1:u[0]=h,u[1]=1,u[2]=0;break;case 2:u[0]=0,u[1]=1,u[2]=p;break;case 3:u[0]=0,u[1]=h,u[2]=1;break;case 4:u[0]=p,u[1]=0,u[2]=1;break;default:u[0]=1,u[1]=0,u[2]=h}return g=(1-l)*f,[(l*u[0]+g)*255,(l*u[1]+g)*255,(l*u[2]+g)*255]},r.hcg.hsv=function(o){let a=o[1]/100,l=o[2]/100,f=a+l*(1-a),u=0;return f>0&&(u=a/f),[o[0],u*100,f*100]},r.hcg.hsl=function(o){let a=o[1]/100,l=o[2]/100*(1-a)+.5*a,f=0;return l>0&&l<.5?f=a/(2*l):l>=.5&&l<1&&(f=a/(2*(1-l))),[o[0],f*100,l*100]},r.hcg.hwb=function(o){let a=o[1]/100,l=o[2]/100,f=a+l*(1-a);return[o[0],(f-a)*100,(1-f)*100]},r.hwb.hcg=function(o){let a=o[1]/100,l=o[2]/100,f=1-l,u=f-a,c=0;return u<1&&(c=(f-u)/(1-u)),[o[0],u*100,c*100]},r.apple.rgb=function(o){return[o[0]/65535*255,o[1]/65535*255,o[2]/65535*255]},r.rgb.apple=function(o){return[o[0]/255*65535,o[1]/255*65535,o[2]/255*65535]},r.gray.rgb=function(o){return[o[0]/100*255,o[0]/100*255,o[0]/100*255]},r.gray.hsl=function(o){return[0,0,o[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(o){return[0,100,o[0]]},r.gray.cmyk=function(o){return[0,0,0,o[0]]},r.gray.lab=function(o){return[o[0],0,0]},r.gray.hex=function(o){let a=Math.round(o[0]/100*255)&255,l=((a<<16)+(a<<8)+a).toString(16).toUpperCase();return"000000".substring(l.length)+l},r.rgb.gray=function(o){return[(o[0]+o[1]+o[2])/3/255*100]}}),Pl=Be((e,t)=>{ye();var n=Mo();function i(){let a={},l=Object.keys(n);for(let f=l.length,u=0;u<f;u++)a[l[u]]={distance:-1,parent:null};return a}function r(a){let l=i(),f=[a];for(l[a].distance=0;f.length;){let u=f.pop(),c=Object.keys(n[u]);for(let p=c.length,h=0;h<p;h++){let g=c[h],b=l[g];b.distance===-1&&(b.distance=l[u].distance+1,b.parent=u,f.unshift(g))}}return l}function s(a,l){return function(f){return l(a(f))}}function o(a,l){let f=[l[a].parent,a],u=n[l[a].parent][a],c=l[a].parent;for(;l[c].parent;)f.unshift(l[c].parent),u=s(n[l[c].parent][c],u),c=l[c].parent;return u.conversion=f,u}t.exports=function(a){let l=r(a),f={},u=Object.keys(l);for(let c=u.length,p=0;p<c;p++){let h=u[p];l[h].parent!==null&&(f[h]=o(h,l))}return f}}),Ml=Be((e,t)=>{ye();var n=Mo(),i=Pl(),r={},s=Object.keys(n);function o(l){let f=function(...u){let c=u[0];return c==null?c:(c.length>1&&(u=c),l(u))};return"conversion"in l&&(f.conversion=l.conversion),f}function a(l){let f=function(...u){let c=u[0];if(c==null)return c;c.length>1&&(u=c);let p=l(u);if(typeof p=="object")for(let h=p.length,g=0;g<h;g++)p[g]=Math.round(p[g]);return p};return"conversion"in l&&(f.conversion=l.conversion),f}s.forEach(l=>{r[l]={},Object.defineProperty(r[l],"channels",{value:n[l].channels}),Object.defineProperty(r[l],"labels",{value:n[l].labels});let f=i(l);Object.keys(f).forEach(u=>{let c=f[u];r[l][u]=a(c),r[l][u].raw=o(c)})}),t.exports=r}),Ll=Be((e,t)=>{"use strict";ye();var n=(c,p)=>(...h)=>`\x1B[${c(...h)+p}m`,i=(c,p)=>(...h)=>{let g=c(...h);return`\x1B[${38+p};5;${g}m`},r=(c,p)=>(...h)=>{let g=c(...h);return`\x1B[${38+p};2;${g[0]};${g[1]};${g[2]}m`},s=c=>c,o=(c,p,h)=>[c,p,h],a=(c,p,h)=>{Object.defineProperty(c,p,{get:()=>{let g=h();return Object.defineProperty(c,p,{value:g,enumerable:!0,configurable:!0}),g},enumerable:!0,configurable:!0})},l,f=(c,p,h,g)=>{l===void 0&&(l=Ml());let b=g?10:0,m={};for(let[v,O]of Object.entries(l)){let T=v==="ansi16"?"ansi":v;v===p?m[T]=c(h,b):typeof O=="object"&&(m[T]=c(O[p],b))}return m};function u(){let c=new Map,p={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};p.color.gray=p.color.blackBright,p.bgColor.bgGray=p.bgColor.bgBlackBright,p.color.grey=p.color.blackBright,p.bgColor.bgGrey=p.bgColor.bgBlackBright;for(let[h,g]of Object.entries(p)){for(let[b,m]of Object.entries(g))p[b]={open:`\x1B[${m[0]}m`,close:`\x1B[${m[1]}m`},g[b]=p[b],c.set(m[0],m[1]);Object.defineProperty(p,h,{value:g,enumerable:!1})}return Object.defineProperty(p,"codes",{value:c,enumerable:!1}),p.color.close="\x1B[39m",p.bgColor.close="\x1B[49m",a(p.color,"ansi",()=>f(n,"ansi16",s,!1)),a(p.color,"ansi256",()=>f(i,"ansi256",s,!1)),a(p.color,"ansi16m",()=>f(r,"rgb",o,!1)),a(p.bgColor,"ansi",()=>f(n,"ansi16",s,!0)),a(p.bgColor,"ansi256",()=>f(i,"ansi256",s,!0)),a(p.bgColor,"ansi16m",()=>f(r,"rgb",o,!0)),p}Object.defineProperty(t,"exports",{enumerable:!0,get:u})}),Fl=Be((e,t)=>{"use strict";ye(),t.exports=(n,i=process.argv)=>{let r=n.startsWith("-")?"":n.length===1?"-":"--",s=i.indexOf(r+n),o=i.indexOf("--");return s!==-1&&(o===-1||s<o)}}),Dl=Be((e,t)=>{"use strict";ye();var n=jo("os"),i=jo("tty"),r=Fl(),{env:s}=process,o;r("no-color")||r("no-colors")||r("color=false")||r("color=never")?o=0:(r("color")||r("colors")||r("color=true")||r("color=always"))&&(o=1),"FORCE_COLOR"in s&&(s.FORCE_COLOR==="true"?o=1:s.FORCE_COLOR==="false"?o=0:o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3));function a(u){return u===0?!1:{level:u,hasBasic:!0,has256:u>=2,has16m:u>=3}}function l(u,c){if(o===0)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(u&&!c&&o===void 0)return 0;let p=o||0;if(s.TERM==="dumb")return p;if(process.platform==="win32"){let h=n.release().split(".");return Number(h[0])>=10&&Number(h[2])>=10586?Number(h[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(h=>h in s)||s.CI_NAME==="codeship"?1:p;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if(s.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in s){let h=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return h>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:p}function f(u){let c=l(u,u&&u.isTTY);return a(c)}t.exports={supportsColor:f,stdout:a(l(!0,i.isatty(1))),stderr:a(l(!0,i.isatty(2)))}}),Tl=Be((e,t)=>{"use strict";ye();var n=(r,s,o)=>{let a=r.indexOf(s);if(a===-1)return r;let l=s.length,f=0,u="";do u+=r.substr(f,a-f)+s+o,f=a+l,a=r.indexOf(s,f);while(a!==-1);return u+=r.substr(f),u},i=(r,s,o,a)=>{let l=0,f="";do{let u=r[a-1]==="\r";f+=r.substr(l,(u?a-1:a)-l)+s+(u?`\r
|
66
|
+
`:`
|
67
|
+
`)+o,l=a+1,a=r.indexOf(`
|
68
|
+
`,l)}while(a!==-1);return f+=r.substr(l),f};t.exports={stringReplaceAll:n,stringEncaseCRLFWithFirstIndex:i}}),Nl=Be((e,t)=>{"use strict";ye();var n=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,i=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,s=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,o=new Map([["n",`
|
69
|
+
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function a(c){let p=c[0]==="u",h=c[1]==="{";return p&&!h&&c.length===5||c[0]==="x"&&c.length===3?String.fromCharCode(parseInt(c.slice(1),16)):p&&h?String.fromCodePoint(parseInt(c.slice(2,-1),16)):o.get(c)||c}function l(c,p){let h=[],g=p.trim().split(/\s*,\s*/g),b;for(let m of g){let v=Number(m);if(!Number.isNaN(v))h.push(v);else if(b=m.match(r))h.push(b[2].replace(s,(O,T,q)=>T?a(T):q));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${c}')`)}return h}function f(c){i.lastIndex=0;let p=[],h;for(;(h=i.exec(c))!==null;){let g=h[1];if(h[2]){let b=l(g,h[2]);p.push([g].concat(b))}else p.push([g])}return p}function u(c,p){let h={};for(let b of p)for(let m of b.styles)h[m[0]]=b.inverse?null:m.slice(1);let g=c;for(let[b,m]of Object.entries(h))if(Array.isArray(m)){if(!(b in g))throw new Error(`Unknown Chalk style: ${b}`);g=m.length>0?g[b](...m):g[b]}return g}t.exports=(c,p)=>{let h=[],g=[],b=[];if(p.replace(n,(m,v,O,T,q,G)=>{if(v)b.push(a(v));else if(T){let Y=b.join("");b=[],g.push(h.length===0?Y:u(c,h)(Y)),h.push({inverse:O,styles:f(T)})}else if(q){if(h.length===0)throw new Error("Found extraneous } in Chalk template literal");g.push(u(c,h)(b.join(""))),b=[],h.pop()}else b.push(G)}),g.push(b.join("")),h.length>0){let m=`Chalk template literal is missing ${h.length} closing bracket${h.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return g.join("")}}),Hi=Be((e,t)=>{"use strict";ye();var n=Ll(),{stdout:i,stderr:r}=Dl(),{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:o}=Tl(),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],f=Object.create(null),u=(Y,N={})=>{if(N.level&&!(Number.isInteger(N.level)&&N.level>=0&&N.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let V=i?i.level:0;Y.level=N.level===void 0?V:N.level},c=class{constructor(Y){return p(Y)}},p=Y=>{let N={};return u(N,Y),N.template=(...V)=>q(N.template,...V),Object.setPrototypeOf(N,h.prototype),Object.setPrototypeOf(N.template,N),N.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},N.template.Instance=c,N.template};function h(Y){return p(Y)}for(let[Y,N]of Object.entries(n))f[Y]={get(){let V=v(this,m(N.open,N.close,this._styler),this._isEmpty);return Object.defineProperty(this,Y,{value:V}),V}};f.visible={get(){let Y=v(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:Y}),Y}};var g=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let Y of g)f[Y]={get(){let{level:N}=this;return function(...V){let Z=m(n.color[l[N]][Y](...V),n.color.close,this._styler);return v(this,Z,this._isEmpty)}}};for(let Y of g){let N="bg"+Y[0].toUpperCase()+Y.slice(1);f[N]={get(){let{level:V}=this;return function(...Z){let W=m(n.bgColor[l[V]][Y](...Z),n.bgColor.close,this._styler);return v(this,W,this._isEmpty)}}}}var b=Object.defineProperties(()=>{},El(_l({},f),{level:{enumerable:!0,get(){return this._generator.level},set(Y){this._generator.level=Y}}})),m=(Y,N,V)=>{let Z,W;return V===void 0?(Z=Y,W=N):(Z=V.openAll+Y,W=N+V.closeAll),{open:Y,close:N,openAll:Z,closeAll:W,parent:V}},v=(Y,N,V)=>{let Z=(...W)=>a(W[0])&&a(W[0].raw)?O(Z,q(Z,...W)):O(Z,W.length===1?""+W[0]:W.join(" "));return Object.setPrototypeOf(Z,b),Z._generator=Y,Z._styler=N,Z._isEmpty=V,Z},O=(Y,N)=>{if(Y.level<=0||!N)return Y._isEmpty?"":N;let V=Y._styler;if(V===void 0)return N;let{openAll:Z,closeAll:W}=V;if(N.indexOf("\x1B")!==-1)for(;V!==void 0;)N=s(N,V.close,V.open),V=V.parent;let Se=N.indexOf(`
|
70
|
+
`);return Se!==-1&&(N=o(N,W,Z,Se)),Z+N+W},T,q=(Y,...N)=>{let[V]=N;if(!a(V)||!a(V.raw))return N.join(" ");let Z=N.slice(1),W=[V.raw[0]];for(let Se=1;Se<V.length;Se++)W.push(String(Z[Se-1]).replace(/[{}\\]/g,"\\$&"),String(V.raw[Se]));return T===void 0&&(T=Nl()),T(Y,W.join(""))};Object.defineProperties(h.prototype,f);var G=h();G.supportsColor=i,G.stderr=h({level:r?r.level:0}),G.stderr.supportsColor=r,t.exports=G});var ci=require("fs"),fi=require("fs/promises"),xn=require("path");A();function Go(e){return typeof e=="undefined"||e===null}function Rl(e){return typeof e=="object"&&e!==null}function $l(e){return Array.isArray(e)?e:Go(e)?[]:[e]}function Ul(e,t){var n,i,r,s;if(t)for(s=Object.keys(t),n=0,i=s.length;n<i;n+=1)r=s[n],e[r]=t[r];return e}function Hl(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function Bl(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Wl=Go,kl=Rl,Yl=$l,ql=Hl,zl=Bl,Gl=Ul,me={isNothing:Wl,isObject:kl,toArray:Yl,repeat:ql,isNegativeZero:zl,extend:Gl};function Ko(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
|
71
|
+
|
72
|
+
`+e.mark.snippet),i+" "+n):i}function hn(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||""}hn.prototype=Object.create(Error.prototype);hn.prototype.constructor=hn;hn.prototype.toString=function(t){return this.name+": "+Ko(this,t)};var _e=hn;function Bi(e,t,n,i,r){var s="",o="",a=Math.floor(r/2)-1;return i-t>a&&(s=" ... ",t=i-a+s.length),n-i>a&&(o=" ...",n=i+a-o.length),{str:s+e.slice(t,n).replace(/\t/g,"\u2192")+o,pos:i-t+s.length}}function Wi(e,t){return me.repeat(" ",t-e.length)+e}function Kl(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,i=[0],r=[],s,o=-1;s=n.exec(e.buffer);)r.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var a="",l,f,u=Math.min(e.line+t.linesAfter,r.length).toString().length,c=t.maxLength-(t.indent+u+3);for(l=1;l<=t.linesBefore&&!(o-l<0);l++)f=Bi(e.buffer,i[o-l],r[o-l],e.position-(i[o]-i[o-l]),c),a=me.repeat(" ",t.indent)+Wi((e.line-l+1).toString(),u)+" | "+f.str+`
|
73
|
+
`+a;for(f=Bi(e.buffer,i[o],r[o],e.position,c),a+=me.repeat(" ",t.indent)+Wi((e.line+1).toString(),u)+" | "+f.str+`
|
74
|
+
`,a+=me.repeat("-",t.indent+u+3+f.pos)+`^
|
75
|
+
`,l=1;l<=t.linesAfter&&!(o+l>=r.length);l++)f=Bi(e.buffer,i[o+l],r[o+l],e.position-(i[o]-i[o+l]),c),a+=me.repeat(" ",t.indent)+Wi((e.line+l+1).toString(),u)+" | "+f.str+`
|
76
|
+
`;return a.replace(/\n$/,"")}var Vl=Kl,Jl=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ql=["scalar","sequence","mapping"];function Zl(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function Xl(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Jl.indexOf(n)===-1)throw new _e('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Zl(t.styleAliases||null),Ql.indexOf(this.kind)===-1)throw new _e('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Ae=Xl;function Lo(e,t){var n=[];return e[t].forEach(function(i){var r=n.length;n.forEach(function(s,o){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(r=o)}),n[r]=i}),n}function ec(){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 Yi(e){return this.extend(e)}Yi.prototype.extend=function(t){var n=[],i=[];if(t instanceof Ae)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new _e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof Ae))throw new _e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new _e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new _e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(s){if(!(s instanceof Ae))throw new _e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(Yi.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=Lo(r,"implicit"),r.compiledExplicit=Lo(r,"explicit"),r.compiledTypeMap=ec(r.compiledImplicit,r.compiledExplicit),r};var tc=Yi,nc=new Ae("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),ic=new Ae("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),rc=new Ae("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),oc=new tc({explicit:[nc,ic,rc]});function sc(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function ac(){return null}function lc(e){return e===null}var cc=new Ae("tag:yaml.org,2002:null",{kind:"scalar",resolve:sc,construct:ac,predicate:lc,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 uc(e){return e==="true"||e==="True"||e==="TRUE"}function pc(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var dc=new Ae("tag:yaml.org,2002:bool",{kind:"scalar",resolve:fc,construct:uc,predicate:pc,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 hc(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function mc(e){return 48<=e&&e<=55}function gc(e){return 48<=e&&e<=57}function bc(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(!hc(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!mc(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<t;n++)if(r=e[n],r!=="_"){if(!gc(e.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function yc(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 wc(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!me.isNegativeZero(e)}var Cc=new Ae("tag:yaml.org,2002:int",{kind:"scalar",resolve:bc,construct:yc,predicate:wc,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"]}}),Ac=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function xc(e){return!(e===null||!Ac.test(e)||e[e.length-1]==="_")}function vc(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var Oc=/^[-+]?[0-9]+e/;function _c(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(me.isNegativeZero(e))return"-0.0";return n=e.toString(10),Oc.test(n)?n.replace("e",".e"):n}function Ec(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||me.isNegativeZero(e))}var Sc=new Ae("tag:yaml.org,2002:float",{kind:"scalar",resolve:xc,construct:vc,predicate:Ec,represent:_c,defaultStyle:"lowercase"}),Ic=oc.extend({implicit:[cc,dc,Cc,Sc]}),jc=Ic,Vo=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Jo=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Pc(e){return e===null?!1:Vo.exec(e)!==null||Jo.exec(e)!==null}function Mc(e){var t,n,i,r,s,o,a,l=0,f=null,u,c,p;if(t=Vo.exec(e),t===null&&(t=Jo.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(s=+t[4],o=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=+t[10],c=+(t[11]||0),f=(u*60+c)*6e4,t[9]==="-"&&(f=-f)),p=new Date(Date.UTC(n,i,r,s,o,a,l)),f&&p.setTime(p.getTime()-f),p}function Lc(e){return e.toISOString()}var Fc=new Ae("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Pc,construct:Mc,instanceOf:Date,represent:Lc});function Dc(e){return e==="<<"||e===null}var Tc=new Ae("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Dc}),Vi=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
77
|
+
\r`;function Nc(e){if(e===null)return!1;var t,n,i=0,r=e.length,s=Vi;for(n=0;n<r;n++)if(t=s.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function Rc(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,s=Vi,o=0,a=[];for(t=0;t<r;t++)t%4===0&&t&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(i.charAt(t));return n=r%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),new Uint8Array(a)}function $c(e){var t="",n=0,i,r,s=e.length,o=Vi;for(i=0;i<s;i++)i%3===0&&i&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[i];return r=s%3,r===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):r===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):r===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function Uc(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Hc=new Ae("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Nc,construct:Rc,predicate:Uc,represent:$c}),Bc=Object.prototype.hasOwnProperty,Wc=Object.prototype.toString;function kc(e){if(e===null)return!0;var t=[],n,i,r,s,o,a=e;for(n=0,i=a.length;n<i;n+=1){if(r=a[n],o=!1,Wc.call(r)!=="[object Object]")return!1;for(s in r)if(Bc.call(r,s))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function Yc(e){return e!==null?e:[]}var qc=new Ae("tag:yaml.org,2002:omap",{kind:"sequence",resolve:kc,construct:Yc}),zc=Object.prototype.toString;function Gc(e){if(e===null)return!0;var t,n,i,r,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(i=o[t],zc.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;s[t]=[r[0],i[r[0]]]}return!0}function Kc(e){if(e===null)return[];var t,n,i,r,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1)i=o[t],r=Object.keys(i),s[t]=[r[0],i[r[0]]];return s}var Vc=new Ae("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Gc,construct:Kc}),Jc=Object.prototype.hasOwnProperty;function Qc(e){if(e===null)return!0;var t,n=e;for(t in n)if(Jc.call(n,t)&&n[t]!==null)return!1;return!0}function Zc(e){return e!==null?e:{}}var Xc=new Ae("tag:yaml.org,2002:set",{kind:"mapping",resolve:Qc,construct:Zc}),Qo=jc.extend({implicit:[Fc,Tc],explicit:[Hc,qc,Vc,Xc]}),st=Object.prototype.hasOwnProperty,zn=1,Zo=2,Xo=3,Gn=4,ki=1,ef=2,Fo=3,tf=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,nf=/[\x85\u2028\u2029]/,rf=/[,\[\]\{\}]/,es=/^(?:!|!!|![a-z\-]+!)$/i,ts=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Do(e){return Object.prototype.toString.call(e)}function We(e){return e===10||e===13}function Rt(e){return e===9||e===32}function Ee(e){return e===9||e===32||e===10||e===13}function Qt(e){return e===44||e===91||e===93||e===123||e===125}function of(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function sf(e){return e===120?2:e===117?4:e===85?8:0}function af(e){return 48<=e&&e<=57?e-48:-1}function To(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
78
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function lf(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var ns=new Array(256),is=new Array(256);for(Nt=0;Nt<256;Nt++)ns[Nt]=To(Nt)?1:0,is[Nt]=To(Nt);var Nt;function cf(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Qo,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function rs(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=Vl(n),new _e(t,n)}function $(e,t){throw rs(e,t)}function Kn(e,t){e.onWarning&&e.onWarning.call(null,rs(e,t))}var No={YAML:function(t,n,i){var r,s,o;t.version!==null&&$(t,"duplication of %YAML directive"),i.length!==1&&$(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&$(t,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),o=parseInt(r[2],10),s!==1&&$(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Kn(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,s;i.length!==2&&$(t,"TAG directive accepts exactly two arguments"),r=i[0],s=i[1],es.test(r)||$(t,"ill-formed tag handle (first argument) of the TAG directive"),st.call(t.tagMap,r)&&$(t,'there is a previously declared suffix for "'+r+'" tag handle'),ts.test(s)||$(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(o){$(t,"tag prefix is malformed: "+s)}t.tagMap[r]=s}};function ot(e,t,n,i){var r,s,o,a;if(t<n){if(a=e.input.slice(t,n),i)for(r=0,s=a.length;r<s;r+=1)o=a.charCodeAt(r),o===9||32<=o&&o<=1114111||$(e,"expected valid JSON character");else tf.test(a)&&$(e,"the stream contains non-printable characters");e.result+=a}}function Ro(e,t,n,i){var r,s,o,a;for(me.isObject(n)||$(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),o=0,a=r.length;o<a;o+=1)s=r[o],st.call(t,s)||(t[s]=n[s],i[s]=!0)}function Zt(e,t,n,i,r,s,o,a,l){var f,u;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),f=0,u=r.length;f<u;f+=1)Array.isArray(r[f])&&$(e,"nested arrays are not supported inside keys"),typeof r=="object"&&Do(r[f])==="[object Object]"&&(r[f]="[object Object]");if(typeof r=="object"&&Do(r)==="[object Object]"&&(r="[object Object]"),r=String(r),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(f=0,u=s.length;f<u;f+=1)Ro(e,t,s[f],n);else Ro(e,t,s,n);else!e.json&&!st.call(n,r)&&st.call(t,r)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,$(e,"duplicated mapping key")),r==="__proto__"?Object.defineProperty(t,r,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[r]=s,delete n[r];return t}function Ji(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):$(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ue(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);r!==0;){for(;Rt(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(We(r))for(Ji(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&&Kn(e,"deficient indentation"),i}function Qn(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Ee(n)))}function Qi(e,t){t===1?e.result+=" ":t>1&&(e.result+=me.repeat(`
|
79
|
+
`,t-1))}function ff(e,t,n){var i,r,s,o,a,l,f,u,c=e.kind,p=e.result,h;if(h=e.input.charCodeAt(e.position),Ee(h)||Qt(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(r=e.input.charCodeAt(e.position+1),Ee(r)||n&&Qt(r)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,a=!1;h!==0;){if(h===58){if(r=e.input.charCodeAt(e.position+1),Ee(r)||n&&Qt(r))break}else if(h===35){if(i=e.input.charCodeAt(e.position-1),Ee(i))break}else{if(e.position===e.lineStart&&Qn(e)||n&&Qt(h))break;if(We(h))if(l=e.line,f=e.lineStart,u=e.lineIndent,ue(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=f,e.lineIndent=u;break}}a&&(ot(e,s,o,!1),Qi(e,e.line-l),s=o=e.position,a=!1),Rt(h)||(o=e.position+1),h=e.input.charCodeAt(++e.position)}return ot(e,s,o,!1),e.result?!0:(e.kind=c,e.result=p,!1)}function uf(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(ot(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)i=e.position,e.position++,r=e.position;else return!0;else We(n)?(ot(e,i,r,!0),Qi(e,ue(e,!1,t)),i=r=e.position):e.position===e.lineStart&&Qn(e)?$(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);$(e,"unexpected end of the stream within a single quoted scalar")}function pf(e,t){var n,i,r,s,o,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return ot(e,n,e.position,!0),e.position++,!0;if(a===92){if(ot(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),We(a))ue(e,!1,t);else if(a<256&&ns[a])e.result+=is[a],e.position++;else if((o=sf(a))>0){for(r=o,s=0;r>0;r--)a=e.input.charCodeAt(++e.position),(o=of(a))>=0?s=(s<<4)+o:$(e,"expected hexadecimal character");e.result+=lf(s),e.position++}else $(e,"unknown escape sequence");n=i=e.position}else We(a)?(ot(e,n,i,!0),Qi(e,ue(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Qn(e)?$(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}$(e,"unexpected end of the stream within a double quoted scalar")}function df(e,t){var n=!0,i,r,s,o=e.tag,a,l=e.anchor,f,u,c,p,h,g=Object.create(null),b,m,v,O;if(O=e.input.charCodeAt(e.position),O===91)u=93,h=!1,a=[];else if(O===123)u=125,h=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),O=e.input.charCodeAt(++e.position);O!==0;){if(ue(e,!0,t),O=e.input.charCodeAt(e.position),O===u)return e.position++,e.tag=o,e.anchor=l,e.kind=h?"mapping":"sequence",e.result=a,!0;n?O===44&&$(e,"expected the node content, but found ','"):$(e,"missed comma between flow collection entries"),m=b=v=null,c=p=!1,O===63&&(f=e.input.charCodeAt(e.position+1),Ee(f)&&(c=p=!0,e.position++,ue(e,!0,t))),i=e.line,r=e.lineStart,s=e.position,Xt(e,t,zn,!1,!0),m=e.tag,b=e.result,ue(e,!0,t),O=e.input.charCodeAt(e.position),(p||e.line===i)&&O===58&&(c=!0,O=e.input.charCodeAt(++e.position),ue(e,!0,t),Xt(e,t,zn,!1,!0),v=e.result),h?Zt(e,a,g,m,b,v,i,r,s):c?a.push(Zt(e,null,g,m,b,v,i,r,s)):a.push(b),ue(e,!0,t),O=e.input.charCodeAt(e.position),O===44?(n=!0,O=e.input.charCodeAt(++e.position)):n=!1}$(e,"unexpected end of the stream within a flow collection")}function hf(e,t){var n,i,r=ki,s=!1,o=!1,a=t,l=0,f=!1,u,c;if(c=e.input.charCodeAt(e.position),c===124)i=!1;else if(c===62)i=!0;else return!1;for(e.kind="scalar",e.result="";c!==0;)if(c=e.input.charCodeAt(++e.position),c===43||c===45)ki===r?r=c===43?Fo:ef:$(e,"repeat of a chomping mode identifier");else if((u=af(c))>=0)u===0?$(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?$(e,"repeat of an indentation width identifier"):(a=t+u-1,o=!0);else break;if(Rt(c)){do c=e.input.charCodeAt(++e.position);while(Rt(c));if(c===35)do c=e.input.charCodeAt(++e.position);while(!We(c)&&c!==0)}for(;c!==0;){for(Ji(e),e.lineIndent=0,c=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&c===32;)e.lineIndent++,c=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),We(c)){l++;continue}if(e.lineIndent<a){r===Fo?e.result+=me.repeat(`
|
80
|
+
`,s?1+l:l):r===ki&&s&&(e.result+=`
|
81
|
+
`);break}for(i?Rt(c)?(f=!0,e.result+=me.repeat(`
|
82
|
+
`,s?1+l:l)):f?(f=!1,e.result+=me.repeat(`
|
83
|
+
`,l+1)):l===0?s&&(e.result+=" "):e.result+=me.repeat(`
|
84
|
+
`,l):e.result+=me.repeat(`
|
85
|
+
`,s?1+l:l),s=!0,o=!0,l=0,n=e.position;!We(c)&&c!==0;)c=e.input.charCodeAt(++e.position);ot(e,n,e.position,!1)}return!0}function $o(e,t){var n,i=e.tag,r=e.anchor,s=[],o,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,$(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!Ee(o))));){if(a=!0,e.position++,ue(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,Xt(e,t,Xo,!1,!0),s.push(e.result),ue(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)$(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=i,e.anchor=r,e.kind="sequence",e.result=s,!0):!1}function mf(e,t,n){var i,r,s,o,a,l,f=e.tag,u=e.anchor,c={},p=Object.create(null),h=null,g=null,b=null,m=!1,v=!1,O;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),O=e.input.charCodeAt(e.position);O!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,$(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(O===63||O===58)&&Ee(i))O===63?(m&&(Zt(e,c,p,h,g,null,o,a,l),h=g=b=null),v=!0,m=!0,r=!0):m?(m=!1,r=!0):$(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,O=i;else{if(o=e.line,a=e.lineStart,l=e.position,!Xt(e,n,Zo,!1,!0))break;if(e.line===s){for(O=e.input.charCodeAt(e.position);Rt(O);)O=e.input.charCodeAt(++e.position);if(O===58)O=e.input.charCodeAt(++e.position),Ee(O)||$(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(Zt(e,c,p,h,g,null,o,a,l),h=g=b=null),v=!0,m=!1,r=!1,h=e.tag,g=e.result;else if(v)$(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=u,!0}else if(v)$(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=u,!0}if((e.line===s||e.lineIndent>t)&&(m&&(o=e.line,a=e.lineStart,l=e.position),Xt(e,t,Gn,!0,r)&&(m?g=e.result:b=e.result),m||(Zt(e,c,p,h,g,b,o,a,l),h=g=b=null),ue(e,!0,-1),O=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&O!==0)$(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&Zt(e,c,p,h,g,null,o,a,l),v&&(e.tag=f,e.anchor=u,e.kind="mapping",e.result=c),v}function gf(e){var t,n=!1,i=!1,r,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&$(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(i=!0,r="!!",o=e.input.charCodeAt(++e.position)):r="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(s=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):$(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Ee(o);)o===33&&(i?$(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),es.test(r)||$(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),rf.test(s)&&$(e,"tag suffix cannot contain flow indicator characters")}s&&!ts.test(s)&&$(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch(a){$(e,"tag name is malformed: "+s)}return n?e.tag=s:st.call(e.tagMap,r)?e.tag=e.tagMap[r]+s:r==="!"?e.tag="!"+s:r==="!!"?e.tag="tag:yaml.org,2002:"+s:$(e,'undeclared tag handle "'+r+'"'),!0}function bf(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&$(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Ee(n)&&!Qt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&$(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function yf(e){var t,n,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!Ee(i)&&!Qt(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&$(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),st.call(e.anchorMap,n)||$(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ue(e,!0,-1),!0}function Xt(e,t,n,i,r){var s,o,a,l=1,f=!1,u=!1,c,p,h,g,b,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=a=Gn===n||Xo===n,i&&ue(e,!0,-1)&&(f=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;gf(e)||bf(e);)ue(e,!0,-1)?(f=!0,a=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=f||r),(l===1||Gn===n)&&(zn===n||Zo===n?b=t:b=t+1,m=e.position-e.lineStart,l===1?a&&($o(e,m)||mf(e,m,b))||df(e,b)?u=!0:(o&&hf(e,b)||uf(e,b)||pf(e,b)?u=!0:yf(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&$(e,"alias node should not have any properties")):ff(e,b,zn===n)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=a&&$o(e,m))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&$(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,p=e.implicitTypes.length;c<p;c+=1)if(g=e.implicitTypes[c],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(st.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,h=e.typeMap.multi[e.kind||"fallback"],c=0,p=h.length;c<p;c+=1)if(e.tag.slice(0,h[c].tag.length)===h[c].tag){g=h[c];break}g||$(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&$(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):$(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function wf(e){var t=e.position,n,i,r,s=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(ue(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(s=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!Ee(o);)o=e.input.charCodeAt(++e.position);for(i=e.input.slice(n,e.position),r=[],i.length<1&&$(e,"directive name must not be less than one character in length");o!==0;){for(;Rt(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!We(o));break}if(We(o))break;for(n=e.position;o!==0&&!Ee(o);)o=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}o!==0&&Ji(e),st.call(No,i)?No[i](e,i,r):Kn(e,'unknown document directive "'+i+'"')}if(ue(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,ue(e,!0,-1)):s&&$(e,"directives end mark is expected"),Xt(e,e.lineIndent-1,Gn,!1,!0),ue(e,!0,-1),e.checkLineBreaks&&nf.test(e.input.slice(t,e.position))&&Kn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Qn(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ue(e,!0,-1));return}if(e.position<e.length-1)$(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+=`
|
86
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new cf(e,t),i=e.indexOf("\0");for(i!==-1&&(n.position=i,$(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)wf(n);return n.documents}function Cf(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,s=i.length;r<s;r+=1)t(i[r])}function Af(e,t){var n=os(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new _e("expected a single document in the stream, but found more")}}var xf=Cf,vf=Af,ss={loadAll:xf,load:vf},as=Object.prototype.toString,ls=Object.prototype.hasOwnProperty,Zi=65279,Of=9,mn=10,_f=13,Ef=32,Sf=33,If=34,qi=35,jf=37,Pf=38,Mf=39,Lf=42,cs=44,Ff=45,Vn=58,Df=61,Tf=62,Nf=63,Rf=64,fs=91,us=93,$f=96,ps=123,Uf=124,ds=125,xe={};xe[0]="\\0";xe[7]="\\a";xe[8]="\\b";xe[9]="\\t";xe[10]="\\n";xe[11]="\\v";xe[12]="\\f";xe[13]="\\r";xe[27]="\\e";xe[34]='\\"';xe[92]="\\\\";xe[133]="\\N";xe[160]="\\_";xe[8232]="\\L";xe[8233]="\\P";var Hf=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Bf=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Wf(e,t){var n,i,r,s,o,a,l;if(t===null)return{};for(n={},i=Object.keys(t),r=0,s=i.length;r<s;r+=1)o=i[r],a=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=e.compiledTypeMap.fallback[o],l&&ls.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function kf(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else if(e<=4294967295)n="U",i=8;else throw new _e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+me.repeat("0",i-t.length)+t}var Yf=1,gn=2;function qf(e){this.schema=e.schema||Qo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=me.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Wf(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?gn:Yf,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 Uo(e,t){for(var n=me.repeat(" ",t),i=0,r=-1,s="",o,a=e.length;i<a;)r=e.indexOf(`
|
87
|
+
`,i),r===-1?(o=e.slice(i),i=a):(o=e.slice(i,r+1),i=r+1),o.length&&o!==`
|
88
|
+
`&&(s+=n),s+=o;return s}function zi(e,t){return`
|
89
|
+
`+me.repeat(" ",e.indent*t)}function zf(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 Jn(e){return e===Ef||e===Of}function bn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Zi||65536<=e&&e<=1114111}function Ho(e){return bn(e)&&e!==Zi&&e!==_f&&e!==mn}function Bo(e,t,n){var i=Ho(e),r=i&&!Jn(e);return(n?i:i&&e!==cs&&e!==fs&&e!==us&&e!==ps&&e!==ds)&&e!==qi&&!(t===Vn&&!r)||Ho(t)&&!Jn(t)&&e===qi||t===Vn&&r}function Gf(e){return bn(e)&&e!==Zi&&!Jn(e)&&e!==Ff&&e!==Nf&&e!==Vn&&e!==cs&&e!==fs&&e!==us&&e!==ps&&e!==ds&&e!==qi&&e!==Pf&&e!==Lf&&e!==Sf&&e!==Uf&&e!==Df&&e!==Tf&&e!==Mf&&e!==If&&e!==jf&&e!==Rf&&e!==$f}function Kf(e){return!Jn(e)&&e!==Vn}function dn(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 hs(e){var t=/^\n* /;return t.test(e)}var ms=1,Gi=2,gs=3,bs=4,Jt=5;function Vf(e,t,n,i,r,s,o,a){var l,f=0,u=null,c=!1,p=!1,h=i!==-1,g=-1,b=Gf(dn(e,0))&&Kf(dn(e,e.length-1));if(t||o)for(l=0;l<e.length;f>=65536?l+=2:l++){if(f=dn(e,l),!bn(f))return Jt;b=b&&Bo(f,u,a),u=f}else{for(l=0;l<e.length;f>=65536?l+=2:l++){if(f=dn(e,l),f===mn)c=!0,h&&(p=p||l-g-1>i&&e[g+1]!==" ",g=l);else if(!bn(f))return Jt;b=b&&Bo(f,u,a),u=f}p=p||h&&l-g-1>i&&e[g+1]!==" "}return!c&&!p?b&&!o&&!r(e)?ms:s===gn?Jt:Gi:n>9&&hs(e)?Jt:o?s===gn?Jt:Gi:p?bs:gs}function Jf(e,t,n,i,r){e.dump=function(){if(t.length===0)return e.quotingType===gn?'""':"''";if(!e.noCompatMode&&(Hf.indexOf(t)!==-1||Bf.test(t)))return e.quotingType===gn?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),a=i||e.flowLevel>-1&&n>=e.flowLevel;function l(f){return zf(e,f)}switch(Vf(t,a,e.indent,o,l,e.quotingType,e.forceQuotes&&!i,r)){case ms:return t;case Gi:return"'"+t.replace(/'/g,"''")+"'";case gs:return"|"+Wo(t,e.indent)+ko(Uo(t,s));case bs:return">"+Wo(t,e.indent)+ko(Uo(Qf(t,o),s));case Jt:return'"'+Zf(t)+'"';default:throw new _e("impossible error: invalid scalar style")}}()}function Wo(e,t){var n=hs(e)?String(t):"",i=e[e.length-1]===`
|
90
|
+
`,r=i&&(e[e.length-2]===`
|
91
|
+
`||e===`
|
92
|
+
`),s=r?"+":i?"":"-";return n+s+`
|
93
|
+
`}function ko(e){return e[e.length-1]===`
|
94
|
+
`?e.slice(0,-1):e}function Qf(e,t){for(var n=/(\n+)([^\n]*)/g,i=function(){var f=e.indexOf(`
|
95
|
+
`);return f=f!==-1?f:e.length,n.lastIndex=f,Yo(e.slice(0,f),t)}(),r=e[0]===`
|
96
|
+
`||e[0]===" ",s,o;o=n.exec(e);){var a=o[1],l=o[2];s=l[0]===" ",i+=a+(!r&&!s&&l!==""?`
|
97
|
+
`:"")+Yo(l,t),r=s}return i}function Yo(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,i,r=0,s,o=0,a=0,l="";i=n.exec(e);)a=i.index,a-r>t&&(s=o>r?o:a,l+=`
|
98
|
+
`+e.slice(r,s),r=s+1),o=a;return l+=`
|
99
|
+
`,e.length-r>t&&o>r?l+=e.slice(r,o)+`
|
100
|
+
`+e.slice(o+1):l+=e.slice(r),l.slice(1)}function Zf(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=dn(e,r),i=xe[n],!i&&bn(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||kf(n);return t}function Xf(e,t,n){var i="",r=e.tag,s,o,a;for(s=0,o=n.length;s<o;s+=1)a=n[s],e.replacer&&(a=e.replacer.call(n,String(s),a)),(Ge(e,t,a,!1,!1)||typeof a=="undefined"&&Ge(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function qo(e,t,n,i){var r="",s=e.tag,o,a,l;for(o=0,a=n.length;o<a;o+=1)l=n[o],e.replacer&&(l=e.replacer.call(n,String(o),l)),(Ge(e,t+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&Ge(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=zi(e,t)),e.dump&&mn===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=s,e.dump=r||"[]"}function eu(e,t,n){var i="",r=e.tag,s=Object.keys(n),o,a,l,f,u;for(o=0,a=s.length;o<a;o+=1)u="",i!==""&&(u+=", "),e.condenseFlow&&(u+='"'),l=s[o],f=n[l],e.replacer&&(f=e.replacer.call(n,l,f)),Ge(e,t,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ge(e,t,f,!1,!1)&&(u+=e.dump,i+=u));e.tag=r,e.dump="{"+i+"}"}function tu(e,t,n,i){var r="",s=e.tag,o=Object.keys(n),a,l,f,u,c,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new _e("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)p="",(!i||r!=="")&&(p+=zi(e,t)),f=o[a],u=n[f],e.replacer&&(u=e.replacer.call(n,f,u)),Ge(e,t+1,f,!0,!0,!0)&&(c=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,c&&(e.dump&&mn===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,c&&(p+=zi(e,t)),Ge(e,t+1,u,!0,c)&&(e.dump&&mn===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,r+=p));e.tag=s,e.dump=r||"{}"}function zo(e,t,n){var i,r,s,o,a,l;for(r=n?e.explicitTypes:e.implicitTypes,s=0,o=r.length;s<o;s+=1)if(a=r[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(l=e.styleMap[a.tag]||a.defaultStyle,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 _e("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function Ge(e,t,n,i,r,s,o){e.tag=null,e.dump=n,zo(e,n,!1)||zo(e,n,!0);var a=as.call(e.dump),l=i,f;i&&(i=e.flowLevel<0||e.flowLevel>t);var u=a==="[object Object]"||a==="[object Array]",c,p;if(u&&(c=e.duplicates.indexOf(n),p=c!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(r=!1),p&&e.usedDuplicates[c])e.dump="*ref_"+c;else{if(u&&p&&!e.usedDuplicates[c]&&(e.usedDuplicates[c]=!0),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(tu(e,t,e.dump,r),p&&(e.dump="&ref_"+c+e.dump)):(eu(e,t,e.dump),p&&(e.dump="&ref_"+c+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?qo(e,t-1,e.dump,r):qo(e,t,e.dump,r),p&&(e.dump="&ref_"+c+e.dump)):(Xf(e,t,e.dump),p&&(e.dump="&ref_"+c+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Jf(e,e.dump,t,s,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new _e("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(f=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?f="!"+f:f.slice(0,18)==="tag:yaml.org,2002:"?f="!!"+f.slice(18):f="!<"+f+">",e.dump=f+" "+e.dump)}return!0}function nu(e,t){var n=[],i=[],r,s;for(Ki(e,n,i),r=0,s=i.length;r<s;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(s)}function Ki(e,t,n){var i,r,s;if(e!==null&&typeof e=="object")if(r=t.indexOf(e),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,s=e.length;r<s;r+=1)Ki(e[r],t,n);else for(i=Object.keys(e),r=0,s=i.length;r<s;r+=1)Ki(e[i[r]],t,n)}function iu(e,t){t=t||{};var n=new qf(t);n.noRefs||nu(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),Ge(n,0,i,!0,!0)?n.dump+`
|
101
|
+
`:""}var ru=iu,ou={dump:ru};function Xi(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 ys=ss.load,vh=ss.loadAll,ws=ou.dump;var Oh=Xi("safeLoad","load"),_h=Xi("safeLoadAll","loadAll"),Eh=Xi("safeDump","dump");var ea=require("fs"),br=require("path"),ta=require("fs"),na=Ce(require("fs"),1);A();function Ke(){}Ke.prototype={diff:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=i.callback;typeof i=="function"&&(r=i,i={}),this.options=i;var s=this;function o(b){return r?(setTimeout(function(){r(void 0,b)},0),!0):b}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var a=n.length,l=t.length,f=1,u=a+l,c=[{newPos:-1,components:[]}],p=this.extractCommon(c[0],n,t,0);if(c[0].newPos+1>=a&&p+1>=l)return o([{value:this.join(n),count:n.length}]);function h(){for(var b=-1*f;b<=f;b+=2){var m=void 0,v=c[b-1],O=c[b+1],T=(O?O.newPos:0)-b;v&&(c[b-1]=void 0);var q=v&&v.newPos+1<a,G=O&&0<=T&&T<l;if(!q&&!G){c[b]=void 0;continue}if(!q||G&&v.newPos<O.newPos?(m=au(O),s.pushComponent(m.components,void 0,!0)):(m=v,m.newPos++,s.pushComponent(m.components,!0,void 0)),T=s.extractCommon(m,n,t,b),m.newPos+1>=a&&T+1>=l)return o(su(s,m.components,n,t,s.useLongestToken));c[b]=m}f++}if(r)(function b(){setTimeout(function(){if(f>u)return r();h()||b()},0)})();else for(;f<=u;){var g=h();if(g)return g}},pushComponent:function(t,n,i){var r=t[t.length-1];r&&r.added===n&&r.removed===i?t[t.length-1]={count:r.count+1,added:n,removed:i}:t.push({count:1,added:n,removed:i})},extractCommon:function(t,n,i,r){for(var s=n.length,o=i.length,a=t.newPos,l=a-r,f=0;a+1<s&&l+1<o&&this.equals(n[a+1],i[l+1]);)a++,l++,f++;return f&&t.components.push({count:f}),t.newPos=a,l},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function su(e,t,n,i,r){for(var s=0,o=t.length,a=0,l=0;s<o;s++){var f=t[s];if(f.removed){if(f.value=e.join(i.slice(l,l+f.count)),l+=f.count,s&&t[s-1].added){var c=t[s-1];t[s-1]=t[s],t[s]=c}}else{if(!f.added&&r){var u=n.slice(a,a+f.count);u=u.map(function(h,g){var b=i[l+g];return b.length>h.length?b:h}),f.value=e.join(u)}else f.value=e.join(n.slice(a,a+f.count));a+=f.count,f.added||(l+=f.count)}}var p=t[o-1];return o>1&&typeof p.value=="string"&&(p.added||p.removed)&&e.equals("",p.value)&&(t[o-2].value+=p.value,t.pop()),t}function au(e){return{newPos:e.newPos,components:e.components.slice(0)}}var Ih=new Ke;var Cs=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,As=/\S/,xs=new Ke;xs.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!As.test(e)&&!As.test(t)};xs.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]&&Cs.test(t[n])&&Cs.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var nr=new Ke;nr.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 ir(e,t,n){return nr.diff(e,t,n)}var lu=new Ke;lu.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var cu=new Ke;cu.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Zn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Zn=function(t){return typeof t}:Zn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zn(e)}var fu=Object.prototype.toString,en=new Ke;en.useLongestToken=!0;en.tokenize=nr.tokenize;en.castInput=function(e){var t=this.options,n=t.undefinedReplacement,i=t.stringifyReplacer,r=i===void 0?function(s,o){return typeof o=="undefined"?n:o}:i;return typeof e=="string"?e:JSON.stringify(er(e,null,null,r),r," ")};en.equals=function(e,t){return Ke.prototype.equals.call(en,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function vs(e,t,n){return en.diff(e,t,n)}function er(e,t,n,i,r){t=t||[],n=n||[],i&&(e=i(r,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];var o;if(fu.call(e)==="[object Array]"){for(t.push(e),o=new Array(e.length),n.push(o),s=0;s<e.length;s+=1)o[s]=er(e[s],t,n,i,r);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Zn(e)==="object"&&e!==null){t.push(e),o={},n.push(o);var a=[],l;for(l in e)e.hasOwnProperty(l)&&a.push(l);for(a.sort(),s=0;s<a.length;s+=1)l=a[s],o[l]=er(e[l],t,n,i,l);t.pop(),n.pop()}else o=e;return o}var tr=new Ke;tr.tokenize=function(e){return e.slice()};tr.join=tr.removeEmpty=function(e){return e};var oa=Ce(Xs(),1);ye();ye();async function ft({objects:e,selectIdentifier:t,selectDisplayName:n=t,onSyncComplete:i}){let r=e.reduce((a,l)=>{let f=t(l);if(a[f])throw new Error(`Identifier ${f} was not unique.`);return a[f]={id:f,object:l,providerId:f,displayName:n(l)},a},{});async function*s(){for(let a of Object.values(r))yield a}function o(){return Object.entries(r).sort((a,l)=>a[0].localeCompare(l[0])).map(a=>a[1].object)}return{objects:s(),deleteObject:async a=>{delete r[a]},writeObject:async a=>{let l=t(a.object);r[l]=a},extractCurrent:o,onSyncComplete:i?a=>i(a,o()):void 0}}ye();var Pp=Ui(Hi());ye();function oe(e){var t,n;return e.option("apiKey",{describe:"Uniform API key. Defaults to CANVAS_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",default:(n=(t=process.env.CANVAS_CLI_API_KEY)!=null?t:process.env.UPM_CLI_API_KEY)!=null?n:process.env.UNIFORM_API_KEY,demandOption:!0,type:"string"}).option("apiHost",{describe:"Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or https://uniform.app. Supports dotenv.",default:process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app",demandOption:!0,type:"string"})}function se(e){var t,n,i;return e.option("project",{describe:"Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",default:(i=(n=(t=process.env.UNIFORM_CLI_PROJECT_ID)!=null?t:process.env.CANVAS_CLI_PROJECT_ID)!=null?n:process.env.UPM_CLI_PROJECT_ID)!=null?i:process.env.UNIFORM_PROJECT_ID,demandOption:!0,type:"string",alias:["p"]})}function ut(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 pt(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 dt(e){let t=(0,br.extname)(e);return t===".yaml"||t===".yml"||t===".json"}function ke(e,t,n){let i;if(n&&!t){let r=(0,br.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=ws(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?(0,ea.writeFileSync)(n,i,"utf8"):console.log(i)}function sn(e){let t=(0,ta.readFileSync)(e,"utf8");return ys(t,{filename:e,json:!0})}async function*ui(e,t){let n=t.pageSize||100,i=0,r=[];do{r=await e(i,n);for(let s of r)yield s;i+=n}while(r.length===n)}async function ht({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:i=n}){(0,ci.existsSync)(e)||(0,ci.mkdirSync)(e,{recursive:!0});let r=await(0,fi.readdir)(e,"utf-8"),s=new Set(r.filter(l=>{let f=(0,xn.extname)(l);return f===".json"||f===".yaml"||f===".yml"})),o=l=>(0,xn.join)(e,`${l}.${t}`);async function*a(){for(let l of s){let f=(0,xn.join)(e,l);try{let u=await sn(f);yield{id:n(u),displayName:i(u),providerId:f,object:u}}catch(u){throw console.error(Pp.default.red(`Failed to read ${f}, data is likely invalid.
|
102
|
+
${u==null?void 0:u.message}`)),u}}}return{objects:a(),deleteObject:async l=>{await(0,fi.unlink)(l)},writeObject:async l=>{ke(l.object,t,o(l.id))}}}ye();function ia(e,t){if(!t&&!na.default.existsSync(e))return{};let n=sn(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function ra(e,t){ke(t,void 0,e)}ye();async function mt({source:e,target:t,compareContents:n=(a,l)=>(0,oa.default)(a.object,l.object,(f,u,c)=>c==="created"||c==="modified"?!0:void 0),mode:i,allowEmptySource:r=!1,whatIf:s=!1,log:o=()=>{}}){var a,l;let f=new Map;for await(let p of t.objects)f.set(p.id,p);let u=[],c=!1;for await(let p of e.objects){c=!0;let h=p.id,g=f.get(h);if(g){if(!n(p,g)&&(i==="createOrUpdate"||i==="mirror")){let b=async(m,v)=>{var O;if(!s)try{await t.writeObject(m,v)}catch(T){throw new li(T,m)}o({action:"update",id:h,providerId:m.providerId,displayName:(O=m.displayName)!=null?O:m.providerId,whatIf:s,diff:vs(v.object,m.object)})};u.push(b(p,g))}f.delete(h)}else{let b=async(m,v)=>{var O;if(!s)try{await t.writeObject(m)}catch(T){throw new li(T,m)}o({action:"create",id:v,providerId:v,displayName:(O=m.displayName)!=null?O:m.providerId,whatIf:s,diff:ir("",JSON.stringify(m.object,null,2))})};u.push(b(p,h))}}if(await Promise.all(u),i==="mirror"){if(!c&&!r)throw new Error("Source is empty and mode is mirror. This would cause deletion of everything in the target, and most likely indicates an error in source definition.");let p=[];f.forEach(async h=>{let g=async b=>{var m;if(!s)try{await t.deleteObject(b.providerId)}catch(v){throw new li(v,b)}o({action:"delete",id:b.id,providerId:b.providerId,displayName:(m=b.displayName)!=null?m:b.providerId,whatIf:s,diff:ir(JSON.stringify(b.object,null,2),"")})};p.push(g(h))}),await Promise.all(p)}await Promise.all([(a=e.onSyncComplete)==null?void 0:a.call(e,!1),(l=t.onSyncComplete)==null?void 0:l.call(t,!0)])}var li=class extends Error{constructor(e,t){var n;super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
|
103
|
+
${e}`),this.stack=void 0,Object.setPrototypeOf(this,li.prototype)}};ye();var on=Ui(Hi());function gt(e){let{diffMode:t="off",indent:n,prefix:i}=e!=null?e:{};return function({action:r,displayName:s,whatIf:o,diff:a}){let l="";switch(r){case"create":l=on.default.green("[A]");break;case"update":l=on.default.white("[U]");break;case"delete":l=on.default.yellow("[D]");break}let f="";(t==="on"||t==="update"&&r==="update")&&(f=`
|
104
|
+
`+a.map(u=>u.added?on.default.green(u.value):u.removed?on.default.red(u.value):u.value).join("")),console.log(`${n!=null?n:""}${o?on.default.gray("[WHATIF]"):""}${l}${i!=null?i:""} ${s}${f}`)}}var aa={command:"get <id>",describe:"Fetch a component definition",builder:e=>ut(oe(se(e.positional("id",{demandOption:!0,describe:"Component definition public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:s})=>{let a=await new X({apiKey:t,apiHost:e,fetch:sa.default,projectId:r}).getComponentDefinitions({componentId:n,limit:1});a.componentDefinitions.length===0?(console.error("Component did not exist"),process.exit(1)):ke(a.componentDefinitions[0],i,s)}};A();var la=Ce(require("isomorphic-unfetch"));var ca={command:"list",describe:"List component definitions",aliases:["ls"],builder:e=>ut(oe(se(e.options({offset:{describe:"Number of rows to skip before fetching",type:"number",default:0},limit:{describe:"Number of rows to fetch",type:"number",default:20}})))),handler:async({apiHost:e,apiKey:t,limit:n,offset:i,format:r,filename:s,project:o})=>{let l=await new X({apiKey:t,apiHost:e,fetch:la.default,projectId:o}).getComponentDefinitions({limit:n,offset:i});ke(l.componentDefinitions,r,s)}};A();A();var fa=Ce(require("p-limit"));function pi(e){let t={...e};return delete t.projectId,delete t.state,t}function Ye(e){return e.option("state",{type:"string",describe:"Composition state to fetch.",choices:["preview","published"],default:"preview"})}function bt(e){let t=Number(e);if(!isNaN(t))return t;if(!e)return 64;if(typeof e!="string")throw new Error('state must be "published", "preview", or a number');return e==="preview"?0:64}var yt=(0,fa.default)(8);var ua=Ce(require("isomorphic-unfetch"));A();A();var wt=e=>e.id,Ct=e=>`${e.name} (pid: ${e.id})`;function di({client:e}){async function*t(){let n=ui(async(i,r)=>(await e.getComponentDefinitions({limit:r,offset:i})).componentDefinitions,{pageSize:100});for await(let i of n)yield{id:wt(i),displayName:Ct(i),providerId:i.id,object:i}}return{objects:t(),deleteObject:async n=>{await e.removeComponentDefinition({componentId:n})},writeObject:async n=>{await e.updateComponentDefinition({componentDefinition:n.object})}}}A();function Qe(e,t){return ia(e,t)}function vn(e,t){ra(e,t)}var pa={command:"pull <directory>",describe:"Pulls all component definitions to local files in a directory",builder:e=>oe(se(pt(e.positional("directory",{describe:"Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:s,project:o,diff:a})=>{var p;let l=new X({apiKey:t,apiHost:e,fetch:ua.default,projectId:o,limitPolicy:yt}),f=di({client:l}),u;if(dt(n)){let h=Qe(n,!1);u=await ft({objects:(p=h.components)!=null?p:[],selectIdentifier:wt,selectDisplayName:Ct,onSyncComplete:async(g,b)=>{h.components=b,vn(n,h)}})}else u=await ht({directory:n,selectIdentifier:wt,selectDisplayName:Ct,format:i});await mt({source:f,target:u,mode:r,whatIf:s,log:gt({diffMode:a})})}};A();var da=Ce(require("isomorphic-unfetch"));var ha={command:"push <directory>",describe:"Pushes all component definitions from files in a directory to Uniform Optimize",builder:e=>oe(se(pt(e.positional("directory",{describe:"Directory to read the component definitions from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,project:s,diff:o})=>{var c;let a=new X({apiKey:t,apiHost:e,fetch:da.default,projectId:s,limitPolicy:yt}),l;if(dt(n)){let p=Qe(n,!0);l=await ft({objects:(c=p.components)!=null?c:[],selectIdentifier:wt,selectDisplayName:Ct})}else l=await ht({directory:n,selectIdentifier:wt,selectDisplayName:Ct});let u=di({client:a});await mt({source:l,target:u,mode:i,whatIf:r,log:gt({diffMode:o})})}};A();var ma=Ce(require("isomorphic-unfetch"));var ga={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a component definition",builder:e=>oe(se(e.positional("id",{demandOption:!0,describe:"Component definition public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new X({apiKey:t,apiHost:e,fetch:ma.default,projectId:i}).removeComponentDefinition({componentId:n})}};A();var ba=Ce(require("isomorphic-unfetch"));var ya={command:"update <filename>",aliases:["put"],describe:"Insert or update a component definition",builder:e=>oe(se(e.positional("filename",{demandOption:!0,describe:"Component definition file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new X({apiKey:t,apiHost:e,fetch:ba.default,projectId:i}),s=sn(n);await r.updateComponentDefinition({componentDefinition:s})}};var wa={command:"component <command>",aliases:["def"],describe:"Commands for Canvas component definitions",builder:e=>e.command(pa).command(ha).command(aa).command(ga).command(ca).command(ya).demandCommand(),handler:()=>{Vt.help()}};A();A();var Ca=Ce(require("isomorphic-unfetch"));var Aa={command:"get <id>",describe:"Fetch a composition",builder:e=>ut(oe(se(Ye(e.positional("id",{demandOption:!0,describe:"Composition public ID to fetch"}).option({resolvePatterns:{type:"boolean",default:!1,describe:"Resolve pattern references in the composition"}}))))),handler:async({apiHost:e,apiKey:t,id:n,format:i,filename:r,state:s,project:o,resolvePatterns:a})=>{let l=new X({apiKey:t,apiHost:e,fetch:Ca.default,projectId:o}),f=pi(await l.getCompositionById({compositionId:n,state:bt(s),skipPatternResolution:!a}));ke(f,i,r)}};A();var xa=Ce(require("isomorphic-unfetch"));var va={command:"list",describe:"List compositions",aliases:["ls"],builder:e=>ut(oe(se(Ye(e.options({offset:{describe:"Number of rows to skip before fetching",type:"number",default:0},limit:{describe:"Number of rows to fetch",type:"number",default:20},resolvePatterns:{type:"boolean",default:!1,describe:"Resolve pattern references in the composition"}}))))),handler:async({apiHost:e,apiKey:t,limit:n,offset:i,format:r,filename:s,project:o,state:a,resolvePatterns:l})=>{let u=await new X({apiKey:t,apiHost:e,fetch:xa.default,projectId:o}).getCompositionList({limit:n,offset:i,state:bt(a),skipPatternResolution:!l});ke(u.compositions,r,s)}};A();var Oa=Ce(require("isomorphic-unfetch"));A();A();var At=e=>e.composition._id,xt=e=>{var t,n;return`${(n=(t=e.composition._name)!=null?t:e.composition._slug)!=null?n:e.composition._id} (pid: ${e.composition._id})`};function hi({client:e,state:t}){let n=bt(t);async function*i(){let r=ui(async(s,o)=>(await e.getCompositionList({limit:o,offset:s,state:n,skipPatternResolution:!0})).compositions,{pageSize:100});for await(let s of r)yield{id:At(s),displayName:xt(s),providerId:s.composition._id,object:pi(s)}}return{objects:i(),deleteObject:async r=>{await e.removeComposition({compositionId:r})},writeObject:async r=>{await e.updateComposition({...r.object,state:n})}}}var _a={command:"pull <directory>",describe:"Pulls all compositions to local files in a directory",builder:e=>oe(se(Ye(pt(e.positional("directory",{describe:"Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"}))))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:s,state:o,project:a,diff:l})=>{var h;let f=new X({apiKey:t,apiHost:e,fetch:Oa.default,projectId:a,limitPolicy:yt}),u=hi({client:f,state:o}),c=dt(n),p;if(c){let g=Qe(n,!1);p=await ft({objects:(h=g==null?void 0:g.compositions)!=null?h:[],selectIdentifier:At,selectDisplayName:xt,onSyncComplete:async(b,m)=>{g.compositions=m,vn(n,g)}})}else p=await ht({directory:n,selectIdentifier:At,selectDisplayName:xt,format:i});await mt({source:u,target:p,mode:r,whatIf:s,log:gt({diffMode:l})})}};A();var Ea=Ce(require("isomorphic-unfetch"));var Sa={command:"push <directory>",describe:"Pushes all compositions from files in a directory to Uniform Optimize",builder:e=>oe(se(Ye(pt(e.positional("directory",{describe:"Directory to read the component definitions from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"}))))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,state:s,project:o,diff:a})=>{var p;let l=new X({apiKey:t,apiHost:e,fetch:Ea.default,projectId:o,limitPolicy:yt}),f;if(dt(n)){let h=Qe(n,!0);f=await ft({objects:(p=h.compositions)!=null?p:[],selectIdentifier:At,selectDisplayName:xt})}else f=await ht({directory:n,selectIdentifier:At,selectDisplayName:xt});let c=hi({client:l,state:s});await mt({source:f,target:c,mode:i,whatIf:r,log:gt({diffMode:a})})}};A();var Ia=Ce(require("isomorphic-unfetch"));var ja={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a composition",builder:e=>oe(se(e.positional("id",{demandOption:!0,describe:"Composition public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new X({apiKey:t,apiHost:e,fetch:Ia.default,projectId:i}).removeComposition({compositionId:n})}};A();var Pa=Ce(require("isomorphic-unfetch"));var Ma={command:"update <filename>",aliases:["put"],describe:"Insert or update a composition",builder:e=>oe(se(Ye(e.positional("filename",{demandOption:!0,describe:"Composition file to put"})))),handler:async({apiHost:e,apiKey:t,filename:n,project:i,state:r})=>{let s=new X({apiKey:t,apiHost:e,fetch:Pa.default,projectId:i}),o=sn(n);await s.updateComposition({...o,state:bt(r)})}};var La={command:"composition <command>",describe:"Commands for Canvas compositions",aliases:["comp"],builder:e=>e.command(_a).command(Sa).command(Aa).command(ja).command(va).command(Ma).demandCommand(),handler:()=>{Vt.help()}};var Lp={commands:[{command:"canvas <command>",aliases:["cv","pm","presentation"],describe:"Uniform Canvas commands",builder:e=>e.command(La).command(wa).demandCommand(),handler:()=>{Vt.showHelp()}}]};0&&(module.exports={readCanvasPackage,uniformCLI,writeCanvasPackage});
|
105
|
+
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|
106
|
+
/**
|
107
|
+
* @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
|
108
|
+
* CJS and ESM environments.
|
109
|
+
*
|
110
|
+
* @license
|
111
|
+
* Copyright (c) 2016, Contributors
|
112
|
+
* SPDX-License-Identifier: ISC
|
113
|
+
*/
|
114
|
+
/**
|
115
|
+
* @license
|
116
|
+
* Copyright (c) 2016, Contributors
|
117
|
+
* SPDX-License-Identifier: ISC
|
118
|
+
*/
|