(()=>{varage=Object.create,Uh=Object.defineProperty,Age=Object.defineProperties,lge=Object.getOwnPropertyDescriptor,cge=Object.getOwnPropertyDescriptors,uge=Object.getOwnPropertyNames,RE=Object.getOwnPropertySymbols,gge=Object.getPrototypeOf,tQ=Object.prototype.hasOwnProperty,HO=Object.prototype.propertyIsEnumerable;varjO=(r,e,t)=>einr?Uh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,N=(r,e)=>{for(vartine||(e={}))tQ.call(e,t)&&jO(r,t,e[t]);if(RE)for(vartofRE(e))HO.call(e,t)&&jO(r,t,e[t]);returnr},te=(r,e)=>Age(r,cge(e)),fge=r=>Uh(r,"__esModule",{value:!0});varOr=(r,e)=>{vart={};for(variinr)tQ.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&RE)for(variofRE(r))e.indexOf(i)<0&&HO.call(r,i)&&(t[i]=r[i]);returnt},hge=(r,e)=>()=>(r&&(e=r(r=0)),e),w=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ft=(r,e)=>{for(vartine)Uh(r,t,{get:e[t],enumerable:!0})},pge=(r,e,t)=>{if(e&&typeofe=="object"||typeofe=="function")for(letiofuge(e))!tQ.call(r,i)&&i!=="default"&&Uh(r,i,{get:()=>e[i],enumerable:!(t=lge(e,i))||t.enumerable});returnr},ge=r=>pge(fge(Uh(r!=null?age(gge(r)):{},"default",r&&r.__esModule&&"default"inr?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);varhM=w((s7e,cM)=>{cM.exports=uM;uM.sync=Dge;vargM=require("fs");functionRge(r,e){vart=e.pathExt!==void0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(vari=0;i<t.length;i++){varn=t[i].toLowerCase();if(n&&r.substr(-n.length).toLowerCase()===n)return!0}return!1}functionfM(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:Rge(e,t)}functionuM(r,e,t){gM.stat(r,function(i,n){t(i,i?!1:fM(n,r,e))})}functionDge(r,e){returnfM(gM.statSync(r),r,e)}});varEM=w((o7e,pM)=>{pM.exports=dM;dM.sync=Fge;varCM=require("fs");functiondM(r,e,t){CM.stat(r,function(i,n){t(i,i?!1:mM(n,e))})}functionFge(r,e){returnmM(CM.statSync(r),e)}functionmM(r,e){returnr.isFile()&&Nge(r,e)}functionNge(r,e){vart=r.mode,i=r.uid,n=r.gid,s=e.uid!==void0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),u=a|l,g=t&c||t&l&&n===o||t&a&&i===s||t&u&&s===0;returng}});varyM=w((A7e,IM)=>{vara7e=require("fs"),_E;process.platform==="win32"||global.TESTING_WINDOWS?_E=hM():_E=EM();IM.exports=mQ;mQ.sync=Lge;functionmQ(r,e,t){if(typeofe=="function"&&(t=e,e={}),!t){if(typeofPromise!="function")thrownewTypeError("callback not provided");returnnewPromise(function(i,n){mQ(r,e||{},function(s,o){s?n(s):i(o)})})}_E(r,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),t(i,n)})}functionLge(r,e){try{return_E.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throwt}}});varkM=w((l7e,wM)=>{varZu=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",BM=require("path"),Tge=Zu?";":":",bM=yM(),QM=r=>Object.assign(newError(`not found: ${r}`),{code:"ENOENT"}),SM=(r,e)=>{lett=e.colon||Tge,i=r.match(/\//)||Zu&&r.match(/\\/)?[""]:[...Zu?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],n=Zu?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Zu?n.split(t):[""];returnZu&&r.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},vM=(r,e,t)=>{typeofe=="function"&&(t=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=SM(r,e),o=[],a=c=>newPromise((u,g)=>{if(c===i.length)returne.all&&o.length?u(o):g(QM(r));letf=i[c],h=/^".*"$/.test(f)?f.slice(1,-1):f,p=BM.join(h,r),m=!h&&/^\.[\\\/]/.test(r)?r.slice(0,2)+p:p;u(l(m,c,0))}),l=(c,u,g)=>newPromise((f,h)=>{if(g===n.length)returnf(a(u+1));letp=n[g];bM(c+p,{pathExt:s},(m,y)=>{if(!m&&y)if(e.all)o.push(c+p);elsereturnf(c+p);returnf(l(c,u,g+1))})});returnt?a(0).then(c=>t(null,c),t):a(0)},Oge=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:i,pathExtExe:n}=SM(r,e),s=[];for(leto=0;o<t.length;o++){leta=t[o],l=/^".*"$/.test(a)?a.slice(1,-1):a,c=BM.join(l,r),u=!l&&/^\.[\\\/]/.test(r)?r.slice(0,2)+c:c;for(letg=0;g<i.length;g++){letf=u+i[g];try{if(bM.
`+o1.repeat(" ",e+this.position-n+i.length)+"^"};FQ.prototype.toString=function(e){var t,i="";return this.name&&(i+='in "'+this.name+'" '),i+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(i+=`:
`+t)),i};s1.exports=FQ});var ci=w((M7e,A1)=>{"use strict";var l1=rg(),gfe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],ffe=["scalar","sequence","mapping"];function hfe(r){var e={};return r!==null&&Object.keys(r).forEach(function(t){r[t].forEach(function(i){e[String(i)]=t})}),e}function pfe(r,e){if(e=e||{},Object.keys(e).forEach(function(t){if(gfe.indexOf(t)===-1)throw new l1('Unknown option "'+t+'" is met in definition of "'+r+'" YAML type.')}),this.tag=r,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=hfe(e.styleAliases||null),ffe.indexOf(this.kind)===-1)throw new l1('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}A1.exports=pfe});var dc=w((U7e,c1)=>{"use strict";var u1=pc(),rI=rg(),dfe=ci();function NQ(r,e,t){var i=[];return r.include.forEach(function(n){t=NQ(n,e,t)}),r[e].forEach(function(n){t.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&i.push(o)}),t.push(n)}),t.filter(function(n,s){return i.indexOf(s)===-1})}function Cfe(){var r={scalar:{},sequence:{},mapping:{},fallback:{}},e,t;function i(n){r[n.kind][n.tag]=r.fallback[n.tag]=n}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(i);return r}function ig(r){this.include=r.include||[],this.implicit=r.implicit||[],this.explicit=r.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&e.loadKind!=="scalar")throw new rI("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=NQ(this,"implicit",[]),this.compiledExplicit=NQ(this,"explicit",[]),this.compiledTypeMap=Cfe(this.compiledImplicit,this.compiledExplicit)}ig.DEFAULT=null;ig.create=function(){var e,t;switch(arguments.length){case 1:e=ig.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new rI("Wrong number of arguments for Schema.create function")}if(e=u1.toArray(e),t=u1.toArray(t),!e.every(function(i){return i instanceof ig}))throw new rI("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(i){return i instanceof dfe}))throw new rI("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new ig({include:e,explicit:t})};c1.exports=ig});var f1=w((K7e,g1)=>{"use strict";var mfe=ci();g1.exports=new mfe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(r){return r!==null?r:""}})});var p1=w((H7e,h1)=>{"use strict";var Efe=ci();h1.exports=new Efe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(r){return r!==null?r:[]}})});var C1=w((j7e,d1)=>{"use strict";var Ife=ci();d1.exports=new Ife("tag:yaml.org,2002:map",{kind:"mapping",construct:function(r){return r!==null?r:{}}})});var iI=w((G7e,m1)=>{"use strict";var yfe=dc();m1.exports=new yfe({explicit:[f1(),p1(),C1()]})});var I1=w((Y7e,E1)=>{"use strict";var wfe=ci();function Bfe(r){if(r===null)return!0;var e=r.length;return e===1&&r==="~"||e===4&&(r==="null"||r==="Null"||r==="NULL")}function bfe(){return null}function Qfe(r){return r===null}E1.exports=new wfe("tag:yaml.org,2002:null",{kind:"scalar",resolve:Bfe,construct:bfe,predicate:Qfe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var w1=w((q7e,y1)=>{"use strict";var Sfe=ci();function vfe(r){if(r===null)return!1;var e=r.length;return e===4&&(r==="true"||r==="True"||r==="TRUE")||e===5&&(r==="false"||r==="False"||r==="FALSE")}function kfe(r){return r==="true"||r==="True"||r==="TRUE"}function xfe(r){return Object.prototype.toString.call(r)==="[object Boolean]"}y1.exports=new Sfe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:vfe,construct:kfe,predicate:xfe,represent:{lowercase:function(r){return r?"true":"false"},uppercase:function(r){return r?"TRUE"
`:r===118?"\v":r===102?"\f":r===114?"\r":r===101?"":r===32?" ":r===34?'"':r===47?"/":r===92?"\\":r===78?"\x85":r===95?"\xA0":r===76?"\u2028":r===80?"\u2029":""}function jhe(r){return r<=65535?String.fromCharCode(r):String.fromCharCode((r-65536>>10)+55296,(r-65536&1023)+56320)}var cU=new Array(256),uU=new Array(256);for(var og=0;og<256;og++)cU[og]=lU(og)?1:0,uU[og]=lU(og);function Ghe(r,e){this.input=r,this.filename=e.filename||null,this.schema=e.schema||Nhe,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function gU(r,e){return new tU(e,new Fhe(r.filename,r.input,r.position,r.line,r.position-r.lineStart))}function dt(r,e){throw gU(r,e)}function aI(r,e){r.onWarning&&r.onWarning.call(null,gU(r,e))}var fU={YAML:function(e,t,i){var n,s,o;e.version!==null&&dt(e,"duplication of %YAML directive"),i.length!==1&&dt(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&&dt(e,"ill-formed argument of the YAML directive"),s=parseInt(n[1],10),o=parseInt(n[2],10),s!==1&&dt(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&aI(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,s;i.length!==2&&dt(e,"TAG directive accepts exactly two arguments"),n=i[0],s=i[1],oU.test(n)||dt(e,"ill-formed tag handle (first argument) of the TAG directive"),WA.call(e.tagMap,n)&&dt(e,'there is a previously declared suffix for "'+n+'" tag handle'),aU.test(s)||dt(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[n]=s}};function zA(r,e,t,i){var n,s,o,a;if(e<t){if(a=r.input.slice(e,t),i)for(n=0,s=a.length;n<s;n+=1)o=a.charCodeAt(n),o===9||32<=o&&o<=1114111||dt(r,"expected valid JSON character");else The.test(a)&&dt(r,"the stream contains non-printable characters");r.result+=a}}function hU(r,e,t,i){var n,s,o,a;for(Ma.isObject(t)||dt(r,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(t),o=0,a=n.length;o<a;o+=1)s=n[o],WA.call(e,s)||(e[s]=t[s],i[s]=!0)}function ag(r,e,t,i,n,s,o,a){var l,c;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),l=0,c=n.length;l<c;l+=1)Array.isArray(n[l])&&dt(r,"nested arrays are not supported inside keys"),typeof n=="object"&&AU(n[l])==="[object Object]"&&(n[l]="[object Object]");if(typeof n=="object"&&AU(n)==="[object Object]"&&(n="[object Object]"),n=String(n),e===null&&(e={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(l=0,c=s.length;l<c;l+=1)hU(r,e,s[l],t);else hU(r,e,s,t);else!r.json&&!WA.call(t,n)&&WA.call(e,n)&&(r.line=o||r.line,r.position=a||r.position,dt(r,"duplicated mapping key")),e[n]=s,delete t[n];return e}function UQ(r){var e;e=r.input.charCodeAt(r.position),e===10?r.position++:e===13?(r.position++,r.input.charCodeAt(r.position)===10&&r.position++):dt(r,"a line break is expected"),r.line+=1,r.lineStart=r.position}function ei(r,e,t){for(var i=0,n=r.input.charCodeAt(r.position);n!==0;){for(;mc(n);)n=r.input.charCodeAt(++r.position);if(e&&n===35)do n=r.input.charCodeAt(++r.position);while(n!==10&&n!==13&&n!==0);if(Oo(n))for(UQ(r),n=r.input.charCodeAt(r.position),i++,r.lineIndent=0;n===32;)r.lineIndent++,n=r.input.charCodeAt(++r.position);else break}return t!==-1&&i!==0&&r.lineIndent<t&&aI(r,"deficient indentation"),i}function AI(r){var e=r.position,t;return t=r.input.charCodeAt(e),!!((t===45||t===46)&&t===r.input.charCodeAt(e+1)&&t===r.input.charCodeAt(e+2)&&(e+=3,t=r.input.charCodeAt(e),t===0||yn(t)))}function KQ(r,e){e===1?r.result+=" ":e>1&&(r.result+=Ma.repeat(`
`,e-1))}function Yhe(r,e,t){var i,n,s,o,a,l,c,u,g=r.kind,f=r.result,h;if(h=r.input.charCodeAt(r.position),yn(h)||sg(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)&&(n=r.input.charCodeAt(r.position+1),yn(n)||t&&sg(n)))return!1;for(r.kind="scalar",r.result="",s=o=r.position,a=!1;h!==0;){if(h===58){if(n=r.input.charCodeAt(r.position+1),yn(n)||t&&sg(n))break}else if(h===35){if(i=r.input.charCodeAt(r.position-1),yn(i))break}else{if(r.position===r.lineStart&&AI(r)||t&&sg(h))break;if(Oo(h))if(l=r.line,c=r.lineStart,u=r.lineIndent,ei(r,!1,-1),r.lineIndent>=e){a=!0,h=r.input.charCodeAt(r.position);continue}else{r.position=o,r.line=l,r.lineStart=c,r.lineIndent=u;break}}a&&(zA(r,s,o,!1),KQ(r,r.line-l),s=o=r.position,a=!1),mc(h)||(o=r.position+1),h=r.input.charCodeAt(++r.position)}return zA(r,s,o,!1),r.result?!0:(r.kind=g,r.result=f,!1)}function qhe(r,e){var t,i,n;if(t=r.input.charCodeAt(r.position),t!==39)return!1;for(r.kind="scalar",r.result="",r.position++,i=n=r.position;(t=r.input.charCodeAt(r.position))!==0;)if(t===39)if(zA(r,i,r.position,!0),t=r.input.charCodeAt(++r.position),t===39)i=r.position,r.position++,n=r.position;else return!0;else Oo(t)?(zA(r,i,n,!0),KQ(r,ei(r,!1,e)),i=n=r.position):r.position===r.lineStart&&AI(r)?dt(r,"unexpected end of the document within a single quoted scalar"):(r.position++,n=r.position);dt(r,"unexpected end of the stream within a single quoted scalar")}function Jhe(r,e){var t,i,n,s,o,a;if(a=r.input.charCodeAt(r.position),a!==34)return!1;for(r.kind="scalar",r.result="",r.position++,t=i=r.position;(a=r.input.charCodeAt(r.position))!==0;){if(a===34)return zA(r,t,r.position,!0),r.position++,!0;if(a===92){if(zA(r,t,r.position,!0),a=r.input.charCodeAt(++r.position),Oo(a))ei(r,!1,e);else if(a<256&&cU[a])r.result+=uU[a],r.position++;else if((o=Khe(a))>0){for(n=o,s=0;n>0;n--)a=r.input.charCodeAt(++r.position),(o=Uhe(a))>=0?s=(s<<4)+o:dt(r,"expected hexadecimal character");r.result+=jhe(s),r.position++}else dt(r,"unknown escape sequence");t=i=r.position}else Oo(a)?(zA(r,t,i,!0),KQ(r,ei(r,!1,e)),t=i=r.position):r.position===r.lineStart&&AI(r)?dt(r,"unexpected end of the document within a double quoted scalar"):(r.position++,i=r.position)}dt(r,"unexpected end of the stream within a double quoted scalar")}function Whe(r,e){var t=!0,i,n=r.tag,s,o=r.anchor,a,l,c,u,g,f={},h,p,m,y;if(y=r.input.charCodeAt(r.position),y===91)l=93,g=!1,s=[];else if(y===123)l=125,g=!0,s={};else return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=s),y=r.input.charCodeAt(++r.position);y!==0;){if(ei(r,!0,e),y=r.input.charCodeAt(r.position),y===l)return r.position++,r.tag=n,r.anchor=o,r.kind=g?"mapping":"sequence",r.result=s,!0;t||dt(r,"missed comma between flow collection entries"),p=h=m=null,c=u=!1,y===63&&(a=r.input.charCodeAt(r.position+1),yn(a)&&(c=u=!0,r.position++,ei(r,!0,e))),i=r.line,Ag(r,e,sI,!1,!0),p=r.tag,h=r.result,ei(r,!0,e),y=r.input.charCodeAt(r.position),(u||r.line===i)&&y===58&&(c=!0,y=r.input.charCodeAt(++r.position),ei(r,!0,e),Ag(r,e,sI,!1,!0),m=r.result),g?ag(r,s,f,p,h,m):c?s.push(ag(r,null,f,p,h,m)):s.push(h),ei(r,!0,e),y=r.input.charCodeAt(r.position),y===44?(t=!0,y=r.input.charCodeAt(++r.position)):t=!1}dt(r,"unexpected end of the stream within a flow collection")}function zhe(r,e){var t,i,n=MQ,s=!1,o=!1,a=e,l=0,c=!1,u,g;if(g=r.input.charCodeAt(r.position),g===124)i=!1;else if(g===62)i=!0;else return!1;for(r.kind="scalar",r.result="";g!==0;)if(g=r.input.charCodeAt(++r.position),g===43||g===45)MQ===n?n=g===43?sU:Lhe:dt(r,"repeat of a chomping mode identifier");else if((u=Hhe(g))>=0)u===0?dt(r,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?dt(r,"repeat of an indentation width identifier"):(a=e+u-1,o=!0);else break;if(mc(g)){do g=r.input.charCodeAt(++r.position);while(mc(g));if(g===35)do g=r.input.charCodeAt(++r.position);while(!Oo(g)&&g!==0)}for(;g!==0;){for(UQ(r),r.lineIndent=0,g=r.input.charCodeAt(r.position);(!o||r.lineIndent<a)&&g===32;)r.lineIndent++,g=r.input.charCodeAt(++r.position);if(!o&&r.lineIndent>a&&(a=r
`,s?1+l:l),s=!0,o=!0,l=0,t=r.position;!Oo(g)&&g!==0;)g=r.input.charCodeAt(++r.position);zA(r,t,r.position,!1)}return!0}function pU(r,e){var t,i=r.tag,n=r.anchor,s=[],o,a=!1,l;for(r.anchor!==null&&(r.anchorMap[r.anchor]=s),l=r.input.charCodeAt(r.position);l!==0&&!(l!==45||(o=r.input.charCodeAt(r.position+1),!yn(o)));){if(a=!0,r.position++,ei(r,!0,-1)&&r.lineIndent<=e){s.push(null),l=r.input.charCodeAt(r.position);continue}if(t=r.line,Ag(r,e,nU,!1,!0),s.push(r.result),ei(r,!0,-1),l=r.input.charCodeAt(r.position),(r.line===t||r.lineIndent>e)&&l!==0)dt(r,"bad indentation of a sequence entry");else if(r.lineIndent<e)break}return a?(r.tag=i,r.anchor=n,r.kind="sequence",r.result=s,!0):!1}function _he(r,e,t){var i,n,s,o,a=r.tag,l=r.anchor,c={},u={},g=null,f=null,h=null,p=!1,m=!1,y;for(r.anchor!==null&&(r.anchorMap[r.anchor]=c),y=r.input.charCodeAt(r.position);y!==0;){if(i=r.input.charCodeAt(r.position+1),s=r.line,o=r.position,(y===63||y===58)&&yn(i))y===63?(p&&(ag(r,c,u,g,f,null),g=f=h=null),m=!0,p=!0,n=!0):p?(p=!1,n=!0):dt(r,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),r.position+=1,y=i;else if(Ag(r,t,iU,!1,!0))if(r.line===s){for(y=r.input.charCodeAt(r.position);mc(y);)y=r.input.charCodeAt(++r.position);if(y===58)y=r.input.charCodeAt(++r.position),yn(y)||dt(r,"a whitespace character is expected after the key-value separator within a block mapping"),p&&(ag(r,c,u,g,f,null),g=f=h=null),m=!0,p=!1,n=!1,g=r.tag,f=r.result;else if(m)dt(r,"can not read an implicit mapping pair; a colon is missed");else return r.tag=a,r.anchor=l,!0}else if(m)dt(r,"can not read a block mapping entry; a multiline key may not be an implicit key");else return r.tag=a,r.anchor=l,!0;else break;if((r.line===s||r.lineIndent>e)&&(Ag(r,e,oI,!0,n)&&(p?f=r.result:h=r.result),p||(ag(r,c,u,g,f,h,s,o),g=f=h=null),ei(r,!0,-1),y=r.input.charCodeAt(r.position)),r.lineIndent>e&&y!==0)dt(r,"bad indentation of a mapping entry");else if(r.lineIndent<e)break}return p&&ag(r,c,u,g,f,null),m&&(r.tag=a,r.anchor=l,r.kind="mapping",r.result=c),m}function Vhe(r){var e,t=!1,i=!1,n,s,o;if(o=r.input.charCodeAt(r.position),o!==33)return!1;if(r.tag!==null&&dt(r,"duplication of a tag property"),o=r.input.charCodeAt(++r.position),o===60?(t=!0,o=r.input.charCodeAt(++r.position)):o===33?(i=!0,n="!!",o=r.input.charCodeAt(++r.position)):n="!",e=r.position,t){do o=r.input.charCodeAt(++r.position);while(o!==0&&o!==62);r.position<r.length?(s=r.input.slice(e,r.position),o=r.input.charCodeAt(++r.position)):dt(r,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!yn(o);)o===33&&(i?dt(r,"tag suffix cannot contain exclamation marks"):(n=r.input.slice(e-1,r.position+1),oU.test(n)||dt(r,"named tag handle cannot contain such characters"),i=!0,e=r.position+1)),o=r.input.charCodeAt(++r.position);s=r.input.slice(e,r.position),Mhe.test(s)&&dt(r,"tag suffix cannot contain flow indicator characters")}return s&&!aU.test(s)&&dt(r,"tag name cannot contain such characters: "+s),t?r.tag=s:WA.call(r.tagMap,n)?r.tag=r.tagMap[n]+s:n==="!"?r.tag="!"+s:n==="!!"?r.tag="tag:yaml.org,2002:"+s:dt(r,'undeclared tag handle "'+n+'"'),!0}function Xhe(r){var e,t;if(t=r.input.charCodeAt(r.position),t!==38)return!1;for(r.anchor!==null&&dt(r,"duplication of an anchor property"),t=r.input.charCodeAt(++r.position),e=r.position;t!==0&&!yn(t)&&!sg(t);)t=r.input.charCodeAt(++r.position);return r.position===e&&dt(r,"name of an anchor node must contain at least one character"),r.anchor=r.input.slice(e,r.position),!0}function Zhe(r){var e,t,i;if(i=r.input.charCodeAt(r.position),i!==42)return!1;for(i=r.input.charCodeAt(++r.position),e=r.position;i!==0&&!yn(i)&&!sg(i);)i=r.input.charCodeAt(++r.position);return r.position===e&&dt(r,"name of an alias node must contain at least one character"),t=r.input.slice(e,r.position),WA.call(r.anchorMap,t)||dt(r,'unidentified alias "'+t+'"'),r.result=r.anchorMap[t],ei(r,!0,-1),!0}function Ag(r,e,t,i,n){var s,o,a,l=1,c=!1,u=!1,g,f,h,p,m;if(r.listener!==null&&r.listener("open",r),r.tag=null,r.anchor=null,r.kind=null,r.result=null,s
`),r.charCodeAt(0)===65279&&(r=r.slice(1)));var t=new Ghe(r,e),i=r.indexOf("\0");for(i!==-1&&(t.position=i,dt(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)$he(t);return t.documents}function CU(r,e,t){e!==null&&typeof e=="object"&&typeof t=="undefined"&&(t=e,e=null);var i=dU(r,t);if(typeof e!="function")return i;for(var n=0,s=i.length;n<s;n+=1)e(i[n])}function mU(r,e){var t=dU(r,e);if(t.length!==0){if(t.length===1)return t[0];throw new tU("expected a single document in the stream, but found more")}}function epe(r,e,t){return typeof e=="object"&&e!==null&&typeof t=="undefined"&&(t=e,e=null),CU(r,e,Ma.extend({schema:rU},t))}function tpe(r,e){return mU(r,Ma.extend({schema:rU},e))}ip.exports.loadAll=CU;ip.exports.load=mU;ip.exports.safeLoadAll=epe;ip.exports.safeLoad=tpe});var jU=w((AXe,HQ)=>{"use strict";var np=pc(),sp=rg(),rpe=rp(),ipe=ng(),IU=Object.prototype.toString,yU=Object.prototype.hasOwnProperty,npe=9,op=10,spe=13,ope=32,ape=33,Ape=34,wU=35,lpe=37,cpe=38,upe=39,gpe=42,BU=44,fpe=45,bU=58,hpe=61,ppe=62,dpe=63,Cpe=64,QU=91,SU=93,mpe=96,vU=123,Epe=124,kU=125,Ui={};Ui[0]="\\0";Ui[7]="\\a";Ui[8]="\\b";Ui[9]="\\t";Ui[10]="\\n";Ui[11]="\\v";Ui[12]="\\f";Ui[13]="\\r";Ui[27]="\\e";Ui[34]='\\"';Ui[92]="\\\\";Ui[133]="\\N";Ui[160]="\\_";Ui[8232]="\\L";Ui[8233]="\\P";var Ipe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function ype(r,e){var t,i,n,s,o,a,l;if(e===null)return{};for(t={},i=Object.keys(e),n=0,s=i.length;n<s;n+=1)o=i[n],a=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=r.compiledTypeMap.fallback[o],l&&yU.call(l.styleAliases,a)&&(a=l.styleAliases[a]),t[o]=a;return t}function xU(r){var e,t,i;if(e=r.toString(16).toUpperCase(),r<=255)t="x",i=2;else if(r<=65535)t="u",i=4;else if(r<=4294967295)t="U",i=8;else throw new sp("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+np.repeat("0",i-e.length)+e}function wpe(r){this.schema=r.schema||rpe,this.indent=Math.max(1,r.indent||2),this.noArrayIndent=r.noArrayIndent||!1,this.skipInvalid=r.skipInvalid||!1,this.flowLevel=np.isNothing(r.flowLevel)?-1:r.flowLevel,this.styleMap=ype(this.schema,r.styles||null),this.sortKeys=r.sortKeys||!1,this.lineWidth=r.lineWidth||80,this.noRefs=r.noRefs||!1,this.noCompatMode=r.noCompatMode||!1,this.condenseFlow=r.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function PU(r,e){for(var t=np.repeat(" ",e),i=0,n=-1,s="",o,a=r.length;i<a;)n=r.indexOf(`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var p=this.popChar();return{type:"Character",value:n(p)}}},r.prototype.characterClass=function(){var p=[],m=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),m=!0);this.isClassAtom();){var y=this.classAtom(),b=y.type==="Character";if(b&&this.isRangeDash()){this.consumeChar("-");var v=this.classAtom(),k=v.type==="Character";if(k){if(v.value<y.value)throw Error("Range out of order in character class");p.push({from:y.value,to:v.value})}else s(y.value,p),p.push(n("-")),s(v.value,p)}else s(y.value,p)}return this.consumeChar("]"),{type:"Set",complement:m,value:p}},r.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},r.prototype.parseHexDigits=function(p){for(var m="",y=0;y<p;y++){var b=this.popChar();if(e.test(b)===!1)throw Error("Expecting a HexDecimal digits");m+=b}var v=parseInt(m,16);return{type:"Character",value:v}},r.prototype.peekChar=function(p){return p===void 0&&(p=0),this.input[this.idx+p]},r.prototype.popChar=function(){var p=this.peekChar(0);return this.consumeChar(),p},r.prototype.consumeChar=function(p){if(p!==void 0&&this.input[this.idx]!==p)throw Error("Expected: '"+p+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},r.prototype.loc=function(p){return{begin:p,end:this.idx}};var e=/[0-9a-fA-F]/,t=/[0-9]/,i=/[1-9]/;function n(p){return p.charCodeAt(0)}function s(p,m){p.length!==void 0?p.forEach(function(y){m.push(y)}):m.push(p)}function o(p,m){if(p[m]===!0)throw"duplicate flag "+m;p[m]=!0}function a(p){if(p===void 0)throw Error("Internal Error - Should never get here!")}function l(){throw Error("Internal Error - Should never get here!")}var c,u=[];for(c=n("0");c<=n("9");c++)u.push(c);var g=[n("_")].concat(u);for(c=n("a");c<=n("z");c++)g.push(c);for(c=n("A");c<=n("Z");c++)g.push(c);var f=[n(" "),n("\f"),n(`
`),n("\r"),n(" "),n("\v"),n(" "),n("\xA0"),n("\u1680"),n("\u2000"),n("\u2001"),n("\u2002"),n("\u2003"),n("\u2004"),n("\u2005"),n("\u2006"),n("\u2007"),n("\u2008"),n("\u2009"),n("\u200A"),n("\u2028"),n("\u2029"),n("\u202F"),n("\u205F"),n("\u3000"),n("\uFEFF")];function h(){}return h.prototype.visitChildren=function(p){for(var m in p){var y=p[m];p.hasOwnProperty(m)&&(y.type!==void 0?this.visit(y):Array.isArray(y)&&y.forEach(function(b){this.visit(b)},this))}},h.prototype.visit=function(p){switch(p.type){case"Pattern":this.visitPattern(p);break;case"Flags":this.visitFlags(p);break;case"Disjunction":this.visitDisjunction(p);break;case"Alternative":this.visitAlternative(p);break;case"StartAnchor":this.visitStartAnchor(p);break;case"EndAnchor":this.visitEndAnchor(p);break;case"WordBoundary":this.visitWordBoundary(p);break;case"NonWordBoundary":this.visitNonWordBoundary(p);break;case"Lookahead":this.visitLookahead(p);break;case"NegativeLookahead":this.visitNegativeLookahead(p);break;case"Character":this.visitCharacter(p);break;case"Set":this.visitSet(p);break;case"Group":this.visitGroup(p);break;case"GroupBackReference":this.visitGroupBackReference(p);break;case"Quantifier":this.visitQuantifier(p);break}this.visitChildren(p)},h.prototype.visitPattern=function(p){},h.prototype.visitFlags=function(p){},h.prototype.visitDisjunction=function(p){},h.prototype.visitAlternative=function(p){},h.prototype.visitStartAnchor=function(p){},h.prototype.visitEndAnchor=function(p){},h.prototype.visitWordBoundary=function(p){},h.prototype.visitNonWordBoundary=function(p){},h.prototype.visitLookahead=function(p){},h.prototype.visitNegativeLookahead=function(p){},h.prototype.visitCharacter=function(p){},h.prototype.visitSet=function(p){},h.prototype.visitGroup=function(p){},h.prototype.visitGroupBackReference=function(p){},h.prototype.visitQuantifier=function(p){},{RegExpParser:r,BaseRegExpVisitor:h,VERSION:"0.5.0"}})});var UI=w(Cg=>{"use strict";Object.defineProperty(Cg,"__esModule",{value:!0});Cg.clearRegExpParserCache=Cg.getRegExpAst=void 0;var _me=OI(),MI={},Vme=new _me.RegExpParser;function Xme(r){var e=r.toString();if(MI.hasOwnProperty(e))return MI[e];var t=Vme.pattern(e);return MI[e]=t,t}Cg.getRegExpAst=Xme;function Zme(){MI={}}Cg.clearRegExpParserCache=Zme});var LH=w(Bn=>{"use strict";var $me=Bn&&Bn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Bn,"__esModule",{value:!0});Bn.canMatchCharCode=Bn.firstCharOptimizedIndices=Bn.getOptimizedStartCodesIndices=Bn.failedOptimizationPrefixMsg=void 0;var DH=OI(),vs=Yt(),RH=UI(),Ga=wS(),FH="Complement Sets are not supported for first char optimization";Bn.failedOptimizationPrefixMsg=`Unabletouse"first char"lexeroptimizations:
`;function eEe(r,e){e===void 0&&(e=!1);try{var t=(0,RH.getRegExpAst)(r),i=KI(t.value,{},t.flags.ignoreCase);return i}catch(s){if(s.message===FH)e&&(0,vs.PRINT_WARNING)(""+Bn.failedOptimizationPrefixMsg+(" Unable to optimize: < "+r.toString()+`>
FordetailsSee:https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var z=(0,mg.getOptimizedStartCodesIndices)(k.PATTERN,e.ensureOptimizations);(0,Ne.isEmpty)(z)&&(y=!1),(0,Ne.forEach)(z,function(ne){vS(v,ne,m[T])})}else e.ensureOptimizations&&(0,Ne.PRINT_ERROR)(""+mg.failedOptimizationPrefixMsg+(" TokenType: <"+k.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
Seehttps://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ar.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Ze.findStartOfInputAnchor=_H;function VH(r){var e=(0,Ne.filter)(r,function(i){var n=i[Ko];return n instanceof RegExp&&(n.multiline||n.global)}),t=(0,Ne.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ar.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[i]}});return t}Ze.findUnsupportedFlags=VH;function XH(r){var e=[],t=(0,Ne.map)(r,function(s){return(0,Ne.reduce)(r,function(o,a){return s.PATTERN.source===a.PATTERN.source&&!(0,Ne.contains)(e,a)&&a.PATTERN!==Ar.Lexer.NA&&(e.push(a),o.push(a)),o},[])});t=(0,Ne.compact)(t);var i=(0,Ne.filter)(t,function(s){return s.length>1}),n=(0,Ne.map)(i,function(s){var o=(0,Ne.map)(s,function(l){return l.name}),a=(0,Ne.first)(s).PATTERN;return{message:"The same RegExp pattern ->"+a+"<-"+("has been used in all of the following Token Types: "+o.join(", ")+" <-"),type:Ar.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}});return n}Ze.findDuplicatePatterns=XH;function YH(r){var e=(0,Ne.filter)(r,function(i){if(!(0,Ne.has)(i,"GROUP"))return!1;var n=i.GROUP;return n!==Ar.Lexer.SKIPPED&&n!==Ar.Lexer.NA&&!(0,Ne.isString)(n)}),t=(0,Ne.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ar.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[i]}});return t}Ze.findInvalidGroupType=YH;function qH(r,e){var t=(0,Ne.filter)(r,function(n){return n.PUSH_MODE!==void 0&&!(0,Ne.contains)(e,n.PUSH_MODE)}),i=(0,Ne.map)(t,function(n){var s="Token Type: ->"+n.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+n.PUSH_MODE+"<-which does not exist";return{message:s,type:Ar.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[n]}});return i}Ze.findModesThatDoNotExist=qH;function JH(r){var e=[],t=(0,Ne.reduce)(r,function(i,n,s){var o=n.PATTERN;return o===Ar.Lexer.NA||((0,Ne.isString)(o)?i.push({str:o,idx:s,tokenType:n}):(0,Ne.isRegExp)(o)&&fEe(o)&&i.push({str:o.source,idx:s,tokenType:n})),i},[]);return(0,Ne.forEach)(r,function(i,n){(0,Ne.forEach)(t,function(s){var o=s.str,a=s.idx,l=s.tokenType;if(n<a&&gEe(o,i.PATTERN)){var c="Token: ->"+l.name+`<- can never be matched.
`,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,Ne.has)(r,Ze.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ze.MODES+`>propertyinitsdefinition
`,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,Ne.has)(r,Ze.MODES)&&(0,Ne.has)(r,Ze.DEFAULT_MODE)&&!(0,Ne.has)(r.modes,r.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a "+Ze.DEFAULT_MODE+": <"+r.defaultMode+`>whichdoesnotexist
`,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,Ne.has)(r,Ze.MODES)&&(0,Ne.forEach)(r.modes,function(n,s){(0,Ne.forEach)(n,function(o,a){(0,Ne.isUndefined)(o)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+s+"> at index: <"+a+`>
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===Ar.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning:ACustomTokenPatternshouldspecifythe<line_breaks>option.
butfound:'`+a+"'";if(n)return o+n+l;var c=(0,uo.reduce)(e,function(h,p){return h.concat(p)},[]),u=(0,uo.map)(c,function(h){return"["+(0,uo.map)(h,function(p){return(0,yg.tokenLabel)(p)}).join(",")+"]"}),g=(0,uo.map)(u,function(h,p){return""+(p+1)+"."+h}),f=`one of these possible Token sequences:
butfound:'`+o+"'";if(i)return s+i+a;var l=(0,uo.map)(e,function(u){return"["+(0,uo.map)(u,function(g){return(0,yg.tokenLabel)(g)}).join(",")+"]"}),c=`expecting at least one iteration which starts with one of these possible Token sequences::
`+("<"+l.join(" ,")+">");return s+c+a}};Object.freeze(qa.defaultParserErrorProvider);qa.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(r,e){var t="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
Thiscouldleadtoaninfiniteloop.`;return t},buildTokenNameError:function(r){return"deprecated"},buildEmptyAlternationError:function(r){var e="Ambiguous empty alternative: <"+(r.emptyChoiceIdx+1)+">"+(" in <OR"+r.alternation.idx+"> inside <"+r.topLevelRule.name+`>Rule.
`)+"Only the last alternative may be an empty alternative.";return e},buildTooManyAlternativesError:function(r){var e=`AnAlternationcannothavemorethan256alternatives:
see:https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(r){return"deprecated"},buildDuplicateRuleNameError:function(r){var e;r.topLevelRule instanceof MS.Rule?e=r.topLevelRule.name:e=r.topLevelRule;var t="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+r.grammarName+"<-";return t}}});var Uj=w($A=>{"use strict";var VEe=$A&&$A.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty($A,"__esModule",{value:!0});$A.GastRefResolverVisitor=$A.resolveGrammar=void 0;var XEe=es(),Oj=Yt(),ZEe=Ig();function $Ee(r,e){var t=new Mj(r,e);return t.resolveRefs(),t.errors}$A.resolveGrammar=$Ee;var Mj=function(r){VEe(e,r);function e(t,i){var n=r.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var t=this;(0,Oj.forEach)((0,Oj.values)(this.nameToTopRule),function(i){t.currTopLevel=i,i.accept(t)})},e.prototype.visitNonTerminal=function(t){var i=this.nameToTopRule[t.nonTerminalName];if(i)t.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:XEe.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}},e}(ZEe.GAstVisitor);$A.GastRefResolverVisitor=Mj});var Up=w(Ur=>{"use strict";var Dc=Ur&&Ur.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Ur,"__esModule",{value:!0});Ur.nextPossibleTokensAfter=Ur.possiblePathsFrom=Ur.NextTerminalAfterAtLeastOneSepWalker=Ur.NextTerminalAfterAtLeastOneWalker=Ur.NextTerminalAfterManySepWalker=Ur.NextTerminalAfterManyWalker=Ur.AbstractNextTerminalAfterProductionWalker=Ur.NextAfterTokenWalker=Ur.AbstractNextPossibleTokensWalker=void 0;var Kj=JI(),Ut=Yt(),eIe=TS(),Dt=bn(),Hj=function(r){Dc(e,r);function e(t,i){var n=r.call(this)||this;return n.topProd=t,n.path=i,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return e.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,Ut.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,Ut.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(t,i){i===void 0&&(i=[]),this.found||r.prototype.walk.call(this,t,i)},e.prototype.walkProdRef=function(t,i,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,Ut.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(Kj.RestWalker);Ur.AbstractNextPossibleTokensWalker=Hj;var tIe=function(r){Dc(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminal
ForFurtherdetails.`)}if((0,Fr.isArray)(e))this.tokensMap=(0,Fr.reduce)(e,function(o,a){return o[a.name]=a,o},{});else if((0,Fr.has)(e,"modes")&&(0,Fr.every)((0,Fr.flatten)((0,Fr.values)(e.modes)),Yp.isTokenType)){var i=(0,Fr.flatten)((0,Fr.values)(e.modes)),n=(0,Fr.uniq)(i);this.tokensMap=(0,Fr.reduce)(n,function(o,a){return o[a.name]=a,o},{})}else if((0,Fr.isObject)(e))this.tokensMap=(0,Fr.cloneObj)(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=RG.EOF;var s=(0,Fr.every)((0,Fr.values)(e),function(o){return(0,Fr.isEmpty)(o.categoryMatches)});this.tokenMatcher=s?Yp.tokenStructuredMatcherNoCategories:Yp.tokenStructuredMatcher,(0,Yp.augmentTokenTypes)((0,Fr.values)(this.tokensMap))},r.prototype.defineRule=function(e,t,i){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+`>maynotbedefinedafterthe'performSelfAnalysis'methodhasbeencalled'
See:https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(YG);var fye={name:`This CSTNode indicates the Parser is in Recording Phase
`+("Idx value must be a none negative value smaller than "+(jG+1)));throw e.KNOWN_RECORDER_ERROR=!0,e}}});var zG=w(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.PerformanceTracer=void 0;var WG=Yt(),dye=es(),Cye=function(){function r(){}return r.prototype.initPerformanceTracer=function(e){if((0,WG.has)(e,"traceInitPerf")){var t=e.traceInitPerf,i=typeof t=="number";this.traceInitMaxIdent=i?t:Infinity,this.traceInitPerf=i?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=dye.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;var i=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(i+"--> <"+e+">");var n=(0,WG.timer)(t),s=n.time,o=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(i+"<-- <"+e+"> time: "+s+"ms"),this.traceInitIndent--,o}else return t()},r}();fy.PerformanceTracer=Cye});var _G=w(hy=>{"use strict";Object.defineProperty(hy,"__esModule",{value:!0});hy.applyMixins=void 0;function mye(r,e){e.forEach(function(t){var i=t.prototype;Object.getOwnPropertyNames(i).forEach(function(n){if(n!=="constructor"){var s=Object.getOwnPropertyDescriptor(i,n);s&&(s.get||s.set)?Object.defineProperty(r.prototype,n,s):r.prototype[n]=t.prototype[n]}})})}hy.applyMixins=mye});var es=w(Er=>{"use strict";var VG=Er&&Er.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Er,"__esModule",{value:!0});Er.EmbeddedActionsParser=Er.CstParser=Er.Parser=Er.EMPTY_ALT=Er.ParserDefinitionErrorType=Er.DEFAULT_RULE_CONFIG=Er.DEFAULT_PARSER_CONFIG=Er.END_OF_FILE=void 0;var an=Yt(),Eye=Lj(),XG=ZA(),ZG=Op(),$G=aG(),Iye=VS(),yye=pG(),wye=QG(),Bye=vG(),bye=xG(),Qye=FG(),Sye=LG(),vye=MG(),kye=JG(),xye=zG(),Pye=_G();Er.END_OF_FILE=(0,XG.createTokenInstance)(XG.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Er.END_OF_FILE);Er.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:ZG.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});Er.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var Dye;(function(r){r[r.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",r[r.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",r[r.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",r[r.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",r[r.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",r[r.LEFT_RECURSION=5]="LEFT_RECURSION",r[r.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",r[r.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",r[r.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",r[r.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",r[r.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",r[r.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",r[r.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(Dye=Er.ParserDefinitionErrorType||(Er.ParserDefinitionErrorType={}));function Rye(r){return r===void 0&&(r=void 0),function(){return r}}Er.EMPTY_ALT=Rye;var py=function(){function r(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;var i=this;if(i.initErrorHandler(t),i.initLexerAdapter(),i.initLooksAhead(t),i.initRecognizerEngine(e,t),i.initRecoverable(t),i.initTreeBuilder(t),i.initContentAssist(),i.initGastRecorder(t),i.initPerformanceTracer(t),(0,an.has)(t,"ignoredIssues"))throw new Error(`The<ignoredIssues>IParserConfigpropertyhasbeendeprecated.
Forfurtherdetails.`);this.skipValidations=(0,an.has)(t,"skipValidations")?t.skipValidations:Er.DEFAULT_PARSER_CONFIG.skipValidations}return r.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},r.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var t;e.selfAnalysisDone=!0;var i=e.className;e.TRACE_INIT("toFastProps",function(){(0,an.toFastProperties)(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),(0,an.forEach)(e.definedRulesNames,function(s){var o=e[s],a=o.originalGrammarAction,l=void 0;e.TRACE_INIT(s+" Rule",function(){l=e.topLevelRuleRecord(s,a)}),e.gastProductionsCache[s]=l})}finally{e.disableRecording()}});var n=[];if(e.TRACE_INIT("Grammar Resolving",function(){n=(0,$G.resolveGrammar)({rules:(0,an.values)(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(n)}),e.TRACE_INIT("Grammar Validations",function(){if((0,an.isEmpty)(n)&&e.skipValidations===!1){var s=(0,$G.validateGrammar)({rules:(0,an.values)(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:(0,an.values)(e.tokensMap),errMsgProvider:ZG.defaultGrammarValidatorErrorProvider,grammarName:i});e.definitionErrors=e.definitionErrors.concat(s)}}),(0,an.isEmpty)(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var s=(0,Eye.computeAllProdsFollows)((0,an.values)(e.gastProductionsCache));e.resyncFollows=s}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions((0,an.values)(e.gastProductionsCache))})),!r.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,an.isEmpty)(e.definitionErrors))throw t=(0,an.map)(e.definitionErrors,function(s){return s.message}),new Error(`ParserDefinitionErrorsdetected:
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a","\x07"]]);function RY(r){let e=r[0]==="u",t=r[1]==="{";return e&&!t&&r.length===5||r[0]==="x"&&r.length===3?String.fromCharCode(parseInt(r.slice(1),16)):e&&t?String.fromCodePoint(parseInt(r.slice(2,-1),16)):Awe.get(r)||r}function lwe(r,e){let t=[],i=e.trim().split(/\s*,\s*/g),n;for(let s of i){let o=Number(s);if(!Number.isNaN(o))t.push(o);else if(n=s.match(owe))t.push(n[2].replace(awe,(a,l,c)=>l?RY(l):c));else throw new Error(`InvalidChalktemplatestyleargument:${s}(instyle'${r}')`)}return t}function cwe(r){DY.lastIndex=0;let e=[],t;for(;(t=DY.exec(r))!==null;){let i=t[1];if(t[2]){let n=lwe(i,t[2]);e.push([i].concat(n))}else e.push([i])}return e}function FY(r,e){let t={};for(let n of e)for(let s of n.styles)t[s[0]]=n.inverse?null:s.slice(1);let i=r;for(let[n,s]of Object.entries(t))if(!!Array.isArray(s)){if(!(n in i))throw new Error(`UnknownChalkstyle:${n}`);i=s.length>0?i[n](...s):i[n]}return i}PY.exports=(r,e)=>{let t=[],i=[],n=[];if(e.replace(swe,(s,o,a,l,c,u)=>{if(o)n.push(RY(o));else if(l){let g=n.join("");n=[],i.push(t.length===0?g:FY(r,t)(g)),t.push({inverse:a,styles:cwe(l)})}else if(c){if(t.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(FY(r,t)(n.join(""))),n=[],t.pop()}else n.push(u)}),i.push(n.join("")),t.length>0){let s=`Chalktemplateliteralismissing${t.length}closingbracket${t.length===1?"":"s"}(\`}\`)`;thrownewError(s)}returni.join("")}});vargv=w((get,LY)=>{"use strict";varzp=wY(),{stdout:Av,stderr:lv}=vY(),{stringReplaceAll:uwe,stringEncaseCRLFWithFirstIndex:gwe}=xY(),TY=["ansi","ansi","ansi256","ansi16m"],Dg=Object.create(null),fwe=(r,e={})=>{if(e.level>3||e.level<0)thrownewError("The `level` option should be an integer from 0 to 3");lett=Av?Av.level:0;r.level=e.level===void0?t:e.level},OY=class{constructor(e){returnMY(e)}},MY=r=>{lete={};returnfwe(e,r),e.template=(...t)=>hwe(e.template,...t),Object.setPrototypeOf(e,wy.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{thrownewError("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=OY,e.template};functionwy(r){returnMY(r)}for(let[r,e]ofObject.entries(zp))Dg[r]={get(){lett=By(this,cv(e.open,e.close,this._styler),this._isEmpty);returnObject.defineProperty(this,r,{value:t}),t}};Dg.visible={get(){letr=By(this,this._styler,!0);returnObject.defineProperty(this,"visible",{value:r}),r}};varUY=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(letrofUY)Dg[r]={get(){let{level:e}=this;returnfunction(...t){leti=cv(zp.color[TY[e]][r](...t),zp.color.close,this._styler);returnBy(this,i,this._isEmpty)}}};for(letrofUY){lete="bg"+r[0].toUpperCase()+r.slice(1);Dg[e]={get(){let{level:t}=this;returnfunction(...i){letn=cv(zp.bgColor[TY[t]][r](...i),zp.bgColor.close,this._styler);returnBy(this,n,this._isEmpty)}}}}varpwe=Object.defineProperties(()=>{},te(N({},Dg),{level:{enumerable:!0,get(){returnthis._generator.level},set(r){this._generator.level=r}}})),cv=(r,e,t)=>{leti,n;returnt===void0?(i=r,n=e):(i=t.openAll+r,n=e+t.closeAll),{open:r,close:e,openAll:i,closeAll:n,parent:t}},By=(r,e,t)=>{leti=(...n)=>dwe(i,n.length===1?""+n[0]:n.join(" "));returni.__proto__=pwe,i._generator=r,i._styler=e,i._isEmpty=t,i},dwe=(r,e)=>{if(r.level<=0||!e)returnr._isEmpty?"":e;lett=r._styler;if(t===void0)returne;let{openAll:i,closeAll:n}=t;if(e.indexOf("")!==-1)for(;t!==void0;)e=uwe(e,t.close,t.open),t=t.parent;lets=e.indexOf(`
`);return s!==-1&&(e=gwe(e,n,i,s)),i+e+n},uv,hwe=(r,...e)=>{let[t]=e;if(!Array.isArray(t))return e.join(" ");let i=e.slice(1),n=[t.raw[0]];for(let s=1;s<t.length;s++)n.push(String(i[s-1]).replace(/[{}\\]/g,"\\$&"),String(t.raw[s]));return uv===void 0&&(uv=NY()),uv(r,n.join(""))};Object.defineProperties(wy.prototype,Dg);var _p=wy();_p.supportsColor=Av;_p.stderr=wy({level:lv?lv.level:0});_p.stderr.supportsColor=lv;_p.Level={None:0,Basic:1,Ansi256:2,TrueColor:3,0:"None",1:"Basic",2:"Ansi256",3:"TrueColor"};LY.exports=_p});var by=w(Rs=>{"use strict";Rs.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;Rs.find=(r,e)=>r.nodes.find(t=>t.type===e);Rs.exceedsLimit=(r,e,t=1,i)=>i===!1||!Rs.isInteger(r)||!Rs.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=i;Rs.escapeNode=(r,e=0,t)=>{let i=r.nodes[e];!i||(t&&i.type===t||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)};Rs.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0==0?(r.invalid=!0,!0):!1;Rs.isInvalidBrace=r=>r.type!=="brace"?!1:r.invalid===!0||r.dollar?!0:r.commas>>0+r.ranges>>0==0||r.open!==!0||r.close!==!0?(r.invalid=!0,!0):!1;Rs.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;Rs.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);Rs.flatten=(...r)=>{let e=[],t=i=>{for(let n=0;n<i.length;n++){let s=i[n];Array.isArray(s)?t(s,e):s!==void 0&&e.push(s)}return e};return t(r),e}});var Qy=w((het,KY)=>{"use strict";var HY=by();KY.exports=(r,e={})=>{let t=(i,n={})=>{let s=e.escapeInvalid&&HY.isInvalidBrace(n),o=i.invalid===!0&&e.escapeInvalid===!0,a="";if(i.value)return(s||o)&&HY.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(let l of i.nodes)a+=t(l);return a};return t(r)}});var GY=w((pet,jY)=>{"use strict";jY.exports=function(r){return typeof r=="number"?r-r==0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var ZY=w((det,YY)=>{"use strict";var qY=GY(),Fc=(r,e,t)=>{if(qY(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(qY(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let i=N({relaxZeros:!0},t);typeof i.strictZeros=="boolean"&&(i.relaxZeros=i.strictZeros===!1);let n=String(i.relaxZeros),s=String(i.shorthand),o=String(i.capture),a=String(i.wrap),l=r+":"+e+"="+n+s+o+a;if(Fc.cache.hasOwnProperty(l))return Fc.cache[l].result;let c=Math.min(r,e),u=Math.max(r,e);if(Math.abs(c-u)===1){let m=r+"|"+e;return i.capture?`(${m})`:i.wrap===!1?m:`(?:${m})`}let g=WY(r)||WY(e),f={min:r,max:e,a:c,b:u},h=[],p=[];if(g&&(f.isPadded=g,f.maxLen=String(f.max).length),c<0){let m=u<0?Math.abs(u):1;p=JY(m,Math.abs(c),f,i),c=f.a=0}return u>=0&&(h=JY(c,u,f,i)),f.negatives=p,f.positives=h,f.result=Cwe(p,h,i),i.capture===!0?f.result=`(${f.result})`:i.wrap!==!1&&h.length+p.length>1&&(f.result=`(?:${f.result})`),Fc.cache[l]=f,f.result};function Cwe(r,e,t){let i=fv(r,e,"-",!1,t)||[],n=fv(e,r,"",!1,t)||[],s=fv(r,e,"-?",!0,t)||[];return i.concat(s).concat(n).join("|")}function Ewe(r,e){let t=1,i=1,n=zY(r,t),s=new Set([e]);for(;r<=n&&n<=e;)s.add(n),t+=1,n=zY(r,t);for(n=_Y(e+1,i)-1;r<n&&n<=e;)s.add(n),i+=1,n=_Y(e+1,i)-1;return s=[...s],s.sort(mwe),s}function wwe(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let i=Iwe(r,e),n=i.length,s="",o=0;for(let a=0;a<n;a++){let[l,c]=i[a];l===c?s+=l:l!=="0"||c!=="9"?s+=ywe(l,c,t):o++}return o&&(s+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:n}}function JY(r,e,t,i){let n=Ewe(r,e),s=[],o=r,a;for(let l=0;l<n.length;l++){let c=n[l],u=wwe(String(o),String(c),i),g="";if(!t.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+VY(a.count),o=c+1;continue}t.isPadded&&(g=Bwe(c,t,i)),u.string=g+u.pattern+VY(u.count),s.push(u),o=c+1,a=u}return s}function fv(r,e,t,i,n){let s=[];for(let o of r){let{string:a}=o;!i&&!XY(e,"string",
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Eq=w((yet,pq)=>{"use strict";var Twe=Qy(),{MAX_LENGTH:dq,CHAR_BACKSLASH:Cv,CHAR_BACKTICK:Owe,CHAR_COMMA:Mwe,CHAR_DOT:Uwe,CHAR_LEFT_PARENTHESES:Kwe,CHAR_RIGHT_PARENTHESES:Hwe,CHAR_LEFT_CURLY_BRACE:jwe,CHAR_RIGHT_CURLY_BRACE:Gwe,CHAR_LEFT_SQUARE_BRACKET:Cq,CHAR_RIGHT_SQUARE_BRACKET:mq,CHAR_DOUBLE_QUOTE:Ywe,CHAR_SINGLE_QUOTE:qwe,CHAR_NO_BREAK_SPACE:Jwe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Wwe}=hq(),zwe=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},i=typeof t.maxLength=="number"?Math.min(dq,t.maxLength):dq;if(r.length>i)throw new SyntaxError(`Inputlength(${r.length}),exceedsmaxcharacters(${i})`);let n={type:"root",input:r,nodes:[]},s=[n],o=n,a=n,l=0,c=r.length,u=0,g=0,f,h={},p=()=>r[u++],m=y=>{if(y.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&y.type==="text"){a.value+=y.value;return}return o.nodes.push(y),y.parent=o,y.prev=a,a=y,y};for(m({type:"bos"});u<c;)if(o=s[s.length-1],f=p(),!(f===Wwe||f===Jwe)){if(f===Cv){m({type:"text",value:(e.keepEscaping?f:"")+p()});continue}if(f===mq){m({type:"text",value:"\\"+f});continue}if(f===Cq){l++;let y=!0,b;for(;u<c&&(b=p());){if(f+=b,b===Cq){l++;continue}if(b===Cv){f+=p();continue}if(b===mq&&(l--,l===0))break}m({type:"text",value:f});continue}if(f===Kwe){o=m({type:"paren",nodes:[]}),s.push(o),m({type:"text",value:f});continue}if(f===Hwe){if(o.type!=="paren"){m({type:"text",value:f});continue}o=s.pop(),m({type:"text",value:f}),o=s[s.length-1];continue}if(f===Ywe||f===qwe||f===Owe){let y=f,b;for(e.keepQuotes!==!0&&(f="");u<c&&(b=p());){if(b===Cv){f+=b+p();continue}if(b===y){e.keepQuotes===!0&&(f+=b);break}f+=b}m({type:"text",value:f});continue}if(f===jwe){g++;let y=a.value&&a.value.slice(-1)==="$"||o.dollar===!0;o=m({type:"brace",open:!0,close:!1,dollar:y,depth:g,commas:0,ranges:0,nodes:[]}),s.push(o),m({type:"open",value:f});continue}if(f===Gwe){if(o.type!=="brace"){m({type:"text",value:f});continue}let y="close";o=s.pop(),o.close=!0,m({type:y,value:f}),g--,o=s[s.length-1];continue}if(f===Mwe&&g>0){if(o.ranges>0){o.ranges=0;let y=o.nodes.shift();o.nodes=[y,{type:"text",value:Twe(o)}]}m({type:"comma",value:f}),o.commas++;continue}if(f===Uwe&&g>0&&o.commas===0){let y=o.nodes;if(g===0||y.length===0){m({type:"text",value:f});continue}if(a.type==="dot"){if(o.range=[],a.value+=f,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){y.pop();let b=y[y.length-1];b.value+=a.value+f,a=b,o.ranges--;continue}m({type:"dot",value:f});continue}m({type:"text",value:f})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(v=>{v.nodes||(v.type==="open"&&(v.isOpen=!0),v.type==="close"&&(v.isClose=!0),v.nodes||(v.type="text"),v.invalid=!0)});let y=s[s.length-1],b=y.nodes.indexOf(o);y.nodes.splice(b,1,...o.nodes)}while(s.length>0);return m({type:"eos"}),n};pq.exports=zwe});var wq=w((wet,Iq)=>{"use strict";var yq=Qy(),_we=lq(),Vwe=gq(),Xwe=Eq(),rs=(r,e={})=>{let t=[];if(Array.isArray(r))for(let i of r){let n=rs.create(i,e);Array.isArray(n)?t.push(...n):t.push(n)}else t=[].concat(rs.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};rs.parse=(r,e={})=>Xwe(r,e);rs.stringify=(r,e={})=>typeof r=="string"?yq(rs.parse(r,e),e):yq(r,e);rs.compile=(r,e={})=>(typeof r=="string"&&(r=rs.parse(r,e)),_we(r,e));rs.expand=(r,e={})=>{typeof r=="string"&&(r=rs.parse(r,e));let t=Vwe(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};rs.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?rs.compile(r,e):rs.expand(r,e);Iq.exports=rs});var Xp=w((Bet,Bq)=>{"use strict";var Zwe=require("path"),zo="\\\\/",bq=`[^${zo}]`,_a="\\.",$we="\\+",eBe="\\?",vy="\\/",tBe="(?=.)",Qq="[^/]",mv=`(?:${vy}|$)`,S
Pleasereportthistohttps://github.com/szmarczak/http2-wrapper/`);p(m)}return}i[0].resolve(h);return}}if(o in this.queue){if(a in this.queue[o]){this.queue[o][a].listeners.push(...i),this._tryToCreateNewSession(o,a);return}}else this.queue[o]={};let l=()=>{o in this.queue&&this.queue[o][a]===c&&(delete this.queue[o][a],Object.keys(this.queue[o]).length===0&&delete this.queue[o])},c=()=>{let u=`${a}:${o}`,g=!1;try{let f=Fke.connect(e,N({createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(u)},t));f[gn]=0,f[tf]=!1;let h=()=>f[gn]<f.remoteSettings.maxConcurrentStreams,p=!0;f.socket.once("session",y=>{this.tlsSessionCache.set(u,y)}),f.once("error",y=>{for(let{reject:b}of i)b(y);this.tlsSessionCache.delete(u)}),f.setTimeout(this.timeout,()=>{f.destroy()}),f.once("close",()=>{if(g){p&&this._freeSessionsCount--,this._sessionsCount--;let y=this.sessions[o];y.splice(y.indexOf(f),1),y.length===0&&delete this.sessions[o]}else{let y=new Error("Session closed without receiving a SETTINGS frame");y.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:b}of i)b(y);l()}this._tryToCreateNewSession(o,a)});let m=()=>{if(!(!(o in this.queue)||!h())){for(let y of f[Os])if(y in this.queue[o]){let{listeners:b}=this.queue[o][y];for(;b.length!==0&&h();)b.shift().resolve(f);let v=this.queue[o];if(v[y].listeners.length===0&&(delete v[y],Object.keys(v).length===0)){delete this.queue[o];break}if(!h())break}}};f.on("origin",()=>{f[Os]=f.originSet,!!h()&&(m(),zx(this.sessions[o],f))}),f.once("remoteSettings",()=>{if(f.ref(),f.unref(),this._sessionsCount++,c.destroyed){let y=new Error("Agent has been destroyed");for(let b of i)b.reject(y);f.destroy();return}f[Os]=f.originSet;{let y=this.sessions;if(o in y){let b=y[o];b.splice(Tke(b,f,Oke),0,f)}else y[o]=[f]}this._freeSessionsCount+=1,g=!0,this.emit("session",f),m(),l(),f[gn]===0&&this._freeSessionsCount>this.maxFreeSessions&&f.close(),i.length!==0&&(this.getSession(a,t,i),i.length=0),f.on("remoteSettings",()=>{m(),zx(this.sessions[o],f)})}),f[Gz]=f.request,f.request=(y,b)=>{if(f[tf])throw new Error("The session is gracefully closing. No new streams are allowed.");let v=f[Gz](y,b);return f.ref(),++f[gn],f[gn]===f.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,v.once("close",()=>{if(p=h(),--f[gn],!f.destroyed&&!f.closed&&(Mke(this.sessions[o],f),h()&&!f.closed)){p||(this._freeSessionsCount++,p=!0);let k=f[gn]===0;k&&f.unref(),k&&(this._freeSessionsCount>this.maxFreeSessions||f[tf])?f.close():(zx(this.sessions[o],f),m())}}),v}}catch(f){for(let h of i)h.reject(f);l()}};c.listeners=i,c.completed=!1,c.destroyed=!1,this.queue[o][a]=c,this._tryToCreateNewSession(o,a)})}request(e,t,i,n){return new Promise((s,o)=>{this.getSession(e,t,[{reject:o,resolve:a=>{try{s(a.request(i,n))}catch(l){o(l)}}}])})}createConnection(e,t){return sA.connect(e,t)}static connect(e,t){t.ALPNProtocols=["h2"];let i=e.port||443,n=e.hostname||e.host;return typeof t.servername=="undefined"&&(t.servername=n),Rke.connect(i,n,t)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let t of e)t[gn]===0&&t.close()}destroy(e){for(let t of Object.values(this.sessions))for(let i of t)i.destroy(e);for(let t of Object.values(this.queue))for(let i of Object.values(t))i.destroyed=!0;this.queue={}}get freeSessions(){return qz({agent:this,isFree:!0})}get busySessions(){return qz({agent:this,isFree:!1})}};sA.kCurrentStreamsCount=gn;sA.kGracefullyClosing=tf;jz.exports={Agent:sA,globalAgent:new sA}});var Vx=w((Cnt,Jz)=>{"use strict";var{Readable:Uke}=require("stream"),Wz=class extends Uke{constructor(e,t){super({highWaterMark:t,autoDestroy:!1});this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,t){return this.req.setTimeout(e,t),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners
`),c=o.length;for(c>0&&o.includes("unstyle")&&(o=[...new Set(["unstyle",...o])].reverse());c-- >0;)a=t(r.styles[o[c]],a,l);return a},n=(s,o,a)=>{r.styles[s]=e({name:s,codes:o}),(r.keys[a]||(r.keys[a]=[])).push(s),Reflect.defineProperty(r,s,{configurable:!0,enumerable:!0,set(c){r.alias(s,c)},get(){let c=u=>i(u,c.stack);return Reflect.setPrototypeOf(c,r),c.stack=this.stack?this.stack.concat(s):[s],c}})};return n("reset",[0,0],"modifier"),n("bold",[1,22],"modifier"),n("dim",[2,22],"modifier"),n("italic",[3,23],"modifier"),n("underline",[4,24],"modifier"),n("inverse",[7,27],"modifier"),n("hidden",[8,28],"modifier"),n("strikethrough",[9,29],"modifier"),n("black",[30,39],"color"),n("red",[31,39],"color"),n("green",[32,39],"color"),n("yellow",[33,39],"color"),n("blue",[34,39],"color"),n("magenta",[35,39],"color"),n("cyan",[36,39],"color"),n("white",[37,39],"color"),n("gray",[90,39],"color"),n("grey",[90,39],"color"),n("bgBlack",[40,49],"bg"),n("bgRed",[41,49],"bg"),n("bgGreen",[42,49],"bg"),n("bgYellow",[43,49],"bg"),n("bgBlue",[44,49],"bg"),n("bgMagenta",[45,49],"bg"),n("bgCyan",[46,49],"bg"),n("bgWhite",[47,49],"bg"),n("blackBright",[90,39],"bright"),n("redBright",[91,39],"bright"),n("greenBright",[92,39],"bright"),n("yellowBright",[93,39],"bright"),n("blueBright",[94,39],"bright"),n("magentaBright",[95,39],"bright"),n("cyanBright",[96,39],"bright"),n("whiteBright",[97,39],"bright"),n("bgBlackBright",[100,49],"bgBright"),n("bgRedBright",[101,49],"bgBright"),n("bgGreenBright",[102,49],"bgBright"),n("bgYellowBright",[103,49],"bgBright"),n("bgBlueBright",[104,49],"bgBright"),n("bgMagentaBright",[105,49],"bgBright"),n("bgCyanBright",[106,49],"bgBright"),n("bgWhiteBright",[107,49],"bgBright"),r.ansiRegex=fGe,r.hasColor=r.hasAnsi=s=>(r.ansiRegex.lastIndex=0,typeof s=="string"&&s!==""&&r.ansiRegex.test(s)),r.alias=(s,o)=>{let a=typeof o=="string"?r[o]:o;if(typeof a!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");a.stack||(Reflect.defineProperty(a,"name",{value:s}),r.styles[s]=a,a.stack=[s]),Reflect.defineProperty(r,s,{configurable:!0,enumerable:!0,set(l){r.alias(s,l)},get(){let l=c=>i(c,l.stack);return Reflect.setPrototypeOf(l,r),l.stack=this.stack?this.stack.concat(a.stack):a.stack,l}})},r.theme=s=>{if(!gGe(s))throw new TypeError("Expected theme to be an object");for(let o of Object.keys(s))r.alias(o,s[o]);return r},r.alias("unstyle",s=>typeof s=="string"&&s!==""?(r.ansiRegex.lastIndex=0,s.replace(r.ansiRegex,"")):""),r.alias("noop",s=>s),r.none=r.clear=r.noop,r.stripColor=r.unstyle,r.symbols=Rre(),r.define=n,r};GF.exports=Fre();GF.exports.create=Fre});var Xi=w(Lt=>{"use strict";var hGe=Object.prototype.toString,_s=yo(),Nre=!1,YF=[],Lre={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};Lt.longest=(r,e)=>r.reduce((t,i)=>Math.max(t,e?i[e].length:i.length),0);Lt.hasColor=r=>!!r&&_s.hasColor(r);var O0=Lt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Lt.nativeType=r=>hGe.call(r).slice(8,-1).toLowerCase().replace(/\s/g,"");Lt.isAsyncFn=r=>Lt.nativeType(r)==="asyncfunction";Lt.isPrimitive=r=>r!=null&&typeof r!="object"&&typeof r!="function";Lt.resolve=(r,e,...t)=>typeof e=="function"?e.call(r,...t):e;Lt.scrollDown=(r=[])=>[...r.slice(1),r[0]];Lt.scrollUp=(r=[])=>[r.pop(),...r];Lt.reorder=(r=[])=>{let e=r.slice();return e.sort((t,i)=>t.index>i.index?1:t.index<i.index?-1:0),e};Lt.swap=(r,e,t)=>{let i=r.length,n=t===i?0:t<0?i-1:t,s=r[e];r[e]=r[n],r[n]=s};Lt.width=(r,e=80)=>{let t=r&&r.columns?r.columns:e;return r&&typeof r.getWindowSize=="function"&&(t=r.getWindowSize()[0]),process.platform==="win32"?t-1:t};Lt.height=(r,e=20)=>{let t=r&&r.rows?r.rows:e;return r&&typeof r.getWindowSize=="function"&&(t=r.getWindowSize()[1]),t};Lt.wordWrap=(r,e={})=>{if(!r)return r;typeof e=="number"&&(e={width:e});let{indent:t="",newline:i=`
`+t,width:n=80}=e;n-=((i+t).match(/[^\S\n]/g)||[]).length;let o=`.{1,${n}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,a=r.trim(),l=new RegExp(o,"g"),c=a.match(l)||[];return c=c.map(u=>u.replace(/\n$/,"")),e.padEnd&&(c=c.map(u=>u.padEnd(n," "))),e.padStart&&(c=c.map(u=>u.padStart(n," "))),t+c.join(i)};Lt.unmute=r=>{let e=r.stack.find(i=>_s.keys.color.includes(i));return e?_s[e]:r.stack.find(i=>i.slice(2)==="bg")?_s[e.slice(2)]:i=>i};Lt.pascal=r=>r?r[0].toUpperCase()+r.slice(1):"";Lt.inverse=r=>{if(!r||!r.stack)return r;let e=r.stack.find(i=>_s.keys.color.includes(i));if(e){let i=_s["bg"+Lt.pascal(e)];return i?i.black:r}let t=r.stack.find(i=>i.slice(0,2)==="bg");return t?_s[t.slice(2).toLowerCase()]||r:_s.none};Lt.complement=r=>{if(!r||!r.stack)return r;let e=r.stack.find(i=>_s.keys.color.includes(i)),t=r.stack.find(i=>i.slice(0,2)==="bg");if(e&&!t)return _s[Lre[e]||e];if(t){let i=t.slice(2).toLowerCase(),n=Lre[i];return n&&_s["bg"+Lt.pascal(n)]||r}return _s.none};Lt.meridiem=r=>{let e=r.getHours(),t=r.getMinutes(),i=e>=12?"pm":"am";e=e%12;let n=e===0?12:e,s=t<10?"0"+t:t;return n+":"+s+" "+i};Lt.set=(r={},e="",t)=>e.split(".").reduce((i,n,s,o)=>{let a=o.length-1>s?i[n]||{}:t;return!Lt.isObject(a)&&s<o.length-1&&(a={}),i[n]=a},r);Lt.get=(r={},e="",t)=>{let i=r[e]==null?e.split(".").reduce((n,s)=>n&&n[s],r):r[e];return i==null?t:i};Lt.mixin=(r,e)=>{if(!O0(r))return e;if(!O0(e))return r;for(let t of Object.keys(e)){let i=Object.getOwnPropertyDescriptor(e,t);if(i.hasOwnProperty("value"))if(r.hasOwnProperty(t)&&O0(i.value)){let n=Object.getOwnPropertyDescriptor(r,t);O0(n.value)?r[t]=Lt.merge({},r[t],e[t]):Reflect.defineProperty(r,t,i)}else Reflect.defineProperty(r,t,i);else Reflect.defineProperty(r,t,i)}return r};Lt.merge=(...r)=>{let e={};for(let t of r)Lt.mixin(e,t);return e};Lt.mixinEmitter=(r,e)=>{let t=e.constructor.prototype;for(let i of Object.keys(t)){let n=t[i];typeof n=="function"?Lt.define(r,i,n.bind(e)):Lt.define(r,i,n)}};Lt.onExit=r=>{let e=(t,i)=>{Nre||(Nre=!0,YF.forEach(n=>n()),t===!0&&process.exit(128+i))};YF.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),YF.push(r)};Lt.define=(r,e,t)=>{Reflect.defineProperty(r,e,{value:t})};Lt.defineExport=(r,e,t)=>{let i;Reflect.defineProperty(r,e,{enumerable:!0,configurable:!0,set(n){i=n},get(){return i?i():t()}})}});var Tre=w(_f=>{"use strict";_f.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};_f.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};_f.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};_f.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};_f.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var Ure=w((Ift,Ore)=>{"use strict";var Mre=require("readline"),pGe=Tre(),dGe=/^(?:\x1b)([a-zA-Z0-9])$/,CGe=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,mGe={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe
`:" ",i=[];for(let n=0;n<4;n++){let s=t(n);e[n]?i.push(s.repeat(e[n])):i.push("")}return i}rie.exports=U0});var oie=w((vft,nie)=>{"use strict";var LGe=Xi(),sie={default(r,e){return e},checkbox(r,e){throw new Error("checkbox role is not implemented yet")},editable(r,e){throw new Error("editable role is not implemented yet")},expandable(r,e){throw new Error("expandable role is not implemented yet")},heading(r,e){return e.disabled="",e.indicator=[e.indicator," "].find(t=>t!=null),e.message=e.message||"",e},input(r,e){throw new Error("input role is not implemented yet")},option(r,e){return sie.default(r,e)},radio(r,e){throw new Error("radio role is not implemented yet")},separator(r,e){return e.disabled="",e.indicator=[e.indicator," "].find(t=>t!=null),e.message=e.message||r.symbols.line.repeat(5),e},spacer(r,e){return e}};nie.exports=(r,e={})=>{let t=LGe.merge({},sie,e.roles);return t[r]||t.default}});var JC=w((kft,aie)=>{"use strict";var TGe=yo(),OGe=Vf(),MGe=oie(),K0=Xi(),{reorder:$F,scrollUp:UGe,scrollDown:KGe,isObject:Aie,swap:HGe}=K0,lie=class extends OGe{constructor(e){super(e);this.cursorHide(),this.maxSelected=e.maxSelected||Infinity,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:t,autofocus:i,suggest:n}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(s=>s.enabled=!1),typeof n!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");Aie(t)&&(t=Object.keys(t)),Array.isArray(t)?(i!=null&&(this.index=this.findIndex(i)),t.forEach(s=>this.enable(this.find(s))),await this.render()):(i!=null&&(t=i),typeof t=="string"&&(t=this.findIndex(t)),typeof t=="number"&&t>-1&&(this.index=Math.max(0,Math.min(t,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,t){this.state.loadingChoices=!0;let i=[],n=0,s=async(o,a)=>{typeof o=="function"&&(o=await o.call(this)),o instanceof Promise&&(o=await o);for(let l=0;l<o.length;l++){let c=o[l]=await this.toChoice(o[l],n++,a);i.push(c),c.choices&&await s(c.choices,c)}return i};return s(e,t).then(o=>(this.state.loadingChoices=!1,o))}async toChoice(e,t,i){if(typeof e=="function"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e=="string"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let n=e.value;if(e=MGe(e.role,this.options)(this,e),typeof e.disabled=="string"&&!e.hint&&(e.hint=e.disabled,e.disabled=!0),e.disabled===!0&&e.hint==null&&(e.hint="(disabled)"),e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message,e.message=e.message||e.name||"",e.value=[e.value,e.name].find(this.isValue.bind(this)),e.input="",e.index=t,e.cursor=0,K0.define(e,"parent",i),e.level=i?i.level+1:1,e.indent==null&&(e.indent=i?i.indent+" ":e.indent||""),e.path=i?i.path+"."+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,TGe.unstyle(e.message).length));let o=N({},e);return e.reset=(a=o.input,l=o.value)=>{for(let c of Object.keys(o))e[c]=o[c];e.input=a,e.value=l},n==null&&typeof e.initial=="function"&&(e.input=await e.initial.call(this,this.state,e,t)),e}async onChoice(e,t){this.emit("choice",e,t,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,t)}async addChoice(e,t,i){let n=await this.toChoice(e,t,i);return this.choices.push(n),this.index=this.choices.length-1,this.limit=this.choices.length,n}async newItem(e,t,i){let n=N({name:"New choice name?",editable:!0,newChoice:!0},e),s=await this.addChoice(n,t,i);return s.updateChoice=()=>{delete s.newChoice,s.name=s.message=s.input,s.input="",s.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?" ".repeat(e.level-1):"":e.indent}dispatch(e,t)
`).map(v=>" "+v),y=s.length,b=0;for(let v of s)g.invalid.has(v.name)&&v.lines.forEach(k=>{m[k][0]===" "&&(m[k]=g.styles.danger(g.symbols.bullet)+m[k].slice(1))}),r.isValue(g.values[v.name])&&b++;return g.completed=(b/y*100).toFixed(0),g.output=m.join(`
`)),this.write(this.margin[2]),this.restore()}};Ine.exports=yne});var Qne=w((eht,Bne)=>{"use strict";var SYe=Ll(),bne=class extends SYe{constructor(e){super(e);if(typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(e,t){let i=await super.toChoices(e,t);if(i.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>i.length)throw new Error("Please specify the index of the correct answer from the list of choices");return i}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};Bne.exports=bne});var vne=w(aN=>{"use strict";var Sne=Xi(),mi=(r,e)=>{Sne.defineExport(aN,r,e),Sne.defineExport(aN,r.toLowerCase(),e)};mi("AutoComplete",()=>pie());mi("BasicAuth",()=>Bie());mi("Confirm",()=>kie());mi("Editable",()=>Die());mi("Form",()=>H0());mi("Input",()=>nN());mi("Invisible",()=>Hie());mi("List",()=>Yie());mi("MultiSelect",()=>Wie());mi("Numeral",()=>Xie());mi("Password",()=>ene());mi("Scale",()=>nne());mi("Select",()=>Ll());mi("Snippet",()=>une());mi("Sort",()=>hne());mi("Survey",()=>Cne());mi("Text",()=>Ene());mi("Toggle",()=>wne());mi("Quiz",()=>Qne())});var xne=w((rht,kne)=>{kne.exports={ArrayPrompt:JC(),AuthPrompt:iN(),BooleanPrompt:j0(),NumberPrompt:sN(),StringPrompt:Bu()}});var zC=w((iht,Pne)=>{"use strict";var Dne=require("assert"),AN=require("events"),Tl=Xi(),pa=class extends AN{constructor(e,t){super();this.options=Tl.merge({},e),this.answers=N({},t)}register(e,t){if(Tl.isObject(e)){for(let n of Object.keys(e))this.register(n,e[n]);return this}Dne.equal(typeof t,"function","expected a function");let i=e.toLowerCase();return t.prototype instanceof this.Prompt?this.prompts[i]=t:this.prompts[i]=t(this.Prompt,this),this}async prompt(e=[]){for(let t of[].concat(e))try{typeof t=="function"&&(t=await t.call(this)),await this.ask(Tl.merge({},this.options,t))}catch(i){return Promise.reject(i)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let t=Tl.merge({},this.options,e),{type:i,name:n}=e,{set:s,get:o}=Tl;if(typeof i=="function"&&(i=await i.call(this,e,this.answers)),!i)return this.answers[n];Dne(this.prompts[i],`Prompt"${i}"isnotregistered`);let a=new this.prompts[i](t),l=o(this.answers,n);a.state.answers=this.answers,a.enquirer=this,n&&a.on("submit",u=>{this.emit("answer",n,u,a),s(this.answers,n,u)});let c=a.emit.bind(a);return a.emit=(...u)=>(this.emit.call(this,...u),c(...u)),this.emit("prompt",a,this),t.autofill&&l!=null?(a.value=a.input=l,t.autofill==="show"&&await a.submit()):l=a.value=await a.run(),l}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||Vf()}static get prompts(){return vne()}static get types(){return xne()}static get prompt(){let e=(t,...i)=>{let n=new this(...i),s=n.emit.bind(n);return n.emit=(...o)=>(e.emit(...o),s(...o)),n.prompt(t)};return Tl.mixinEmitter(e,new AN),e}};Tl.mixinEmitter(pa,new AN);var lN=pa.prompts;for(let r of Object.keys(lN)){let e=r.toLowerCase(),t=i=>new lN[r](i).run();pa.prompt[e]=t,pa[e]=t,pa[r]||Reflect.defineProperty(pa,r,{get:()=>lN[r]})}var WC=r=>{Tl.defineExport(pa,r,()=>pa.types[r])};WC("ArrayPrompt");WC("AuthPrompt");WC("BooleanPrompt");WC("NumberPrompt");WC("StringPrompt");Pne.exports=pa});var Yne=w((Jht,Gne)=>{function DYe(r,e){for(var t=-1,i=r==null?0:r.length;++t<i&&e(r[t],t,r)!==!1;);return r}Gne.exports=DYe});var $f=w((Wht,qne)=>{var RYe=e0(),FYe=Lf();function NYe(r,e,t,i){var n=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=i?i(t[a],r[a],a,t,r):void 0;l===void 0&&(l=r[a]),n?FYe(t,a,l):RYe(t,a,l)}return t}qne.exports=NYe});var Wne=w((zht,Jne)=>{var LYe=$f(),TYe=Kf();function OYe(r,e){return r&&LYe(e,TYe(e),r)}Jne.expo
`,h}function Nze(r,e){return e.fs_.chmod(r,493)}function KL(r){if(!r)return{win32:"",posix:""};let e=typeof r=="string"?r.split(Vs.delimiter):Array.from(r),t={};for(let i=0;i<e.length;i++){let n=e[i].split("/").join("\\"),s=VAe()?e[i].split("\\").join("/").replace(/^([^:\\/]*):/,(o,a)=>`/mnt/${a.toLowerCase()}`):e[i];t.win32=t.win32?`${t.win32};${n}`:n,t.posix=t.posix?`${t.posix}:${s}`:s,t[i]={win32:n,posix:s}}return t}_Ae.exports=UL});var tT=w((NSt,mle)=>{mle.exports=require("stream")});var wle=w((LSt,Ele)=>{"use strict";function Ile(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function t8e(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ile(Object(t),!0).forEach(function(i){e8e(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ile(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function e8e(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function r8e(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function yle(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}function i8e(r,e,t){return e&&yle(r.prototype,e),t&&yle(r,t),r}var n8e=require("buffer"),cb=n8e.Buffer,s8e=require("util"),rT=s8e.inspect,o8e=rT&&rT.custom||"inspect";function a8e(r,e,t){cb.prototype.copy.call(r,e,t)}Ele.exports=function(){function r(){r8e(this,r),this.head=null,this.tail=null,this.length=0}return i8e(r,[{key:"push",value:function(t){var i={data:t,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(t){var i={data:t,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=t+i.data;return n}},{key:"concat",value:function(t){if(this.length===0)return cb.alloc(0);for(var i=cb.allocUnsafe(t>>>0),n=this.head,s=0;n;)a8e(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(t,i){var n;return t<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):t===this.head.data.length?n=this.shift():n=i?this._getString(t):this._getBuffer(t),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var i=this.head,n=1,s=i.data;for(t-=s.length;i=i.next;){var o=i.data,a=t>o.length?o.length:t;if(a===o.length?s+=o:s+=o.slice(0,t),t-=a,t===0){a===o.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(a));break}++n}return this.length-=n,s}},{key:"_getBuffer",value:function(t){var i=cb.allocUnsafe(t),n=this.head,s=1;for(n.data.copy(i),t-=n.data.length;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(i,i.length-t,0,a),t-=a,t===0){a===o.length?(++s,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++s}return this.length-=s,i}},{key:o8e,value:function(t,i){return rT(this,t8e({},i,{depth:0,customInspect:!1}))}}]),r}()});var nT=w((TSt,Ble)=>{"use strict";function A8e(r,e){var t=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(iT,this,r)):process.nextTick(iT,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(
`)),r.linkname&&(e+=FT(" linkpath="+r.linkname+`
`));var t=r.pax;if(t)for(var i in t)e+=FT(" "+i+"="+t[i]+`
`);return Buffer.from(e)};Ch.decodePax=function(r){for(var e={};r.length;){for(var t=0;t<r.length&&r[t]!==32;)t++;var i=parseInt(r.slice(0,t).toString(),10);if(!i)return e;var n=r.slice(t+1,i-1).toString(),s=n.indexOf("=");if(s===-1)return e;e[n.slice(0,s)]=n.slice(s+1),r=r.slice(i)}return e};Ch.encode=function(r){var e=r9e(512),t=r.name,i="";if(r.typeflag===5&&t[t.length-1]!=="/"&&(t+="/"),Buffer.byteLength(t)!==t.length)return null;for(;Buffer.byteLength(t)>100;){var n=t.indexOf("/");if(n===-1)return null;i+=i?"/"+t.slice(0,n):t.slice(0,n),t=t.slice(n+1)}return Buffer.byteLength(t)>100||Buffer.byteLength(i)>155||r.linkname&&Buffer.byteLength(r.linkname)>100?null:(e.write(t),e.write(Wl(r.mode&A9e,6),100),e.write(Wl(r.uid,6),108),e.write(Wl(r.gid,6),116),e.write(Wl(r.size,11),124),e.write(Wl(r.mtime.getTime()/1e3|0,11),136),e[156]=bce+u9e(r.type),r.linkname&&e.write(r.linkname,157),Qce.copy(e,eE),s9e.copy(e,RT),r.uname&&e.write(r.uname,265),r.gname&&e.write(r.gname,297),e.write(Wl(r.devmajor||0,6),329),e.write(Wl(r.devminor||0,6),337),i&&e.write(i,345),e.write(Wl(vce(e),6),148),e)};Ch.decode=function(r,e,t){var i=r[156]===0?0:r[156]-bce,n=mh(r,0,100,e),s=zl(r,100,8),o=zl(r,108,8),a=zl(r,116,8),l=zl(r,124,12),c=zl(r,136,12),u=c9e(i),g=r[157]===0?null:mh(r,157,100,e),f=mh(r,265,32),h=mh(r,297,32),p=zl(r,329,8),m=zl(r,337,8),y=vce(r);if(y===8*32)return null;if(y!==zl(r,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(Qce.compare(r,eE,eE+6)===0)r[345]&&(n=mh(r,345,155,e)+"/"+n);else if(!(o9e.compare(r,eE,eE+6)===0&&a9e.compare(r,RT,RT+2)===0)){if(!t)throw new Error("Invalid tar header: unknown format.")}return i===0&&n&&n[n.length-1]==="/"&&(i=5),{name:n,mode:s,uid:o,gid:a,size:l,mtime:new Date(1e3*c),type:u,linkname:g,uname:f,gname:h,devmajor:p,devminor:m}}});var Nce=w((rvt,kce)=>{var xce=require("util"),f9e=Bce(),tE=NT(),Pce=dh().Writable,Dce=dh().PassThrough,Rce=function(){},Fce=function(r){return r&=511,r&&512-r},h9e=function(r,e){var t=new Sb(r,e);return t.end(),t},p9e=function(r,e){return e.path&&(r.name=e.path),e.linkpath&&(r.linkname=e.linkpath),e.size&&(r.size=parseInt(e.size,10)),r.pax=e,r},Sb=function(r,e){this._parent=r,this.offset=e,Dce.call(this,{autoDestroy:!1})};xce.inherits(Sb,Dce);Sb.prototype.destroy=function(r){this._parent.destroy(r)};var PA=function(r){if(!(this instanceof PA))return new PA(r);Pce.call(this,r),r=r||{},this._offset=0,this._buffer=f9e(),this._missing=0,this._partial=!1,this._onparse=Rce,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var e=this,t=e._buffer,i=function(){e._continue()},n=function(f){if(e._locked=!1,f)return e.destroy(f);e._stream||i()},s=function(){e._stream=null;var f=Fce(e._header.size);f?e._parse(f,o):e._parse(512,g),e._locked||i()},o=function(){e._buffer.consume(Fce(e._header.size)),e._parse(512,g),i()},a=function(){var f=e._header.size;e._paxGlobal=tE.decodePax(t.slice(0,f)),t.consume(f),s()},l=function(){var f=e._header.size;e._pax=tE.decodePax(t.slice(0,f)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),t.consume(f),s()},c=function(){var f=e._header.size;this._gnuLongPath=tE.decodeLongPath(t.slice(0,f),r.filenameEncoding),t.consume(f),s()},u=function(){var f=e._header.size;this._gnuLongLinkPath=tE.decodeLongPath(t.slice(0,f),r.filenameEncoding),t.consume(f),s()},g=function(){var f=e._offset,h;try{h=e._header=tE.decode(t.slice(0,512),r.filenameEncoding,r.allowUnknownFormat)}catch(p){e.emit("error",p)}if(t.consume(512),!h){e._parse(512,g),i();return}if(h.type==="gnu-long-path"){e._parse(h.size,c),i();return}if(h.type==="gnu-long-link-path"){e._parse(h.size,u),i();return}if(h.type==="pax-global-header"){e._parse(h.size,a),i();return}if(h.type==="pax-header"){e._parse(h.size,l),i();return}if(e._gnuLongPath&&(h.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(h.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=h=p9e(h,e._pax),e
-${hI(t)}`).join("")}`)}functiongp(r,e,t){if(typeoft=="undefined")returne;leti=[],n=[],s=a=>{letl=e;returne=a,s.bind(null,l)};if(!t(e,{errors:i,coercions:n,coercion:s}))throwup(`Invalid value for ${r}`,i);for(let[,a]ofn)a();returne}varRe=class{constructor(){this.help=!1}staticUsage(e){returne}asynccatch(e){throwe}asyncvalidateAndExecute(){lett=this.constructor.schema;if(Array.isArray(t)){let{isDict:n,isUnknown:s,applyCascade:o}=awaitPromise.resolve().then(()=>(ws(),ug)),a=o(n(s()),t),l=[],c=[];if(!a(this,{errors:l,coercions:c}))throwup("Invalid option schema",l);for(let[,g]ofc)g()}elseif(t!=null)thrownewError("Invalid command schema");leti=awaitthis.execute();returntypeofi!="undefined"?i:0}};Re.isOption=cp;Re.Default=[];varpK=80,rS=Array(pK).fill("\u2501");for(letr=0;r<=24;++r)rS[rS.length-r]=`[38;5;${232+r}m\u2501`;variS={header:r=>`[1m\u2501\u2501\u2501 ${r}${r.length<pK-5?`${rS.slice(r.length+5).join("")}`:":"}[0m`,bold:r=>`[1m${r}[22m`,error:r=>`[31m[1m${r}[22m[39m`,code:r=>`[36m${r}[39m`},dK={header:r=>r,bold:r=>r,error:r=>r,code:r=>r};functionbde(r){lete=r.split(`
`:""}var oS=ge(require("tty"));function wn(r){XQ&&console.log(r)}var CK={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:cg};function mK(){return{nodes:[sn(),sn(),sn()]}}function Sde(r){let e=mK(),t=[],i=e.nodes.length;for(let n of r){t.push(i);for(let s=0;s<n.nodes.length;++s)EK(s)||e.nodes.push(Qde(n.nodes[s],i));i+=n.nodes.length-2}for(let n of t)gg(e,wc,n);return e}function ao(r,e){return r.nodes.push(e),r.nodes.length-1}function vde(r){let e=new Set,t=i=>{if(e.has(i))return;e.add(i);let n=r.nodes[i];for(let o of Object.values(n.statics))for(let{to:a}of o)t(a);for(let[,{to:o}]of n.dynamics)t(o);for(let{to:o}of n.shortcuts)t(o);let s=new Set(n.shortcuts.map(({to:o})=>o));for(;n.shortcuts.length>0;){let{to:o}=n.shortcuts.shift(),a=r.nodes[o];for(let[l,c]of Object.entries(a.statics)){let u=Object.prototype.hasOwnProperty.call(n.statics,l)?n.statics[l]:n.statics[l]=[];for(let g of c)u.some(({to:f})=>g.to===f)||u.push(g)}for(let[l,c]of a.dynamics)n.dynamics.some(([u,{to:g}])=>l===u&&c.to===g)||n.dynamics.push([l,c]);for(let l of a.shortcuts)s.has(l.to)||(n.shortcuts.push(l),s.add(l.to))}};t(wc)}function kde(r,{prefix:e=""}={}){if(XQ){wn(`${e}Nodesare:`);for(let t=0;t<r.nodes.length;++t)wn(`${e}${t}:${JSON.stringify(r.nodes[t])}`)}}function IK(r,e,t=!1){wn(`Runningavmon${JSON.stringify(e)}`);let i=[{node:wc,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null}}];kde(r,{prefix:" "});let n=[zQ,...e];for(let s=0;s<n.length;++s){let o=n[s];wn(`Processing${JSON.stringify(o)}`);let a=[];for(let{node:l,state:c}of i){wn(`Currentnodeis${l}`);let u=r.nodes[l];if(l===tn){a.push({node:l,state:c});continue}console.assert(u.shortcuts.length===0,"Shortcuts should have been eliminated by now");let g=Object.prototype.hasOwnProperty.call(u.statics,o);if(!t||s<n.length-1||g)if(g){let f=u.statics[o];for(let{to:h,reducer:p}of f)a.push({node:h,state:typeof p!="undefined"?dI(nS,p,c,o):c}),wn(`Statictransitionto${h}found`)}else wn(" No static transition found");else{let f=!1;for(let h of Object.keys(u.statics))if(!!h.startsWith(o)){if(o===h)for(let{to:p,reducer:m}of u.statics[h])a.push({node:p,state:typeof m!="undefined"?dI(nS,m,c,o):c}),wn(`Statictransitionto${p}found`);else for(let{to:p}of u.statics[h])a.push({node:p,state:te(N({},c),{remainder:h.slice(o.length)})}),wn(`Statictransitionto${p}found(partialmatch)`);f=!0}f||wn(" No partial static transition found")}if(o!==vi)for(let[f,{to:h,reducer:p}]of u.dynamics)dI(CI,f,c,o)&&(a.push({node:h,state:typeof p!="undefined"?dI(nS,p,c,o):c}),wn(`Dynamictransitionto${h}found(via${f})`))}if(a.length===0&&o===vi&&e.length===1)return[{node:wc,state:CK}];if(a.length===0)throw new lp(e,i.filter(({node:l})=>l!==tn).map(({state:l})=>({usage:l.candidateUsage,reason:null})));if(a.every(({node:l})=>l===tn))throw new lp(e,a.map(({state:l})=>({usage:l.candidateUsage,reason:l.errorMessage})));i=xde(a)}if(i.length>0){wn(" Results:");for(let s of i)wn(`-${s.node}->${JSON.stringify(s.state)}`)}else wn(" No results");return i}function Pde(r,e){if(e.selectedIndex!==null)return!0;if(Object.prototype.hasOwnProperty.call(r.statics,vi)){for(let{to:t}of r.statics[vi])if(t===Ap)return!0}return!1}function Rde(r,e,t){let i=t&&e.length>0?[""]:[],n=IK(r,e,t),s=[],o=new Set,a=(l,c,u=!0)=>{let g=[c];for(;g.length>0;){let h=g;g=[];for(let p of h){let m=r.nodes[p],y=Object.keys(m.statics);for(let b of Object.keys(m.statics)){let v=y[0];for(let{to:k,reducer:T}of m.statics[v])T==="pushPath"&&(u||l.push(v),g.push(k))}}u=!1}let f=JSON.stringify(l);o.has(f)||(s.push(l),o.add(f))};for(let{node:l,state:c}of n){if(c.remainder!==null){a([c.remainder],l);continue}let u=r.nodes[l],g=Pde(u,c);for(let[f,h]of Object.entries(u.statics))(g&&f!==vi||!f.startsWith("-")&&h.some(({reducer:p})=>p==="pushPath"))&&a([...i,f],l);if(!!g)for(let[f,{to:h}]of u.dynamics){if(h===tn)continue;let p=D
`);let t=0;for(let i of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[i].commandClass,{prefix:`${t++}.`.padStart(5)}));this.context.stdout.write(`
`;for(let f of c){let h=l.get(f).slice().sort((m,y)=>m.usage.localeCompare(y.usage,"en",{usage:"sort",caseFirst:"upper"})),p=f!==null?f.trim():"General commands";a+=`
`,a+=Ki("You can also print more details about any of these commands by calling them with the `-h,--help` flag right after the command name.",{format:this.format(t),paragraphs:!0})}return a}error(e,t){var i,{colored:n,command:s=(i=e[BK])!==null&&i!==void 0?i:null}=t===void 0?{}:t;e instanceof Error||(e=new Error(`Executionfailedwithanon-errorrejection(rejectedvalue:${JSON.stringify(e)})`));let o="",a=e.name.replace(/([a-z])([A-Z])/g,"$1 $2");a==="Error"&&(a="Internal Error"),o+=`${this.format(n).error(a)}:${e.message}
`);return{stdout:s,stderr:o}}makeResolver(){let e=[];for(let t of this.plugins.values())for(let i of t.resolvers||[])e.push(new i);return new Bd([new dw,new oi,new sx,...e])}makeFetcher(){let e=[];for(let t of this.plugins.values())for(let i of t.fetchers||[])e.push(new i);return new wd([new bd,new Qd,...e])}getLinkers(){let e=[];for(let t of this.plugins.values())for(let i of t.linkers||[])e.push(new i);return e}getSupportedArchitectures(){let e=vd(),t=this.get("supportedArchitectures"),i=t.get("os");i!==null&&(i=i.map(o=>o==="current"?e.os:o));let n=t.get("cpu");n!==null&&(n=n.map(o=>o==="current"?e.cpu:o));let s=t.get("libc");return s!==null&&(s=Vo(s,o=>{var a;return o==="current"?(a=e.libc)!=null?a:Vo.skip:o})),{os:i,cpu:n,libc:s}}async refreshPackageExtensions(){this.packageExtensions=new Map;let e=this.packageExtensions,t=(i,n,{userProvided:s=!1}={})=>{if(!mo(i.range))throw new Error("Only semver ranges are allowed as keys for the packageExtensions setting");let o=new At;o.load(n,{yamlCompatibilityMode:!0});let a=Ng(e,i.identHash),l=[];a.push([i.range,l]);let c={status:qi.Inactive,userProvided:s,parentDescriptor:i};for(let u of o.dependencies.values())l.push(te(N({},c),{type:wi.Dependency,descriptor:u}));for(let u of o.peerDependencies.values())l.push(te(N({},c),{type:wi.PeerDependency,descriptor:u}));for(let[u,g]of o.peerDependenciesMeta)for(let[f,h]of Object.entries(g))l.push(te(N({},c),{type:wi.PeerDependencyMeta,selector:u,key:f,value:h}))};await this.triggerHook(i=>i.registerPackageExtensions,this,t);for(let[i,n]of this.get("packageExtensions"))t(cl(i,!0),Py(n),{userProvided:!0})}normalizePackage(e){let t=ud(e);if(this.packageExtensions==null)throw new Error("refreshPackageExtensions has to be called before normalizing packages");let i=this.packageExtensions.get(e.identHash);if(typeof i!="undefined"){let s=e.version;if(s!==null){for(let[o,a]of i)if(!!Jc(s,o))for(let l of a)switch(l.status===qi.Inactive&&(l.status=qi.Redundant),l.type){case wi.Dependency:typeof t.dependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=qi.Active,t.dependencies.set(l.descriptor.identHash,l.descriptor));break;case wi.PeerDependency:typeof t.peerDependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=qi.Active,t.peerDependencies.set(l.descriptor.identHash,l.descriptor));break;case wi.PeerDependencyMeta:{let c=t.peerDependenciesMeta.get(l.selector);(typeof c=="undefined"||!Object.prototype.hasOwnProperty.call(c,l.key)||c[l.key]!==l.value)&&(l.status=qi.Active,Va(t.peerDependenciesMeta,l.selector,()=>({}))[l.key]=l.value)}break;default:Dv(l);break}}}let n=s=>s.scope?`${s.scope}__${s.name}`:`${s.name}`;for(let s of t.peerDependenciesMeta.keys()){let o=An(s);t.peerDependencies.has(o.identHash)||t.peerDependencies.set(o.identHash,rr(o,"*"))}for(let s of t.peerDependencies.values()){if(s.scope==="types")continue;let o=n(s),a=ea("types",o),l=Ot(a);t.peerDependencies.has(a.identHash)||t.peerDependenciesMeta.has(l)||(t.peerDependencies.set(a.identHash,rr(a,"*")),t.peerDependenciesMeta.set(l,{optional:!0}))}return t.dependencies=new Map(xn(t.dependencies,([,s])=>Pn(s))),t.peerDependencies=new Map(xn(t.peerDependencies,([,s])=>Pn(s))),t}getLimit(e){return Va(this.limits,e,()=>(0,H4.default)(this.get(e)))}async triggerHook(e,...t){for(let i of this.plugins.values()){let n=i.hooks;if(!n)continue;let s=e(n);!s||await s(...t)}}async triggerMultipleHooks(e,t){for(let i of t)await this.triggerHook(e,...i)}async reduceHook(e,t,...i){let n=t;for(let s of this.plugins.values()){let o=s.hooks;if(!o)continue;let a=e(o);!a||(n=await a(n,...i))}return n}async firstHook(e,...t){for(let i of this.plugins.values()){let n=i.hooks;if(!n)continue;let s=e(n);if(!s)continue;let o=await s(...t);if(typeof o!="undefined")return o}return null}},ye=rA;ye.telemetry=null;var ss;(function(i){i[i.Never=0]="Never",i[i.ErrorCode=1]="ErrorCode",i[i.Always=2]="Always"})(ss||(ss={}));var Bw=class extends ct{constructor({fileName:e,code:t,signal:i}){let n=ye.create(x.cwd()),s=tt(n,e,Ye.PATH);super(X.EXCEPTION,`Child${s}reportedanerror`,o=>{Cve(t,i,{config
`),0)],["sleep",async([r],e,t)=>{if(typeof r=="undefined")throw new Ks("sleep: missing operand");let i=Number(r);if(Number.isNaN(i))throw new Ks(`sleep:invalidtimeinterval'${r}'`);return await NPe(1e3*i,0)}],["__ysh_run_procedure",async(r,e,t)=>{let i=t.procedures[r[0]];return await zw(i,{stdin:new Io(t.stdin),stdout:new Io(t.stdout),stderr:new Io(t.stderr)}).run()}],["__ysh_set_redirects",async(r,e,t)=>{let i=t.stdin,n=t.stdout,s=t.stderr,o=[],a=[],l=[],c=0;for(;r[c]!=="--";){let g=r[c++],{type:f,fd:h}=JSON.parse(g),p=v=>{switch(h){case null:case 0:o.push(v);break;default:throw new Error(`Unsupportedfiledescriptor:"${h}"`)}},m=v=>{switch(h){case null:case 1:a.push(v);break;case 2:l.push(v);break;default:throw new Error(`Unsupportedfiledescriptor:"${h}"`)}},y=Number(r[c++]),b=c+y;for(let v=c;v<b;++c,++v)switch(f){case"<":p(()=>e.baseFs.createReadStream(x.resolve(t.cwd,H.toPortablePath(r[v]))));break;case"<<<":p(()=>{let k=new os.PassThrough;return process.nextTick(()=>{k.write(`${r[v]}
`),k.end()}),k});break;case"<&":p(()=>V5(Number(r[v]),1,t));break;case">":case">>":{let k=x.resolve(t.cwd,H.toPortablePath(r[v]));m(k==="/dev/null"?new os.Writable({autoDestroy:!0,emitClose:!0,write(T,Y,q){setImmediate(q)}}):e.baseFs.createWriteStream(k,f===">>"?{flags:"a"}:void 0))}break;case">&":m(V5(Number(r[v]),2,t));break;default:throw new Error(`Assertionfailed:Unsupportedredirectiontype:"${f}"`)}}if(o.length>0){let g=new os.PassThrough;i=g;let f=h=>{if(h===o.length)g.end();else{let p=o[h]();p.pipe(g,{end:!1}),p.on("end",()=>{f(h+1)})}};f(0)}if(a.length>0){let g=new os.PassThrough;n=g;for(let f of a)g.pipe(f)}if(l.length>0){let g=new os.PassThrough;s=g;for(let f of l)g.pipe(f)}let u=await zw(jd(r.slice(c+1),e,t),{stdin:new Io(i),stdout:new Io(n),stderr:new Io(s)}).run();return await Promise.all(a.map(g=>new Promise((f,h)=>{g.on("error",p=>{h(p)}),g.on("close",()=>{f()}),g.end()}))),await Promise.all(l.map(g=>new Promise((f,h)=>{g.on("error",p=>{h(p)}),g.on("close",()=>{f()}),g.end()}))),u}]]);async function TPe(r,e,t){let i=[],n=new os.PassThrough;return n.on("data",s=>i.push(s)),await Vw(r,e,_w(t,{stdout:n})),Buffer.concat(i).toString().replace(/[\r\n]+$/,"")}async function X5(r,e,t){let i=r.map(async s=>{let o=await AA(s.args,e,t);return{name:s.name,value:o.join(" ")}});return(await Promise.all(i)).reduce((s,o)=>(s[o.name]=o.value,s),{})}function Xw(r){return r.match(/[^ \r\n\t]+/g)||[]}async function Z5(r,e,t,i,n=i){switch(r.name){case"$":i(String(process.pid));break;case"#":i(String(e.args.length));break;case"@":if(r.quoted)for(let s of e.args)n(s);else for(let s of e.args){let o=Xw(s);for(let a=0;a<o.length-1;++a)n(o[a]);i(o[o.length-1])}break;case"*":{let s=e.args.join(" ");if(r.quoted)i(s);else for(let o of Xw(s))n(o)}break;case"PPID":i(String(process.ppid));break;case"RANDOM":i(String(Math.floor(Math.random()*32768)));break;default:{let s=parseInt(r.name,10),o;if(Number.isFinite(s))if(s>=0&&s<e.args.length)o=e.args[s];else if(r.defaultValue)o=(await AA(r.defaultValue,e,t)).join(" ");else if(r.alternativeValue)o=(await AA(r.alternativeValue,e,t)).join(" ");else throw new Ks(`Unboundargument#${s}`);else if(Object.prototype.hasOwnProperty.call(t.variables,r.name))o=t.variables[r.name];else if(Object.prototype.hasOwnProperty.call(t.environment,r.name))o=t.environment[r.name];else if(r.defaultValue)o=(await AA(r.defaultValue,e,t)).join(" ");else throw new Ks(`Unboundvariable"${r.name}"`);if(typeof o!="undefined"&&r.alternativeValue&&(o=(await AA(r.alternativeValue,e,t)).join(" ")),r.quoted)i(o);else{let a=Xw(o);for(let c=0;c<a.length-1;++c)n(a[c]);let l=a[a.length-1];typeof l!="undefined"&&i(l)}}break}}var OPe={addition:(r,e)=>r+e,subtraction:(r,e)=>r-e,multiplication:(r,e)=>r*e,division:(r,e)=>Math.trunc(r/e)};async function Gd(r,e,t){if(r.type==="number"){if(Number.isInteger(r.value))return r.value;throw new Error(`Invalidnumber:"${r.value}",onlyintegersareallowed`)}else if(r.type==="variable"){let i=[];await Z5(te(N({},r),{quoted:!0}),e,t,s=>i.push(s));let n=Number(i.join(" "));return Number.isNaN(n)?Gd({type:"variable",name:i.join(" ")},e,t):Gd({type:"number",value:n},e,t)}else return OPe[r.type](await Gd(r.left,e,t),await Gd(r.right,e,t))}async function AA(r,e,t){let i=new Map,n=[],s=[],o=u=>{s.push(u)},a=()=>{s.length>0&&n.push(s.join("")),s=[]},l=u=>{o(u),a()},c=(u,g,f)=>{let h=JSON.stringify({type:u,fd:g}),p=i.get(h);typeof p=="undefined"&&i.set(h,p=[]),p.push(f)};for(let u of r){let g=!1;switch(u.type){case"redirection":{let f=await AA(u.args,e,t);for(let h of f)c(u.subtype,u.fd,h)}break;case"argument":for(let f of u.segments)switch(f.type){case"text":o(f.text);break;case"glob":o(f.pattern),g=!0;break;case"shell":{let h=await TPe(f.shell,e,t);if(f.quoted)o(h);else{let p=Xw(h);for(let m=0;m<p.length-1;++m)l(p[m]);o(p[p.length-1])}}break;case"variable":await Z5(f,e,t,o,l);break;case"arithmetic":o(String(await Gd(f.arithmetic,e,t)));break}break}if(a(),g){let f=n.pop();if(typeof f=="undefined")throw new Error("Assertion failed: Expected a glob pattern to have been set");let h=await e.glob.ma
`),this.writeProgress()}writeLineWithForgettableReset(e,{truncate:t}={}){this.forgettableLines=[],this.writeLine(e,{truncate:t})}writeLines(e,{truncate:t}={}){this.clearProgress({delta:e.length});for(let i of e)this.stdout.write(`${this.truncate(i,{truncate:t})}
`);this.writeProgress()}reportCacheChanges({cacheHitCount:e,cacheMissCount:t}){let i=this.cacheHitCount-e,n=this.cacheMissCount-t;if(i===0&&n===0)return;let s="";this.cacheHitCount>1?s+=`${this.cacheHitCount}packageswerealreadycached`:this.cacheHitCount===1?s+=" - one package was already cached":s+="No packages were cached",this.cacheHitCount>0?this.cacheMissCount>1?s+=`,${this.cacheMissCount}hadtobefetched`:this.cacheMissCount===1&&(s+=`,onehadtobefetched(${It(this.configuration,this.lastCacheMiss)})`):this.cacheMissCount>1?s+=`-${this.cacheMissCount}packageshadtobefetched`:this.cacheMissCount===1&&(s+=`-onepackagehadtobefetched(${It(this.configuration,this.lastCacheMiss)})`),this.reportInfo(X.FETCH_NOT_CACHED,s)}commit(){let e=this.uncommitted;this.uncommitted=new Set;for(let t of e)t.committed=!0,t.action()}clearProgress({delta:e=0,clear:t=!1}){this.progressStyle!==null&&this.progress.size+e>0&&(this.stdout.write(`[${this.progress.size+e}A`),(e>0||t)&&this.stdout.write("[0J"))}writeProgress(){if(this.progressStyle===null||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let e=Date.now();e-this.progressTime>M9&&(this.progressFrame=(this.progressFrame+1)%O9.length,this.progressTime=e);let t=O9[this.progressFrame];for(let i of this.progress.values()){let n="";if(typeof i.lastScaledSize!="undefined"){let l=this.progressStyle.chars[0].repeat(i.lastScaledSize),c=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-i.lastScaledSize);n=`${l}${c}`}let s=this.formatName(null),o=s?`${s}:`:"",a=i.definition.title?`${i.definition.title}`:"";this.stdout.write(`${tt(this.configuration,"\u27A4","blueBright")}${o}${t}${n}${a}
`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},M9)}refreshProgress({delta:e=0,force:t=!1}={}){let i=!1,n=!1;if(t||this.progress.size===0)i=!0;else for(let s of this.progress.values()){let o=typeof s.definition.progress!="undefined"?Math.trunc(this.progressMaxScaledSize*s.definition.progress):void 0,a=s.lastScaledSize;s.lastScaledSize=o;let l=s.lastTitle;if(s.lastTitle=s.definition.title,o!==a||(n=l!==s.definition.title)){i=!0;break}}i&&(this.clearProgress({delta:e,clear:n}),this.writeProgress())}truncate(e,{truncate:t}={}){return this.progressStyle===null&&(t=!1),typeof t=="undefined"&&(t=this.configuration.get("preferTruncatedLines")),t&&(e=(0,T9.default)(e,0,this.stdout.columns-1)),e}formatName(e){return K9(e,{configuration:this.configuration,json:this.json})}formatNameWithHyperlink(e){return tD(e,{configuration:this.configuration,json:this.json})}formatIndent(){return"\u2502 ".repeat(this.indent)}};var Kr="3.2.3";var hn;(function(n){n.Yarn1="Yarn Classic",n.Yarn2="Yarn",n.Npm="npm",n.Pnpm="pnpm"})(hn||(hn={}));async function lA(r,e,t,i=[]){if(process.platform==="win32"){let n=`@goto#_undefined_#2>NUL||@title%COMSPEC%&@setlocal&@"${t}"${i.map(s=>`"${s.replace('"','""')}"`).join(" ")}%*`;await U.writeFilePromise(x.format({dir:r,name:e,ext:".cmd"}),n)}await U.writeFilePromise(x.join(r,e),`#!/bin/sh
`,{mode:493})}async function G9(r){let e=await At.tryFind(r);if(e==null?void 0:e.packageManager){let i=cw(e.packageManager);if(i==null?void 0:i.name){let n=`found${JSON.stringify({packageManager:e.packageManager})}inmanifest`,[s]=i.reference.split(".");switch(i.name){case"yarn":return{packageManager:Number(s)===1?hn.Yarn1:hn.Yarn2,reason:n};case"npm":return{packageManager:hn.Npm,reason:n};case"pnpm":return{packageManager:hn.Pnpm,reason:n}}}}let t;try{t=await U.readFilePromise(x.join(r,xt.lockfile),"utf8")}catch{}return t!==void 0?t.match(/^__metadata:$/m)?{packageManager:hn.Yarn2,reason:'"__metadata" key found in yarn.lock'}:{packageManager:hn.Yarn1,reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:U.existsSync(x.join(r,"package-lock.json"))?{packageManager:hn.Npm,reason:`foundnpm's "package-lock.json" lockfile`}:U.existsSync(x.join(r,"pnpm-lock.yaml"))?{packageManager:hn.Pnpm,reason:`found pnpm's"pnpm-lock.yaml"lockfile`}:null}async function qd({project:r,locator:e,binFolder:t,lifecycleScript:i}){var l,c;let n={};for(let[u,g]of Object.entries(process.env))typeof g!="undefined"&&(n[u.toLowerCase()!=="path"?u:"PATH"]=g);let s=H.fromPortablePath(t);n.BERRY_BIN_FOLDER=H.fromPortablePath(s);let o=process.env.COREPACK_ROOT?H.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([lA(t,"node",process.execPath),...Kr!==null?[lA(t,"run",process.execPath,[o,"run"]),lA(t,"yarn",process.execPath,[o]),lA(t,"yarnpkg",process.execPath,[o]),lA(t,"node-gyp",process.execPath,[o,"run","--top-level","node-gyp"])]:[]]),r&&(n.INIT_CWD=H.fromPortablePath(r.configuration.startingCwd),n.PROJECT_CWD=H.fromPortablePath(r.cwd)),n.PATH=n.PATH?`${s}${H.delimiter}${n.PATH}`:`${s}`,n.npm_execpath=`${s}${H.sep}yarn`,n.npm_node_execpath=`${s}${H.sep}node`,e){if(!r)throw new Error("Assertion failed: Missing project");let u=r.tryWorkspaceByLocator(e),g=u?(l=u.manifest.version)!=null?l:"":(c=r.storedPackages.get(e.locatorHash).version)!=null?c:"";n.npm_package_name=Ot(e),n.npm_package_version=g;let f;if(u)f=u.cwd;else{let h=r.storedPackages.get(e.locatorHash);if(!h)throw new Error(`Packagefor${It(r.configuration,e)}notfoundintheproject`);let p=r.configuration.getLinkers(),m={project:r,report:new Je({stdout:new Il.PassThrough,configuration:r.configuration})},y=p.find(b=>b.supportsPackage(h,m));if(!y)throw new Error(`Thepackage${It(r.configuration,h)}isn'tsupportedbyanyoftheavailablelinkers`);f=await y.findPackageLocation(h,m)}n.npm_package_json=H.fromPortablePath(x.join(f,xt.manifest))}let a=Kr!==null?`yarn/${Kr}`:`yarn/${Mg("@yarnpkg/core").version}-core`;return n.npm_config_user_agent=`${a}npm/?node/${process.version}${process.platform}${process.arch}`,i&&(n.npm_lifecycle_event=i),r&&await r.configuration.triggerHook(u=>u.setupScriptEnvironment,r,n,async(u,g,f)=>await lA(t,Jr(u),g,f)),n}var YDe=2,qDe=(0,j9.default)(YDe);async function JDe(r,e,{configuration:t,report:i,workspace:n=null,locator:s=null}){await qDe(async()=>{await U.mktempPromise(async o=>{let a=x.join(o,"pack.log"),l=null,{stdout:c,stderr:u}=t.getSubprocessStreams(a,{prefix:H.fromPortablePath(r),report:i}),g=s&&ta(s)?fd(s):s,f=g?Fs(g):"an external project";c.write(`Packing${f}fromsources
`);let ne=await ia("yarn",[...T,"pack","--filename",H.fromPortablePath(e)],{cwd:r,env:y,stdin:l,stdout:c,stderr:u});return ne.code!==0?ne.code:0}],[hn.Yarn2,async()=>{let T=n!==null?["workspace",n]:[];y.YARN_ENABLE_INLINE_BUILDS="1";let Y=x.join(r,xt.lockfile);await U.existsPromise(Y)||await U.writeFilePromise(Y,"");let q=await ia("yarn",[...T,"pack","--install-if-needed","--filename",H.fromPortablePath(e)],{cwd:r,env:y,stdin:l,stdout:c,stderr:u});return q.code!==0?q.code:0}],[hn.Npm,async()=>{if(n!==null){let A=new Il.PassThrough,oe=Og(A);A.pipe(c,{end:!1});let ce=await ia("npm",["--version"],{cwd:r,env:y,stdin:l,stdout:A,stderr:u,end:ss.Never});if(A.end(),ce.code!==0)return c.end(),u.end(),ce.code;let Z=(await oe).toString().trim();if(!Jc(Z,">=7.x")){let O=ea(null,"npm"),L=rr(O,Z),de=rr(O,">=7.x");throw new Error(`Workspacesaren't supported by ${sr(t,L)}; please upgrade to ${sr(t,de)} (npm has been detected as the primary package manager for ${tt(t,r,Ye.PATH)})`)}}let T=n!==null?["--workspace",n]:[];delete y.npm_config_user_agent,delete y.npm_config_production,delete y.NPM_CONFIG_PRODUCTION,delete y.NODE_ENV;let Y=await ia("npm",["install"],{cwd:r,env:y,stdin:l,stdout:c,stderr:u,end:ss.ErrorCode});if(Y.code!==0)return Y.code;let q=new Il.PassThrough,$=Og(q);q.pipe(c);let z=await ia("npm",["pack","--silent",...T],{cwd:r,env:y,stdin:l,stdout:q,stderr:u});if(z.code!==0)return z.code;let ne=(await $).toString().trim().replace(/^.*\n/s,""),ee=x.resolve(r,H.toPortablePath(ne));return await U.renamePromise(ee,e),0}]]).get(p);if(typeof v=="undefined")throw new Error("Assertion failed: Unsupported workflow");let k=await v();if(!(k===0||typeof k=="undefined"))throw U.detachTemp(o),new ct(X.PACKAGE_PREPARATION_FAILED,`Packing the package failed (exit code ${k}, logs can be found here: ${tt(t,a,Ye.PATH)})`)})})})}async function WDe(r,e,{project:t}){let i=t.tryWorkspaceByLocator(r);if(i!==null)return rD(i,e);let n=t.storedPackages.get(r.locatorHash);if(!n)throw new Error(`Package for ${It(t.configuration,r)} not found in the project`);return await ys.openPromise(async s=>{let o=t.configuration,a=t.configuration.getLinkers(),l={project:t,report:new Je({stdout:new Il.PassThrough,configuration:o})},c=a.find(h=>h.supportsPackage(n,l));if(!c)throw new Error(`The package ${It(t.configuration,n)} isn'tsupportedbyanyoftheavailablelinkers`);let u=await c.findPackageLocation(n,l),g=new _t(u,{baseFs:s});return(await At.find(Me.dot,{baseFs:g})).scripts.has(e)},{libzip:await fn()})}async function sB(r,e,t,{cwd:i,project:n,stdin:s,stdout:o,stderr:a}){return await U.mktempPromise(async l=>{let{manifest:c,env:u,cwd:g}=await Y9(r,{project:n,binFolder:l,cwd:i,lifecycleScript:e}),f=c.scripts.get(e);if(typeof f=="undefined")return 1;let h=async()=>await Zw(f,t,{cwd:g,env:u,stdin:s,stdout:o,stderr:a});return await(await n.configuration.reduceHook(m=>m.wrapScriptExecution,h,n,r,e,{script:f,args:t,cwd:g,env:u,stdin:s,stdout:o,stderr:a}))()})}async function iD(r,e,t,{cwd:i,project:n,stdin:s,stdout:o,stderr:a}){return await U.mktempPromise(async l=>{let{env:c,cwd:u}=await Y9(r,{project:n,binFolder:l,cwd:i});return await Zw(e,t,{cwd:u,env:c,stdin:s,stdout:o,stderr:a})})}async function zDe(r,{binFolder:e,cwd:t,lifecycleScript:i}){let n=await qd({project:r.project,locator:r.anchoredLocator,binFolder:e,lifecycleScript:i});return await Promise.all(Array.from(await q9(r),([s,[,o]])=>lA(e,Jr(s),process.execPath,[o]))),typeof t=="undefined"&&(t=x.dirname(await U.realpathPromise(x.join(r.cwd,"package.json")))),{manifest:r.manifest,binFolder:e,env:n,cwd:t}}async function Y9(r,{project:e,binFolder:t,cwd:i,lifecycleScript:n}){let s=e.tryWorkspaceByLocator(r);if(s!==null)return zDe(s,{binFolder:t,cwd:i,lifecycleScript:n});let o=e.storedPackages.get(r.locatorHash);if(!o)throw new Error(`Packagefor${It(e.configuration,r)}notfoundintheproject`);return await ys.openPromise(async a=>{let l=e.configuration,c=e.configuration.getLinkers(),u={project:e,report:new Je({stdout:new Il.PassThrough,configuration:l})},g=c.find(y=>y.supportsPackage(o,u));if(!g)throw new
`,{stdout:c,stderr:u}=n.getSubprocessStreams(a,{report:i,prefix:It(n,r.anchoredLocator),header:l});i.reportInfo(X.LIFECYCLE_SCRIPT,`Callingthe"${e}"lifecyclescript`);let g=await J9(r,e,[],{cwd:t,stdin:s,stdout:c,stderr:u});if(c.end(),u.end(),g!==0)throw U.detachTemp(o),new ct(X.LIFECYCLE_SCRIPT,`${(0,H9.default)(e)}scriptfailed(exitcode${tt(n,g,Ye.NUMBER)},logscanbefoundhere:${tt(n,a,Ye.PATH)});run${tt(n,`yarn ${e}`,Ye.CODE)}toinvestigate`)})}async function _De(r,e,t){rD(r,e)&&await W9(r,e,t)}async function oB(r,{project:e}){let t=e.configuration,i=new Map,n=e.storedPackages.get(r.locatorHash);if(!n)throw new Error(`Packagefor${It(t,r)}notfoundintheproject`);let s=new Il.Writable,o=t.getLinkers(),a={project:e,report:new Je({configuration:t,stdout:s})},l=new Set([r.locatorHash]);for(let u of n.dependencies.values()){let g=e.storedResolutions.get(u.descriptorHash);if(!g)throw new Error(`Assertionfailed:Theresolution(${sr(t,u)})shouldhavebeenregistered`);l.add(g)}let c=await Promise.all(Array.from(l,async u=>{let g=e.storedPackages.get(u);if(!g)throw new Error(`Assertionfailed:Thepackage(${u})shouldhavebeenregistered`);if(g.bin.size===0)return Vo.skip;let f=o.find(p=>p.supportsPackage(g,a));if(!f)return Vo.skip;let h=null;try{h=await f.findPackageLocation(g,a)}catch(p){if(p.code==="LOCATOR_NOT_INSTALLED")return Vo.skip;throw p}return{dependency:g,packageLocation:h}}));for(let u of c){if(u===Vo.skip)continue;let{dependency:g,packageLocation:f}=u;for(let[h,p]of g.bin)i.set(h,[g,H.fromPortablePath(x.resolve(f,p))])}return i}async function q9(r){return await oB(r.anchoredLocator,{project:r.project})}async function z9(r,e,t,{cwd:i,project:n,stdin:s,stdout:o,stderr:a,nodeArgs:l=[],packageAccessibleBinaries:c}){c!=null||(c=await oB(r,{project:n}));let u=c.get(e);if(!u)throw new Error(`Binarynotfound(${e})for${It(n.configuration,r)}`);return await U.mktempPromise(async g=>{let[,f]=u,h=await qd({project:n,locator:r,binFolder:g});await Promise.all(Array.from(c,([m,[,y]])=>lA(h.BERRY_BIN_FOLDER,Jr(m),process.execPath,[y])));let p;try{p=await ia(process.execPath,[...l,f,...t],{cwd:i,env:h,stdin:s,stdout:o,stderr:a})}finally{await U.removePromise(h.BERRY_BIN_FOLDER)}return p.code})}async function VDe(r,e,t,{cwd:i,stdin:n,stdout:s,stderr:o,packageAccessibleBinaries:a}){return await z9(r.anchoredLocator,e,t,{project:r.project,cwd:i,stdin:n,stdout:s,stderr:o,packageAccessibleBinaries:a})}var Bi={};ft(Bi,{convertToZip:()=>oNe,extractArchiveTo:()=>ANe,makeArchiveFromDirectory:()=>sNe});var K6=ge(require("stream")),H6=ge(N6());var L6=ge(require("os")),T6=ge(fg()),O6=ge(require("worker_threads")),Rl=Symbol("kTaskInfo"),dR=class{constructor(e){this.source=e;this.workers=[];this.limit=(0,T6.default)(Math.max(1,(0,L6.cpus)().length));this.cleanupInterval=setInterval(()=>{if(this.limit.pendingCount===0&&this.limit.activeCount===0){let t=this.workers.pop();t?t.terminate():clearInterval(this.cleanupInterval)}},5e3).unref()}createWorker(){this.cleanupInterval.refresh();let e=new O6.Worker(this.source,{eval:!0,execArgv:[...process.execArgv,"--unhandled-rejections=strict"]});return e.on("message",t=>{if(!e[Rl])throw new Error("Assertion failed: Worker sent a result without having a task assigned");e[Rl].resolve(t),e[Rl]=null,e.unref(),this.workers.push(e)}),e.on("error",t=>{var i;(i=e[Rl])==null||i.reject(t),e[Rl]=null}),e.on("exit",t=>{var i;t!==0&&((i=e[Rl])==null||i.reject(new Error(`Workerexitedwithcode${t}`))),e[Rl]=null}),e}run(e){return this.limit(()=>{var i;let t=(i=this.workers.pop())!=null?i:this.createWorker();return t.ref(),new Promise((n,s)=>{t[Rl]={resolve:n,reject:s},t.postMessage(e)})})}};var j6=ge(U6());async function sNe(r,{baseFs:e=new ar,prefixPath:t=Me.root,compressionLevel:i,inMemory:n=!1}={}){let s=await fn(),o;if(n)o=new li(null,{libzip:s,level:i});else{let l=await U.mktempPromise(),c=x.join(l,"archive.zip");o=new li(c,{create:!0,libzip:s,level:i})}let a=x.resolve(Me.root,t);return await o.copyPromise(a,r,{baseFs:e,stableTime:!0,stableSort:!0}),o}var G6;async function oNe(r,e){
$2`).replace(/^│\n/,"");if(n>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");t.write(s)}var V6=ge(require("crypto")),ER=ge(require("fs"));var cNe=8,Nt=class{constructor(e,{configuration:t,immutable:i=t.get("enableImmutableCache"),check:n=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.cacheId=`-${(0,V6.randomBytes)(8).toString("hex")}.tmp`;this.configuration=t,this.cwd=e,this.immutable=i,this.check=n;let s=t.get("cacheKeyOverride");if(s!==null)this.cacheKey=`${s}`;else{let o=t.get("compressionLevel"),a=o!==cc?`c${o}`:"";this.cacheKey=[cNe,a].join("")}}static async find(e,{immutable:t,check:i}={}){let n=new Nt(e.get("cacheFolder"),{configuration:e,immutable:t,check:i});return await n.setup(),n}get mirrorCwd(){if(!this.configuration.get("enableMirror"))return null;let e=`${this.configuration.get("globalFolder")}/cache`;return e!==this.cwd?e:null}getVersionFilename(e){return`${Wg(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,t){let n=uNe(t).slice(0,10);return`${Wg(e)}-${n}.zip`}getLocatorPath(e,t,i={}){var s;return this.mirrorCwd===null||((s=i.unstablePackages)==null?void 0:s.has(e.locatorHash))?x.resolve(this.cwd,this.getVersionFilename(e)):t===null||IR(t)!==this.cacheKey?null:x.resolve(this.cwd,this.getChecksumFilename(e,t))}getLocatorMirrorPath(e){let t=this.mirrorCwd;return t!==null?x.resolve(t,this.getVersionFilename(e)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await U.existsPromise(this.cwd))throw new ct(X.IMMUTABLE_CACHE,"Cache path does not exist.")}else{await U.mkdirPromise(this.cwd,{recursive:!0});let e=x.resolve(this.cwd,".gitignore");await U.changeFilePromise(e,`/.gitignore
`);if(k.lines=T,k.added||k.removed){var Y;if(!u){var q=a[v-1];u=h,g=p,q&&(f=o.context>0?l(q.lines.slice(-o.context)):[],u-=f.length,g-=f.length)}(Y=f).push.apply(Y,wR(T.map(function(Z){return(k.added?"+":"-")+Z}))),k.added?p+=T.length:h+=T.length}else{if(u)if(T.length<=o.context*2&&v<a.length-2){var $;($=f).push.apply($,wR(l(T)))}else{var z,ne=Math.min(T.length,o.context);(z=f).push.apply(z,wR(l(T.slice(0,ne))));var ee={oldStart:u,oldLines:h-u+ne,newStart:g,newLines:p-g+ne,lines:f};if(v>=a.length-2&&T.length<=o.context){var A=/\n$/.test(t),oe=/\n$/.test(i),ce=T.length==0&&f.length>ee.oldLines;!A&&ce&&t.length>0&&f.splice(ee.oldLines,0,"\\ No newline at end of file"),(!A&&!ce||!oe)&&f.push("\\ No newline at end of file")}c.push(ee),u=0,g=0,f=[]}h+=T.length,p+=T.length}},y=0;y<a.length;y++)m(y);return{oldFileName:r,newFileName:e,oldHeader:n,newHeader:s,hunks:c}}var s0=ge(oZ()),AZ=ge(fg()),lZ=ge(ri()),MR=ge(require("util")),UR=ge(require("v8")),KR=ge(require("zlib"));var _Oe=[[/^(git(?:\+(?:https|ssh))?:\/\/.*(?:\.git)?)#(.*)$/,(r,e,t,i)=>`${t}#commit=${i}`],[/^https:\/\/((?:[^/]+?)@)?codeload\.github\.com\/([^/]+\/[^/]+)\/tar\.gz\/([0-9a-f]+)$/,(r,e,t="",i,n)=>`https://${t}github.com/${i}.git#commit=${n}`],[/^https:\/\/((?:[^/]+?)@)?github\.com\/([^/]+\/[^/]+?)(?:\.git)?#([0-9a-f]+)$/,(r,e,t="",i,n)=>`https://${t}github.com/${i}.git#commit=${n}`],[/^https?:\/\/[^/]+\/(?:[^/]+\/)*(?:@.+(?:\/|(?:%2f)))?([^/]+)\/(?:-|download)\/\1-[^/]+\.tgz(?:#|$)/,r=>`npm:${r}`],[/^https:\/\/npm\.pkg\.github\.com\/download\/(?:@[^/]+)\/(?:[^/]+)\/(?:[^/]+)\/(?:[0-9a-f]+)(?:#|$)/,r=>`npm:${r}`],[/^https:\/\/npm\.fontawesome\.com\/(?:@[^/]+)\/([^/]+)\/-\/([^/]+)\/\1-\2.tgz(?:#|$)/,r=>`npm:${r}`],[/^https?:\/\/[^/]+\/.*\/(@[^/]+)\/([^/]+)\/-\/\1\/\2-(?:[.\d\w-]+)\.tgz(?:#|$)/,(r,e)=>uw({protocol:"npm:",source:null,selector:r,params:{__archiveUrl:e}})],[/^[^/]+\.tgz#[0-9a-f]+$/,r=>`npm:${r}`]],LR=class{constructor(e){this.resolver=e;this.resolutions=null}async setup(e,{report:t}){let i=x.join(e.cwd,e.configuration.get("lockfileFilename"));if(!U.existsSync(i))return;let n=await U.readFilePromise(i,"utf8"),s=Si(n);if(Object.prototype.hasOwnProperty.call(s,"__metadata"))return;let o=this.resolutions=new Map;for(let a of Object.keys(s)){let l=dd(a);if(!l){t.reportWarning(X.YARN_IMPORT_FAILED,`Failed to parse the string "${a}" into a proper descriptor`);continue}mo(l.range)&&(l=rr(l,`npm:${l.range}`));let{version:c,resolved:u}=s[a];if(!u)continue;let g;for(let[h,p]of _Oe){let m=u.match(h);if(m){g=p(c,...m);break}}if(!g){t.reportWarning(X.YARN_IMPORT_FAILED,`${sr(e.configuration,l)}: Only some patterns can be imported from legacy lockfiles (not "${u}")`);continue}let f=l;try{let h=Jg(l.range),p=dd(h.selector,!0);p&&(f=p)}catch{}o.set(l.descriptorHash,cn(f,g))}}supportsDescriptor(e,t){return this.resolutions?this.resolutions.has(e.descriptorHash):!1}supportsLocator(e,t){return!1}shouldPersistResolution(e,t){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){if(!this.resolutions)throw new Error("Assertion failed: The resolution store should have been setup");let n=this.resolutions.get(e.descriptorHash);if(!n)throw new Error("Assertion failed: The resolution should have been registered");return await this.resolver.getCandidates(Vk(n),t,i)}async getSatisfying(e,t,i){return null}async resolve(e,t){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}};var TR=class{constructor(e){this.resolver=e}supportsDescriptor(e,t){return!!(t.project.storedResolutions.get(e.descriptorHash)||t.project.originalPackages.has(lw(e).locatorHash))}supportsLocator(e,t){return!!(t.project.originalPackages.has(e.locatorHash)&&!t.project.lockfileNeedsRefresh)}shouldPersistResolution(e,t){throw new Error("The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes")}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){return this.reso
`;await U.changeFilePromise(t,i,{automaticNewlines:!0}),this.manifest.raw=e}};var cZ=6,VOe=1,XOe=/ *, */g,uZ=/\/$/,ZOe=32,$Oe=(0,MR.promisify)(KR.default.gzip),eMe=(0,MR.promisify)(KR.default.gunzip),Ci;(function(t){t.UpdateLockfile="update-lockfile",t.SkipBuild="skip-build"})(Ci||(Ci={}));var HR={restoreInstallersCustomData:["installersCustomData"],restoreResolutions:["accessibleLocators","conditionalLocators","disabledLocators","optionalBuilds","storedDescriptors","storedResolutions","storedPackages","lockFileChecksum"],restoreBuildState:["storedBuildState"]},gZ=r=>ln(`${VOe}`,r),ze=class{constructor(e,{configuration:t}){this.resolutionAliases=new Map;this.workspaces=[];this.workspacesByCwd=new Map;this.workspacesByIdent=new Map;this.storedResolutions=new Map;this.storedDescriptors=new Map;this.storedPackages=new Map;this.storedChecksums=new Map;this.storedBuildState=new Map;this.accessibleLocators=new Set;this.conditionalLocators=new Set;this.disabledLocators=new Set;this.originalPackages=new Map;this.optionalBuilds=new Set;this.lockfileNeedsRefresh=!1;this.peerRequirements=new Map;this.installersCustomData=new Map;this.lockFileChecksum=null;this.installStateChecksum=null;this.configuration=t,this.cwd=e}static async find(e,t){var p,m,y;if(!e.projectCwd)throw new Pe(`Noprojectfoundin${t}`);let i=e.projectCwd,n=t,s=null;for(;s!==e.projectCwd;){if(s=n,U.existsSync(x.join(s,xt.manifest))){i=s;break}n=x.dirname(s)}let o=new ze(e.projectCwd,{configuration:e});(p=ye.telemetry)==null||p.reportProject(o.cwd),await o.setupResolutions(),await o.setupWorkspaces(),(m=ye.telemetry)==null||m.reportWorkspaceCount(o.workspaces.length),(y=ye.telemetry)==null||y.reportDependencyCount(o.workspaces.reduce((b,v)=>b+v.manifest.dependencies.size+v.manifest.devDependencies.size,0));let a=o.tryWorkspaceByCwd(i);if(a)return{project:o,workspace:a,locator:a.anchoredLocator};let l=await o.findLocatorForLocation(`${i}/`,{strict:!0});if(l)return{project:o,locator:l,workspace:null};let c=tt(e,o.cwd,Ye.PATH),u=tt(e,x.relative(o.cwd,i),Ye.PATH),g=`-If${c}isn't intended to be a project, remove any yarn.lock and/or package.json file there.`,f=`- If ${c} is intended to be a project, it might be that you forgot to list ${u} in its workspace configuration.`,h=`- Finally, if ${c} is fine and you intend ${u} to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in it.`;throw new Pe(`The nearest package directory (${tt(e,i,Ye.PATH)}) doesn'tseemtobepartoftheprojectdeclaredin${tt(e,o.cwd,Ye.PATH)}.
`)}`)}asyncsetupResolutions(){vari;this.storedResolutions=newMap,this.storedDescriptors=newMap,this.storedPackages=newMap,this.lockFileChecksum=null;lete=x.join(this.cwd,this.configuration.get("lockfileFilename")),t=this.configuration.get("defaultLanguageName");if(U.existsSync(e)){letn=awaitU.readFilePromise(e,"utf8");this.lockFileChecksum=gZ(n);lets=Si(n);if(s.__metadata){leto=s.__metadata.version,a=s.__metadata.cacheKey;this.lockfileNeedsRefresh=o<cZ;for(letlofObject.keys(s)){if(l==="__metadata")continue;letc=s[l];if(typeofc.resolution=="undefined")thrownewError(`Assertion failed: Expected the lockfile entry to have a resolution field (${l})`);letu=qc(c.resolution,!0),g=newAt;g.load(c,{yamlCompatibilityMode:!0});letf=g.version,h=g.languageName||t,p=c.linkType.toUpperCase(),m=(i=c.conditions)!=null?i:null,y=g.dependencies,b=g.peerDependencies,v=g.dependenciesMeta,k=g.peerDependenciesMeta,T=g.bin;if(c.checksum!=null){letq=typeofa!="undefined"&&!c.checksum.includes("/")?`${a}/${c.checksum}`:c.checksum;this.storedChecksums.set(u.locatorHash,q)}letY=te(N({},u),{version:f,languageName:h,linkType:p,conditions:m,dependencies:y,peerDependencies:b,dependenciesMeta:v,peerDependenciesMeta:k,bin:T});this.originalPackages.set(Y.locatorHash,Y);for(letqofl.split(XOe)){let$=cl(q);this.storedDescriptors.set($.descriptorHash,$),this.storedResolutions.set($.descriptorHash,u.locatorHash)}}}}}asyncsetupWorkspaces(){this.workspaces=[],this.workspacesByCwd=newMap,this.workspacesByIdent=newMap;lete=[this.cwd];for(;e.length>0;){lett=e;e=[];for(letioft){if(this.workspacesByCwd.has(i))continue;letn=awaitthis.addWorkspace(i),s=this.storedPackages.get(n.anchoredLocator.locatorHash);s&&(n.dependencies=s.dependencies);for(letoofn.workspacesCwds)e.push(o)}}}asyncaddWorkspace(e){lett=newmC(e,{project:this});awaitt.setup();leti=this.workspacesByIdent.get(t.locator.identHash);if(typeofi!="undefined")thrownewError(`Duplicate workspace name ${fi(this.configuration,t.locator)}: ${H.fromPortablePath(e)} conflicts with ${H.fromPortablePath(i.cwd)}`);returnthis.workspaces.push(t),this.workspacesByCwd.set(e,t),this.workspacesByIdent.set(t.locator.identHash,t),t}gettopLevelWorkspace(){returnthis.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(e){x.isAbsolute(e)||(e=x.resolve(this.cwd,e)),e=x.normalize(e).replace(/\/+$/,"");lett=this.workspacesByCwd.get(e);returnt||null}getWorkspaceByCwd(e){lett=this.tryWorkspaceByCwd(e);if(!t)thrownewError(`Workspace not found (${e})`);returnt}tryWorkspaceByFilePath(e){lett=null;for(letiofthis.workspaces)x.relative(i.cwd,e).startsWith("../")||t&&t.cwd.length>=i.cwd.length||(t=i);returnt||null}getWorkspaceByFilePath(e){lett=this.tryWorkspaceByFilePath(e);if(!t)thrownewError(`Workspace not found (${e})`);returnt}tryWorkspaceByIdent(e){lett=this.workspacesByIdent.get(e.identHash);returntypeoft=="undefined"?null:t}getWorkspaceByIdent(e){lett=this.tryWorkspaceByIdent(e);if(!t)thrownewError(`Workspace not found (${fi(this.configuration,e)})`);returnt}tryWorkspaceByDescriptor(e){lett=this.tryWorkspaceByIdent(e);returnt===null||(ll(e)&&(e=gd(e)),!t.accepts(e.range))?null:t}getWorkspaceByDescriptor(e){lett=this.tryWorkspaceByDescriptor(e);if(t===null)thrownewError(`Workspace not found (${sr(this.configuration,e)})`);returnt}tryWorkspaceByLocator(e){lett=this.tryWorkspaceByIdent(e);returnt===null||(ta(e)&&(e=fd(e)),t.locator.locatorHash!==e.locatorHash&&t.anchoredLocator.locatorHash!==e.locatorHash)?null:t}getWorkspaceByLocator(e){lett=this.tryWorkspaceByLocator(e);if(!t)thrownewError(`Workspace not found (${It(this.configuration,e)})`);returnt}refreshWorkspaceDependencies(){for(leteofthis.workspaces){lett=this.storedPackages.get(e.anchoredLocator.locatorHash);if(!t)thrownewError(`Assertion failed: Expected workspace ${md(this.configuration,e)} (${tt(this.configuration,x.join(e.cwd,xt.manifest),Ye.PATH)}) to have been resolved. Run "yarn install" to update the lockfile`);e.dependencies=newMap(t.dependencies)}}forgetResolution(e){lett=n=>{this.store
`;break}let Ue=null;if(!await U.mktempPromise(async ve=>{let pe=x.join(ve,"build.log"),{stdout:V,stderr:Qe}=this.configuration.getSubprocessStreams(pe,{header:Fe,prefix:It(this.configuration,de),report:t}),le;try{switch(be){case cs.SCRIPT:le=await sB(de,he,[],{cwd:se,project:this,stdin:Ue,stdout:V,stderr:Qe});break;case cs.SHELLCODE:le=await iD(de,he,[],{cwd:se,project:this,stdin:Ue,stdout:V,stderr:Qe});break}}catch(gt){Qe.write(gt.stack),le=1}if(V.end(),Qe.end(),le===0)return ne.set(de.locatorHash,re),!0;U.detachTemp(ve);let fe=`${It(this.configuration,de)}couldn't be built successfully (exit code ${tt(this.configuration,le,Ye.NUMBER)}, logs can be found here: ${tt(this.configuration,pe,Ye.PATH)})`;return this.optionalBuilds.has(de.locatorHash)?(t.reportInfo(X.BUILD_FAILED,fe),ne.set(de.locatorHash,re),!0):(t.reportError(X.BUILD_FAILED,fe),!1)}))return}})())}}if(await ho(O),Z===k.size){let L=Array.from(k).map(de=>{let Be=this.storedPackages.get(de);if(!Be)throw new Error("Assertion failed: The package should have been registered");return It(this.configuration,Be)}).join(", ");t.reportError(X.CYCLIC_DEPENDENCIES,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won'tbebuilt(affectedpackagesare:${L})`);break}}this.storedBuildState=ne}async install(e){var a,l;let t=this.configuration.get("nodeLinker");(a=ye.telemetry)==null||a.reportInstall(t),await e.report.startTimerPromise("Project validation",{skipIfEmpty:!0},async()=>{await this.configuration.triggerHook(c=>c.validateProject,this,{reportWarning:e.report.reportWarning.bind(e.report),reportError:e.report.reportError.bind(e.report)})});for(let c of this.configuration.packageExtensions.values())for(let[,u]of c)for(let g of u)g.status=qi.Inactive;let i=x.join(this.cwd,this.configuration.get("lockfileFilename")),n=null;if(e.immutable)try{n=await U.readFilePromise(i,"utf8")}catch(c){throw c.code==="ENOENT"?new ct(X.FROZEN_LOCKFILE_EXCEPTION,"The lockfile would have been created by this install, which is explicitly forbidden."):c}await e.report.startTimerPromise("Resolution step",async()=>{await this.resolveEverything(e)}),await e.report.startTimerPromise("Post-resolution validation",{skipIfEmpty:!0},async()=>{for(let[,c]of this.configuration.packageExtensions)for(let[,u]of c)for(let g of u)if(g.userProvided){let f=tt(this.configuration,g,Ye.PACKAGE_EXTENSION);switch(g.status){case qi.Inactive:e.report.reportWarning(X.UNUSED_PACKAGE_EXTENSION,`${f}:Nomatchingpackageinthedependencytree;youmaynotneedthisruleanymore.`);break;case qi.Redundant:e.report.reportWarning(X.REDUNDANT_PACKAGE_EXTENSION,`${f}:Thisruleseemsredundantwhenappliedontheoriginalpackage;theextensionmayhavebeenappliedupstream.`);break}}if(n!==null){let c=oc(n,this.generateLockfile());if(c!==n){let u=e7(i,i,n,c,void 0,void 0,{maxEditLength:100});if(u){e.report.reportSeparator();for(let g of u.hunks){e.report.reportInfo(null,`@@-${g.oldStart},${g.oldLines}+${g.newStart},${g.newLines}@@`);for(let f of g.lines)f.startsWith("+")?e.report.reportError(X.FROZEN_LOCKFILE_EXCEPTION,tt(this.configuration,f,Ye.ADDED)):f.startsWith("-")?e.report.reportError(X.FROZEN_LOCKFILE_EXCEPTION,tt(this.configuration,f,Ye.REMOVED)):e.report.reportInfo(null,tt(this.configuration,f,"grey"))}e.report.reportSeparator()}throw new ct(X.FROZEN_LOCKFILE_EXCEPTION,"The lockfile would have been modified by this install, which is explicitly forbidden.")}}});for(let c of this.configuration.packageExtensions.values())for(let[,u]of c)for(let g of u)g.userProvided&&g.status===qi.Active&&((l=ye.telemetry)==null||l.reportPackageExtension(Mc(g,Ye.PACKAGE_EXTENSION)));await e.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(e),(typeof e.persistProject=="undefined"||e.persistProject)&&e.mode!==Ci.UpdateLockfile&&await this.cacheCleanup(e)});let s=e.immutable?[...new Set(this.configuration.get("immutablePatterns"))].sort():[],o=await Promise.all(s.map(async c=>aw(c,{cwd:this.cwd})));(typeof e.persistProject=="undefined"||e.persistProject)
`+Ua(t)}async persistLockfile(){let e=x.join(this.cwd,this.configuration.get("lockfileFilename")),t="";try{t=await U.readFilePromise(e,"utf8")}catch(s){}let i=this.generateLockfile(),n=oc(t,i);n!==t&&(await U.writeFilePromise(e,n),this.lockFileChecksum=gZ(n),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let e=[];for(let o of Object.values(HR))e.push(...o);let t=(0,s0.default)(this,e),i=UR.default.serialize(t),n=ln(i);if(this.installStateChecksum===n)return;let s=this.configuration.get("installStatePath");await U.mkdirPromise(x.dirname(s),{recursive:!0}),await U.writeFilePromise(s,await $Oe(i)),this.installStateChecksum=n}async restoreInstallState({restoreInstallersCustomData:e=!0,restoreResolutions:t=!0,restoreBuildState:i=!0}={}){let n=this.configuration.get("installStatePath"),s;try{let o=await eMe(await U.readFilePromise(n));s=UR.default.deserialize(o),this.installStateChecksum=ln(o)}catch{t&&await this.applyLightResolution();return}e&&typeof s.installersCustomData!="undefined"&&(this.installersCustomData=s.installersCustomData),i&&Object.assign(this,(0,s0.default)(s,HR.restoreBuildState)),t&&(s.lockFileChecksum===this.lockFileChecksum?(Object.assign(this,(0,s0.default)(s,HR.restoreResolutions)),this.refreshWorkspaceDependencies()):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new di}),await this.persistInstallStateFile()}async persist(){await this.persistLockfile();for(let e of this.workspacesByCwd.values())await e.persistManifest()}async cacheCleanup({cache:e,report:t}){if(this.configuration.get("enableGlobalCache"))return;let i=new Set([".gitignore"]);if(!lx(e.cwd,this.cwd)||!await U.existsPromise(e.cwd))return;let n=this.configuration.get("preferAggregateCacheInfo"),s=0,o=null;for(let a of await U.readdirPromise(e.cwd)){if(i.has(a))continue;let l=x.resolve(e.cwd,a);e.markedFiles.has(l)||(o=a,e.immutable?t.reportError(X.IMMUTABLE_CACHE,`${tt(this.configuration,x.basename(l),"magenta")}appearstobeunusedandwouldbemarkedfordeletion,butthecacheisimmutable`):(n?s+=1:t.reportInfo(X.UNUSED_CACHE_ENTRY,`${tt(this.configuration,x.basename(l),"magenta")}appearstobeunused-removing`),await U.removePromise(l)))}n&&s!==0&&t.reportInfo(X.UNUSED_CACHE_ENTRY,s>1?`${s}packagesappearedtobeunusedandwereremoved`:`${o}appearedtobeunusedandwasremoved`),e.markedFiles.clear()}};function tMe({project:r,allDescriptors:e,allResolutions:t,allPackages:i,accessibleLocators:n=new Set,optionalBuilds:s=new Set,peerRequirements:o=new Map,volatileDescriptors:a=new Set,report:l,tolerateMissingPackages:c=!1}){var ne;let u=new Map,g=[],f=new Map,h=new Map,p=new Map,m=new Map,y=new Map,b=new Map(r.workspaces.map(ee=>{let A=ee.anchoredLocator.locatorHash,oe=i.get(A);if(typeof oe=="undefined"){if(c)return[A,null];throw new Error("Assertion failed: The workspace should have an associated package")}return[A,ud(oe)]})),v=()=>{let ee=U.mktempSync(),A=x.join(ee,"stacktrace.log"),oe=String(g.length+1).length,ce=g.map((Z,O)=>`${`${O+1}.`.padStart(oe," ")}${Fs(Z)}
`).join("");throw U.writeFileSync(A,ce),U.detachTemp(ee),new ct(X.STACK_OVERFLOW_RESOLUTION,`Encounteredastackoverflowwhenresolvingpeerdependencies;cf${H.fromPortablePath(A)}`)},k=ee=>{let A=t.get(ee.descriptorHash);if(typeof A=="undefined")throw new Error("Assertion failed: The resolution should have been registered");let oe=i.get(A);if(!oe)throw new Error("Assertion failed: The package could not be found");return oe},T=(ee,A,oe,{top:ce,optional:Z})=>{g.length>1e3&&v(),g.push(A);let O=Y(ee,A,oe,{top:ce,optional:Z});return g.pop(),O},Y=(ee,A,oe,{top:ce,optional:Z})=>{if(n.has(A.locatorHash))return;n.add(A.locatorHash),Z||s.delete(A.locatorHash);let O=i.get(A.locatorHash);if(!O){if(c)return;throw new Error(`Assertionfailed:Thepackage(${It(r.configuration,A)})shouldhavebeenregistered`)}let L=[],de=[],Be=[],Ge=[],re=[];for(let be of Array.from(O.dependencies.values())){if(O.peerDependencies.has(be.identHash)&&O.locatorHash!==ce)continue;if(ll(be))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");a.delete(be.descriptorHash);let he=Z;if(!he){let Qe=O.dependenciesMeta.get(Ot(be));if(typeof Qe!="undefined"){let le=Qe.get(null);typeof le!="undefined"&&le.optional&&(he=!0)}}let Fe=t.get(be.descriptorHash);if(!Fe){if(c)continue;throw new Error(`Assertionfailed:Theresolution(${sr(r.configuration,be)})shouldhavebeenregistered`)}let Ue=b.get(Fe)||i.get(Fe);if(!Ue)throw new Error(`Assertionfailed:Thepackage(${Fe},resolvedfrom${sr(r.configuration,be)})shouldhavebeenregistered`);if(Ue.peerDependencies.size===0){T(be,Ue,new Map,{top:ce,optional:he});continue}let xe,ve,pe=new Set,V;de.push(()=>{xe=Xk(be,A.locatorHash),ve=Zk(Ue,A.locatorHash),O.dependencies.delete(be.identHash),O.dependencies.set(xe.identHash,xe),t.set(xe.descriptorHash,ve.locatorHash),e.set(xe.descriptorHash,xe),i.set(ve.locatorHash,ve),L.push([Ue,xe,ve])}),Be.push(()=>{var Qe;V=new Map;for(let le of ve.peerDependencies.values()){let fe=O.dependencies.get(le.identHash);if(!fe&&hd(A,le)&&(ee.identHash===A.identHash?fe=ee:(fe=rr(A,ee.range),e.set(fe.descriptorHash,fe),t.set(fe.descriptorHash,A.locatorHash),a.delete(fe.descriptorHash))),(!fe||fe.range==="missing:")&&ve.dependencies.has(le.identHash)){ve.peerDependencies.delete(le.identHash);continue}fe||(fe=rr(le,"missing:")),ve.dependencies.set(fe.identHash,fe),ll(fe)&&Lc(p,fe.descriptorHash).add(ve.locatorHash),f.set(fe.identHash,fe),fe.range==="missing:"&&pe.add(fe.identHash),V.set(le.identHash,(Qe=oe.get(le.identHash))!=null?Qe:ve.locatorHash)}ve.dependencies=new Map(xn(ve.dependencies,([le,fe])=>Ot(fe)))}),Ge.push(()=>{if(!i.has(ve.locatorHash))return;let Qe=u.get(Ue.locatorHash);typeof Qe=="number"&&Qe>=2&&v();let le=u.get(Ue.locatorHash),fe=typeof le!="undefined"?le+1:1;u.set(Ue.locatorHash,fe),T(xe,ve,V,{top:ce,optional:he}),u.set(Ue.locatorHash,fe-1)}),re.push(()=>{let Qe=O.dependencies.get(be.identHash);if(typeof Qe=="undefined")throw new Error("Assertion failed: Expected the peer dependency to have been turned into a dependency");let le=t.get(Qe.descriptorHash);if(typeof le=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");if(Lc(y,le).add(A.locatorHash),!!i.has(ve.locatorHash)){for(let fe of ve.peerDependencies.values()){let gt=V.get(fe.identHash);if(typeof gt=="undefined")throw new Error("Assertion failed: Expected the peer dependency ident to be registered");Ng(Lg(m,gt),Ot(fe)).push(ve.locatorHash)}for(let fe of pe)ve.dependencies.delete(fe)}})}for(let be of[...de,...Be])be();let se;do{se=!0;for(let[be,he,Fe]of L){let Ue=Lg(h,be.locatorHash),xe=ln(...[...Fe.dependencies.values()].map(Qe=>{let le=Qe.range!=="missing:"?t.get(Qe.descriptorHash):"missing:";if(typeof le=="undefined")throw new Error(`Assertionfailed:Expectedtheresolutionfor${sr(r.configuration,Qe)}tohavebeenregistered`);return le===ce?`${le}(top)`:le}),he.identHash),ve=Ue.get(xe);if(typeof ve=="undefined"){Ue.set(xe,he);continue}if(ve===he)continue;i.delete(Fe.locatorHash),e.delete(he.descriptorHash),t.delete
Tryrunningthecommandagainwiththepackagenameprefixed:${ae.pretty(e,"yarn add",Ri.CODE)}${ae.pretty(e,P.makeDescriptor(P.makeIdent(null,"my-package"),`${v[0]}...`),Ri.DESCRIPTOR)}`);if(!b)throw new Pe(`The${ae.pretty(e,y,Ri.CODE)}stringdidn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);let k=PYe(i,b,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional}),T=await VC(b,{project:t,workspace:i,cache:n,target:k,modifier:o,strategies:a,maxResults:l});return[b,T,k]})),u=await dA.start({configuration:e,stdout:this.context.stdout,suggestInstall:!1},async y=>{for(let[b,{suggestions:v,rejections:k}]of c)if(v.filter(Y=>Y.descriptor!==null).length===0){let[Y]=k;if(typeof Y=="undefined")throw new Error("Assertion failed: Expected an error to have been set");t.configuration.get("enableNetwork")?y.reportError(X.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,b)} can'tberesolvedtoasatisfyingrange`):y.reportError(X.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,b)}can'tberesolvedtoasatisfyingrange(note:networkresolutionhasbeendisabled)`),y.reportSeparator(),y.reportExceptionOnce(Y)}});if(u.hasErrors())return u.exitCode();let g=!1,f=[],h=[];for(let[,{suggestions:y},b]of c){let v,k=y.filter($=>$.descriptor!==null),T=k[0].descriptor,Y=k.every($=>P.areDescriptorsEqual($.descriptor,T));k.length===1||Y?v=T:(g=!0,{answer:v}=await(0,One.prompt)({type:"select",name:"answer",message:"Which range do you want to use?",choices:y.map(({descriptor:$,name:z,reason:ne})=>$?{name:z,hint:ne,descriptor:$}:{name:z,hint:ne,disabled:!0}),onCancel:()=>process.exit(130),result($){return this.find($,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let q=i.manifest[b].get(v.identHash);(typeof q=="undefined"||q.descriptorHash!==v.descriptorHash)&&(i.manifest[b].set(v.identHash,v),this.optional&&(b==="dependencies"?i.manifest.ensureDependencyMeta(te(N({},v),{range:"unknown"})).optional=!0:b==="peerDependencies"&&(i.manifest.ensurePeerDependencyMeta(te(N({},v),{range:"unknown"})).optional=!0)),typeof q=="undefined"?f.push([i,b,v,a]):h.push([i,b,q,v]))}return await e.triggerMultipleHooks(y=>y.afterWorkspaceDependencyAddition,f),await e.triggerMultipleHooks(y=>y.afterWorkspaceDependencyReplacement,h),g&&this.context.stdout.write(`
`),(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout,includeLogs:!this.context.quiet},async y=>{await t.install({cache:n,report:y,mode:this.mode})})).exitCode()}};XC.paths=[["add"]],XC.usage=Re.Usage({description:"add dependencies to the project",details:"\n This command adds a package to the package.json for the nearest workspace.\n\n - If it didn't exist before, the package will by default be added to the regular `dependencies` field, but this behavior can be overriden thanks to the `-D,--dev` flag (which will cause the dependency to be added to the `devDependencies` field instead) and the `-P,--peer` flag (which will do the same but for `peerDependencies`).\n\n - If the package was already listed in your dependencies, it will by default be upgraded whether it's part of your `dependencies` or `devDependencies` (it won't ever update `peerDependencies`, though).\n\n - If set, the `--prefer-dev` flag will operate as a more flexible `-D,--dev` in that it will add the package to your `devDependencies` if it isn't already listed in either `dependencies` or `devDependencies`, but it will also happily upgrade your `dependencies` if that's what you already use (whereas `-D,--dev` would throw an exception).\n\n - If set, the `-O,--optional` flag will add the package to the `optionalDependencies` field and, in combination with the `-P,--peer` flag, it will add the package as an optional peer dependency. If the package was already listed in your `dependencies`, it will be upgraded to `optionalDependencies`. If the package was already listed in your `peerDependencies`, in combination with the `-P,--peer` flag, it will be upgraded to an optional peer dependency: `\"peerDependenciesMeta\": { \"<package>\": { \"optional\": true } }`\n\n - If the added package doesn't specify a range at all its `latest` tag will be resolved and the returned version will be used to generate a new semver range (using the `^` modifier by default unless otherwise configured via the `defaultSemverRangePrefix` configuration, or the `~` modifier if `-T,--tilde` is specified, or no modifier at all if `-E,--exact` is specified). Two exceptions to this rule: the first one is that if the package is a workspace then its local version will be used, and the second one is that if you use `-P,--peer` the default range will be `*` and won't be resolved at all.\n\n - If the added package specifies a range (such as `^1.0.0`, `latest`, or `rc`), Yarn will add this range as-is in the resulting package.json entry (in particular, tags such as `rc` will be encoded as-is rather than being converted into a semver range).\n\n If the `--cached` option is used, Yarn will preferably reuse the highest version already used somewhere within the project, even if through a transitive dependency.\n\n If the `-i,--interactive` option is used (or if the `preferInteractive` settings is toggled on) the command will first try to check whether other workspaces in the project use the specified package and, if so, will offer to reuse them.\n\n If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n For a compilation of all the supported protocols, please consult the dedicated page from our website: https://yarnpkg.com/features/protocols.\n ",examples:[["Add a regular package to the current workspace","$0addlo
`),0}return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async s=>{let o=await Zt.getPackageAccessibleBinaries(i,{project:t}),l=Array.from(o.keys()).reduce((c,u)=>Math.max(c,u.length),0);for(let[c,[u,g]]of o)s.reportJson({name:c,source:P.stringifyIdent(u),path:g});if(this.verbose)for(let[c,[u]]of o)s.reportInfo(null,`${c.padEnd(l," ")}${P.prettyLocator(e,u)}`);else for(let c of o.keys())s.reportInfo(null,c)})).exitCode()}};ZC.paths=[["bin"]],ZC.usage=Re.Usage({description:"get the path to a binary script",details:`
Whenusedwithoutarguments,thiscommandwillprintthelistofallthebinariesavailableinthecurrentworkspace.Addingthe\`-v,--verbose\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary.
`,examples:[["List all the available binaries","$0 bin"],["Print the path to a specific binary","$0 bin eslint"]]});var Une=ZC;var $C=class extends Le{constructor(){super(...arguments);this.mirror=J.Boolean("--mirror",!1,{description:"Remove the global cache files instead of the local cache files"});this.all=J.Boolean("--all",!1,{description:"Remove both the global cache files and the local cache files of the current project"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=await Nt.find(e);return(await Je.start({configuration:e,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&t.mirrorCwd!==null,s=!this.mirror;n&&(await U.removePromise(t.mirrorCwd),await e.triggerHook(o=>o.cleanGlobalArtifacts,e)),s&&await U.removePromise(t.cwd)})).exitCode()}};$C.paths=[["cache","clean"],["cache","clear"]],$C.usage=Re.Usage({description:"remove the shared cache files",details:`
`,examples:[["Remove all the local archives","$0 cache clean"],["Remove all the archives stored in the ~/.yarn directory","$0 cache clean --mirror"]]});var Kne=$C;var Hne=ge(m0()),hN=ge(require("util")),em=class extends Le{constructor(){super(...arguments);this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.unsafe=J.Boolean("--no-redacted",!1,{description:"Don't redact secrets (such as tokens) from the output"});this.name=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=this.name.replace(/[.[].*$/,""),i=this.name.replace(/^[^.[]*/,"");if(typeof e.settings.get(t)=="undefined")throw new Pe(`Couldn'tfindaconfigurationsettingsnamed"${t}"`);let s=e.getSpecial(t,{hideSecrets:!this.unsafe,getNativePaths:!0}),o=Se.convertMapsToIndexableObjects(s),a=i?(0,Hne.default)(o,i):o,l=await Je.start({configuration:e,includeFooter:!1,json:this.json,stdout:this.context.stdout},async c=>{c.reportJson(a)});if(!this.json){if(typeof a=="string")return this.context.stdout.write(`${a}
`,examples:[["Print a simple configuration setting","yarn config get yarnPath"],["Print a complex configuration setting","yarn config get packageExtensions"],["Print a nested field from the configuration",`yarnconfigget'npmScopes["my-company"].npmRegistryServer'`],["Print a token from the configuration","yarn config get npmAuthToken --no-redacted"],["Print a configuration setting as JSON","yarn config get packageExtensions --json"]]});var jne=em;var eoe=ge(IN()),toe=ge(m0()),roe=ge($se()),yN=ge(require("util")),rm=class extends Le{constructor(){super(...arguments);this.json=J.Boolean("--json",!1,{description:"Set complex configuration settings to JSON values"});this.home=J.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=J.String();this.value=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=()=>{if(!e.projectCwd)throw new Pe("This command must be run from within a project folder");return e.projectCwd},i=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof e.settings.get(i)=="undefined")throw new Pe(`Couldn't find a configuration settings named "${i}"`);if(i==="enableStrictSettings")throw new Pe("This setting only affects the file it'sin,andthuscannotbesetfromtheCLI");let o=this.json?JSON.parse(this.value):this.value;await(this.home?h=>ye.updateHomeConfiguration(h):h=>ye.updateConfiguration(t(),h))(h=>{if(n){let p=(0,eoe.default)(h);return(0,roe.default)(p,this.name,o),p}else return te(N({},h),{[i]:o})});let c=(await ye.find(this.context.cwd,this.context.plugins)).getSpecial(i,{hideSecrets:!0,getNativePaths:!0}),u=Se.convertMapsToIndexableObjects(c),g=n?(0,toe.default)(u,n):u;return(await Je.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async h=>{yN.inspect.styles.name="cyan",h.reportInfo(X.UNNAMED,`Successfully set ${this.name} to ${(0,yN.inspect)(g,{depth:Infinity,colors:e.get("enableColors"),compact:!1})}`)})).exitCode()}};rm.paths=[["config","set"]],rm.usage=Re.Usage({description:"changeaconfigurationsettings",details:`
`,examples:[["Set a simple configuration setting (a string, a number, or a boolean)","yarn config set initScope myScope"],["Set a simple configuration setting (a string, a number, or a boolean) using the `--json` flag",'yarn config set initScope --json \\"myScope\\"'],["Set a complex configuration setting (an Array) using the `--json` flag",`yarnconfigsetunsafeHttpWhitelist--json'["*.example.com", "example.com"]'`],["Set a complex configuration setting (an Object) using the `--json` flag",`yarnconfigsetpackageExtensions--json'{ "@babel/parser@*": { "dependencies": { "@babel/types": "*" } } }'`],["Set a nested configuration setting",'yarn config set npmScopes.company.npmRegistryServer "https://npm.example.com"'],["Set a nested configuration setting using indexed access for non-simple keys",`yarnconfigset'npmRegistries["//npm.example.com"].npmAuthToken'"ffffffff-ffff-ffff-ffff-ffffffffffff"`]]});var ioe=rm;var goe=ge(IN()),foe=ge(wC()),hoe=ge(uoe()),im=class extends Le{constructor(){super(...arguments);this.home=J.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=()=>{if(!e.projectCwd)throw new Pe("This command must be run from within a project folder");return e.projectCwd},i=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof e.settings.get(i)=="undefined")throw new Pe(`Couldn't find a configuration settings named "${i}"`);let o=this.home?l=>ye.updateHomeConfiguration(l):l=>ye.updateConfiguration(t(),l);return(await Je.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async l=>{let c=!1;await o(u=>{if(!(0,foe.default)(u,this.name))return l.reportWarning(X.UNNAMED,`Configuration doesn'tcontainsetting${this.name};thereisnothingtounset`),c=!0,u;let g=n?(0,goe.default)(u):N({},u);return(0,hoe.default)(g,this.name),g}),c||l.reportInfo(X.UNNAMED,`Successfullyunset${this.name}`)})).exitCode()}};im.paths=[["config","unset"]],im.usage=Re.Usage({description:"unset a configuration setting",details:`
`,examples:[["Unset a simple configuration setting","yarn config unset initScope"],["Unset a complex configuration setting","yarn config unset packageExtensions"],["Unset a nested configuration setting","yarn config unset npmScopes.company.npmRegistryServer"]]});var poe=im;var wN=ge(require("util")),nm=class extends Le{constructor(){super(...arguments);this.verbose=J.Boolean("-v,--verbose",!1,{description:"Print the setting description on top of the regular key/value information"});this.why=J.Boolean("--why",!1,{description:"Print the reason why a setting is set a particular way"});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins,{strict:!1});return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{if(e.invalid.size>0&&!this.json){for(let[n,s]of e.invalid)i.reportError(X.INVALID_CONFIGURATION_KEY,`Invalidconfigurationkey"${n}"in${s}`);i.reportSeparator()}if(this.json){let n=Se.sortMap(e.settings.keys(),s=>s);for(let s of n){let o=e.settings.get(s),a=e.getSpecial(s,{hideSecrets:!0,getNativePaths:!0}),l=e.sources.get(s);this.verbose?i.reportJson({key:s,effective:a,source:l}):i.reportJson(N({key:s,effective:a,source:l},o))}}else{let n=Se.sortMap(e.settings.keys(),a=>a),s=n.reduce((a,l)=>Math.max(a,l.length),0),o={breakLength:Infinity,colors:e.get("enableColors"),maxArrayLength:2};if(this.why||this.verbose){let a=n.map(c=>{let u=e.settings.get(c);if(!u)throw new Error(`Assertionfailed:Thissettings("${c}")shouldhavebeenregistered`);let g=this.why?e.sources.get(c)||"<default>":u.description;return[c,g]}),l=a.reduce((c,[,u])=>Math.max(c,u.length),0);for(let[c,u]of a)i.reportInfo(null,`${c.padEnd(s," ")}${u.padEnd(l," ")}${(0,wN.inspect)(e.getSpecial(c,{hideSecrets:!0,getNativePaths:!0}),o)}`)}else for(let a of n)i.reportInfo(null,`${a.padEnd(s," ")}${(0,wN.inspect)(e.getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),o)}`)}})).exitCode()}};nm.paths=[["config"]],nm.usage=Re.Usage({description:"display the current configuration",details:`
`,examples:[["Execute a single shell command","$0 exec echo Hello World"],["Execute a shell script",'$0 exec "tsc & babel src --out-dir lib"']]});var Qoe=om;ws();var am=class extends Le{constructor(){super(...arguments);this.hash=J.String({required:!1,validator:hp(fp(),[pp(/^p[0-9a-f]{5}$/)])})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd);return await t.restoreInstallState({restoreResolutions:!1}),await t.applyLightResolution(),typeof this.hash!="undefined"?await LWe(this.hash,t,{stdout:this.context.stdout}):(await Je.start({configuration:e,stdout:this.context.stdout,includeFooter:!1},async n=>{var o;let s=[([,a])=>P.stringifyLocator(t.storedPackages.get(a.subject)),([,a])=>P.stringifyIdent(a.requested)];for(let[a,l]of Se.sortMap(t.peerRequirements,s)){let c=t.storedPackages.get(l.subject);if(typeof c=="undefined")throw new Error("Assertion failed: Expected the subject package to have been registered");let u=t.storedPackages.get(l.rootRequester);if(typeof u=="undefined")throw new Error("Assertion failed: Expected the root package to have been registered");let g=(o=c.dependencies.get(l.requested.identHash))!=null?o:null,f=ae.pretty(e,a,ae.Type.CODE),h=P.prettyLocator(e,c),p=P.prettyIdent(e,l.requested),m=P.prettyIdent(e,u),y=l.allRequesters.length-1,b=`descendant${y===1?"":"s"}`,v=y>0?`and${y}${b}`:"",k=g!==null?"provides":"doesn't provide";n.reportInfo(null,`${f}\u2192${h}${k}${p}to${m}${v}`)}})).exitCode()}};am.paths=[["explain","peer-requirements"]],am.usage=Re.Usage({description:"explain a set of peer requirements",details:`
`,examples:[["Explain the corresponding set of peer requirements for a hash","$0 explain peer-requirements p1a4ed"],["List all sets of peer requirements","$0 explain peer-requirements"]]});var Soe=am;async function LWe(r,e,t){let{configuration:i}=e,n=e.peerRequirements.get(r);if(typeof n=="undefined")throw new Error(`NopeerDependencyrequirementsfoundforhash:"${r}"`);return(await Je.start({configuration:i,stdout:t.stdout,includeFooter:!1},async o=>{var b,v;let a=e.storedPackages.get(n.subject);if(typeof a=="undefined")throw new Error("Assertion failed: Expected the subject package to have been registered");let l=e.storedPackages.get(n.rootRequester);if(typeof l=="undefined")throw new Error("Assertion failed: Expected the root package to have been registered");let c=(b=a.dependencies.get(n.requested.identHash))!=null?b:null,u=c!==null?e.storedResolutions.get(c.descriptorHash):null;if(typeof u=="undefined")throw new Error("Assertion failed: Expected the resolution to have been registered");let g=u!==null?e.storedPackages.get(u):null;if(typeof g=="undefined")throw new Error("Assertion failed: Expected the provided package to have been registered");let f=[...n.allRequesters.values()].map(k=>{let T=e.storedPackages.get(k);if(typeof T=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let Y=P.devirtualizeLocator(T),q=e.storedPackages.get(Y.locatorHash);if(typeof q=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let $=q.peerDependencies.get(n.requested.identHash);if(typeof $=="undefined")throw new Error("Assertion failed: Expected the peer dependency to be registered");return{pkg:T,peerDependency:$}});if(g!==null){let k=f.every(({peerDependency:T})=>Wt.satisfiesWithPrereleases(g.version,T.range));o.reportInfo(X.UNNAMED,`${P.prettyLocator(i,a)}provides${P.prettyLocator(i,g)}withversion${P.prettyReference(i,(v=g.version)!=null?v:"<missing>")},which${k?"satisfies":"doesn't satisfy"}thefollowingrequirements:`)}else o.reportInfo(X.UNNAMED,`${P.prettyLocator(i,a)}doesn't provide ${P.prettyIdent(i,n.requested)}, breaking the following requirements:`);o.reportSeparator();let h=ae.mark(i),p=[];for(let{pkg:k,peerDependency:T}of Se.sortMap(f,Y=>P.stringifyLocator(Y.pkg))){let q=(g!==null?Wt.satisfiesWithPrereleases(g.version,T.range):!1)?h.Check:h.Cross;p.push({stringifiedLocator:P.stringifyLocator(k),prettyLocator:P.prettyLocator(i,k),prettyRange:P.prettyRange(i,T.range),mark:q})}let m=Math.max(...p.map(({stringifiedLocator:k})=>k.length)),y=Math.max(...p.map(({prettyRange:k})=>k.length));for(let{stringifiedLocator:k,prettyLocator:T,prettyRange:Y,mark:q}of Se.sortMap(p,({stringifiedLocator:$})=>$))o.reportInfo(null,`${T.padEnd(m+(T.length-k.length)," ")} \u2192 ${Y.padEnd(y," ")} ${q}`);p.length>1&&(o.reportSeparator(),o.reportInfo(X.UNNAMED,`Note: these requirements start with ${P.prettyLocator(e.configuration,l)}`))})).exitCode()}ws();var voe=ge(ri()),Am=class extends Le{constructor(){super(...arguments);this.onlyIfNeeded=J.Boolean("--only-if-needed",!1,{description:"Only lock the Yarn version if it isn'talreadylocked"});this.version=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);if(e.get("yarnPath")&&this.onlyIfNeeded)return 0;let t=()=>{if(typeof Kr=="undefined")throw new Pe("The--installflagcanonlybeusedwithoutexplicitversionspecifierfromtheYarnCLI");return`file://${process.argv[1]}`},i;if(this.version==="self")i=t();else if(this.version==="latest"||this.version==="berry"||this.version==="stable")i=`https://repo.yarnpkg.com/${await lm(e,"stable")}/packages/yarnpkg-cli/bin/yarn.js`;else if(this.version==="canary")i=`https://repo.yarnpkg.com/${await lm(e,"canary")}/packages/yarnpkg-cli/bin/yarn.js`;else if(this.version==="classic")i="https://nightly.yarnpkg.com/latest.js";else if(this.version.match(/^https?:/))i=this.version;else if(this.version.match(/^\.{0,2}[\\/]/)||H.isAbsolute(this.version))i=`file://${H.resolve(this.version)}`;else if(Wt.satisfiesWithPrereleases(this.version,">=
`;await U.changeFilePromise(p,m,{automaticNewlines:!0})}}function xoe(r){return X[yI(r)]}var OWe=/## (?<code>YN[0-9]{4}) - `(?<name>[A-Z_]+)`\n\n(?<details>(?:.(?!##))+)/gs;async function MWe(r){let t=`https://repo.yarnpkg.com/${Se.isTaggedYarnVersion(Kr)?Kr:await lm(r,"canary")}/packages/gatsby/content/advanced/error-codes.md`,i=await ir.get(t,{configuration:r});return new Map(Array.from(i.toString().matchAll(OWe),({groups:n})=>{if(!n)throw new Error("Assertion failed: Expected the match to have been successful");let s=xoe(n.code);if(n.name!==s)throw new Error(`Assertion failed: Invalid error code data: Expected "${n.name}" to be named "${s}"`);return[n.code,n.details]}))}var cm=class extends Le{constructor(){super(...arguments);this.code=J.String({required:!1,validator:hp(fp(),[pp(/^YN[0-9]{4}$/)])});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);if(typeof this.code!="undefined"){let t=xoe(this.code),i=ae.pretty(e,t,ae.Type.CODE),n=this.cli.format().header(`${this.code} - ${i}`),o=(await MWe(e)).get(this.code),a=typeof o!="undefined"?ae.jsonOrPretty(this.json,e,ae.tuple(ae.Type.MARKDOWN,{text:o,format:this.cli.format(),paragraphs:!0})):`This error code does not have a description.
`)}else{let t={children:Se.mapAndFilter(Object.entries(X),([i,n])=>Number.isNaN(Number(i))?Se.mapAndFilter.skip:{label:VA(Number(i)),value:ae.tuple(ae.Type.CODE,n)})};ls.emitTree(t,{configuration:e,stdout:this.context.stdout,json:this.json})}}};cm.paths=[["explain"]],cm.usage=Re.Usage({description:"explain an error code",details:`
`,examples:[["Explain an error code","$0 explain YN0006"],["List all error codes","$0 explain"]]});var Poe=cm;var Doe=ge(ns()),um=class extends Le{constructor(){super(...arguments);this.all=J.Boolean("-A,--all",!1,{description:"Print versions of a package from the whole project"});this.recursive=J.Boolean("-R,--recursive",!1,{description:"Print information for all packages, including transitive dependencies"});this.extra=J.Array("-X,--extra",[],{description:"An array of requests of extra data provided by plugins"});this.cache=J.Boolean("--cache",!1,{description:"Print information about the cache entry of a package (path, size, checksum)"});this.dependents=J.Boolean("--dependents",!1,{description:"Print all dependents for each matching package"});this.manifest=J.Boolean("--manifest",!1,{description:"Print data obtained by looking at the package archive (license, homepage, ...)"});this.nameOnly=J.Boolean("--name-only",!1,{description:"Only print the name for the matching packages"});this.virtuals=J.Boolean("--virtuals",!1,{description:"Print each instance of the virtual packages"});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=J.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i&&!this.all)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState();let s=new Set(this.extra);this.cache&&s.add("cache"),this.dependents&&s.add("dependents"),this.manifest&&s.add("manifest");let o=(k,{recursive:T})=>{let Y=k.anchoredLocator.locatorHash,q=new Map,$=[Y];for(;$.length>0;){let z=$.shift();if(q.has(z))continue;let ne=t.storedPackages.get(z);if(typeof ne=="undefined")throw new Error("Assertion failed: Expected the package to be registered");if(q.set(z,ne),P.isVirtualLocator(ne)&&$.push(P.devirtualizeLocator(ne).locatorHash),!(!T&&z!==Y))for(let ee of ne.dependencies.values()){let A=t.storedResolutions.get(ee.descriptorHash);if(typeof A=="undefined")throw new Error("Assertion failed: Expected the resolution to be registered");$.push(A)}}return q.values()},a=({recursive:k})=>{let T=new Map;for(let Y of t.workspaces)for(let q of o(Y,{recursive:k}))T.set(q.locatorHash,q);return T.values()},l=({all:k,recursive:T})=>k&&T?t.storedPackages.values():k?a({recursive:T}):o(i,{recursive:T}),c=({all:k,recursive:T})=>{let Y=l({all:k,recursive:T}),q=this.patterns.map(ne=>{let ee=P.parseLocator(ne),A=Doe.default.makeRe(P.stringifyIdent(ee)),oe=P.isVirtualLocator(ee),ce=oe?P.devirtualizeLocator(ee):ee;return Z=>{let O=P.stringifyIdent(Z);if(!A.test(O))return!1;if(ee.reference==="unknown")return!0;let L=P.isVirtualLocator(Z),de=L?P.devirtualizeLocator(Z):Z;return!(oe&&L&&ee.reference!==Z.reference||ce.reference!==de.reference)}}),$=Se.sortMap([...Y],ne=>P.stringifyLocator(ne));return{selection:$.filter(ne=>q.length===0||q.some(ee=>ee(ne))),sortedLookup:$}},{selection:u,sortedLookup:g}=c({all:this.all,recursive:this.recursive});if(u.length===0)throw new Pe("No package matched your request");let f=new Map;if(this.dependents)for(let k of g)for(let T of k.dependencies.values()){let Y=t.storedResolutions.get(T.descriptorHash);if(typeof Y=="undefined")throw new Error("Assertion failed: Expected the resolution to be registered");Se.getArrayWithDefault(f,Y).push(k)}let h=new Map;for(let k of g){if(!P.isVirtualLocator(k))continue;let T=P.devirtualizeLocator(k);Se.getArrayWithDefault(h,T.locatorHash).push(k)}let p={},m={children:p},y=e.makeFetcher(),b={project:t,fetcher:y,cache:n,checksums:t.storedChecksums,report:new di,cacheOptions:{skipIntegrityCheck:!0},skipIntegrityCheck:!0},v=[async(k,T,Y)=>{var z,ne;if(!T.has("manifest"))return;let q=await y.fetch(k,b),$;try{$=await At.find(q.prefixPath,{baseFs:q.packageFs})}finally{(z=q.releaseFs)==null||z.call(q)}Y("Manifest",{License:ae.tuple(ae.Type.NO_HINT,$.license),Homepage:ae.tuple(ae.Type.URL,(ne=$.raw.homepage)!=null?ne:null)})},async(k,T,Y)=>{var A;if(!T.has("cache"))return;let q={mockedPackages:t.disabledLocators,unstablePackages:t.c
-**Resolution:**Firstthepackagemanagerwillresolveyourdependencies.Theexactwayadependencyversionisprivilegedoveranotherisn't standardized outside of the regular semver guarantees. If a package doesn'tresolvetowhatyouwouldexpect,checkthatalldependenciesarecorrectlydeclared(alsocheckourwebsiteformoreinformation:).
-**Fetch:**Thenwedownloadallthedependenciesifneeded,andmakesurethatthey'reallstoredwithinourcache(checkthevalueof\`cacheFolder\` in \`yarn config\` to see where the cache files are stored).
-**Build:**Oncethedependencytreehasbeenwrittenonthedisk,thepackagemanagerwillnowbefreetorunthebuildscriptsforallpackagesthatmightneedit,inatopologicalordercompatiblewiththewaytheydependononeanother.Seehttps://yarnpkg.com/advanced/lifecycle-scripts for detail.
Ifthe\`--immutable\` option is set (defaults to true on CI), Yarn will abort with an error exit code if the lockfile was to be modified (other paths can be added using the \`immutablePatterns\` configuration setting). For backward compatibility we offer an alias under the name of \`--frozen-lockfile\`, but it will be removed in a later release.
Ifthe\`--immutable-cache\` option is set, Yarn will abort with an error exit code if the cache folder was to be modified (either because files would be added, or because they'd be removed).
Ifthe\`--check-cache\` option is set, Yarn will always refetch the packages and will ensure that their checksum matches what's 1/ described in the lockfile 2/ inside the existing cache files (if present). This is recommended as part of your CI workflow if you're both following the Zero-Installs model and accepting PRs from third-parties, as they'd otherwise have the ability to alter the checked-in packages before submitting them.
Ifthe\`--inline-builds\` option is set, Yarn will verbosely print the output of the build steps of your dependencies (instead of writing them into individual files). This is likely useful mostly for debug purposes only when using Docker-like environments.
Ifthe\`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
-\`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
-\`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
`,examples:[["Install the project","$0 install"],["Validate a project when using Zero-Installs","$0 install --immutable --immutable-cache"],["Validate a project when using Zero-Installs (slightly safer if you accept external PRs)","$0 install --immutable --immutable-cache --check-cache"]]});var Foe=gm,KWe="|||||||",HWe=">>>>>>>",jWe="=======",Noe="<<<<<<<";async function UWe(r,e){if(!r.projectCwd)return!1;let t=x.join(r.projectCwd,r.get("lockfileFilename"));if(!await U.existsPromise(t))return!1;let i=await U.readFilePromise(t,"utf8");if(!i.includes(Noe))return!1;if(e)throw new ct(X.AUTOMERGE_IMMUTABLE,"Cannot autofix a lockfile when running an immutable install");let[n,s]=GWe(i),o,a;try{o=Si(n),a=Si(s)}catch(c){throw new ct(X.AUTOMERGE_FAILED_TO_PARSE,"The individual variants of the lockfile failed to parse")}let l=N(N({},o),a);for(let[c,u]of Object.entries(l))typeof u=="string"&&delete l[c];return await U.changeFilePromise(t,Ua(l),{automaticNewlines:!0}),!0}function GWe(r){let e=[[],[]],t=r.split(/\r?\n/g),i=!1;for(;t.length>0;){let n=t.shift();if(typeof n=="undefined")throw new Error("Assertion failed: Some lines should remain");if(n.startsWith(Noe)){for(;t.length>0;){let s=t.shift();if(typeof s=="undefined")throw new Error("Assertion failed: Some lines should remain");if(s===jWe){i=!1;break}else if(i||s.startsWith(KWe)){i=!0;continue}else e[0].push(s)}for(;t.length>0;){let s=t.shift();if(typeof s=="undefined")throw new Error("Assertion failed: Some lines should remain");if(s.startsWith(HWe))break;e[1].push(s)}}else e[0].push(n),e[1].push(n)}return[e[0].join(`
`)]}var fm=class extends Le{constructor(){super(...arguments);this.all=J.Boolean("-A,--all",!1,{description:"Link all workspaces belonging to the target project to the current one"});this.private=J.Boolean("-p,--private",!1,{description:"Also link private workspaces belonging to the target project to the current one"});this.relative=J.Boolean("-r,--relative",!1,{description:"Link workspaces using relative paths instead of absolute paths"});this.destination=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState({restoreResolutions:!1});let s=x.resolve(this.context.cwd,H.toPortablePath(this.destination)),o=await ye.find(s,this.context.plugins,{useRc:!1,strict:!1}),{project:a,workspace:l}=await ze.find(o,s);if(t.cwd===a.cwd)throw new Pe("Invalid destination; Can't link the project to itself");if(!l)throw new ht(a.cwd,s);let c=t.topLevelWorkspace,u=[];if(this.all){for(let f of a.workspaces)f.manifest.name&&(!f.manifest.private||this.private)&&u.push(f);if(u.length===0)throw new Pe("No workspace found to be linked in the target project")}else{if(!l.manifest.name)throw new Pe("The target workspace doesn't have a name and thus cannot be linked");if(l.manifest.private&&!this.private)throw new Pe("The target workspace is marked private - use the --private flag to link it anyway");u.push(l)}for(let f of u){let h=P.stringifyIdent(f.locator),p=this.relative?x.relative(t.cwd,f.cwd):f.cwd;c.manifest.resolutions.push({pattern:{descriptor:{fullName:h}},reference:`portal:${p}`})}return(await Je.start({configuration:e,stdout:this.context.stdout},async f=>{await t.install({cache:n,report:f})})).exitCode()}};fm.paths=[["link"]],fm.usage=Re.Usage({description:"connect the local project to another one",details:"\n This command will set a new `resolutions` field in the project-level manifest and point it to the workspace at the specified location (even if part of another project).\n ",examples:[["Register a remote workspace for use in the current project","$0 link ~/ts-loader"],["Register all workspaces from a remote project for use in the current project","$0 link ~/jest --all"]]});var Loe=fm;var hm=class extends Le{constructor(){super(...arguments);this.args=J.Proxy()}async execute(){return this.cli.run(["exec","node",...this.args])}};hm.paths=[["node"]],hm.usage=Re.Usage({description:"run node with the hook already setup",details:`
`,examples:[["Run a Node script","$0 node ./my-script.js"]]});var Toe=hm;var qoe=ge(require("os"));var Moe=ge(require("os"));var YWe="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function Qu(r){let e=await ir.get(YWe,{configuration:r});return Si(e.toString())}var pm=class extends Le{constructor(){super(...arguments);this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{let n=await Qu(e);for(let s of Object.entries(n)){let[l,o]=s,a=o,{experimental:c}=a,u=Or(a,["experimental"]);let g=l;c&&(g+=" [experimental]"),i.reportJson(N({name:l,experimental:c},u)),i.reportInfo(null,g)}})).exitCode()}};pm.paths=[["plugin","list"]],pm.usage=Re.Usage({category:"Plugin-related commands",description:"list the available official plugins",details:"\n This command prints the plugins available directly from the Yarn repository. Only those plugins can be referenced by name in `yarnpluginimport`.\n ",examples:[["List the official plugins","$0 plugin list"]]});var Ooe=pm;var qWe=/^[0-9]+$/;function Uoe(r){return qWe.test(r)?`pull/${r}/head`:r}var JWe=({repository:r,branch:e},t)=>[["git","init",H.fromPortablePath(t)],["git","remote","add","origin",r],["git","fetch","origin","--depth=1",Uoe(e)],["git","reset","--hard","FETCH_HEAD"]],WWe=({branch:r})=>[["git","fetch","origin","--depth=1",Uoe(r),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx"]],zWe=({plugins:r,noMinify:e},t)=>[["yarn","build:cli",...new Array().concat(...r.map(i=>["--plugin",x.resolve(t,i)])),...e?["--no-minify"]:[],"|"]],dm=class extends Le{constructor(){super(...arguments);this.installPath=J.String("--path",{description:"The path where the repository should be cloned to"});this.repository=J.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=J.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.plugins=J.Array("--plugin",[],{description:"An array of additional plugins that should be included in the bundle"});this.noMinify=J.Boolean("--no-minify",!1,{description:"Build a bundle for development (debugging) - non-minified and non-mangled"});this.force=J.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.skipPlugins=J.Boolean("--skip-plugins",!1,{description:"Skip updating the contrib plugins"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd),i=typeof this.installPath!="undefined"?x.resolve(this.context.cwd,H.toPortablePath(this.installPath)):x.resolve(H.toPortablePath((0,Moe.tmpdir)()),"yarnpkg-sources",Rn.makeHash(this.repository).slice(0,6));return(await Je.start({configuration:e,stdout:this.context.stdout},async s=>{await kN(this,{configuration:e,report:s,target:i}),s.reportSeparator(),s.reportInfo(X.UNNAMED,"Building a fresh bundle"),s.reportSeparator(),await Cm(zWe(this,i),{configuration:e,context:this.context,target:i}),s.reportSeparator();let o=x.resolve(i,"packages/yarnpkg-cli/bundles/yarn.js"),a=await U.readFilePromise(o);await SN(e,"sources",a,{report:s}),this.skipPlugins||await _We(this,{project:t,report:s,target:i})})).exitCode()}};dm.paths=[["set","version","from","sources"]],dm.usage=Re.Usage({description:"build Yarn from master",details:`
`,examples:[["Build Yarn from master","$0 set version from sources"]]});var Koe=dm;async function Cm(r,{configuration:e,context:t,target:i}){for(let[n,...s]of r){let o=s[s.length-1]==="|";if(o&&s.pop(),o)await Nr.pipevp(n,s,{cwd:i,stdin:t.stdin,stdout:t.stdout,stderr:t.stderr,strict:!0});else{t.stdout.write(`${ae.pretty(e,`$${[n,...s].join(" ")}`,"grey")}
`);try{await Nr.execvp(n,s,{cwd:i,strict:!0})}catch(a){throw t.stdout.write(a.stdout||a.stack),a}}}}async function kN(r,{configuration:e,report:t,target:i}){let n=!1;if(!r.force&&U.existsSync(x.join(i,".git"))){t.reportInfo(X.UNNAMED,"Fetching the latest commits"),t.reportSeparator();try{await Cm(WWe(r),{configuration:e,context:r.context,target:i}),n=!0}catch(s){t.reportSeparator(),t.reportWarning(X.UNNAMED,"Repository update failed; we'll try to regenerate it")}}n||(t.reportInfo(X.UNNAMED,"Cloning the remote repository"),t.reportSeparator(),await U.removePromise(i),await U.mkdirPromise(i,{recursive:!0}),await Cm(JWe(r,i),{configuration:e,context:r.context,target:i}))}async function _We(r,{project:e,report:t,target:i}){let n=await Qu(e.configuration),s=new Set(Object.keys(n));for(let o of e.configuration.plugins.keys())!s.has(o)||await vN(o,r,{project:e,report:t,target:i})}var Hoe=ge(ri()),joe=ge(require("url")),Goe=ge(require("vm"));var mm=class extends Le{constructor(){super(...arguments);this.name=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);return(await Je.start({configuration:e,stdout:this.context.stdout},async i=>{let{project:n}=await ze.find(e,this.context.cwd),s,o;if(this.name.match(/^\.{0,2}[\\/]/)||H.isAbsolute(this.name)){let a=x.resolve(this.context.cwd,H.toPortablePath(this.name));i.reportInfo(X.UNNAMED,`Reading${ae.pretty(e,a,ae.Type.PATH)}`),s=x.relative(n.cwd,a),o=await U.readFilePromise(a)}else{let a;if(this.name.match(/^https?:/)){try{new joe.URL(this.name)}catch{throw new ct(X.INVALID_PLUGIN_REFERENCE,`Pluginspecifier"${this.name}"isneitherapluginnamenoravalidurl`)}s=this.name,a=this.name}else{let l=P.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(l.reference!=="unknown"&&!Hoe.default.valid(l.reference))throw new ct(X.UNNAMED,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let c=P.stringifyIdent(l),u=await Qu(e);if(!Object.prototype.hasOwnProperty.call(u,c))throw new ct(X.PLUGIN_NAME_NOT_FOUND,`Couldn'tfindapluginnamed"${c}"ontheremoteregistry.Notethatonlythepluginsreferencedonourwebsite(https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be referenced by their name; any other plugin will have to be referenced through its public url (for example https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js).`);s=c,a=u[c].url,l.reference!=="unknown"?a=a.replace(/\/master\//,`/${c}/${l.reference}/`):Kr!==null&&(a=a.replace(/\/master\//,`/@yarnpkg/cli/${Kr}/`))}i.reportInfo(X.UNNAMED,`Downloading ${ae.pretty(e,a,"green")}`),o=await ir.get(a,{configuration:e})}await xN(s,o,{project:n,report:i})})).exitCode()}};mm.paths=[["plugin","import"]],mm.usage=Re.Usage({category:"Plugin-related commands",description:"download a plugin",details:`
`,examples:[['Download and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import @yarnpkg/plugin-exec"],['Download and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import exec"],["Download and activate a community plugin","$0 plugin import https://example.org/path/to/plugin.js"],["Activate a local plugin","$0 plugin import ./path/to/plugin.js"]]});var Yoe=mm;async function xN(r,e,{project:t,report:i}){let{configuration:n}=t,s={},o={exports:s};(0,Goe.runInNewContext)(e.toString(),{module:o,exports:s});let a=o.exports.name,l=`.yarn/plugins/${a}.cjs`,c=x.resolve(t.cwd,l);i.reportInfo(X.UNNAMED,`Savingthenewpluginin${ae.pretty(n,l,"magenta")}`),await U.mkdirPromise(x.dirname(c),{recursive:!0}),await U.writeFilePromise(c,e);let u={path:l,spec:r};await ye.updateConfiguration(t.cwd,g=>{let f=[],h=!1;for(let p of g.plugins||[]){let m=typeof p!="string"?p.path:p,y=x.resolve(t.cwd,H.toPortablePath(m)),{name:b}=Se.dynamicRequire(y);b!==a?f.push(p):(f.push(u),h=!0)}return h||f.push(u),te(N({},g),{plugins:f})})}var VWe=({pluginName:r,noMinify:e},t)=>[["yarn",`build:${r}`,...e?["--no-minify"]:[],"|"]],Em=class extends Le{constructor(){super(...arguments);this.installPath=J.String("--path",{description:"The path where the repository should be cloned to"});this.repository=J.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=J.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.noMinify=J.Boolean("--no-minify",!1,{description:"Build a plugin for development (debugging) - non-minified and non-mangled"});this.force=J.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.name=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=typeof this.installPath!="undefined"?x.resolve(this.context.cwd,H.toPortablePath(this.installPath)):x.resolve(H.toPortablePath((0,qoe.tmpdir)()),"yarnpkg-sources",Rn.makeHash(this.repository).slice(0,6));return(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{let{project:s}=await ze.find(e,this.context.cwd),o=P.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),a=P.stringifyIdent(o),l=await Qu(e);if(!Object.prototype.hasOwnProperty.call(l,a))throw new ct(X.PLUGIN_NAME_NOT_FOUND,`Couldn'tfindapluginnamed"${a}"ontheremoteregistry.Notethatonlythepluginsreferencedonourwebsite(https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let c=a;await kN(this,{configuration:e,report:n,target:t}),await vN(c,this,{project:s,report:n,target:t})})).exitCode()}};Em.paths=[["plugin","import","from","sources"]],Em.usage=Re.Usage({category:"Plugin-related commands",description:"build a plugin from sources",details:`
`,examples:[["Remove a plugin imported from the Yarn repository","$0 plugin remove @yarnpkg/plugin-typescript"],["Remove a plugin imported from a local file","$0 plugin remove my-local-plugin"]]});var Woe=Im;var ym=class extends Le{constructor(){super(...arguments);this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{for(let n of e.plugins.keys()){let s=this.context.plugins.plugins.has(n),o=n;s&&(o+=" [builtin]"),i.reportJson({name:n,builtin:s}),i.reportInfo(null,`${o}`)}})).exitCode()}};ym.paths=[["plugin","runtime"]],ym.usage=Re.Usage({category:"Plugin-related commands",description:"list the active plugins",details:`
`,examples:[["List the currently active plugins","$0 plugin runtime"]]});var zoe=ym;var wm=class extends Le{constructor(){super(...arguments);this.idents=J.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);let s=new Set;for(let a of this.idents)s.add(P.parseIdent(a).identHash);if(await t.restoreInstallState({restoreResolutions:!1}),await t.resolveEverything({cache:n,report:new di}),s.size>0)for(let a of t.storedPackages.values())s.has(a.identHash)&&t.storedBuildState.delete(a.locatorHash);else t.storedBuildState.clear();return(await Je.start({configuration:e,stdout:this.context.stdout,includeLogs:!this.context.quiet},async a=>{await t.install({cache:n,report:a})})).exitCode()}};wm.paths=[["rebuild"]],wm.usage=Re.Usage({description:"rebuild the project's native packages",details:`
`,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]});var _oe=wm;var PN=ge(ns());ws();var Bm=class extends Le{constructor(){super(...arguments);this.all=J.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.mode=J.String("--mode",{description:"Change what artifacts installs generate",validator:nn(Ci)});this.patterns=J.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState({restoreResolutions:!1});let s=this.all?t.workspaces:[i],o=[Hr.REGULAR,Hr.DEVELOPMENT,Hr.PEER],a=[],l=!1,c=[];for(let h of this.patterns){let p=!1,m=P.parseIdent(h);for(let y of s){let b=[...y.manifest.peerDependenciesMeta.keys()];for(let v of(0,PN.default)(b,h))y.manifest.peerDependenciesMeta.delete(v),l=!0,p=!0;for(let v of o){let k=y.manifest.getForScope(v),T=[...k.values()].map(Y=>P.stringifyIdent(Y));for(let Y of(0,PN.default)(T,P.stringifyIdent(m))){let{identHash:q}=P.parseIdent(Y),$=k.get(q);if(typeof $=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");y.manifest[v].delete(q),c.push([y,v,$]),l=!0,p=!0}}}p||a.push(h)}let u=a.length>1?"Patterns":"Pattern",g=a.length>1?"don't":"doesn't",f=this.all?"any":"this";if(a.length>0)throw new Pe(`${u}${ae.prettyList(e,a,Ri.CODE)}${g}matchanypackagesreferencedby${f}workspace`);return l?(await e.triggerMultipleHooks(p=>p.afterWorkspaceDependencyRemoval,c),(await Je.start({configuration:e,stdout:this.context.stdout},async p=>{await t.install({cache:n,report:p,mode:this.mode})})).exitCode()):0}};Bm.paths=[["remove"]],Bm.usage=Re.Usage({description:"remove dependencies from the project",details:`
Ifthe\`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
-\`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
-\`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
Thiscommandacceptsglobpatternsasarguments(ifvalidIdentsandsupportedby[micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.
`,examples:[["Remove a dependency from the current project","$0 remove lodash"],["Remove a dependency from all workspaces at once","$0 remove lodash --all"],["Remove all dependencies starting with `eslint-`","$0 remove 'eslint-*'"],["Remove all dependencies with the `@babel` scope","$0 remove '@babel/*'"],["Remove all dependencies matching `react-dom` or `react-helmet`","$0 remove 'react-{dom,helmet}'"]]});var Voe=Bm;var Xoe=ge(require("util")),X0=class extends Le{async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(t.cwd,this.context.cwd);return(await Je.start({configuration:e,stdout:this.context.stdout},async s=>{let o=i.manifest.scripts,a=Se.sortMap(o.keys(),u=>u),l={breakLength:Infinity,colors:e.get("enableColors"),maxArrayLength:2},c=a.reduce((u,g)=>Math.max(u,g.length),0);for(let[u,g]of o.entries())s.reportInfo(null,`${u.padEnd(c," ")}${(0,Xoe.inspect)(g,l)}`)})).exitCode()}};X0.paths=[["run"]];var Zoe=X0;var bm=class extends Le{constructor(){super(...arguments);this.inspect=J.String("--inspect",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.inspectBrk=J.String("--inspect-brk",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.topLevel=J.Boolean("-T,--top-level",!1,{description:"Check the root workspace for scripts and/or binaries instead of the current one"});this.binariesOnly=J.Boolean("-B,--binaries-only",!1,{description:"Ignore any user defined scripts and only check for binaries"});this.silent=J.Boolean("--silent",{hidden:!0});this.scriptName=J.String();this.args=J.Proxy()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i,locator:n}=await ze.find(e,this.context.cwd);await t.restoreInstallState();let s=this.topLevel?t.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await Zt.hasPackageScript(s,this.scriptName,{project:t}))return await Zt.executePackageScript(s,this.scriptName,this.args,{project:t,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let o=await Zt.getPackageAccessibleBinaries(s,{project:t});if(o.get(this.scriptName)){let l=[];return this.inspect&&(typeof this.inspect=="string"?l.push(`--inspect=${this.inspect}`):l.push("--inspect")),this.inspectBrk&&(typeof this.inspectBrk=="string"?l.push(`--inspect-brk=${this.inspectBrk}`):l.push("--inspect-brk")),await Zt.executePackageAccessibleBinary(s,this.scriptName,this.args,{cwd:this.context.cwd,project:t,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,nodeArgs:l,packageAccessibleBinaries:o})}if(!this.topLevel&&!this.binariesOnly&&i&&this.scriptName.includes(":")){let c=(await Promise.all(t.workspaces.map(async u=>u.manifest.scripts.has(this.scriptName)?u:null))).filter(u=>u!==null);if(c.length===1)return await Zt.executeWorkspaceScript(c[0],this.scriptName,this.args,{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}if(this.topLevel)throw this.scriptName==="node-gyp"?new Pe(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${P.prettyLocator(e,n)}). This typically happens because some package depends on "node-gyp" to build itself, but didn'tlistitintheirdependencies.Tofixthat,pleaserun"yarn add node-gyp"intoyourtop-levelworkspace.Youalsocanopenanissueontherepositoryofthespecifiedpackagetosuggestthemtouseanoptionalpeerdependency.`):new Pe(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${P.prettyLocator(e,n)}).`);{if(this.scriptName==="global")throw new Pe("The 'yarnglobal' commands have been removed in 2.x - consider using 'yarndlx' or a third-party plugin instead");let l=[this.scriptName].concat(this.args);for(let[c,u]of Tf)for(let g of u)if(l.length>=g.length&&JSON.stringify(l.slice(0,g.length))===JSON.stringify(g))throw new Pe(`Couldn'tfindascriptnamed"${this.scriptName}",butamatchin
`,examples:[["Run the tests from the local workspace","$0 run test"],['Same thing, but without the "run" keyword',"$0 test"],["Inspect Webpack while running","$0 run --inspect-brk webpack"]]});var $oe=bm;var Qm=class extends Le{constructor(){super(...arguments);this.save=J.Boolean("-s,--save",!1,{description:"Persist the resolution inside the top-level manifest"});this.descriptor=J.String();this.resolution=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(await t.restoreInstallState({restoreResolutions:!1}),!i)throw new ht(t.cwd,this.context.cwd);let s=P.parseDescriptor(this.descriptor,!0),o=P.makeDescriptor(s,this.resolution);return t.storedDescriptors.set(s.descriptorHash,s),t.storedDescriptors.set(o.descriptorHash,o),t.resolutionAliases.set(s.descriptorHash,o.descriptorHash),(await Je.start({configuration:e,stdout:this.context.stdout},async l=>{await t.install({cache:n,report:l})})).exitCode()}};Qm.paths=[["set","resolution"]],Qm.usage=Re.Usage({description:"enforce a package resolution",details:'\n This command updates the resolution table so that `descriptor` is resolved by `resolution`.\n\n Note that by default this command only affect the current resolution table - meaning that this "manual override" will disappear if you remove the lockfile, or if the package disappear from the table. If you wish to make the enforced resolution persist whatever happens, add the `-s,--save` flag which will also edit the `resolutions` field from your top-level manifest.\n\n Note that no attempt is made at validating that `resolution` is a valid resolution entry for `descriptor`.\n ',examples:[["Force all instances of lodash@npm:^1.2.3 to resolve to 1.5.0","$0 set resolution lodash@npm:^1.2.3 1.5.0"]]});var eae=Qm;var tae=ge(ns()),Sm=class extends Le{constructor(){super(...arguments);this.all=J.Boolean("-A,--all",!1,{description:"Unlink all workspaces belonging to the target project from the current one"});this.leadingArguments=J.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);let s=t.topLevelWorkspace,o=new Set;if(this.leadingArguments.length===0&&this.all)for(let{pattern:l,reference:c}of s.manifest.resolutions)c.startsWith("portal:")&&o.add(l.descriptor.fullName);if(this.leadingArguments.length>0)for(let l of this.leadingArguments){let c=x.resolve(this.context.cwd,H.toPortablePath(l));if(Se.isPathLike(l)){let u=await ye.find(c,this.context.plugins,{useRc:!1,strict:!1}),{project:g,workspace:f}=await ze.find(u,c);if(!f)throw new ht(g.cwd,c);if(this.all){for(let h of g.workspaces)h.manifest.name&&o.add(P.stringifyIdent(h.locator));if(o.size===0)throw new Pe("No workspace found to be unlinked in the target project")}else{if(!f.manifest.name)throw new Pe("The target workspace doesn't have a name and thus cannot be unlinked");o.add(P.stringifyIdent(f.locator))}}else{let u=[...s.manifest.resolutions.map(({pattern:g})=>g.descriptor.fullName)];for(let g of(0,tae.default)(u,l))o.add(g)}}return s.manifest.resolutions=s.manifest.resolutions.filter(({pattern:l})=>!o.has(l.descriptor.fullName)),(await Je.start({configuration:e,stdout:this.context.stdout},async l=>{await t.install({cache:n,report:l})})).exitCode()}};Sm.paths=[["unlink"]],Sm.usage=Re.Usage({description:"disconnect the local project from another one",details:`
`,examples:[["Unregister a remote workspace in the current project","$0 unlink ~/ts-loader"],["Unregister all workspaces from a remote project in the current project","$0 unlink ~/jest --all"],["Unregister all previously linked workspaces","$0 unlink --all"],["Unregister all workspaces matching a glob","$0 unlink '@babel/*' 'pkg-{a,b}'"]]});var rae=Sm;var iae=ge(zC()),DN=ge(ns());ws();var rh=class extends Le{constructor(){super(...arguments);this.interactive=J.Boolean("-i,--interactive",{description:"Offer various choices, depending on the detected upgrade paths"});this.exact=J.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=J.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=J.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.recursive=J.Boolean("-R,--recursive",!1,{description:"Resolve again ALL resolutions for those packages"});this.mode=J.String("--mode",{description:"Change what artifacts installs generate",validator:nn(Ci)});this.patterns=J.Rest()}async execute(){return this.recursive?await this.executeUpRecursive():await this.executeUpClassic()}async executeUpRecursive(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState({restoreResolutions:!1});let s=[...t.storedDescriptors.values()],o=s.map(u=>P.stringifyIdent(u)),a=new Set;for(let u of this.patterns){if(P.parseDescriptor(u).range!=="unknown")throw new Pe("Ranges aren't allowed when using --recursive");for(let g of(0,DN.default)(o,u)){let f=P.parseIdent(g);a.add(f.identHash)}}let l=s.filter(u=>a.has(u.identHash));for(let u of l)t.storedDescriptors.delete(u.descriptorHash),t.storedResolutions.delete(u.descriptorHash);return(await Je.start({configuration:e,stdout:this.context.stdout},async u=>{await t.install({cache:n,report:u})})).exitCode()}async executeUpClassic(){var m;let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState({restoreResolutions:!1});let s=(m=this.interactive)!=null?m:e.get("preferInteractive"),o=_C(this,t),a=s?[Vr.KEEP,Vr.REUSE,Vr.PROJECT,Vr.LATEST]:[Vr.PROJECT,Vr.LATEST],l=[],c=[];for(let y of this.patterns){let b=!1,v=P.parseDescriptor(y);for(let k of t.workspaces)for(let T of[Hr.REGULAR,Hr.DEVELOPMENT]){let q=[...k.manifest.getForScope(T).values()].map($=>P.stringifyIdent($));for(let $ of(0,DN.default)(q,P.stringifyIdent(v))){let z=P.parseIdent($),ne=k.manifest[T].get(z.identHash);if(typeof ne=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");let ee=P.makeDescriptor(z,v.range);l.push(Promise.resolve().then(async()=>[k,T,ne,await VC(ee,{project:t,workspace:k,cache:n,target:T,modifier:o,strategies:a})])),b=!0}}b||c.push(y)}if(c.length>1)throw new Pe(`Patterns${ae.prettyList(e,c,Ri.CODE)}don't match any packages referenced by any workspace`);if(c.length>0)throw new Pe(`Pattern ${ae.prettyList(e,c,Ri.CODE)} doesn'tmatchanypackagesreferencedbyanyworkspace`);let u=await Promise.all(l),g=await dA.start({configuration:e,stdout:this.context.stdout,suggestInstall:!1},async y=>{for(let[,,b,{suggestions:v,rejections:k}]of u){let T=v.filter(Y=>Y.descriptor!==null);if(T.length===0){let[Y]=k;if(typeof Y=="undefined")throw new Error("Assertion failed: Expected an error to have been set");let q=this.cli.error(Y);t.configuration.get("enableNetwork")?y.reportError(X.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,b)}can'tberesolvedtoasatisfyingrange
${q}`)}else T.length>1&&!s&&y.reportError(X.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,b)}hasmultiplepossibleupgradestrategies;use-itodisambiguatemanually`)}});if(g.hasErrors())return g.exitCode();let f=!1,h=[];for(let[y,b,,{suggestions:v}]of u){let k,T=v.filter(z=>z.descriptor!==null),Y=T[0].descriptor,q=T.every(z=>P.areDescriptorsEqual(z.descriptor,Y));T.length===1||q?k=Y:(f=!0,{answer:k}=await(0,iae.prompt)({type:"select",name:"answer",message:`Whichrangetoyouwanttousein${P.prettyWorkspace(e,y)}\u276F${b}?`,choices:v.map(({descriptor:z,name:ne,reason:ee})=>z?{name:ne,hint:ee,descriptor:z}:{name:ne,hint:ee,disabled:!0}),onCancel:()=>process.exit(130),result(z){return this.find(z,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let $=y.manifest[b].get(k.identHash);if(typeof $=="undefined")throw new Error("Assertion failed: This descriptor should have a matching entry");if($.descriptorHash!==k.descriptorHash)y.manifest[b].set(k.identHash,k),h.push([y,b,$,k]);else{let z=e.makeResolver(),ne={project:t,resolver:z},ee=z.bindDescriptor($,y.anchoredLocator,ne);t.forgetResolution(ee)}}return await e.triggerMultipleHooks(y=>y.afterWorkspaceDependencyReplacement,h),f&&this.context.stdout.write(`
`),(await Je.start({configuration:e,stdout:this.context.stdout},async y=>{await t.install({cache:n,report:y,mode:this.mode})})).exitCode()}};rh.paths=[["up"]],rh.usage=Re.Usage({description:"upgrade dependencies across the project",details:"\n This command upgrades the packages matching the list of specified patterns to their latest available version across the whole project (regardless of whether they're part of `dependencies` or `devDependencies` - `peerDependencies` won't be affected). This is a project-wide command: all workspaces will be upgraded in the process.\n\n If `-R,--recursive` is set the command will change behavior and no other switch will be allowed. When operating under this mode `yarnup` will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both `yarnup` and `yarnup-R` to cover all bases.\n\n If `-i,--interactive` is set (or if the `preferInteractive` settings is toggled on) the command will offer various choices, depending on the detected upgrade paths. Some upgrades require this flag in order to resolve ambiguities.\n\n The, `-C,--caret`, `-E,--exact` and `-T,--tilde` options have the same meaning as in the `add` command (they change the modifier used when the range is missing or a tag, and are ignored when the range is explicitly set).\n\n If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n Generally you can see `yarnup` as a counterpart to what was `yarnupgrade--latest` in Yarn 1 (ie it ignores the ranges previously listed in your manifests), but unlike `yarnupgrade` which only upgraded dependencies in the current workspace, `yarnup` will upgrade all workspaces at the same time.\n\n This command accepts glob patterns as arguments (if valid Descriptors and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n\n **Note:** The ranges have to be static, only the package scopes and names can contain glob patterns.\n ",examples:[["Upgrade all instances of lodash to the latest release","$0 up lodash"],["Upgrade all instances of lodash to the latest release, but ask confirmation for each","$0 up lodash -i"],["Upgrade all instances of lodash to 1.2.3","$0 up lodash@1.2.3"],["Upgrade all instances of packages with the `@babel` scope to the latest release","$0 up '@babel/*'"],["Upgrade all instances of packages containing the word `jest` to the latest release","$0 up '*jest*'"],["Upgrade all instances of packages with the `@babel` scope to 7.0.0","$0 up '@babel/*@7.0.0'"]]}),rh.schema=[tS("recursive",bc.Forbids,["interactive","exact","tilde","caret"],{ignore:[void 0,!1]})];var nae=rh;var vm=class extends Le{constructor(){super(...arguments);this.recursive=J.Boolean("-R,--recursive",!1,{description:"List, for each workspace, what are all the paths that lead to the dependency"});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.peers=J.Boolean("--peers",!1,{description:"Also print the peer dependencies that match the specified name"});this.package=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.c
If\`-R,--recursive\` is set, the listing will go in depth and will list, for each workspaces, what are all the paths that lead to the dependency. Note that the display is somewhat optimized in that it will not print the package listing twice for a single package, so if you see a leaf named "Foo" when looking for "Bar", it means that "Foo" already got printed higher in the tree.
`,examples:[["Explain why lodash is used in your project","$0 why lodash"]]});var sae=vm;function XWe(r,e,{configuration:t,peers:i}){let n=Se.sortMap(r.storedPackages.values(),a=>P.stringifyLocator(a)),s={},o={children:s};for(let a of n){let l={},c=null;for(let u of a.dependencies.values()){if(!i&&a.peerDependencies.has(u.identHash))continue;let g=r.storedResolutions.get(u.descriptorHash);if(!g)throw new Error("Assertion failed: The resolution should have been registered");let f=r.storedPackages.get(g);if(!f)throw new Error("Assertion failed: The package should have been registered");if(f.identHash!==e)continue;if(c===null){let p=P.stringifyLocator(a);s[p]={value:[a,ae.Type.LOCATOR],children:l}}let h=P.stringifyLocator(f);l[h]={value:[{descriptor:u,locator:f},ae.Type.DEPENDENT]}}}return o}function ZWe(r,e,{configuration:t,peers:i}){let n=Se.sortMap(r.workspaces,f=>P.stringifyLocator(f.anchoredLocator)),s=new Set,o=new Set,a=f=>{if(s.has(f.locatorHash))return o.has(f.locatorHash);if(s.add(f.locatorHash),f.identHash===e)return o.add(f.locatorHash),!0;let h=!1;f.identHash===e&&(h=!0);for(let p of f.dependencies.values()){if(!i&&f.peerDependencies.has(p.identHash))continue;let m=r.storedResolutions.get(p.descriptorHash);if(!m)throw new Error("Assertion failed: The resolution should have been registered");let y=r.storedPackages.get(m);if(!y)throw new Error("Assertion failed: The package should have been registered");a(y)&&(h=!0)}return h&&o.add(f.locatorHash),h};for(let f of n){let h=r.storedPackages.get(f.anchoredLocator.locatorHash);if(!h)throw new Error("Assertion failed: The package should have been registered");a(h)}let l=new Set,c={},u={children:c},g=(f,h,p)=>{if(!o.has(f.locatorHash))return;let m=p!==null?ae.tuple(ae.Type.DEPENDENT,{locator:f,descriptor:p}):ae.tuple(ae.Type.LOCATOR,f),y={},b={value:m,children:y},v=P.stringifyLocator(f);if(h[v]=b,!l.has(f.locatorHash)&&(l.add(f.locatorHash),!(p!==null&&r.tryWorkspaceByLocator(f))))for(let k of f.dependencies.values()){if(!i&&f.peerDependencies.has(k.identHash))continue;let T=r.storedResolutions.get(k.descriptorHash);if(!T)throw new Error("Assertion failed: The resolution should have been registered");let Y=r.storedPackages.get(T);if(!Y)throw new Error("Assertion failed: The package should have been registered");g(Y,y,k)}};for(let f of n){let h=r.storedPackages.get(f.anchoredLocator.locatorHash);if(!h)throw new Error("Assertion failed: The package should have been registered");g(h,c,null)}return u}var GN={};ft(GN,{default:()=>E3e,gitUtils:()=>Su});var Su={};ft(Su,{TreeishProtocols:()=>Mn,clone:()=>KN,fetchBase:()=>Sae,fetchChangedFiles:()=>vae,fetchChangedWorkspaces:()=>C3e,fetchRoot:()=>Qae,isGitUrl:()=>nh,lsRemote:()=>bae,normalizeLocator:()=>ON,normalizeRepoUrl:()=>km,resolveUrl:()=>UN,splitRepoUrl:()=>xm});var LN=ge(Iae()),yae=ge($w()),ih=ge(require("querystring")),TN=ge(ri()),wae=ge(require("url"));function Bae(){return te(N({},process.env),{GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND||`${process.env.GIT_SSH||"ssh"}-oBatchMode=yes`})}var d3e=[/^ssh:/,/^git(?:\+[^:]+)?:/,/^(?:git\+)?https?:[^#]+\/[^#]+(?:\.git)(?:#.*)?$/,/^git@[^#]+\/[^#]+\.git(?:#.*)?$/,/^(?:github:|https:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z._0-9-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z._0-9-]+?)(?:\.git)?(?:#.*)?$/,/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/],Mn;(function(n){n.Commit="commit",n.Head="head",n.Tag="tag",n.Semver="semver"})(Mn||(Mn={}));function nh(r){return r?d3e.some(e=>!!r.match(e)):!1}function xm(r){r=km(r);let e=r.indexOf("#");if(e===-1)return{repo:r,treeish:{protocol:Mn.Head,request:"HEAD"},extra:{}};let t=r.slice(0,e),i=r.slice(e+1);if(i.match(/^[a-z]+=/)){let n=ih.default.parse(i);for(let[l,c]of Object.entries(n))if(typeof c!="string")throw new Error(`Assertionfailed:The${l}parametermustbealiteralstring`);let s=Object.values(Mn).find(l=>Object.prototype.hasOwnProperty.call(n,l)),o,a;typeof s!="undefined"?(o=s,a=n[s]):(o=Mn.Head,a="HEAD");for(let l of Object.values(Mn))delete n[l];return{repo:t,treei
-`)}?`)}returnthis.cli.run([this.commandName,...this.args],{cwd:o.cwd})}};Dm.paths=[["workspace"]],Dm.usage=Re.Usage({category:"Workspace-related commands",description:"run a command within the specified workspace",details:`
`,examples:[["Add a package to a single workspace","yarn workspace components add -D react"],["Run build script on a single workspace","yarn workspace components run build"]]});var xae=Dm;var I3e={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:Ie.BOOLEAN,default:Pae.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:Ie.STRING,values:["^","~",""],default:da.CARET}},commands:[Kne,jne,ioe,poe,eae,Koe,koe,kae,yoe,woe,Boe,boe,Mne,Une,doe,moe,Qoe,Soe,Poe,Roe,Foe,Loe,rae,Toe,Joe,Yoe,Woe,Ooe,zoe,_oe,Voe,Zoe,$oe,nae,sae,xae]},y3e=I3e;var _N={};ft(_N,{default:()=>B3e});var He={optional:!0},qN=[["@tailwindcss/aspect-ratio@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@tailwindcss/line-clamp@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@fullhuman/postcss-purgecss@3.1.3 || 3.1.3-alpha.0",{peerDependencies:{postcss:"^8.0.0"}}],["@samverschueren/stream-to-observable@<0.3.1",{peerDependenciesMeta:{rxjs:He,zenObservable:He}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:He,zenObservable:He}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{["supports-color"]:He}}],["got@<11",{dependencies:{["@types/responselike"]:"^1.0.0",["@types/keyv"]:"^3.1.1"}}],["cacheable-lookup@<4.1.2",{dependencies:{["@types/keyv"]:"^3.1.1"}}],["http-link-dataloader@*",{peerDependencies:{graphql:"^0.13.1 || ^14.0.0"}}],["typescript-language-server@*",{dependencies:{["vscode-jsonrpc"]:"^5.0.1",["vscode-languageserver-protocol"]:"^3.15.0"}}],["postcss-syntax@*",{peerDependenciesMeta:{["postcss-html"]:He,["postcss-jsx"]:He,["postcss-less"]:He,["postcss-markdown"]:He,["postcss-scss"]:He}}],["jss-plugin-rule-value-function@<=10.1.1",{dependencies:{["tiny-warning"]:"^1.0.2"}}],["ink-select-input@<4.1.0",{peerDependencies:{react:"^16.8.2"}}],["license-webpack-plugin@<2.3.18",{peerDependenciesMeta:{webpack:He}}],["snowpack@>=3.3.0",{dependencies:{["node-gyp"]:"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:He}}],["reactcss@*",{peerDependencies:{react:"*"}}],["react-color@<=2.19.0",{peerDependencies:{react:"*"}}],["gatsby-plugin-i18n@*",{dependencies:{ramda:"^0.24.1"}}],["useragent@^2.0.0",{dependencies:{request:"^2.88.0",yamlparser:"0.0.x",semver:"5.5.x"}}],["@apollographql/apollo-tools@<=0.5.2",{peerDependencies:{graphql:"^14.2.1 || ^15.0.0"}}],["material-table@^2.0.0",{dependencies:{"@babel/runtime":"^7.11.2"}}],["@babel/parser@*",{dependencies:{"@babel/types":"^7.8.3"}}],["fork-ts-checker-webpack-plugin@<=6.3.4",{peerDependencies:{eslint:">= 6",typescript:">= 2.7",webpack:">= 4","vue-template-compiler":"*"},peerDependenciesMeta:{eslint:He,"vue-template-compiler":He}}],["rc-animate@<=3.1.1",{peerDependencies:{react:">=16.9.0","react-dom":">=16.9.0"}}],["react-bootstrap-table2-paginator@*",{dependencies:{classnames:"^2.2.6"}}],["react-draggable@<=4.4.3",{peerDependencies:{react:">= 16.3.0","react-dom":">= 16.3.0"}}],["apollo-upload-client@<14",{peerDependencies:{graphql:"14 - 15"}}],["react-instantsearch-core@<=6.7.0",{peerDependencies:{algoliasearch:">= 3.1 < 5"}}],["react-instantsearch-dom@<=6.7.0",{dependencies:{"react-fast-compare":"^3.0.0"}}],["ws@<7.2.1",{peerDependencies:{bufferutil:"^4.0.1","utf-8-validate":"^5.0.2"},peerDependenciesMeta:{bufferutil:He,"utf-8-validate":He}}],["react-portal@*",{peerDependencies:{"react-dom":"^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0"}}],["react-scripts@<=4.0.1",{peerDependencies:{react:"*"}}],["testcafe@<=1.10.1",{dependencies:{"@babel/plugin-transform-for-of":"^7.12.1","@babel/runtime":"^7.12.5"}}],["testcafe-legacy-api@<=4.2.0",{dependencies:{"testcafe-hammerhead":"^17.0.1","read-file-relative":"^1.2.0"}}],["@google-cloud/firestore@<=4.9.3",{dependencies:{protobufjs:"^6.8.6"}}],["gatsby-source-apiserver@*",{dependencies:{["babel-polyfill"]:"^6.26.0"}}],["@webpack-cli/package-utils@<=1.0.1-alpha.4",{dependencies:{["cross-spawn"]:"^7.0.3"}}],["gatsby-remark-prismjs@<3.3.28",{dependencies:{lodash:"^4"}}],["gatsby-plu
`);let u=await ye.find(t,this.context.plugins),{project:g,workspace:f}=await ze.find(u,t);if(f===null)throw new ht(g.cwd,t);await g.restoreInstallState();let h=await Zt.getWorkspaceAccessibleBinaries(f);return h.has(l)===!1&&h.size===1&&typeof this.packages=="undefined"&&(l=Array.from(h)[0][0]),await Zt.executeWorkspaceAccessibleBinary(f,l,this.args,{packageAccessibleBinaries:h,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};Rm.paths=[["dlx"]],Rm.usage=Re.Usage({description:"run a package in a temporary environment",details:"\n This command will install a package within a temporary environment, and run its binary script if it contains any. The binary will run within the current cwd.\n\n By default Yarn will download the package named `command`, but this can be changed through the use of the `-p,--package` flag which will instruct Yarn to still run the same command but from a different package.\n\n Using `yarndlx` as a replacement of `yarnadd` isn't recommended, as it makes your project non-deterministic (Yarn doesn't keep track of the packages installed through `dlx` - neither their name, nor their version).\n ",examples:[["Use create-react-app to create a new React app","yarn dlx create-react-app ./my-app"],["Install multiple packages for a single command",`yarndlx-ptypescript-pts-nodets-node--transpile-only-e"console.log('hello!')"`]]});var Tae=Rm;var b3e={commands:[Lae,Tae]},Q3e=b3e;var sL={};ft(sL,{default:()=>k3e,fileUtils:()=>XN});var sh=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,Fm=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,Xr="file:";var XN={};ft(XN,{makeArchiveFromLocator:()=>$0,makeBufferFromLocator:()=>eL,makeLocator:()=>$N,makeSpec:()=>Oae,parseSpec:()=>ZN});function ZN(r){let{params:e,selector:t}=P.parseRange(r),i=H.toPortablePath(t);return{parentLocator:e&&typeof e.locator=="string"?P.parseLocator(e.locator):null,path:i}}function Oae({parentLocator:r,path:e,folderHash:t,protocol:i}){let n=r!==null?{locator:P.stringifyLocator(r)}:{},s=typeof t!="undefined"?{hash:t}:{};return P.makeRange({protocol:i,source:e,selector:e,params:N(N({},s),n)})}function $N(r,{parentLocator:e,path:t,folderHash:i,protocol:n}){return P.makeLocator(r,Oae({parentLocator:e,path:t,folderHash:i,protocol:n}))}async function $0(r,{protocol:e,fetchOptions:t,inMemory:i=!1}){let{parentLocator:n,path:s}=P.parseFileStyleRange(r.reference,{protocol:e}),o=x.isAbsolute(s)?{packageFs:new _t(Me.root),prefixPath:Me.dot,localPath:Me.root}:await t.fetcher.fetch(n,t),a=o.localPath?{packageFs:new _t(Me.root),prefixPath:x.relative(Me.root,o.localPath)}:o;o!==a&&o.releaseFs&&o.releaseFs();let l=a.packageFs,c=x.join(a.prefixPath,s);return await Se.releaseAfterUseAsync(async()=>await Bi.makeArchiveFromDirectory(c,{baseFs:l,prefixPath:P.getIdentVendorPath(r),compressionLevel:t.project.configuration.get("compressionLevel"),inMemory:i}),a.releaseFs)}async function eL(r,{protocol:e,fetchOptions:t}){return(await $0(r,{protocol:e,fetchOptions:t,inMemory:!0})).getBufferAndClose()}var tL=class{supports(e,t){return!!e.reference.startsWith(Xr)}getLocalPath(e,t){let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:Xr});if(x.isAbsolute(n))return n;let s=t.fetcher.getLocalPath(i,t);return s===null?null:x.resolve(s,n)}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,N({onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${P.prettyLocator(t.project.configuration,e)}can'tbefoundinthecacheandwillbefetchedfromthedisk`),loader:()=>this.fetchFromDisk(e,t),skipIntegrityCheck:t.skipIntegrityCheck},t.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:P.getIdentVendorPath(e),localPath:this.getLocalPath(e,t),checksum:o}}async fetchFromDisk(e,t){return $0(e,{protocol:Xr,fetchOptions:t})}};var S3e=2,rL=class{supportsDescriptor(e,t){return e.range.match(sh)?!0:!!e.range.startsWith(Xr)}supportsLocator(e,t){return!!e.reference.startsWith(Xr)}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i)
`),!t||t.cwd===this.context.cwd){let c=x.join(this.context.cwd,xt.lockfile);U.existsSync(c)||await U.writeFilePromise(c,"");let g=[".yarn/*","!.yarn/patches","!.yarn/plugins","!.yarn/releases","!.yarn/sdks","!.yarn/versions","","# Swap the comments on the following lines if you don't wish to use zero-installs","# Documentation here: https://yarnpkg.com/features/zero-installs","!.yarn/cache","#.pnp.*"].map(y=>`${y}
`}let m=x.join(this.context.cwd,".editorconfig");U.existsSync(m)||await U.writeFilePromise(m,p),U.existsSync(x.join(this.context.cwd,".git"))||await Nr.execvp("git",["init"],{cwd:this.context.cwd})}}};Tm.paths=[["init"]],Tm.usage=Re.Usage({description:"create a new package",details:"\n This command will setup a new package in your local directory.\n\n If the `-p,--private` or `-w,--workspace` options are set, the package will be private by default.\n\n If the `-w,--workspace` option is set, the package will be configured to accept a set of workspaces in the `packages/` directory.\n\n If the `-i,--install` option is given a value, Yarn will first download it using `yarnsetversion` and only then forward the init call to the newly downloaded bundle. Without arguments, the downloaded bundle will be `latest`.\n\n The initial settings of the manifest can be changed by using the `initScope` and `initFields` configuration values. Additionally, Yarn will generate an EditorConfig file whose rules can be altered via `initEditorConfig`, and will initialize a Git repository in the current directory.\n ",examples:[["Create a new package in the local directory","yarn init"],["Create a new private package in the local directory","yarn init -p"],["Create a new package and store the Yarn release inside","yarn init -i=latest"],["Create a new private package and defines it as a workspace root","yarn init -w"]]});var pAe=Tm;var F4e={configuration:{initScope:{description:"Scope used when creating packages via the init command",type:Ie.STRING,default:null},initFields:{description:"Additional fields to set when creating packages via the init command",type:Ie.MAP,valueDefinition:{description:"",type:Ie.ANY}},initEditorConfig:{description:"Extra rules to define in the generator editorconfig",type:Ie.MAP,valueDefinition:{description:"",type:Ie.ANY}}},commands:[pAe]},N4e=F4e;var EL={};ft(EL,{default:()=>T4e});var BA="portal:",bA="link:";var pL=class{supports(e,t){return!!e.reference.startsWith(BA)}getLocalPath(e,t){let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:BA});if(x.isAbsolute(n))return n;let s=t.fetcher.getLocalPath(i,t);return s===null?null:x.resolve(s,n)}async fetch(e,t){var c;let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:BA}),s=x.isAbsolute(n)?{packageFs:new _t(Me.root),prefixPath:Me.dot,localPath:Me.root}:await t.fetcher.fetch(i,t),o=s.localPath?{packageFs:new _t(Me.root),prefixPath:x.relative(Me.root,s.localPath),localPath:Me.root}:s;s!==o&&s.releaseFs&&s.releaseFs();let a=o.packageFs,l=x.resolve((c=o.localPath)!=null?c:o.packageFs.getRealPath(),o.prefixPath,n);return s.localPath?{packageFs:new _t(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Me.dot,localPath:l}:{packageFs:new Ta(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Me.dot}}};var dL=class{supportsDescriptor(e,t){return!!e.range.startsWith(BA)}supportsLocator(e,t){return!!e.reference.startsWith(BA)}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){return P.bindDescriptor(e,{locator:P.stringifyLocator(t)})}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){let n=e.range.slice(BA.length);return[P.makeLocator(e,`${BA}${H.toPortablePath(n)}`)]}async getSatisfying(e,t,i){return null}async resolve(e,t){if(!t.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let i=await t.fetchOptions.fetcher.fetch(e,t.fetchOptions),n=await Se.releaseAfterUseAsync(async()=>await At.find(i.prefixPath,{baseFs:i.packageFs}),i.releaseFs);return te(N({},e),{version:n.version||"0.0.0",languageName:n.languageName||t.project.configuration.get("defaultLanguageName"),linkType:Qt.SOFT,conditions:n.getConditions(),dependencies:new Map([...n.dependencies]),peerDependencies:n.peerDependencies,dependenciesMeta:n.dependenciesMeta,peerDependenciesMeta:n.peerDependenciesMeta,bin:n.bin})}};var CL=class{supports(e,t){return!!e.reference.startsWith(bA)}getLocalPath(e,t){let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:bA});if(x.isAbso
${Om(a)}`);let f=CAe(a);if(f)throw new Error(`${f},afterhoistingfinished:
${Om(a)}`)}return s.debugLevel>=2&&console.log(Om(a)),M4e(a)},U4e=r=>{let e=r[r.length-1],t=new Map,i=new Set,n=s=>{if(!i.has(s)){i.add(s);for(let o of s.hoistedDependencies.values())t.set(o.name,o);for(let o of s.dependencies.values())s.peerNames.has(o.name)||n(o)}};return n(e),t},K4e=r=>{let e=r[r.length-1],t=new Map,i=new Set,n=new Set,s=(o,a)=>{if(i.has(o))return;i.add(o);for(let c of o.hoistedDependencies.values())if(!a.has(c.name)){let u;for(let g of r)u=g.dependencies.get(c.name),u&&t.set(u.name,u)}let l=new Set;for(let c of o.dependencies.values())l.add(c.name);for(let c of o.dependencies.values())o.peerNames.has(c.name)||s(c,l)};return s(e,n),t},EAe=(r,e)=>{if(e.decoupled)return e;let{name:t,references:i,ident:n,locator:s,dependencies:o,originalDependencies:a,hoistedDependencies:l,peerNames:c,reasons:u,isHoistBorder:g,hoistPriority:f,dependencyKind:h,hoistedFrom:p,hoistedTo:m}=e,y={name:t,references:new Set(i),ident:n,locator:s,dependencies:new Map(o),originalDependencies:new Map(a),hoistedDependencies:new Map(l),peerNames:new Set(c),reasons:new Map(u),decoupled:!0,isHoistBorder:g,hoistPriority:f,dependencyKind:h,hoistedFrom:new Map(p),hoistedTo:new Map(m)},b=y.dependencies.get(t);return b&&b.ident==y.ident&&y.dependencies.set(t,y),r.dependencies.set(y.name,y),y},H4e=(r,e)=>{let t=new Map([[r.name,[r.ident]]]);for(let n of r.dependencies.values())r.peerNames.has(n.name)||t.set(n.name,[n.ident]);let i=Array.from(e.keys());i.sort((n,s)=>{let o=e.get(n),a=e.get(s);return a.hoistPriority!==o.hoistPriority?a.hoistPriority-o.hoistPriority:a.peerDependents.size!==o.peerDependents.size?a.peerDependents.size-o.peerDependents.size:a.dependents.size-o.dependents.size});for(let n of i){let s=n.substring(0,n.indexOf("@",1)),o=n.substring(s.length+1);if(!r.peerNames.has(s)){let a=t.get(s);a||(a=[],t.set(s,a)),a.indexOf(o)<0&&a.push(o)}}return t},wL=r=>{let e=new Set,t=(i,n=new Set)=>{if(!n.has(i)){n.add(i);for(let s of i.peerNames)if(!r.peerNames.has(s)){let o=r.dependencies.get(s);o&&!e.has(o)&&t(o,n)}e.add(i)}};for(let i of r.dependencies.values())r.peerNames.has(i.name)||t(i);return e},yL=(r,e,t,i,n,s=new Set)=>{let o=e[e.length-1];if(s.has(o))return{anotherRoundNeeded:!1,isGraphChanged:!1};s.add(o);let a=G4e(o),l=H4e(o,a),c=r==o?new Map:n.fastLookupPossible?U4e(e):K4e(e),u,g=!1,f=!1,h=new Map(Array.from(l.entries()).map(([m,y])=>[m,y[0]])),p=new Map;do{let m=j4e(r,e,t,c,h,l,i,p,n);m.isGraphChanged&&(f=!0),m.anotherRoundNeeded&&(g=!0),u=!1;for(let[y,b]of l)b.length>1&&!o.dependencies.has(y)&&(h.delete(y),b.shift(),h.set(y,b[0]),u=!0)}while(u);for(let m of o.dependencies.values())if(!o.peerNames.has(m.name)&&!t.has(m.locator)){t.add(m.locator);let y=yL(r,[...e,m],t,p,n);y.isGraphChanged&&(f=!0),y.anotherRoundNeeded&&(g=!0),t.delete(m.locator)}return{anotherRoundNeeded:g,isGraphChanged:f}},Y4e=r=>{for(let[e,t]of r.dependencies)if(!r.peerNames.has(e)&&t.ident!==r.ident)return!0;return!1},q4e=(r,e,t,i,n,s,o,a,{outputReason:l,fastLookupPossible:c})=>{let u,g=null,f=new Set;l&&(u=`${Array.from(e).map(y=>Li(y)).join("\u2192")}`);let h=t[t.length-1],m=!(i.ident===h.ident);if(l&&!m&&(g="- self-reference"),m&&(m=i.dependencyKind!==1,l&&!m&&(g="- workspace")),m&&i.dependencyKind===2&&(m=!Y4e(i),l&&!m&&(g="- external soft link with unhoisted dependencies")),m&&(m=h.dependencyKind!==1||h.hoistedFrom.has(i.name)||e.size===1,l&&!m&&(g=h.reasons.get(i.name))),m&&(m=!r.peerNames.has(i.name),l&&!m&&(g=`-cannotshadowpeer:${Li(r.originalDependencies.get(i.name).locator)}at${u}`)),m){let y=!1,b=n.get(i.name);if(y=!b||b.ident===i.ident,l&&!y&&(g=`-filledby:${Li(b.locator)}at${u}`),y)for(let v=t.length-1;v>=1;v--){let T=t[v].dependencies.get(i.name);if(T&&T.ident!==i.ident){y=!1;let Y=a.get(h);Y||(Y=new Set,a.set(h,Y)),Y.add(i.name),l&&(g=`-filledby${Li(T.locator)}at${t.slice(0,v).map(q=>Li(q.locator)).join("\u2192")}`);break}}m=y}if(m&&(m=s.get(i.name)===i.ident,l&&!m&&(g=`-filledby:${Li(o.get(i.name)[0])}at${u}`)),m){let y=!0,b=new Set(i.peerNames);for(let v=t.length-1;v>=1;v--){let k=t[v];for(let T of b){if(k.peerNames.h
${Om(r)}`)}let ce=wL(T);for(let Z of ce)if(ee.has(Z)){let O=ne.get(Z);if((n.get(Z.name)===Z.ident||!T.reasons.has(Z.name))&&O.isHoistable!==0&&T.reasons.set(Z.name,O.reason),!Z.isHoistBorder&&$.indexOf(eb(Z))<0){u.add(T);let de=EAe(T,Z);h([...b,T],q,$,de,m),u.delete(T)}}},p,m=new Set(wL(c)),y=Array.from(e).map(b=>eb(b));do{p=m,m=new Set;for(let b of p){if(b.locator===c.locator||b.isHoistBorder)continue;let v=EAe(c,b);h([],Array.from(t),y,v,m)}}while(m.size>0);return{anotherRoundNeeded:g,isGraphChanged:f}},CAe=r=>{let e=[],t=new Set,i=new Set,n=(s,o,a)=>{if(t.has(s)||(t.add(s),i.has(s)))return;let l=new Map(o);for(let c of s.dependencies.values())s.peerNames.has(c.name)||l.set(c.name,c);for(let c of s.originalDependencies.values()){let u=l.get(c.name),g=()=>`${Array.from(i).concat([s]).map(f=>Li(f.locator)).join("\u2192")}`;if(s.peerNames.has(c.name)){let f=o.get(c.name);(f!==u||!f||f.ident!==c.ident)&&e.push(`${g()}-brokenpeerpromise:expected${c.ident}butfound${f&&f.ident}`)}else{let f=a.hoistedFrom.get(s.name),h=s.hoistedTo.get(c.name),p=`${f?` hoisted from ${f.join(", ")}`:""}`,m=`${h?` hoisted to ${h}`:""}`,y=`${g()}${p}`;u?u.ident!==c.ident&&e.push(`${y}-brokenrequirepromisefor${c.name}${m}:expected${c.ident},butfound:${u.ident}`):e.push(`${y}-brokenrequirepromise:norequireddependency${c.name}${m}found`)}}i.add(s);for(let c of s.dependencies.values())s.peerNames.has(c.name)||n(c,l,s);i.delete(s)};return n(r,r.dependencies,r),e.join(`
`)},O4e=(r,e)=>{let{identName:t,name:i,reference:n,peerNames:s}=r,o={name:i,references:new Set([n]),locator:IL(t,n),ident:dAe(t,n),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(s),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistPriority:0,dependencyKind:1,hoistedFrom:new Map,hoistedTo:new Map},a=new Map([[r,o]]),l=(c,u)=>{let g=a.get(c),f=!!g;if(!g){let{name:h,identName:p,reference:m,peerNames:y,hoistPriority:b,dependencyKind:v}=c,k=e.hoistingLimits.get(u.locator);g={name:h,references:new Set([m]),locator:IL(p,m),ident:dAe(p,m),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(y),reasons:new Map,decoupled:!0,isHoistBorder:k?k.has(h):!1,hoistPriority:b||0,dependencyKind:v||0,hoistedFrom:new Map,hoistedTo:new Map},a.set(c,g)}if(u.dependencies.set(c.name,g),u.originalDependencies.set(c.name,g),f){let h=new Set,p=m=>{if(!h.has(m)){h.add(m),m.decoupled=!1;for(let y of m.dependencies.values())m.peerNames.has(y.name)||p(y)}};p(g)}else for(let h of c.dependencies)l(h,g)};for(let c of r.dependencies)l(c,o);return o},BL=r=>r.substring(0,r.indexOf("@",1)),M4e=r=>{let e={name:r.name,identName:BL(r.locator),references:new Set(r.references),dependencies:new Set},t=new Set([r]),i=(n,s,o)=>{let a=t.has(n),l;if(s===n)l=o;else{let{name:c,references:u,locator:g}=n;l={name:c,identName:BL(g),references:u,dependencies:new Set}}if(o.dependencies.add(l),!a){t.add(n);for(let c of n.dependencies.values())n.peerNames.has(c.name)||i(c,n,l);t.delete(n)}};for(let n of r.dependencies.values())i(n,r,e);return e},G4e=r=>{let e=new Map,t=new Set([r]),i=o=>`${o.name}@${o.ident}`,n=o=>{let a=i(o),l=e.get(a);return l||(l={dependents:new Set,peerDependents:new Set,hoistPriority:0},e.set(a,l)),l},s=(o,a)=>{let l=!!t.has(a);if(n(a).dependents.add(o.ident),!l){t.add(a);for(let u of a.dependencies.values()){let g=n(u);g.hoistPriority=Math.max(g.hoistPriority,u.hoistPriority),a.peerNames.has(u.name)?g.peerDependents.add(a.ident):s(a,u)}}};for(let o of r.dependencies.values())r.peerNames.has(o.name)||s(r,o);return e},Li=r=>{if(!r)return"none";let e=r.indexOf("@",1),t=r.substring(0,e);t.endsWith("$wsroot$")&&(t=`wh:${t.replace("$wsroot$","")}`);let i=r.substring(e+1);if(i==="workspace:.")return".";if(i){let n=(i.indexOf("#")>0?i.split("#")[1]:i).replace("npm:","");return i.startsWith("virtual")&&(t=`v:${t}`),n.startsWith("workspace")&&(t=`w:${t}`,n=""),`${t}${n?`@${n}`:""}`}else return`${t}`},IAe=5e4,Om=r=>{let e=0,t=(n,s,o="")=>{if(e>IAe||s.has(n))return"";e++;let a=Array.from(n.dependencies.values()).sort((c,u)=>c.name===u.name?0:c.name>u.name?1:-1),l="";s.add(n);for(let c=0;c<a.length;c++){let u=a[c];if(!n.peerNames.has(u.name)&&u!==n){let g=n.reasons.get(u.name),f=BL(u.locator);l+=`${o}${c<a.length-1?"\u251C\u2500":"\u2514\u2500"}${(s.has(u)?">":"")+(f!==u.name?`a:${u.name}:`:"")+Li(u.locator)+(g?`${g}`:"")}
`:"")};var bo;(function(t){t.HARD="HARD",t.SOFT="SOFT"})(bo||(bo={}));var Kn;(function(i){i.WORKSPACES="workspaces",i.DEPENDENCIES="dependencies",i.NONE="none"})(Kn||(Kn={}));var yAe="node_modules",vu="$wsroot$";var Mm=(r,e)=>{let{packageTree:t,hoistingLimits:i,errors:n,preserveSymlinksRequired:s}=J4e(r,e),o=null;if(n.length===0){let a=mAe(t,{hoistingLimits:i});o=W4e(r,a,e)}return{tree:o,errors:n,preserveSymlinksRequired:s}},Ca=r=>`${r.name}@${r.reference}`,bL=r=>{let e=new Map;for(let[t,i]of r.entries())if(!i.dirList){let n=e.get(i.locator);n||(n={target:i.target,linkType:i.linkType,locations:[],aliases:i.aliases},e.set(i.locator,n)),n.locations.push(t)}for(let t of e.values())t.locations=t.locations.sort((i,n)=>{let s=i.split(x.delimiter).length,o=n.split(x.delimiter).length;return n===i?0:s!==o?o-s:n>i?1:-1});return e},wAe=(r,e)=>{let t=P.isVirtualLocator(r)?P.devirtualizeLocator(r):r,i=P.isVirtualLocator(e)?P.devirtualizeLocator(e):e;return P.areLocatorsEqual(t,i)},QL=(r,e,t,i)=>{if(r.linkType!==bo.SOFT)return!1;let n=H.toPortablePath(t.resolveVirtual&&e.reference&&e.reference.startsWith("virtual:")?t.resolveVirtual(r.packageLocation):r.packageLocation);return x.contains(i,n)===null},z4e=r=>{let e=r.getPackageInformation(r.topLevel);if(e===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");if(r.findPackageLocator(e.packageLocation)===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let i=H.toPortablePath(e.packageLocation.slice(0,-1)),n=new Map,s={children:new Map},o=r.getDependencyTreeRoots(),a=new Map,l=new Set,c=(f,h)=>{let p=Ca(f);if(l.has(p))return;l.add(p);let m=r.getPackageInformation(f);if(m){let y=h?Ca(h):"";if(Ca(f)!==y&&m.linkType===bo.SOFT&&!QL(m,f,r,i)){let b=BAe(m,f,r);(!a.get(b)||f.reference.startsWith("workspace:"))&&a.set(b,f)}for(let[b,v]of m.packageDependencies)v!==null&&(m.packagePeers.has(b)||c(r.getLocator(b,v),f))}};for(let f of o)c(f,null);let u=i.split(x.sep);for(let f of a.values()){let h=r.getPackageInformation(f),m=H.toPortablePath(h.packageLocation.slice(0,-1)).split(x.sep).slice(u.length),y=s;for(let b of m){let v=y.children.get(b);v||(v={children:new Map},y.children.set(b,v)),y=v}y.workspaceLocator=f}let g=(f,h)=>{if(f.workspaceLocator){let p=Ca(h),m=n.get(p);m||(m=new Set,n.set(p,m)),m.add(f.workspaceLocator)}for(let p of f.children.values())g(p,f.workspaceLocator||h)};for(let f of s.children.values())g(f,s.workspaceLocator);return n},J4e=(r,e)=>{let t=[],i=!1,n=new Map,s=z4e(r),o=r.getPackageInformation(r.topLevel);if(o===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let a=r.findPackageLocator(o.packageLocation);if(a===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let l=H.toPortablePath(o.packageLocation.slice(0,-1)),c={name:a.name,identName:a.name,reference:a.reference,peerNames:o.packagePeers,dependencies:new Set,dependencyKind:Un.WORKSPACE},u=new Map,g=(h,p)=>`${Ca(p)}:${h}`,f=(h,p,m,y,b,v,k,T)=>{var Z,O;let Y=g(h,m),q=u.get(Y),$=!!q;!$&&m.name===a.name&&m.reference===a.reference&&(q=c,u.set(Y,c));let z=QL(p,m,r,l);if(!q){let L=Un.REGULAR;z?L=Un.EXTERNAL_SOFT_LINK:p.linkType===bo.SOFT&&m.name.endsWith(vu)&&(L=Un.WORKSPACE),q={name:h,identName:m.name,reference:m.reference,dependencies:new Set,peerNames:L===Un.WORKSPACE?new Set:p.packagePeers,dependencyKind:L},u.set(Y,q)}let ne;if(z?ne=2:b.linkType===bo.SOFT?ne=1:ne=0,q.hoistPriority=Math.max(q.hoistPriority||0,ne),T&&!z){let L=Ca({name:y.identName,reference:y.reference}),de=n.get(L)||new Set;n.set(L,de),de.add(q.name)}let ee=new Map(p.packageDependencies);if(e.project){let L=e.project.workspacesByCwd.get(H.toPortablePath(p.packageLocation.slice(0,-1)));if(L){let de=new Set([...Array.from(L.manifest.peerDependencies.values(),Be=>P.stringifyIdent(Be)),...Array.from(L.manifest.peerDependenciesMeta.keys())]);for(let Be of de)ee.has(Be)||(ee.set(Be,v.get(Be)||null),q.peerNames.add(Be))}}let A=Ca({name:m.name.replace(vu,""),reference:m.ref
`),s+=t,s+="}",s}function tb(r,e,t,i){let{next:n}=QAe[t],s=n[r]||n["*"];return SAe(e,s,i)}function SAe(r,e,t){let{collapsed:i}=QAe[e];return Array.isArray(r)?i?V4e(r,e,t):X4e(r,e,t):typeof r=="object"&&r!==null?i?Z4e(r,e,t):$4e(r,e,t):JSON.stringify(r)}function vAe(r){return SAe(r,er.TOP_LEVEL,"")}function Um(r,e){let t=Array.from(r);Array.isArray(e)||(e=[e]);let i=[];for(let s of e)i.push(t.map(o=>s(o)));let n=t.map((s,o)=>o);return n.sort((s,o)=>{for(let a of i){let l=a[s]<a[o]?-1:a[s]>a[o]?1:0;if(l!==0)return l}return 0}),n.map(s=>t[s])}function eze(r){let e=new Map,t=Um(r.fallbackExclusionList||[],[({name:i,reference:n})=>i,({name:i,reference:n})=>n]);for(let{name:i,reference:n}of t){let s=e.get(i);typeof s=="undefined"&&e.set(i,s=new Set),s.add(n)}return Array.from(e).map(([i,n])=>[i,Array.from(n)])}function tze(r){return Um(r.fallbackPool||[],([e])=>e)}function rze(r){let e=[];for(let[t,i]of Um(r.packageRegistry,([n])=>n===null?"0":`1${n}`)){let n=[];e.push([t,n]);for(let[s,{packageLocation:o,packageDependencies:a,packagePeers:l,linkType:c,discardFromLookup:u}]of Um(i,([g])=>g===null?"0":`1${g}`)){let g=[];t!==null&&s!==null&&!a.has(t)&&g.push([t,s]);for(let[p,m]of Um(a.entries(),([y])=>y))g.push([p,m]);let f=l&&l.size>0?Array.from(l):void 0,h=u||void 0;n.push([s,{packageLocation:o,packageDependencies:g,packagePeers:f,linkType:c,discardFromLookup:h}])}}return e}function Km(r){return{__info:["This file is automatically generated. Do not touch it, or risk","your modifications being lost. We also recommend you not to read","it either without using the @yarnpkg/pnp package, as the data layout","is entirely unspecified and WILL change from a version to another."],dependencyTreeRoots:r.dependencyTreeRoots,enableTopLevelFallback:r.enableTopLevelFallback||!1,ignorePatternData:r.ignorePattern||null,fallbackExclusionList:eze(r),fallbackPool:tze(r),packageRegistryData:rze(r)}}var PAe=ge(xAe());function DAe(r,e){return[r?`${r}
`," throw new Error(`ThewholePnPfilegotstrict-mode-ified,whichisknowntobreak(Emscriptenlibrariesaren'tstrictmode).ThisusuallyhappenswhenthefilegoesthroughBabel.`);\n",`}
`,{request:he,issuer:Fe});return H.toPortablePath(ve)}let Ue,xe=re.match(n);if(xe){if(!se)throw ai(ur.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:he,issuer:Fe});let[,ve,pe]=xe,V=Z(se);if(!V){let jt=$(re,se);if(jt===!1)throw ai(ur.BUILTIN_NODE_RESOLUTION_FAILED,`Thebuiltinnoderesolutionalgorithmwasunabletoresolvetherequestedmodule(itdidn't go through the pnp resolver because the issuer doesn'tseemtobepartoftheYarn-manageddependencytree).
`,{request:he,issuer:Fe,dependencyName:ve}):gt=ai(ur.UNDECLARED_DEPENDENCY,`${V.name}triedtoaccess${ve}.WhilethismoduleisusuallyinterpretedasaNodebuiltin,yourresolverisrunninginsideanon-Noderesolutioncontextwheresuchbuiltinsareignored.Since${ve}isn't otherwise declared in ${V.name}'sdependencies,thismakestherequirecallambiguousandunsound.
`,{request:he,issuer:Fe,issuerLocator:Object.assign({},V),dependencyName:ve}));if(le==null){if(fe===null||gt===null)throw gt||new Error("Assertion failed: Expected an error to have been set");le=fe;let jt=gt.message.replace(/\n.*/g,"");gt.message=jt,!u.has(jt)&&i!==0&&(u.add(jt),process.emitWarning(gt))}let Ht=Array.isArray(le)?{name:le[0],reference:le[1]}:{name:ve,reference:le},Mt=b(Ht);if(!Mt.packageLocation)throw ai(ur.MISSING_DEPENDENCY,`Adependencyseemsvalidbutdidn'tgetinstalledforsomereason.Thismightbecausedbyapartialinstall,suchasdevvsprod.
`,{request:he,issuer:Fe,dependencyLocator:Object.assign({},Ht)});let Ei=Mt.packageLocation;pe?Ue=x.join(Ei,pe):Ue=Ei}else if(x.isAbsolute(re))Ue=x.normalize(re);else{if(!se)throw ai(ur.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:he,issuer:Fe});let ve=x.resolve(se);se.match(o)?Ue=x.normalize(x.join(ve,re)):Ue=x.normalize(x.join(x.dirname(ve),re))}return x.normalize(Ue)}function L(re,se,be=k){if(s.test(re))return se;let he=T(se,be);return he?x.normalize(he):se}function de(re,{extensions:se=Object.keys(Hm.Module._extensions)}={}){var Fe,Ue;let be=[],he=Y(re,be,{extensions:se});if(he)return x.normalize(he);{let xe=Qo(re),ve=Z(re);if(ve){let{packageLocation:pe}=b(ve),V=!0;try{e.fakeFs.accessSync(pe)}catch(Qe){if((Qe==null?void 0:Qe.code)==="ENOENT")V=!1;else{let le=((Ue=(Fe=Qe==null?void 0:Qe.message)!=null?Fe:Qe)!=null?Ue:"empty exception thrown").replace(/^[A-Z]/,fe=>fe.toLowerCase());throw ai(ur.QUALIFIED_PATH_RESOLUTION_FAILED,`Requiredpackageexistsbutcouldnotbeaccessed(${le}).
`,{unqualifiedPath:xe,extensions:se})}}if(!V){let Qe=pe.includes("/unplugged/")?"Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).":"Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.";throw ai(ur.QUALIFIED_PATH_RESOLUTION_FAILED,`${Qe}
`).join("")}`,{unqualifiedPath:xe,extensions:se})}}functionBe(re,se,{considerBuiltins:be,extensions:he,conditions:Fe}={}){try{letUe=O(re,se,{considerBuiltins:be});if(re==="pnpapi")returnUe;if(Ue===null)returnnull;letxe=()=>se!==null?z(se):!1,ve=(!be||!rb(re))&&!xe()?L(re,Ue,Fe):Ue;returnde(ve,{extensions:he})}catch(Ue){throwObject.prototype.hasOwnProperty.call(Ue,"pnpCode")&&Object.assign(Ue.data,{request:Qo(re),issuer:se&&Qo(se)}),Ue}}functionGe(re){letse=x.normalize(re),be=Wr.resolveVirtual(se);returnbe!==se?be:null}return{VERSIONS:ne,topLevel:ee,getLocator:(re,se)=>Array.isArray(se)?{name:se[0],reference:se[1]}:{name:re,reference:se},getDependencyTreeRoots:()=>[...r.dependencyTreeRoots],getAllLocators(){letre=[];for(let[se,be]off)for(letheofbe.keys())se!==null&&he!==null&&re.push({name:se,reference:he});returnre},getPackageInformation:re=>{letse=A(re);if(se===null)returnnull;letbe=H.fromPortablePath(se.packageLocation);returnte(N({},se),{packageLocation:be})},findPackageLocator:re=>Z(H.toPortablePath(re)),resolveToUnqualified:y("resolveToUnqualified",(re,se,be)=>{lethe=se!==null?H.toPortablePath(se):null,Fe=O(H.toPortablePath(re),he,be);returnFe===null?null:H.fromPortablePath(Fe)}),resolveUnqualified:y("resolveUnqualified",(re,se)=>H.fromPortablePath(de(H.toPortablePath(re),se))),resolveRequest:y("resolveRequest",(re,se,be)=>{lethe=se!==null?H.toPortablePath(se):null,Fe=Be(H.toPortablePath(re),he,be);returnFe===null?null:H.fromPortablePath(Fe)}),resolveVirtual:y("resolveVirtual",re=>{letse=Ge(H.toPortablePath(re));returnse!==null?H.fromPortablePath(se):null})}}varU0t=(0,OAe.promisify)(TAe.readFile);varMAe=(r,e,t)=>{leti=Km(r),n=vL(i,{basePath:e}),s=H.join(e,xt.pnpCjs);returnxL(n,{fakeFs:t,pnpapiResolution:s})};varDL=ge(KAe());varma={};ft(ma,{checkAndReportManifestCompatibility:()=>jAe,checkManifestCompatibility:()=>HAe,extractBuildScripts:()=>ib,getExtractHint:()=>RL,hasBindingGyp:()=>FL});functionHAe(r){returnP.isPackageCompatible(r,Xg.getArchitectureSet())}functionjAe(r,e,{configuration:t,report:i}){returnHAe(r)?!0:(i==null||i.reportWarningOnce(X.INCOMPATIBLE_ARCHITECTURE,`${P.prettyLocator(t,r)} The ${Xg.getArchitectureName()} architecture is incompatible with this package, ${e} skipped.`),!1)}functionib(r,e,t,{configuration:i,report:n}){lets=[];for(letaof["preinstall","install","postinstall"])e.manifest.scripts.has(a)&&s.push([cs.SCRIPT,a]);return!e.manifest.scripts.has("install")&&e.misc.hasBindingGyp&&s.push([cs.SHELLCODE,"node-gyp rebuild"]),s.length===0?[]:r.linkType!==Qt.HARD?(n==null||n.reportWarningOnce(X.SOFT_LINK_BUILD,`${P.prettyLocator(i,r)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`),[]):t&&t.built===!1?(n==null||n.reportInfoOnce(X.BUILD_DISABLED,`${P.prettyLocator(i,r)} lists build scripts, but its build has been explicitly disabled through configuration.`),[]):!i.get("enableScripts")&&!t.built?(n==null||n.reportWarningOnce(X.DISABLED_BUILD_SCRIPTS,`${P.prettyLocator(i,r)} lists build scripts, but all build scripts have been disabled.`),[]):jAe(r,"build",{configuration:i,report:n})?s:[]}varfze=newSet([".exe",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);functionRL(r){returnr.packageFs.getExtractHint({relevantExtensions:fze})}functionFL(r){lete=x.join(r.prefixPath,"binding.gyp");returnr.packageFs.existsSync(e)}varNL={};ft(NL,{getUnpluggedPath:()=>jm});functionjm(r,{configuration:e}){returnx.resolve(e.get("pnpUnpluggedFolder"),P.slugifyLocator(r))}varhze=newSet([P.makeIdent(null,"nan").identHash,P.makeIdent(null,"node-gyp").identHash,P.makeIdent(null,"node-pre-gyp").identHash,P.makeIdent(null,"node-addon-api").identHash,P.makeIdent(null,"fsevents").identHash,P.makeIdent(null,"open").identHash,P.makeIdent(null,"opn").identHash]),xu=class{constructor(){this.mode="strict";this.pnpCache=newMap}supportsPackage(e,t){returnthis.isEnabled(t)}asyncfindPackageLocation(e,t){if(!this.isEnabled(t))thrownewError("Assertionfailed:ExpectedthePnPlinkertobeenabl
`;for(let f of g.locations){let h=x.contains(r.cwd,f);if(h===null)throw new Error(`Assertionfailed:Expectedthepathtobewithintheproject(${f})`);s+=`-${JSON.stringify(h)}
`;for(let[f,h]of t){let p=x.contains(r.cwd,f);if(p===null)throw new Error(`Assertionfailed:Expectedthepathtobewithintheproject(${f})`);s+=`${JSON.stringify(p)}:
Forconsistencywithourothercommandsthedefaultistoonlycheckthedirectdependenciesfortheactiveworkspace.Toextendthissearchtoallworkspaces,use\`-A,--all\`. To extend this search to both direct and transitive dependencies, use \`-R,--recursive\`.
Applyingthe\`--severity\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${Fb.map(e=>`\`${e}\``).join(", ")}.
Ifthe\`--json\` flag is set, Yarn will print the output exactly as received from the registry. Regardless of this flag, the process will exit with a non-zero exit code if a report is found for the selected packages.
Tounderstandthedependencytreerequiringvulnerablepackages,checktherawreportwiththe\`--json\` flag or use \`yarn why <package>\` to get more information as to who depends on them.
`,examples:[["Checks for known security issues with the installed packages. The output is a list of known issues.","yarn npm audit"],["Audit dependencies in all workspaces","yarn npm audit --all"],["Limit auditing to `dependencies` (excludes `devDependencies`)","yarn npm audit --environment production"],["Show audit report as valid JSON","yarn npm audit --json"],["Audit all direct and transitive dependencies","yarn npm audit --recursive"],["Output moderate (or more severe) vulnerabilities","yarn npm audit --severity moderate"]]});var due=oE;var zT=ge(ri()),_T=ge(require("util")),aE=class extends Le{constructor(){super(...arguments);this.fields=J.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=J.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd),i=typeof this.fields!="undefined"?new Set(["name",...this.fields.split(/\s*,\s*/)]):null,n=[],s=!1,o=await Je.start({configuration:e,includeFooter:!1,json:this.json,stdout:this.context.stdout},async a=>{for(let l of this.packages){let c;if(l==="."){let k=t.topLevelWorkspace;if(!k.manifest.name)throw new Pe(`Missing${ae.pretty(e,"name",ae.Type.CODE)}fieldin${H.fromPortablePath(x.join(k.cwd,xt.manifest))}`);c=P.makeDescriptor(k.manifest.name,"unknown")}else c=P.parseDescriptor(l);let u=zt.getIdentUrl(c),g=VT(await zt.get(u,{configuration:e,ident:c,jsonResponse:!0,customErrorMessage:zt.customPackageError})),f=Object.keys(g.versions).sort(zT.default.compareLoose),p=g["dist-tags"].latest||f[f.length-1],m=Wt.validRange(c.range);if(m){let k=zT.default.maxSatisfying(f,m);k!==null?p=k:(a.reportWarning(X.UNNAMED,`Unmetrange${P.prettyRange(e,c.range)};fallingbacktothelatestversion`),s=!0)}else Object.prototype.hasOwnProperty.call(g["dist-tags"],c.range)?p=g["dist-tags"][c.range]:c.range!=="unknown"&&(a.reportWarning(X.UNNAMED,`Unknowntag${P.prettyRange(e,c.range)};fallingbacktothelatestversion`),s=!0);let y=g.versions[p],b=te(N(N({},g),y),{version:p,versions:f}),v;if(i!==null){v={};for(let k of i){let T=b[k];if(typeof T!="undefined")v[k]=T;else{a.reportWarning(X.EXCEPTION,`The${ae.pretty(e,k,ae.Type.CODE)}fielddoesn't exist inside ${P.prettyIdent(e,c)}'sinformation`),s=!0;continue}}}else this.json||(delete b.dist,delete b.readme,delete b.users),v=b;a.reportJson(v),this.json||n.push(v)}});_T.inspect.styles.name="cyan";for(let a of n)(a!==n[0]||s)&&this.context.stdout.write(`
`);return o.exitCode()}};aE.paths=[["npm","info"]],aE.usage=Re.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command fetches information about a package from the npm registry and prints it in a tree format.\n\n The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\n\n Append `@<range>` to the package argument to provide information specific to the latest version that satisfies the range or to the corresponding tagged version. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\n\n If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package information.\n\n By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\n ",examples:[["Show all available information about react (except the `dist`, `readme`, and `users` fields)","yarn npm info react"],["Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)","yarn npm info react --json"],["Show all available information about react@16.12.0","yarn npm info react@16.12.0"],["Show all available information about react@next","yarn npm info react@next"],["Show the description of react","yarn npm info react --fields description"],["Show all available versions of react","yarn npm info react --fields versions"],["Show the readme of react","yarn npm info react --fields readme"],["Show a few fields of react","yarn npm info react --fields homepage,repository"]]});var Cue=aE;function VT(r){if(Array.isArray(r)){let e=[];for(let t of r)t=VT(t),t&&e.push(t);return e}else if(typeof r=="object"&&r!==null){let e={};for(let t of Object.keys(r)){if(t.startsWith("_"))continue;let i=VT(r[t]);i&&(e[t]=i)}return e}else return r||null}var mue=ge(zC()),AE=class extends Le{constructor(){super(...arguments);this.scope=J.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=J.Boolean("--publish",!1,{description:"Login to the publish registry"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=await Nb({configuration:e,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{let s=await n_e({registry:t,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),o=`/-/user/org.couchdb.user:${encodeURIComponent(s.name)}`,a=awaitzt.put(o,s,{attemptedAs:s.name,configuration:e,registry:t,jsonResponse:!0,authType:zt.AuthType.NO_AUTH});returnawaiti_e(t,a.token,{configuration:e,scope:this.scope}),n.reportInfo(X.UNNAMED,"Successfullyloggedin")})).exitCode()}};AE.paths=[["npm","login"]],AE.usage=Re.Usage({category:"Npm-relatedcommands",description:"storenewlogininfotoaccessthenpmregistry",details:"\nThiscommandwillaskyouforyourusername,password,and2FAOne-Time-Password(whenitapplies).Itwillthenmodifyyourlocalconfiguration(inyourhomefolder,neverintheprojectitself)toreferencethenewtokensthusgenerated.\n\nAddingthe`-s,--scope`flagwillcausetheauthenticationtobedoneagainstwhateverregistryisconfiguredfortheassociatedscope(seealso`npmScopes`).\n\nAddingthe`--publish`flagwillcausetheauthenticationtobedoneagainsttheregistryusedwhenpublishingthepackage(seealso`publishConfig.registry`and`npmPublishRegistry`).\n",examples:[["Logintothedefaultregistry","yarnnpmlogin"],["Logintotheregistrylinkedtothe@my-scoperegistry","yarnnpmlogin--scopemy-scope"],["Logintothepublishregistryforthecurrentpackage","yarnnpmlogin--publish"]]});varEue=AE;asyncfunctionNb({scope:r,publish:e,co
`,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]});var Bue=uE;async function gE(r,e){let t=`/-/package${zt.getIdentUrl(r)}/dist-tags`;returnzt.get(t,{configuration:e,ident:r,jsonResponse:!0,customErrorMessage:zt.customPackageError})}varfE=classextendsLe{constructor(){super(...arguments);this.package=J.String();this.tag=J.String()}asyncexecute(){lete=awaitye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=awaitze.find(e,this.context.cwd);if(!i)thrownewht(t.cwd,this.context.cwd);letn=P.parseDescriptor(this.package,!0),s=n.range;if(!bue.default.valid(s))thrownewPe(`Therange${ae.pretty(e,n.range,ae.Type.RANGE)}mustbeavalidsemverversion`);leto=br.getPublishRegistry(i.manifest,{configuration:e}),a=ae.pretty(e,n,ae.Type.IDENT),l=ae.pretty(e,s,ae.Type.RANGE),c=ae.pretty(e,this.tag,ae.Type.CODE);return(awaitJe.start({configuration:e,stdout:this.context.stdout},asyncg=>{letf=awaitgE(n,e);Object.prototype.hasOwnProperty.call(f,this.tag)&&f[this.tag]===s&&g.reportWarning(X.UNNAMED,`Tag${c}isalreadysettoversion${l}`);leth=`/-/package${zt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;awaitzt.put(h,s,{configuration:e,registry:o,ident:n,jsonRequest:!0,jsonResponse:!0}),g.reportInfo(X.UNNAMED,`Tag${c}addedtoversion${l}ofpackage${a}`)})).exitCode()}};fE.paths=[["npm","tag","add"]],fE.usage=Re.Usage({category:"Npm-relatedcommands",description:"addatagforaspecificversionofapackage",details:`
`,examples:[["Add a `beta` tag for version `2.3.4-beta.4` of package `my-pkg`","yarn npm tag add my-pkg@2.3.4-beta.4 beta"]]});var Que=fE;var hE=class extends Le{constructor(){super(...arguments);this.package=J.String();this.tag=J.String()}async execute(){if(this.tag==="latest")throw new Pe("The 'latest' tag cannot be removed.");let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(t.cwd,this.context.cwd);let n=P.parseIdent(this.package),s=br.getPublishRegistry(i.manifest,{configuration:e}),o=ae.pretty(e,this.tag,ae.Type.CODE),a=ae.pretty(e,n,ae.Type.IDENT),l=await gE(n,e);if(!Object.prototype.hasOwnProperty.call(l,this.tag))throw new Pe(`${o}isnotatagofpackage${a}`);return(await Je.start({configuration:e,stdout:this.context.stdout},async u=>{let g=`/-/package${zt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;awaitzt.del(g,{configuration:e,registry:s,ident:n,jsonResponse:!0}),u.reportInfo(X.UNNAMED,`Tag${o}removedfrompackage${a}`)})).exitCode()}};hE.paths=[["npm","tag","remove"]],hE.usage=Re.Usage({category:"Npm-relatedcommands",description:"removeatagfromapackage",details:`
`,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]});var Sue=hE;var pE=class extends Le{constructor(){super(...arguments);this.scope=J.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=J.Boolean("--publish",!1,{description:"Print username for the publish registry"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t;return this.scope&&this.publish?t=br.getScopeRegistry(this.scope,{configuration:e,type:br.RegistryType.PUBLISH_REGISTRY}):this.scope?t=br.getScopeRegistry(this.scope,{configuration:e}):this.publish?t=br.getPublishRegistry((await zf(e,this.context.cwd)).manifest,{configuration:e}):t=br.getDefaultRegistry({configuration:e}),(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{var o,a;let s;try{s=await zt.get("/-/whoami",{configuration:e,registry:t,authType:zt.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?P.makeIdent(this.scope,""):void 0})}catch(l){if(((o=l.response)==null?void 0:o.statusCode)===401||((a=l.response)==null?void 0:a.statusCode)===403){n.reportError(X.AUTHENTICATION_INVALID,"Authentication failed - your credentials may have expired");return}else throw l}n.reportInfo(X.UNNAMED,s.username)})).exitCode()}};pE.paths=[["npm","whoami"]],pE.usage=Re.Usage({category:"Npm-related commands",description:"display the name of the authenticated user",details:"\n Print the username associated with the current authentication settings to the standard output.\n\n When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\n\n When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\n ",examples:[["Print username for the default registry","yarn npm whoami"],["Print username for the registry on a given scope","yarn npm whoami --scope company"]]});var vue=pE;var a_e={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:Ie.STRING,default:null}},commands:[due,Cue,Eue,yue,wue,Que,Bue,Sue,vue]},A_e=a_e;var AO={};ft(AO,{default:()=>B_e,patchUtils:()=>ZT});var ZT={};ft(ZT,{applyPatchFile:()=>Ob,diffFolders:()=>sO,ensureUnpatchedDescriptor:()=>eO,extractPackageToDisk:()=>nO,extractPatchFlags:()=>Nue,isParentRequired:()=>iO,loadPatchFiles:()=>EE,makeDescriptor:()=>tO,makeLocator:()=>rO,parseDescriptor:()=>CE,parseLocator:()=>mE,parsePatchFile:()=>Tb});var dE=class extends Error{constructor(e,t){super(`Cannotapplyhunk#${e+1}`);this.hunk=t}};var l_e=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function Qh(r){return x.relative(Me.root,x.resolve(Me.root,H.toPortablePath(r)))}function c_e(r){let e=r.trim().match(l_e);if(!e)throw new Error(`Badheaderline:'${r}'`);return{original:{start:Math.max(Number(e[1]),1),length:Number(e[3]||1)},patched:{start:Math.max(Number(e[4]),1),length:Number(e[6]||1)}}}var u_e=420,g_e=493,Zr;(function(i){i.Context="context",i.Insertion="insertion",i.Deletion="deletion"})(Zr||(Zr={}));var kue=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),f_e=r=>({header:c_e(r),parts:[]}),h_e={["@"]:"header",["-"]:Zr.Deletion,["+"]:Zr.Insertion,[" "]:Zr.Context,["\\"]:"pragma",undefined:Zr.Context};function d_e(r){let e=[],t=kue(),i="parsing header",n=null,s=null;function o(){n&&(s&&(n.parts.push(s),s=null),t.hunks.push(n),n=null)}function a(){o(),e.push(t),t=kue()}for(let l=0;l<r.length;l++){let c=r[l];if(i==="parsing header")if(c.startsWith("@@"))i="parsing hunks",t.hunks=[],l-=1;else if(c.startsWith("diff -
`):"";await e.mkdirpPromise(x.dirname(n.path),{chmod:493,utimes:[Rr.SAFE_TIME,Rr.SAFE_TIME]}),await e.writeFilePromise(n.path,s,{mode:n.mode}),await e.utimesPromise(n.path,Rr.SAFE_TIME,Rr.SAFE_TIME)}break;case"patch":await Sh(e,n.path,async()=>{await m_e(n,{baseFs:e,dryRun:t})});break;case"mode change":{let o=(await e.statPromise(n.path)).mode;if(xue(n.newMode)!==xue(o))continue;await Sh(e,n.path,async()=>{await e.chmodPromise(n.path,n.newMode)})}break;default:Se.assertNever(n);break}}function xue(r){return(r&64)>0}function Pue(r){return r.replace(/\s+$/,"")}function E_e(r,e){return Pue(r)===Pue(e)}async function m_e({hunks:r,path:e},{baseFs:t,dryRun:i=!1}){let n=await t.statSync(e).mode,o=(await t.readFileSync(e,"utf8")).split(/\n/),a=[],l=0,c=0;for(let g of r){let f=Math.max(c,g.header.patched.start+l),h=Math.max(0,f-c),p=Math.max(0,o.length-f-g.header.original.length),m=Math.max(h,p),y=0,b=0,v=null;for(;y<=m;){if(y<=h&&(b=f-y,v=Due(g,o,b),v!==null)){y=-y;break}if(y<=p&&(b=f+y,v=Due(g,o,b),v!==null))break;y+=1}if(v===null)throw new dE(r.indexOf(g),g);a.push(v),l+=y,c=b+g.header.original.length}if(i)return;let u=0;for(let g of a)for(let f of g)switch(f.type){case"splice":{let h=f.index+u;o.splice(h,f.numToDelete,...f.linesToInsert),u+=f.linesToInsert.length-f.numToDelete}break;case"pop":o.pop();break;case"push":o.push(f.line);break;default:Se.assertNever(f);break}await t.writeFilePromise(e,o.join(`
`),{mode:n})}function Due(r,e,t){let i=[];for(let n of r.parts)switch(n.type){case Zr.Context:case Zr.Deletion:{for(let s of n.lines){let o=e[t];if(o==null||!E_e(o,s))return null;t+=1}n.type===Zr.Deletion&&(i.push({type:"splice",index:t-n.lines.length,numToDelete:n.lines.length,linesToInsert:[]}),n.noNewlineAtEndOfFile&&i.push({type:"push",line:""}))}break;case Zr.Insertion:i.push({type:"splice",index:t,numToDelete:0,linesToInsert:n.lines}),n.noNewlineAtEndOfFile&&i.push({type:"pop"});break;default:Se.assertNever(n.type);break}return i}var I_e=/^builtin<([^>]+)>$/;function $T(r,e){let{source:t,selector:i,params:n}=P.parseRange(r);if(t===null)throw new Error("Patch locators must explicitly define their source");let s=i?i.split(/&/).map(c=>H.toPortablePath(c)):[],o=n&&typeof n.locator=="string"?P.parseLocator(n.locator):null,a=n&&typeof n.version=="string"?n.version:null,l=e(t);return{parentLocator:o,sourceItem:l,patchPaths:s,sourceVersion:a}}function CE(r){let i=$T(r.range,P.parseDescriptor),{sourceItem:e}=i,t=Or(i,["sourceItem"]);return te(N({},t),{sourceDescriptor:e})}function mE(r){let i=$T(r.reference,P.parseLocator),{sourceItem:e}=i,t=Or(i,["sourceItem"]);return te(N({},t),{sourceLocator:e})}function eO(r){if(!r.range.startsWith("patch:"))return r;let{sourceItem:e}=$T(r.range,P.parseDescriptor);return e}function Rue({parentLocator:r,sourceItem:e,patchPaths:t,sourceVersion:i,patchHash:n},s){let o=r!==null?{locator:P.stringifyLocator(r)}:{},a=typeof i!="undefined"?{version:i}:{},l=typeof n!="undefined"?{hash:n}:{};return P.makeRange({protocol:"patch:",source:s(e),selector:t.join("&"),params:N(N(N({},a),l),o)})}function tO(r,{parentLocator:e,sourceDescriptor:t,patchPaths:i}){return P.makeDescriptor(r,Rue({parentLocator:e,sourceItem:t,patchPaths:i},P.stringifyDescriptor))}function rO(r,{parentLocator:e,sourcePackage:t,patchPaths:i,patchHash:n}){return P.makeLocator(r,Rue({parentLocator:e,sourceItem:t,sourceVersion:t.version,patchPaths:i,patchHash:n},P.stringifyLocator))}function Fue({onAbsolute:r,onRelative:e,onBuiltin:t},i){i.startsWith("~")&&(i=i.slice(1));let s=i.match(I_e);return s!==null?t(s[1]):x.isAbsolute(i)?r(i):e(i)}function Nue(r){let e=r.startsWith("~");return e&&(r=r.slice(1)),{optional:e}}function iO(r){return Fue({onAbsolute:()=>!1,onRelative:()=>!0,onBuiltin:()=>!1},r)}async function EE(r,e,t){let i=r!==null?await t.fetcher.fetch(r,t):null,n=i&&i.localPath?{packageFs:new _t(Me.root),prefixPath:x.relative(Me.root,i.localPath)}:i;i&&i!==n&&i.releaseFs&&i.releaseFs();let s=await Se.releaseAfterUseAsync(async()=>await Promise.all(e.map(async o=>{let a=Nue(o),l=await Fue({onAbsolute:async()=>await U.readFilePromise(o,"utf8"),onRelative:async()=>{if(n===null)throw new Error("Assertion failed: The parent locator should have been fetched");return await n.packageFs.readFilePromise(x.join(n.prefixPath,o),"utf8")},onBuiltin:async c=>await t.project.configuration.firstHook(u=>u.getBuiltinPatch,t.project,c)},o);return te(N({},a),{source:l})})));for(let o of s)typeof o.source=="string"&&(o.source=o.source.replace(/\r\n?/g,`
`));return s}async function nO(r,{cache:e,project:t}){let i=t.storedPackages.get(r.locatorHash);if(typeof i=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let n=t.storedChecksums,s=new di,o=t.configuration.makeFetcher(),a=await o.fetch(r,{cache:e,project:t,fetcher:o,checksums:n,report:s}),l=await U.mktempPromise(),c=x.join(l,"source"),u=x.join(l,"user"),g=x.join(l,".yarn-patch.json");return await Promise.all([U.copyPromise(c,a.prefixPath,{baseFs:a.packageFs}),U.copyPromise(u,a.prefixPath,{baseFs:a.packageFs}),U.writeJsonPromise(g,{locator:P.stringifyLocator(r),version:i.version})]),U.detachTemp(l),u}async function sO(r,e){let t=H.fromPortablePath(r).replace(/\\/g,"/"),i=H.fromPortablePath(e).replace(/\\/g,"/"),{stdout:n,stderr:s}=await Nr.execvp("git",["-c","core.safecrlf=false","diff","--src-prefix=a/","--dst-prefix=b/","--ignore-cr-at-eol","--full-index","--no-index","--no-renames","--text",t,i],{cwd:H.toPortablePath(process.cwd()),env:te(N({},process.env),{GIT_CONFIG_NOSYSTEM:"1",HOME:"",XDG_CONFIG_HOME:"",USERPROFILE:""})});if(s.length>0)throw new Error(`Unabletodiffdirectories.Makesureyouhavearecentversionof'git'availableinPATH.
${s}`);let o=t.startsWith("/")?a=>a.slice(1):a=>a;return n.replace(new RegExp(`(a|b)(${Se.escapeRegExp(`/${o(t)}/`)})`,"g"),"$1/").replace(new RegExp(`(a|b)${Se.escapeRegExp(`/${o(i)}/`)}`,"g"),"$1/").replace(new RegExp(Se.escapeRegExp(`${t}/`),"g"),"").replace(new RegExp(Se.escapeRegExp(`${i}/`),"g"),"")}function Lue(r,{configuration:e,report:t}){for(let i of r.parts)for(let n of i.lines)switch(i.type){case Zr.Context:t.reportInfo(null,`${ae.pretty(e,n,"grey")}`);break;case Zr.Deletion:t.reportError(X.FROZEN_LOCKFILE_EXCEPTION,`-${ae.pretty(e,n,ae.Type.REMOVED)}`);break;case Zr.Insertion:t.reportError(X.FROZEN_LOCKFILE_EXCEPTION,`+${ae.pretty(e,n,ae.Type.ADDED)}`);break;default:Se.assertNever(i.type)}}var oO=class{supports(e,t){return!!e.reference.startsWith("patch:")}getLocalPath(e,t){return null}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,N({onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${P.prettyLocator(t.project.configuration,e)}can'tbefoundinthecacheandwillbefetchedfromthedisk`),loader:()=>this.patchPackage(e,t),skipIntegrityCheck:t.skipIntegrityCheck},t.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:P.getIdentVendorPath(e),localPath:this.getLocalPath(e,t),checksum:o}}async patchPackage(e,t){let{parentLocator:i,sourceLocator:n,sourceVersion:s,patchPaths:o}=mE(e),a=await EE(i,o,t),l=await U.mktempPromise(),c=x.join(l,"current.zip"),u=await t.fetcher.fetch(n,t),g=P.getIdentVendorPath(e),f=await fn(),h=new li(c,{libzip:f,create:!0,level:t.project.configuration.get("compressionLevel")});await Se.releaseAfterUseAsync(async()=>{await h.copyPromise(g,u.prefixPath,{baseFs:u.packageFs,stableSort:!0})},u.releaseFs),h.saveAndClose();for(let{source:p,optional:m}of a){if(p===null)continue;let y=new li(c,{libzip:f,level:t.project.configuration.get("compressionLevel")}),b=new _t(x.resolve(Me.root,g),{baseFs:y});try{await Ob(Tb(p),{baseFs:b,version:s})}catch(v){if(!(v instanceof dE))throw v;let k=t.project.configuration.get("enableInlineHunks"),T=!k&&!m?" (set enableInlineHunks for details)":"",Y=`${P.prettyLocator(t.project.configuration,e)}:${v.message}${T}`,q=$=>{!k||Lue(v.hunk,{configuration:t.project.configuration,report:$})};if(y.discardAndClose(),m){t.report.reportWarningOnce(X.PATCH_HUNK_FAILED,Y,{reportExtra:q});continue}else throw new ct(X.PATCH_HUNK_FAILED,Y,q)}y.saveAndClose()}return new li(c,{libzip:f,level:t.project.configuration.get("compressionLevel")})}};var y_e=3,aO=class{supportsDescriptor(e,t){return!!e.range.startsWith("patch:")}supportsLocator(e,t){return!!e.reference.startsWith("patch:")}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){let{patchPaths:n}=CE(e);return n.every(s=>!iO(s))?e:P.bindDescriptor(e,{locator:P.stringifyLocator(t)})}getResolutionDependencies(e,t){let{sourceDescriptor:i}=CE(e);return[i]}async getCandidates(e,t,i){if(!i.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{parentLocator:n,sourceDescriptor:s,patchPaths:o}=CE(e),a=await EE(n,o,i.fetchOptions),l=t.get(s.descriptorHash);if(typeof l=="undefined")throw new Error("Assertion failed: The dependency should have been resolved");let c=Rn.makeHash(`${y_e}`,...a.map(u=>JSON.stringify(u))).slice(0,6);return[rO(e,{parentLocator:n,sourcePackage:l,patchPaths:o,patchHash:c})]}async getSatisfying(e,t,i){return null}async resolve(e,t){let{sourceLocator:i}=mE(e),n=await t.resolver.resolve(i,t);return N(N({},n),e)}};var IE=class extends Le{constructor(){super(...arguments);this.save=J.Boolean("-s,--save",!1,{description:"Add the patch to your resolution entries"});this.patchFolder=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState();let n=x.resolve(this.context.cwd,H.toPortablePath(this.patchFolder)),s=x.join(n,"../source"),o=x.join(n,"../.yarn-patch.json");if(!U.existsSync(s))throw new Pe("Th
-${P.prettyLocator(e,a)}`).join("")}`);s=o[0]}if(!t.storedPackages.has(s.locatorHash))thrownewPe("No package found in the project for the given locator");awaitJe.start({configuration:e,json:this.json,stdout:this.context.stdout},asynco=>{leta=awaitnO(s,{cache:n,project:t});o.reportJson({locator:P.stringifyLocator(s),path:H.fromPortablePath(a)}),o.reportInfo(X.UNNAMED,`Package ${P.prettyLocator(e,s)} got extracted with success!`),o.reportInfo(X.UNNAMED,`You can now edit the following folder: ${ae.pretty(e,H.fromPortablePath(a),"magenta")}`),o.reportInfo(X.UNNAMED,`Once you are done run ${ae.pretty(e,`yarn patch-commit -s ${process.platform==="win32"?'"':""}${H.fromPortablePath(a)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};yE.paths=[["patch"]],yE.usage=Re.Usage({description:"prepare a package for patching",details:"\n This command will cause a package to be extracted in a temporary directory intended to be editable at will.\n \n Once you're done with your changes, run `yarn patch-commit -s <path>` (with `<path>` being the temporary directory you received) to generate a patchfile and register it into your top-level manifest via the `patch:` protocol. Run `yarn patch-commit -h` for more details.\n "});varOue=yE;varw_e={configuration:{enableInlineHunks:{description:"If true, the installs will print unmatched patch hunks",type:Ie.BOOLEAN,default:!1},patchFolder:{description:"Folder where the patch files must be written",type:Ie.ABSOLUTE_PATH,default:"./.yarn/patches"}},commands:[Tue,Oue],fetchers:[oO],resolvers:[aO]},B_e=w_e;vargO={};ft(gO,{default:()=>S_e});varlO=class{supportsPackage(e,t){returnthis.isEnabled(t)}asyncfindPackageLocation(e,t){if(!this.isEnabled(t))thrownewError("Assertion failed: Expected the pnpm linker to be enabled");leti=cO(),n=t.project.installersCustomData.get(i);if(!n)thrownewPe(`The project in ${ae.pretty(t.project.configuration,`${t.project.cwd}/package.json`,ae.Type.PATH)} doesn't seem to have been installed - running an install there might help`);lets=n.pathByLocator.get(e.locatorHash);if(typeofs=="undefined")thrownewPe(`Couldn't find ${P.prettyLocator(t.project.configuration,e)} in the currently installed pnpm map - running an install might help`);returns}asyncfindPackageLocator(e,t){if(!this.isEnabled(t))returnnull;leti=cO(),n=t.project.installersCustomData.get(i);if(!n)thrownewPe(`The project in ${ae.pretty(t.project.configuration,`${t.project.cwd}/package.json`,ae.Type.PATH)} doesn't seem to have been installed - running an install there might help`);lets=e.match(/(^.*\/node_modules\/(@[^/]*\/)?[^/]+)(\/.*$)/);if(s){letl=n.locatorByPath.get(s[1]);if(l)returnl}leto=e,a=e;do{a=o,o=x.dirname(a);letl=n.locatorByPath.get(a);if(l)returnl}while(o!==a);returnnull}makeInstaller(e){returnnewMue(e)}isEnabled(e){returne.project.configuration.get("nodeLinker")==="pnpm"}},Mue=class{constructor(e){this.opts=e;this.asyncActions=newSe.AsyncActions(10);this.customData={pathByLocator:newMap,locatorByPath:newMap}}getCustomDataKey(){returncO()}attachCustomData(e){}asyncinstallPackage(e,t,i){switch(e.linkType){caseQt.SOFT:returnthis.installPackageSoft(e,t,i);caseQt.HARD:returnthis.installPackageHard(e,t,i)}thrownewError("Assertion failed: Unsupported package link type")}asyncinstallPackageSoft(e,t,i){letn=x.resolve(t.packageFs.getRealPath(),t.prefixPath);returnthis.customData.pathByLocator.set(e.locatorHash,n),{packageLocation:n,buildDirective:null}}asyncinstallPackageHard(e,t,i){varu;letn=b_e(e,{project:this.opts.project});this.customData.locatorByPath.set(n,P.stringifyLocator(e)),this.customData.pathByLocator.set(e.locatorHash,n),i.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{awaitU.mkdirPromise(n,{recursive:!0}),awaitU.copyPromise(n,t.prefixPath,{baseFs:t.packageFs,overwrite:!1})}));leto=P.isVirtualLocator(e)?P.devirtualizeLocator(e):e,a={manifest:(u=awaitAt.tryFind(t.prefixPath,{baseFs:t.packageFs}))!=null?u:newAt,misc:{hasBindingGyp:ma.hasBindingGyp(t)}}