616 lines
1.9 MiB
JavaScript
616 lines
1.9 MiB
JavaScript
|
#!/usr/bin/env node
|
|||
|
/* eslint-disable */
|
|||
|
//prettier-ignore
|
|||
|
(()=>{var Uoe=Object.create,dg=Object.defineProperty,Hoe=Object.defineProperties,Yoe=Object.getOwnPropertyDescriptor,Goe=Object.getOwnPropertyDescriptors,qoe=Object.getOwnPropertyNames,uC=Object.getOwnPropertySymbols,joe=Object.getPrototypeOf,gw=Object.prototype.hasOwnProperty,BL=Object.prototype.propertyIsEnumerable;var wL=(t,e,r)=>e in t?dg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,k=(t,e)=>{for(var r in e||(e={}))gw.call(e,r)&&wL(t,r,e[r]);if(uC)for(var r of uC(e))BL.call(e,r)&&wL(t,r,e[r]);return t},V=(t,e)=>Hoe(t,Goe(e)),Joe=t=>dg(t,"__esModule",{value:!0});var vr=(t,e)=>{var r={};for(var i in t)gw.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&uC)for(var i of uC(t))e.indexOf(i)<0&&BL.call(t,i)&&(r[i]=t[i]);return r},Woe=(t,e)=>()=>(t&&(e=t(t=0)),e),C=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),$e=(t,e)=>{for(var r in e)dg(t,r,{get:e[r],enumerable:!0})},zoe=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of qoe(e))!gw.call(t,i)&&i!=="default"&&dg(t,i,{get:()=>e[i],enumerable:!(r=Yoe(e,i))||r.enumerable});return t},ee=t=>zoe(Joe(dg(t!=null?Uoe(joe(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var eN=C((V4e,XL)=>{XL.exports=ZL;ZL.sync=Aae;var _L=require("fs");function lae(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&t.substr(-n.length).toLowerCase()===n)return!0}return!1}function $L(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:lae(e,r)}function ZL(t,e,r){_L.stat(t,function(i,n){r(i,i?!1:$L(n,t,e))})}function Aae(t,e){return $L(_L.statSync(t),t,e)}});var sN=C((X4e,tN)=>{tN.exports=rN;rN.sync=cae;var iN=require("fs");function rN(t,e,r){iN.stat(t,function(i,n){r(i,i?!1:nN(n,e))})}function cae(t,e){return nN(iN.statSync(t),e)}function nN(t,e){return t.isFile()&&uae(t,e)}function uae(t,e){var r=t.mode,i=t.uid,n=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),u=a|l,g=r&c||r&l&&n===o||r&a&&i===s||r&u&&s===0;return g}});var aN=C((_4e,oN)=>{var Z4e=require("fs"),wC;process.platform==="win32"||global.TESTING_WINDOWS?wC=eN():wC=sN();oN.exports=Sw;Sw.sync=gae;function Sw(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){Sw(t,e||{},function(s,o){s?n(s):i(o)})})}wC(t,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),r(i,n)})}function gae(t,e){try{return wC.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var fN=C(($4e,AN)=>{var vl=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",lN=require("path"),hae=vl?";":":",cN=aN(),uN=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),gN=(t,e)=>{let r=e.colon||hae,i=t.match(/\//)||vl&&t.match(/\\/)?[""]:[...vl?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],n=vl?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=vl?n.split(r):[""];return vl&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},hN=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=gN(t,e),o=[],a=c=>new Promise((u,g)=>{if(c===i.length)return e.all&&o.length?u(o):g(uN(t));let h=i[c],f=/^".*"$/.test(h)?h.slice(1,-1):h,p=lN.join(f,t),m=!f&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;u(l(m,c,0))}),l=(c,u,g)=>new Promise((h,f)=>{if(g===n.length)return h(a(u+1));let p=n[g];cN(c+p,{pathExt:s},(m,I)=>{if(!m&&I)if(e.all)o.push(c+p);else return h(c+p);return h(l(c,u,g+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},fae=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=gN(t,e),s=[];for(let o=0;o<r.length;o++){let a=r[o],l=/^".*"$/.test(a)?a.slice(1,-1):a,c=lN.join(l,t),u=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let g=0;g<i.length;g++){let h=u+i[g];try{if(cN.s
|
|||
|
`:`
|
|||
|
`)+r,n=i+1,i=t.indexOf(`
|
|||
|
`,n)}while(i!==-1);return s+=t.substr(n),s};rM.exports={stringReplaceAll:zae,stringEncaseCRLFWithFirstIndex:Vae}});var AM=C((y8e,nM)=>{"use strict";var Xae=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,sM=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Zae=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,_ae=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,$ae=new Map([["n",`
|
|||
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a","\x07"]]);function oM(t){let e=t[0]==="u",r=t[1]==="{";return e&&!r&&t.length===5||t[0]==="x"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):$ae.get(t)||t}function eAe(t,e){let r=[],i=e.trim().split(/\s*,\s*/g),n;for(let s of i){let o=Number(s);if(!Number.isNaN(o))r.push(o);else if(n=s.match(Zae))r.push(n[2].replace(_ae,(a,l,c)=>l?oM(l):c));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${t}')`)}return r}function tAe(t){sM.lastIndex=0;let e=[],r;for(;(r=sM.exec(t))!==null;){let i=r[1];if(r[2]){let n=eAe(i,r[2]);e.push([i].concat(n))}else e.push([i])}return e}function aM(t,e){let r={};for(let n of e)for(let s of n.styles)r[s[0]]=n.inverse?null:s.slice(1);let i=t;for(let[n,s]of Object.entries(r))if(!!Array.isArray(s)){if(!(n in i))throw new Error(`Unknown Chalk style: ${n}`);i=s.length>0?i[n](...s):i[n]}return i}nM.exports=(t,e)=>{let r=[],i=[],n=[];if(e.replace(Xae,(s,o,a,l,c,u)=>{if(o)n.push(oM(o));else if(l){let g=n.join("");n=[],i.push(r.length===0?g:aM(t,r)(g)),r.push({inverse:a,styles:tAe(l)})}else if(c){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(aM(t,r)(n.join(""))),n=[],r.pop()}else n.push(u)}),i.push(n.join("")),r.length>0){let s=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return i.join("")}});var $w=C((B8e,lM)=>{"use strict";var Lg=XN(),{stdout:Vw,stderr:Xw}=tM(),{stringReplaceAll:rAe,stringEncaseCRLFWithFirstIndex:iAe}=iM(),cM=["ansi","ansi","ansi256","ansi16m"],Ml=Object.create(null),nAe=(t,e={})=>{if(e.level>3||e.level<0)throw new Error("The `level` option should be an integer from 0 to 3");let r=Vw?Vw.level:0;t.level=e.level===void 0?r:e.level},uM=class{constructor(e){return gM(e)}},gM=t=>{let e={};return nAe(e,t),e.template=(...r)=>sAe(e.template,...r),Object.setPrototypeOf(e,SC.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=uM,e.template};function SC(t){return gM(t)}for(let[t,e]of Object.entries(Lg))Ml[t]={get(){let r=xC(this,Zw(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};Ml.visible={get(){let t=xC(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};var hM=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let t of hM)Ml[t]={get(){let{level:e}=this;return function(...r){let i=Zw(Lg.color[cM[e]][t](...r),Lg.color.close,this._styler);return xC(this,i,this._isEmpty)}}};for(let t of hM){let e="bg"+t[0].toUpperCase()+t.slice(1);Ml[e]={get(){let{level:r}=this;return function(...i){let n=Zw(Lg.bgColor[cM[r]][t](...i),Lg.bgColor.close,this._styler);return xC(this,n,this._isEmpty)}}}}var oAe=Object.defineProperties(()=>{},V(k({},Ml),{level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}})),Zw=(t,e,r)=>{let i,n;return r===void 0?(i=t,n=e):(i=r.openAll+t,n=e+r.closeAll),{open:t,close:e,openAll:i,closeAll:n,parent:r}},xC=(t,e,r)=>{let i=(...n)=>aAe(i,n.length===1?""+n[0]:n.join(" "));return i.__proto__=oAe,i._generator=t,i._styler=e,i._isEmpty=r,i},aAe=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;let{openAll:i,closeAll:n}=r;if(e.indexOf("")!==-1)for(;r!==void 0;)e=rAe(e,r.close,r.open),r=r.parent;let s=e.indexOf(`
|
|||
|
`);return s!==-1&&(e=iAe(e,n,i,s)),i+e+n},_w,sAe=(t,...e)=>{let[r]=e;if(!Array.isArray(r))return e.join(" ");let i=e.slice(1),n=[r.raw[0]];for(let s=1;s<r.length;s++)n.push(String(i[s-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[s]));return _w===void 0&&(_w=AM()),_w(t,n.join(""))};Object.defineProperties(SC.prototype,Ml);var Ng=SC();Ng.supportsColor=Vw;Ng.stderr=SC({level:Xw?Xw.level:0});Ng.stderr.supportsColor=Xw;Ng.Level={None:0,Basic:1,Ansi256:2,TrueColor:3,0:"None",1:"Basic",2:"Ansi256",3:"TrueColor"};lM.exports=Ng});var pM=C((w8e,fM)=>{fM.exports=[{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",pr:"SYSTEM_PULLREQUEST_PULLREQUESTID"},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY_BUILD_BASE",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}}]});var Mg=C(Mi=>{"use strict";var dM=pM(),Xn=process.env;Object.defineProperty(Mi,"_vendors",{value:dM.map(function(t){return t.constant})});Mi.name=null;Mi.isPR=null;dM.forEach(function(t){var e=Array.isArray(t.env)?t.env:[t.env],r=e.every(function(i){return CM(i)});if(Mi[t.constant]=r,r)switch(Mi.name=t.name,typeof t.pr){case"string":Mi.isPR=!!Xn[t.pr];break;case"object":"env"in t.pr?Mi.isPR=t.pr.env in Xn&&Xn[t.pr.env]!==t.pr.ne:"any"in t.pr?Mi.isPR=t.pr.any.some(function(i){return!!Xn[i]}):Mi.isPR=CM(t.pr);break;default:Mi.isPR=null}});Mi.isCI=!!(Xn.CI||Xn.CONTINUOUS_INTEGRATION||Xn.BUILD_NUMBER||Xn.RUN_ID||Mi.name);function CM(t){return typeof t=="string"?!!Xn[t]:Object.keys(t).every(function(e){return Xn[e]===t[e]})}});var DC=C(sn=>{"use strict";sn.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;sn.find=(t,e)=>t.nodes.find(r=>r.type===e);sn.exceedsLimit=(t,e,r=1,i)=>i===!1||!sn.isInteger(t)||!sn.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=i;sn.escapeNode=(t,e=0,r)=>{let i=t.nodes[e];!i||(r&&i.type===r||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)};sn.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0==0?(t.invalid=!0,!0):!1;sn.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0==0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;sn.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!
|
|||
|
`,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 ZM=C((R8e,WM)=>{"use strict";var xAe=PC(),{MAX_LENGTH:zM,CHAR_BACKSLASH:nQ,CHAR_BACKTICK:DAe,CHAR_COMMA:PAe,CHAR_DOT:kAe,CHAR_LEFT_PARENTHESES:vAe,CHAR_RIGHT_PARENTHESES:FAe,CHAR_LEFT_CURLY_BRACE:RAe,CHAR_RIGHT_CURLY_BRACE:LAe,CHAR_LEFT_SQUARE_BRACKET:VM,CHAR_RIGHT_SQUARE_BRACKET:XM,CHAR_DOUBLE_QUOTE:NAe,CHAR_SINGLE_QUOTE:MAe,CHAR_NO_BREAK_SPACE:OAe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:KAe}=JM(),TAe=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},i=typeof r.maxLength=="number"?Math.min(zM,r.maxLength):zM;if(t.length>i)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${i})`);let n={type:"root",input:t,nodes:[]},s=[n],o=n,a=n,l=0,c=t.length,u=0,g=0,h,f={},p=()=>t[u++],m=I=>{if(I.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&I.type==="text"){a.value+=I.value;return}return o.nodes.push(I),I.parent=o,I.prev=a,a=I,I};for(m({type:"bos"});u<c;)if(o=s[s.length-1],h=p(),!(h===KAe||h===OAe)){if(h===nQ){m({type:"text",value:(e.keepEscaping?h:"")+p()});continue}if(h===XM){m({type:"text",value:"\\"+h});continue}if(h===VM){l++;let I=!0,y;for(;u<c&&(y=p());){if(h+=y,y===VM){l++;continue}if(y===nQ){h+=p();continue}if(y===XM&&(l--,l===0))break}m({type:"text",value:h});continue}if(h===vAe){o=m({type:"paren",nodes:[]}),s.push(o),m({type:"text",value:h});continue}if(h===FAe){if(o.type!=="paren"){m({type:"text",value:h});continue}o=s.pop(),m({type:"text",value:h}),o=s[s.length-1];continue}if(h===NAe||h===MAe||h===DAe){let I=h,y;for(e.keepQuotes!==!0&&(h="");u<c&&(y=p());){if(y===nQ){h+=y+p();continue}if(y===I){e.keepQuotes===!0&&(h+=y);break}h+=y}m({type:"text",value:h});continue}if(h===RAe){g++;let I=a.value&&a.value.slice(-1)==="$"||o.dollar===!0;o=m({type:"brace",open:!0,close:!1,dollar:I,depth:g,commas:0,ranges:0,nodes:[]}),s.push(o),m({type:"open",value:h});continue}if(h===LAe){if(o.type!=="brace"){m({type:"text",value:h});continue}let I="close";o=s.pop(),o.close=!0,m({type:I,value:h}),g--,o=s[s.length-1];continue}if(h===PAe&&g>0){if(o.ranges>0){o.ranges=0;let I=o.nodes.shift();o.nodes=[I,{type:"text",value:xAe(o)}]}m({type:"comma",value:h}),o.commas++;continue}if(h===kAe&&g>0&&o.commas===0){let I=o.nodes;if(g===0||I.length===0){m({type:"text",value:h});continue}if(a.type==="dot"){if(o.range=[],a.value+=h,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"){I.pop();let y=I[I.length-1];y.value+=a.value+h,a=y,o.ranges--;continue}m({type:"dot",value:h});continue}m({type:"text",value:h})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(B=>{B.nodes||(B.type==="open"&&(B.isOpen=!0),B.type==="close"&&(B.isClose=!0),B.nodes||(B.type="text"),B.invalid=!0)});let I=s[s.length-1],y=I.nodes.indexOf(o);I.nodes.splice(y,1,...o.nodes)}while(s.length>0);return m({type:"eos"}),n};WM.exports=TAe});var eO=C((L8e,_M)=>{"use strict";var $M=PC(),UAe=HM(),HAe=qM(),YAe=ZM(),Oi=(t,e={})=>{let r=[];if(Array.isArray(t))for(let i of t){let n=Oi.create(i,e);Array.isArray(n)?r.push(...n):r.push(n)}else r=[].concat(Oi.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Oi.parse=(t,e={})=>YAe(t,e);Oi.stringify=(t,e={})=>typeof t=="string"?$M(Oi.parse(t,e),e):$M(t,e);Oi.compile=(t,e={})=>(typeof t=="string"&&(t=Oi.parse(t,e)),UAe(t,e));Oi.expand=(t,e={})=>{typeof t=="string"&&(t=Oi.parse(t,e));let r=HAe(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Oi.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Oi.compile(t,e):Oi.expand(t,e);_M.exports=Oi});var Kg=C((N8e,tO)=>{"use strict";var GAe=require("path"),Zn="\\\\/",rO=`[^${Zn}]`,Ns="\\.",qAe="\\+",jAe="\\?",vC="\\/",JAe="(?=.)",iO="[^/]",sQ=`(?:${vC}|$)`,n
|
|||
|
Please report this to https://github.com/szmarczak/http2-wrapper/`);p(m)}return}i[0].resolve(f);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 h=CCe.connect(e,k({createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(u)},r));h[oi]=0,h[Ac]=!1;let f=()=>h[oi]<h.remoteSettings.maxConcurrentStreams,p=!0;h.socket.once("session",I=>{this.tlsSessionCache.set(u,I)}),h.once("error",I=>{for(let{reject:y}of i)y(I);this.tlsSessionCache.delete(u)}),h.setTimeout(this.timeout,()=>{h.destroy()}),h.once("close",()=>{if(g){p&&this._freeSessionsCount--,this._sessionsCount--;let I=this.sessions[o];I.splice(I.indexOf(h),1),I.length===0&&delete this.sessions[o]}else{let I=new Error("Session closed without receiving a SETTINGS frame");I.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:y}of i)y(I);l()}this._tryToCreateNewSession(o,a)});let m=()=>{if(!(!(o in this.queue)||!f())){for(let I of h[un])if(I in this.queue[o]){let{listeners:y}=this.queue[o][I];for(;y.length!==0&&f();)y.shift().resolve(h);let B=this.queue[o];if(B[I].listeners.length===0&&(delete B[I],Object.keys(B).length===0)){delete this.queue[o];break}if(!f())break}}};h.on("origin",()=>{h[un]=h.originSet,!!f()&&(m(),M0(this.sessions[o],h))}),h.once("remoteSettings",()=>{if(h.ref(),h.unref(),this._sessionsCount++,c.destroyed){let I=new Error("Agent has been destroyed");for(let y of i)y.reject(I);h.destroy();return}h[un]=h.originSet;{let I=this.sessions;if(o in I){let y=I[o];y.splice(ECe(y,h,yCe),0,h)}else I[o]=[h]}this._freeSessionsCount+=1,g=!0,this.emit("session",h),m(),l(),h[oi]===0&&this._freeSessionsCount>this.maxFreeSessions&&h.close(),i.length!==0&&(this.getSession(a,r,i),i.length=0),h.on("remoteSettings",()=>{m(),M0(this.sessions[o],h)})}),h[qH]=h.request,h.request=(I,y)=>{if(h[Ac])throw new Error("The session is gracefully closing. No new streams are allowed.");let B=h[qH](I,y);return h.ref(),++h[oi],h[oi]===h.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,B.once("close",()=>{if(p=f(),--h[oi],!h.destroyed&&!h.closed&&(BCe(this.sessions[o],h),f()&&!h.closed)){p||(this._freeSessionsCount++,p=!0);let D=h[oi]===0;D&&h.unref(),D&&(this._freeSessionsCount>this.maxFreeSessions||h[Ac])?h.close():(M0(this.sessions[o],h),m())}}),B}}catch(h){for(let f of i)f.reject(h);l()}};c.listeners=i,c.completed=!1,c.destroyed=!1,this.queue[o][a]=c,this._tryToCreateNewSession(o,a)})}request(e,r,i,n){return new Promise((s,o)=>{this.getSession(e,r,[{reject:o,resolve:a=>{try{s(a.request(i,n))}catch(l){o(l)}}}])})}createConnection(e,r){return Ws.connect(e,r)}static connect(e,r){r.ALPNProtocols=["h2"];let i=e.port||443,n=e.hostname||e.host;return typeof r.servername=="undefined"&&(r.servername=n),dCe.connect(i,n,r)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let r of e)r[oi]===0&&r.close()}destroy(e){for(let r of Object.values(this.sessions))for(let i of r)i.destroy(e);for(let r of Object.values(this.queue))for(let i of Object.values(r))i.destroyed=!0;this.queue={}}get freeSessions(){return JH({agent:this,isFree:!0})}get busySessions(){return JH({agent:this,isFree:!1})}};Ws.kCurrentStreamsCount=oi;Ws.kGracefullyClosing=Ac;GH.exports={Agent:Ws,globalAgent:new Ws}});var K0=C((N9e,WH)=>{"use strict";var{Readable:wCe}=require("stream"),zH=class extends wCe{constructor(e,r){super({highWaterMark:r,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,r){return this.req.setTimeout(e,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners
|
|||
|
`).reverse(),a=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`
|
|||
|
`).reverse();for(;a.length!==0&&a[0]===o[0];)o.shift();this.stack=`${this.stack.slice(0,s)}${o.reverse().join(`
|
|||
|
`)}${a.reverse().join(`
|
|||
|
`)}`}}};Et.RequestError=Ir;var gS=class extends Ir{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e);this.name="MaxRedirectsError"}};Et.MaxRedirectsError=gS;var hS=class extends Ir{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request);this.name="HTTPError"}};Et.HTTPError=hS;var fS=class extends Ir{constructor(e,r){super(e.message,e,r);this.name="CacheError"}};Et.CacheError=fS;var pS=class extends Ir{constructor(e,r){super(e.message,e,r);this.name="UploadError"}};Et.UploadError=pS;var dS=class extends Ir{constructor(e,r,i){super(e.message,e,i);this.name="TimeoutError",this.event=e.event,this.timings=r}};Et.TimeoutError=dS;var eI=class extends Ir{constructor(e,r){super(e.message,e,r);this.name="ReadError"}};Et.ReadError=eI;var CS=class extends Ir{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e);this.name="UnsupportedProtocolError"}};Et.UnsupportedProtocolError=CS;var vme=["socket","connect","continue","information","upgrade","timeout"],uS=class extends TY.Duplex{constructor(e,r={},i){super({autoDestroy:!1,highWaterMark:0});this[uc]=0,this[hc]=0,this.requestInitialized=!1,this[_m]=new Set,this.redirects=[],this[fc]=!1,this[$m]=!1,this[kh]=[],this.retryCount=0,this._progressCallbacks=[];let n=()=>this._unlockWrite(),s=()=>this._lockWrite();this.on("pipe",c=>{c.prependListener("data",n),c.on("data",s),c.prependListener("end",n),c.on("end",s)}),this.on("unpipe",c=>{c.off("data",n),c.off("data",s),c.off("end",n),c.off("end",s)}),this.on("pipe",c=>{c instanceof AS.IncomingMessage&&(this.options.headers=k(k({},c.headers),this.options.headers))});let{json:o,body:a,form:l}=r;if((o||a||l)&&this._lockWrite(),Et.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,i)}catch(c){se.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(c);return}(async()=>{var c;try{this.options.body instanceof lme.ReadStream&&await Dme(this.options.body);let{url:u}=this.options;if(!u)throw new TypeError("Missing `url` property");if(this.requestUrl=u.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(c=this[xr])===null||c===void 0||c.destroy();return}for(let g of this[kh])g();this[kh].length=0,this.requestInitialized=!0}catch(u){if(u instanceof Ir){this._beforeError(u);return}this.destroyed||this.destroy(u)}})()}static normalizeArguments(e,r,i){var n,s,o,a,l;let c=r;if(se.default.object(e)&&!se.default.urlInstance(e))r=k(k(k({},i),e),r);else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r=k(k({},i),r),e!==void 0&&(r.url=e),se.default.urlInstance(r.url)&&(r.url=new Jo.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),se.assert.any([se.default.string,se.default.undefined],r.method),se.assert.any([se.default.object,se.default.undefined],r.headers),se.assert.any([se.default.string,se.default.urlInstance,se.default.undefined],r.prefixUrl),se.assert.any([se.default.object,se.default.undefined],r.cookieJar),se.assert.any([se.default.object,se.default.string,se.default.undefined],r.searchParams),se.assert.any([se.default.object,se.default.string,se.default.undefined],r.cache),se.assert.any([se.default.object,se.default.number,se.default.undefined],r.timeout),se.assert.any([se.default.object,se.default.undefined],r.context),se.assert.any([se.default.object,se.default.undefined],r.hooks),se.assert.any([se.default.boolean,se.default.undefined],r.decompress),se.assert.any([se.default.boolean,se.default.undefined],r.ignoreInvalidCookies),se.assert.any([se.default.boolean,se.default.undefined],r.followRedirect),se.assert.any([se.default.number,se.default.undefined],r.maxRedirects),se.assert.any([se.default.boolean,se.default.undefined],r.throwHttpErrors),se.assert.any([se.default.boolean,se.default.undefined],r.http2),se.assert.any([se.default.boolean,se.default.undefined],r.allowGetBody),se.assert.any([se.default.string,se.default.undefined],r.localAddress),se.ass
|
|||
|
`,g.message,g.stack);var h=new Error("tunneling socket could not be established, cause="+g.message);h.code="ECONNRESET",e.request.emit("error",h),i.removeSocket(n)}};Vs.prototype.removeSocket=function(e){var r=this.sockets.indexOf(e);if(r!==-1){this.sockets.splice(r,1);var i=this.requests.shift();i&&this.createSocket(i,function(n){i.request.onSocket(n)})}};function IG(t,e){var r=this;Vs.prototype.createSocket.call(r,t,function(i){var n=t.request.getHeader("host"),s=bS({},r.options,{socket:i,servername:n?n.replace(/:.*$/,""):t.host}),o=iIe.connect(0,s);r.sockets[r.sockets.indexOf(i)]=o,e(o)})}function EG(t,e,r){return typeof t=="string"?{host:t,port:e,localAddress:r}:t}function bS(t){for(var e=1,r=arguments.length;e<r;++e){var i=arguments[e];if(typeof i=="object")for(var n=Object.keys(i),s=0,o=n.length;s<o;++s){var a=n[s];i[a]!==void 0&&(t[a]=i[a])}}return t}var Xo;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?Xo=function(){var t=Array.prototype.slice.call(arguments);typeof t[0]=="string"?t[0]="TUNNEL: "+t[0]:t.unshift("TUNNEL:"),console.error.apply(console,t)}:Xo=function(){};pc.debug=Xo});var wG=C((CVe,BG)=>{BG.exports=yG()});var oq=C((P7e,kS)=>{var NG=Object.assign({},require("fs")),ne=typeof ne!="undefined"?ne:{},Lh={},_o;for(_o in ne)ne.hasOwnProperty(_o)&&(Lh[_o]=ne[_o]);var vS=[],MG="./this.program",OG=function(t,e){throw e},KG=!1,EA=!0,Nh="";function mIe(t){return ne.locateFile?ne.locateFile(t,Nh):Nh+t}var AI,FS,lI,RS;EA&&(KG?Nh=require("path").dirname(Nh)+"/":Nh=__dirname+"/",AI=function(e,r){var i=UG(e);return i?r?i:i.toString():(lI||(lI=NG),RS||(RS=require("path")),e=RS.normalize(e),lI.readFileSync(e,r?null:"utf8"))},FS=function(e){var r=AI(e,!0);return r.buffer||(r=new Uint8Array(r)),TG(r.buffer),r},process.argv.length>1&&(MG=process.argv[1].replace(/\\/g,"/")),vS=process.argv.slice(2),typeof kS!="undefined"&&(kS.exports=ne),OG=function(t){process.exit(t)},ne.inspect=function(){return"[Emscripten Module object]"});var cI=ne.print||console.log.bind(console),qr=ne.printErr||console.warn.bind(console);for(_o in Lh)Lh.hasOwnProperty(_o)&&(ne[_o]=Lh[_o]);Lh=null;ne.arguments&&(vS=ne.arguments);ne.thisProgram&&(MG=ne.thisProgram);ne.quit&&(OG=ne.quit);var IIe=16;function EIe(t,e){return e||(e=IIe),Math.ceil(t/e)*e}var yIe=0,BIe=function(t){yIe=t},LS;ne.wasmBinary&&(LS=ne.wasmBinary);var vVe=ne.noExitRuntime||!0;typeof WebAssembly!="object"&&cr("no native wasm support detected");function wIe(t,e,r){switch(e=e||"i8",e.charAt(e.length-1)==="*"&&(e="i32"),e){case"i1":return Ai[t>>0];case"i8":return Ai[t>>0];case"i16":return NS[t>>1];case"i32":return Ye[t>>2];case"i64":return Ye[t>>2];case"float":return HG[t>>2];case"double":return YG[t>>3];default:cr("invalid type for getValue: "+e)}return null}var uI,GG=!1,QIe;function TG(t,e){t||cr("Assertion failed: "+e)}function qG(t){var e=ne["_"+t];return TG(e,"Cannot call unknown function "+t+", make sure it is exported"),e}function DIe(t,e,r,i,n){var s={string:function(f){var p=0;if(f!=null&&f!==0){var m=(f.length<<2)+1;p=WG(m),JG(f,p,m)}return p},array:function(f){var p=WG(f.length);return bIe(f,p),p}};function o(f){return e==="string"?jG(f):e==="boolean"?Boolean(f):f}var a=qG(t),l=[],c=0;if(i)for(var u=0;u<i.length;u++){var g=s[r[u]];g?(c===0&&(c=SIe()),l[u]=g(i[u])):l[u]=i[u]}var h=a.apply(null,l);return h=o(h),c!==0&&xIe(c),h}function PIe(t,e,r,i){r=r||[];var n=r.every(function(o){return o==="number"}),s=e!=="string";return s&&n&&!i?qG(t):function(){return DIe(t,e,r,arguments,i)}}var zG=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function dc(t,e,r){for(var i=e+r,n=e;t[n]&&!(n>=i);)++n;if(n-e>16&&t.subarray&&zG)return zG.decode(t.subarray(e,n));for(var s="";e<n;){var o=t[e++];if(!(o&128)){s+=String.fromCharCode(o);continue}var a=t[e++]&63;if((o&224)==192){s+=String.fromCharCode((o&31)<<6|a);continue}var l=t[e++]&63;if((o&240)==224?o=(o&15)<<12|a<<6|l:o=(o&7)<<18|a<<12|l<<6|t[e++]&63,o<65536)s+=String.fromCharCode(o);else{var c=o-65536;s+=String.fromCharCode(55296|c>>10,56320|c&1023)}}return s}function jG(t,e){return t?dc(Cc,t,e):""}func
|
|||
|
`)):typeof readline=="function"&&(e=readline(),e!==null&&(e+=`
|
|||
|
`));if(!e)return null;t.input=YS(e,!0)}return t.input.shift()},put_char:function(t,e){e===null||e===10?(cI(dc(t.output,0)),t.output=[]):e!=0&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(cI(dc(t.output,0)),t.output=[])}},default_tty1_ops:{put_char:function(t,e){e===null||e===10?(qr(dc(t.output,0)),t.output=[]):e!=0&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(qr(dc(t.output,0)),t.output=[])}}};function GS(t){for(var e=EIe(t,65536),r=VG(e);t<e;)Ai[r+t++]=0;return r}var st={ops_table:null,mount:function(t){return st.createNode(null,"/",16384|511,0)},createNode:function(t,e,r,i){if(E.isBlkdev(r)||E.isFIFO(r))throw new E.ErrnoError(63);st.ops_table||(st.ops_table={dir:{node:{getattr:st.node_ops.getattr,setattr:st.node_ops.setattr,lookup:st.node_ops.lookup,mknod:st.node_ops.mknod,rename:st.node_ops.rename,unlink:st.node_ops.unlink,rmdir:st.node_ops.rmdir,readdir:st.node_ops.readdir,symlink:st.node_ops.symlink},stream:{llseek:st.stream_ops.llseek}},file:{node:{getattr:st.node_ops.getattr,setattr:st.node_ops.setattr},stream:{llseek:st.stream_ops.llseek,read:st.stream_ops.read,write:st.stream_ops.write,allocate:st.stream_ops.allocate,mmap:st.stream_ops.mmap,msync:st.stream_ops.msync}},link:{node:{getattr:st.node_ops.getattr,setattr:st.node_ops.setattr,readlink:st.node_ops.readlink},stream:{}},chrdev:{node:{getattr:st.node_ops.getattr,setattr:st.node_ops.setattr},stream:E.chrdev_stream_ops}});var n=E.createNode(t,e,r,i);return E.isDir(n.mode)?(n.node_ops=st.ops_table.dir.node,n.stream_ops=st.ops_table.dir.stream,n.contents={}):E.isFile(n.mode)?(n.node_ops=st.ops_table.file.node,n.stream_ops=st.ops_table.file.stream,n.usedBytes=0,n.contents=null):E.isLink(n.mode)?(n.node_ops=st.ops_table.link.node,n.stream_ops=st.ops_table.link.stream):E.isChrdev(n.mode)&&(n.node_ops=st.ops_table.chrdev.node,n.stream_ops=st.ops_table.chrdev.stream),n.timestamp=Date.now(),t&&(t.contents[e]=n,t.timestamp=n.timestamp),n},getFileDataAsTypedArray:function(t){return t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0)},expandFileStorage:function(t,e){var r=t.contents?t.contents.length:0;if(!(r>=e)){var i=1024*1024;e=Math.max(e,r*(r<i?2:1.125)>>>0),r!=0&&(e=Math.max(e,256));var n=t.contents;t.contents=new Uint8Array(e),t.usedBytes>0&&t.contents.set(n.subarray(0,t.usedBytes),0)}},resizeFileStorage:function(t,e){if(t.usedBytes!=e)if(e==0)t.contents=null,t.usedBytes=0;else{var r=t.contents;t.contents=new Uint8Array(e),r&&t.contents.set(r.subarray(0,Math.min(e,t.usedBytes))),t.usedBytes=e}},node_ops:{getattr:function(t){var e={};return e.dev=E.isChrdev(t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,E.isDir(t.mode)?e.size=4096:E.isFile(t.mode)?e.size=t.usedBytes:E.isLink(t.mode)?e.size=t.link.length:e.size=0,e.atime=new Date(t.timestamp),e.mtime=new Date(t.timestamp),e.ctime=new Date(t.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(t,e){e.mode!==void 0&&(t.mode=e.mode),e.timestamp!==void 0&&(t.timestamp=e.timestamp),e.size!==void 0&&st.resizeFileStorage(t,e.size)},lookup:function(t,e){throw E.genericErrors[44]},mknod:function(t,e,r,i){return st.createNode(t,e,r,i)},rename:function(t,e,r){if(E.isDir(t.mode)){var i;try{i=E.lookupNode(e,r)}catch(s){}if(i)for(var n in i.contents)throw new E.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=r,e.contents[r]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink:function(t,e){delete t.contents[e],t.timestamp=Date.now()},rmdir:function(t,e){var r=E.lookupNode(t,e);for(var i in r.contents)throw new E.ErrnoError(55);delete t.contents[e],t.timestamp=Date.now()},readdir:function(t){var e=[".",".."];for(var r in t.contents)!t.contents.hasOwnProperty(r)||e.push(r);return e},symlink:function(t,e,r){var i=st.createNode(t,e,511|40960,0);return i.link=r,i},readlink:function(t){if(!E.isLink(t.mode))throw new E.ErrnoError(28);return t.link}},stream_ops:{read:function(t,e,r,i,n){var s=t.node.contents;if(n>=t.node.usedBytes)return
|
|||
|
\x85\u2028\u2029`.indexOf(this.buffer.charAt(n-1))===-1;)if(n-=1,this.position-n>r/2-1){i=" ... ",n+=5;break}for(s="",o=this.position;o<this.buffer.length&&`\0\r
|
|||
|
\x85\u2028\u2029`.indexOf(this.buffer.charAt(o))===-1;)if(o+=1,o-this.position>r/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(n,o),Cq.repeat(" ",e)+i+a+s+`
|
|||
|
`+Cq.repeat(" ",e+this.position-n+i.length)+"^"};ex.prototype.toString=function(e){var r,i="";return this.name&&(i+='in "'+this.name+'" '),i+="at line "+(this.line+1)+", column "+(this.column+1),e||(r=this.getSnippet(),r&&(i+=`:
|
|||
|
`+r)),i};dq.exports=ex});var Er=C((Z7e,Iq)=>{"use strict";var Eq=Bc(),DEe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],PEe=["scalar","sequence","mapping"];function kEe(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(i){e[String(i)]=r})}),e}function vEe(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(DEe.indexOf(r)===-1)throw new Eq('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=kEe(e.styleAliases||null),PEe.indexOf(this.kind)===-1)throw new Eq('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}Iq.exports=vEe});var xA=C((_7e,yq)=>{"use strict";var Bq=SA(),bI=Bc(),FEe=Er();function tx(t,e,r){var i=[];return t.include.forEach(function(n){r=tx(n,e,r)}),t[e].forEach(function(n){r.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&i.push(o)}),r.push(n)}),r.filter(function(n,s){return i.indexOf(s)===-1})}function REe(){var t={scalar:{},sequence:{},mapping:{},fallback:{}},e,r;function i(n){t[n.kind][n.tag]=t.fallback[n.tag]=n}for(e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(i);return t}function wc(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&e.loadKind!=="scalar")throw new bI("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=tx(this,"implicit",[]),this.compiledExplicit=tx(this,"explicit",[]),this.compiledTypeMap=REe(this.compiledImplicit,this.compiledExplicit)}wc.DEFAULT=null;wc.create=function(){var e,r;switch(arguments.length){case 1:e=wc.DEFAULT,r=arguments[0];break;case 2:e=arguments[0],r=arguments[1];break;default:throw new bI("Wrong number of arguments for Schema.create function")}if(e=Bq.toArray(e),r=Bq.toArray(r),!e.every(function(i){return i instanceof wc}))throw new bI("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(i){return i instanceof FEe}))throw new bI("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new wc({include:e,explicit:r})};yq.exports=wc});var Qq=C(($7e,wq)=>{"use strict";var LEe=Er();wq.exports=new LEe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var Sq=C((eXe,bq)=>{"use strict";var NEe=Er();bq.exports=new NEe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var Dq=C((tXe,xq)=>{"use strict";var MEe=Er();xq.exports=new MEe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var SI=C((rXe,Pq)=>{"use strict";var OEe=xA();Pq.exports=new OEe({explicit:[Qq(),Sq(),Dq()]})});var vq=C((iXe,kq)=>{"use strict";var KEe=Er();function TEe(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function UEe(){return null}function HEe(t){return t===null}kq.exports=new KEe("tag:yaml.org,2002:null",{kind:"scalar",resolve:TEe,construct:UEe,predicate:HEe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var Rq=C((nXe,Fq)=>{"use strict";var YEe=Er();function GEe(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function qEe(t){return t==="true"||t==="True"||t==="TRUE"}function jEe(t){return Object.prototype.toString.call(t)==="[object Boolean]"}Fq.exports=new YEe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:GEe,construct:qEe,predicate:jEe,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE"
|
|||
|
\r`;function dye(t){if(t===null)return!1;var e,r,i=0,n=t.length,s=nx;for(r=0;r<n;r++)if(e=s.indexOf(t.charAt(r)),!(e>64)){if(e<0)return!1;i+=6}return i%8==0}function Cye(t){var e,r,i=t.replace(/[\r\n=]/g,""),n=i.length,s=nx,o=0,a=[];for(e=0;e<n;e++)e%4==0&&e&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(i.charAt(e));return r=n%4*6,r===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):r===18?(a.push(o>>10&255),a.push(o>>2&255)):r===12&&a.push(o>>4&255),DA?DA.from?DA.from(a):new DA(a):a}function mye(t){var e="",r=0,i,n,s=t.length,o=nx;for(i=0;i<s;i++)i%3==0&&i&&(e+=o[r>>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]),r=(r<<8)+t[i];return n=s%3,n===0?(e+=o[r>>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]):n===2?(e+=o[r>>10&63],e+=o[r>>4&63],e+=o[r<<2&63],e+=o[64]):n===1&&(e+=o[r>>2&63],e+=o[r<<4&63],e+=o[64],e+=o[64]),e}function Iye(t){return DA&&DA.isBuffer(t)}Wq.exports=new pye("tag:yaml.org,2002:binary",{kind:"scalar",resolve:dye,construct:Cye,predicate:Iye,represent:mye})});var Zq=C((gXe,Xq)=>{"use strict";var Eye=Er(),yye=Object.prototype.hasOwnProperty,Bye=Object.prototype.toString;function wye(t){if(t===null)return!0;var e=[],r,i,n,s,o,a=t;for(r=0,i=a.length;r<i;r+=1){if(n=a[r],o=!1,Bye.call(n)!=="[object Object]")return!1;for(s in n)if(yye.call(n,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}function Qye(t){return t!==null?t:[]}Xq.exports=new Eye("tag:yaml.org,2002:omap",{kind:"sequence",resolve:wye,construct:Qye})});var $q=C((hXe,_q)=>{"use strict";var bye=Er(),Sye=Object.prototype.toString;function xye(t){if(t===null)return!0;var e,r,i,n,s,o=t;for(s=new Array(o.length),e=0,r=o.length;e<r;e+=1){if(i=o[e],Sye.call(i)!=="[object Object]"||(n=Object.keys(i),n.length!==1))return!1;s[e]=[n[0],i[n[0]]]}return!0}function Dye(t){if(t===null)return[];var e,r,i,n,s,o=t;for(s=new Array(o.length),e=0,r=o.length;e<r;e+=1)i=o[e],n=Object.keys(i),s[e]=[n[0],i[n[0]]];return s}_q.exports=new bye("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:xye,construct:Dye})});var tj=C((fXe,ej)=>{"use strict";var Pye=Er(),kye=Object.prototype.hasOwnProperty;function vye(t){if(t===null)return!0;var e,r=t;for(e in r)if(kye.call(r,e)&&r[e]!==null)return!1;return!0}function Fye(t){return t!==null?t:{}}ej.exports=new Pye("tag:yaml.org,2002:set",{kind:"mapping",resolve:vye,construct:Fye})});var Qc=C((pXe,rj)=>{"use strict";var Rye=xA();rj.exports=new Rye({include:[ix()],implicit:[qq(),Jq()],explicit:[Vq(),Zq(),$q(),tj()]})});var nj=C((dXe,ij)=>{"use strict";var Lye=Er();function Nye(){return!0}function Mye(){}function Oye(){return""}function Kye(t){return typeof t=="undefined"}ij.exports=new Lye("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:Nye,construct:Mye,predicate:Kye,represent:Oye})});var oj=C((CXe,sj)=>{"use strict";var Tye=Er();function Uye(t){if(t===null||t.length===0)return!1;var e=t,r=/\/([gim]*)$/.exec(t),i="";return!(e[0]==="/"&&(r&&(i=r[1]),i.length>3||e[e.length-i.length-1]!=="/"))}function Hye(t){var e=t,r=/\/([gim]*)$/.exec(t),i="";return e[0]==="/"&&(r&&(i=r[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)}function Yye(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}function Gye(t){return Object.prototype.toString.call(t)==="[object RegExp]"}sj.exports=new Tye("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:Uye,construct:Hye,predicate:Gye,represent:Yye})});var lj=C((mXe,aj)=>{"use strict";var xI;try{Aj=require,xI=Aj("esprima")}catch(t){typeof window!="undefined"&&(xI=window.esprima)}var Aj,qye=Er();function jye(t){if(t===null)return!1;try{var e="("+t+")",r=xI.parse(e,{range:!0});return!(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")}catch(i){return!1}}function Jye(t){var e="("+t+")",r=xI.parse(e,{range:!0}),i=[],n;if(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&
|
|||
|
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function nBe(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}var yj=new Array(256),Bj=new Array(256);for(var Sc=0;Sc<256;Sc++)yj[Sc]=Ej(Sc)?1:0,Bj[Sc]=Ej(Sc);function sBe(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Xye,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=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function wj(t,e){return new gj(e,new Vye(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function _e(t,e){throw wj(t,e)}function kI(t,e){t.onWarning&&t.onWarning.call(null,wj(t,e))}var Qj={YAML:function(e,r,i){var n,s,o;e.version!==null&&_e(e,"duplication of %YAML directive"),i.length!==1&&_e(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&&_e(e,"ill-formed argument of the YAML directive"),s=parseInt(n[1],10),o=parseInt(n[2],10),s!==1&&_e(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&kI(e,"unsupported YAML version of the document")},TAG:function(e,r,i){var n,s;i.length!==2&&_e(e,"TAG directive accepts exactly two arguments"),n=i[0],s=i[1],Cj.test(n)||_e(e,"ill-formed tag handle (first argument) of the TAG directive"),ea.call(e.tagMap,n)&&_e(e,'there is a previously declared suffix for "'+n+'" tag handle'),mj.test(s)||_e(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[n]=s}};function ta(t,e,r,i){var n,s,o,a;if(e<r){if(a=t.input.slice(e,r),i)for(n=0,s=a.length;n<s;n+=1)o=a.charCodeAt(n),o===9||32<=o&&o<=1114111||_e(t,"expected valid JSON character");else _ye.test(a)&&_e(t,"the stream contains non-printable characters");t.result+=a}}function bj(t,e,r,i){var n,s,o,a;for(_s.isObject(r)||_e(t,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(r),o=0,a=n.length;o<a;o+=1)s=n[o],ea.call(e,s)||(e[s]=r[s],i[s]=!0)}function xc(t,e,r,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])&&_e(t,"nested arrays are not supported inside keys"),typeof n=="object"&&Ij(n[l])==="[object Object]"&&(n[l]="[object Object]");if(typeof n=="object"&&Ij(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)bj(t,e,s[l],r);else bj(t,e,s,r);else!t.json&&!ea.call(r,n)&&ea.call(e,n)&&(t.line=o||t.line,t.position=a||t.position,_e(t,"duplicated mapping key")),e[n]=s,delete r[n];return e}function ox(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):_e(t,"a line break is expected"),t.line+=1,t.lineStart=t.position}function ur(t,e,r){for(var i=0,n=t.input.charCodeAt(t.position);n!==0;){for(;PA(n);)n=t.input.charCodeAt(++t.position);if(e&&n===35)do n=t.input.charCodeAt(++t.position);while(n!==10&&n!==13&&n!==0);if(os(n))for(ox(t),n=t.input.charCodeAt(t.position),i++,t.lineIndent=0;n===32;)t.lineIndent++,n=t.input.charCodeAt(++t.position);else break}return r!==-1&&i!==0&&t.lineIndent<r&&kI(t,"deficient indentation"),i}function vI(t){var e=t.position,r;return r=t.input.charCodeAt(e),!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||Si(r)))}function ax(t,e){e===1?t.result+=" ":e>1&&(t.result+=_s.repeat(`
|
|||
|
`,e-1))}function oBe(t,e,r){var i,n,s,o,a,l,c,u,g=t.kind,h=t.result,f;if(f=t.input.charCodeAt(t.position),Si(f)||bc(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(n=t.input.charCodeAt(t.position+1),Si(n)||r&&bc(n)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,a=!1;f!==0;){if(f===58){if(n=t.input.charCodeAt(t.position+1),Si(n)||r&&bc(n))break}else if(f===35){if(i=t.input.charCodeAt(t.position-1),Si(i))break}else{if(t.position===t.lineStart&&vI(t)||r&&bc(f))break;if(os(f))if(l=t.line,c=t.lineStart,u=t.lineIndent,ur(t,!1,-1),t.lineIndent>=e){a=!0,f=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=l,t.lineStart=c,t.lineIndent=u;break}}a&&(ta(t,s,o,!1),ax(t,t.line-l),s=o=t.position,a=!1),PA(f)||(o=t.position+1),f=t.input.charCodeAt(++t.position)}return ta(t,s,o,!1),t.result?!0:(t.kind=g,t.result=h,!1)}function aBe(t,e){var r,i,n;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,i=n=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(ta(t,i,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)i=t.position,t.position++,n=t.position;else return!0;else os(r)?(ta(t,i,n,!0),ax(t,ur(t,!1,e)),i=n=t.position):t.position===t.lineStart&&vI(t)?_e(t,"unexpected end of the document within a single quoted scalar"):(t.position++,n=t.position);_e(t,"unexpected end of the stream within a single quoted scalar")}function ABe(t,e){var r,i,n,s,o,a;if(a=t.input.charCodeAt(t.position),a!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;(a=t.input.charCodeAt(t.position))!==0;){if(a===34)return ta(t,r,t.position,!0),t.position++,!0;if(a===92){if(ta(t,r,t.position,!0),a=t.input.charCodeAt(++t.position),os(a))ur(t,!1,e);else if(a<256&&yj[a])t.result+=Bj[a],t.position++;else if((o=rBe(a))>0){for(n=o,s=0;n>0;n--)a=t.input.charCodeAt(++t.position),(o=tBe(a))>=0?s=(s<<4)+o:_e(t,"expected hexadecimal character");t.result+=nBe(s),t.position++}else _e(t,"unknown escape sequence");r=i=t.position}else os(a)?(ta(t,r,i,!0),ax(t,ur(t,!1,e)),r=i=t.position):t.position===t.lineStart&&vI(t)?_e(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}_e(t,"unexpected end of the stream within a double quoted scalar")}function lBe(t,e){var r=!0,i,n=t.tag,s,o=t.anchor,a,l,c,u,g,h={},f,p,m,I;if(I=t.input.charCodeAt(t.position),I===91)l=93,g=!1,s=[];else if(I===123)l=125,g=!0,s={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),I=t.input.charCodeAt(++t.position);I!==0;){if(ur(t,!0,e),I=t.input.charCodeAt(t.position),I===l)return t.position++,t.tag=n,t.anchor=o,t.kind=g?"mapping":"sequence",t.result=s,!0;r||_e(t,"missed comma between flow collection entries"),p=f=m=null,c=u=!1,I===63&&(a=t.input.charCodeAt(t.position+1),Si(a)&&(c=u=!0,t.position++,ur(t,!0,e))),i=t.line,Dc(t,e,DI,!1,!0),p=t.tag,f=t.result,ur(t,!0,e),I=t.input.charCodeAt(t.position),(u||t.line===i)&&I===58&&(c=!0,I=t.input.charCodeAt(++t.position),ur(t,!0,e),Dc(t,e,DI,!1,!0),m=t.result),g?xc(t,s,h,p,f,m):c?s.push(xc(t,null,h,p,f,m)):s.push(f),ur(t,!0,e),I=t.input.charCodeAt(t.position),I===44?(r=!0,I=t.input.charCodeAt(++t.position)):r=!1}_e(t,"unexpected end of the stream within a flow collection")}function cBe(t,e){var r,i,n=sx,s=!1,o=!1,a=e,l=0,c=!1,u,g;if(g=t.input.charCodeAt(t.position),g===124)i=!1;else if(g===62)i=!0;else return!1;for(t.kind="scalar",t.result="";g!==0;)if(g=t.input.charCodeAt(++t.position),g===43||g===45)sx===n?n=g===43?dj:Zye:_e(t,"repeat of a chomping mode identifier");else if((u=iBe(g))>=0)u===0?_e(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?_e(t,"repeat of an indentation width identifier"):(a=e+u-1,o=!0);else break;if(PA(g)){do g=t.input.charCodeAt(++t.position);while(PA(g));if(g===35)do g=t.input.charCodeAt(++t.position);while(!os(g)&&g!==0)}for(;g!==0;){for(ox(t),t.lineIndent=0,g=t.input.charCodeAt(t.position);(!o||t.lineIndent<a)&&g===32;)t.lineIndent++,g=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>a&&(a=t
|
|||
|
`,s?1+l:l):n===sx&&s&&(t.result+=`
|
|||
|
`);break}for(i?PA(g)?(c=!0,t.result+=_s.repeat(`
|
|||
|
`,s?1+l:l)):c?(c=!1,t.result+=_s.repeat(`
|
|||
|
`,l+1)):l===0?s&&(t.result+=" "):t.result+=_s.repeat(`
|
|||
|
`,l):t.result+=_s.repeat(`
|
|||
|
`,s?1+l:l),s=!0,o=!0,l=0,r=t.position;!os(g)&&g!==0;)g=t.input.charCodeAt(++t.position);ta(t,r,t.position,!1)}return!0}function Sj(t,e){var r,i=t.tag,n=t.anchor,s=[],o,a=!1,l;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),l=t.input.charCodeAt(t.position);l!==0&&!(l!==45||(o=t.input.charCodeAt(t.position+1),!Si(o)));){if(a=!0,t.position++,ur(t,!0,-1)&&t.lineIndent<=e){s.push(null),l=t.input.charCodeAt(t.position);continue}if(r=t.line,Dc(t,e,pj,!1,!0),s.push(t.result),ur(t,!0,-1),l=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&l!==0)_e(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return a?(t.tag=i,t.anchor=n,t.kind="sequence",t.result=s,!0):!1}function uBe(t,e,r){var i,n,s,o,a=t.tag,l=t.anchor,c={},u={},g=null,h=null,f=null,p=!1,m=!1,I;for(t.anchor!==null&&(t.anchorMap[t.anchor]=c),I=t.input.charCodeAt(t.position);I!==0;){if(i=t.input.charCodeAt(t.position+1),s=t.line,o=t.position,(I===63||I===58)&&Si(i))I===63?(p&&(xc(t,c,u,g,h,null),g=h=f=null),m=!0,p=!0,n=!0):p?(p=!1,n=!0):_e(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,I=i;else if(Dc(t,r,fj,!1,!0))if(t.line===s){for(I=t.input.charCodeAt(t.position);PA(I);)I=t.input.charCodeAt(++t.position);if(I===58)I=t.input.charCodeAt(++t.position),Si(I)||_e(t,"a whitespace character is expected after the key-value separator within a block mapping"),p&&(xc(t,c,u,g,h,null),g=h=f=null),m=!0,p=!1,n=!1,g=t.tag,h=t.result;else if(m)_e(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=a,t.anchor=l,!0}else if(m)_e(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=a,t.anchor=l,!0;else break;if((t.line===s||t.lineIndent>e)&&(Dc(t,e,PI,!0,n)&&(p?h=t.result:f=t.result),p||(xc(t,c,u,g,h,f,s,o),g=h=f=null),ur(t,!0,-1),I=t.input.charCodeAt(t.position)),t.lineIndent>e&&I!==0)_e(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return p&&xc(t,c,u,g,h,null),m&&(t.tag=a,t.anchor=l,t.kind="mapping",t.result=c),m}function gBe(t){var e,r=!1,i=!1,n,s,o;if(o=t.input.charCodeAt(t.position),o!==33)return!1;if(t.tag!==null&&_e(t,"duplication of a tag property"),o=t.input.charCodeAt(++t.position),o===60?(r=!0,o=t.input.charCodeAt(++t.position)):o===33?(i=!0,n="!!",o=t.input.charCodeAt(++t.position)):n="!",e=t.position,r){do o=t.input.charCodeAt(++t.position);while(o!==0&&o!==62);t.position<t.length?(s=t.input.slice(e,t.position),o=t.input.charCodeAt(++t.position)):_e(t,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Si(o);)o===33&&(i?_e(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),Cj.test(n)||_e(t,"named tag handle cannot contain such characters"),i=!0,e=t.position+1)),o=t.input.charCodeAt(++t.position);s=t.input.slice(e,t.position),eBe.test(s)&&_e(t,"tag suffix cannot contain flow indicator characters")}return s&&!mj.test(s)&&_e(t,"tag name cannot contain such characters: "+s),r?t.tag=s:ea.call(t.tagMap,n)?t.tag=t.tagMap[n]+s:n==="!"?t.tag="!"+s:n==="!!"?t.tag="tag:yaml.org,2002:"+s:_e(t,'undeclared tag handle "'+n+'"'),!0}function hBe(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&_e(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!Si(r)&&!bc(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&_e(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function fBe(t){var e,r,i;if(i=t.input.charCodeAt(t.position),i!==42)return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;i!==0&&!Si(i)&&!bc(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&_e(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),ea.call(t.anchorMap,r)||_e(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],ur(t,!0,-1),!0}function Dc(t,e,r,i,n){var s,o,a,l=1,c=!1,u=!1,g,h,f,p,m;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s
|
|||
|
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new sBe(t,e),i=t.indexOf("\0");for(i!==-1&&(r.position=i,_e(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)pBe(r);return r.documents}function Dj(t,e,r){e!==null&&typeof e=="object"&&typeof r=="undefined"&&(r=e,e=null);var i=xj(t,r);if(typeof e!="function")return i;for(var n=0,s=i.length;n<s;n+=1)e(i[n])}function Pj(t,e){var r=xj(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new gj("expected a single document in the stream, but found more")}}function dBe(t,e,r){return typeof e=="object"&&e!==null&&typeof r=="undefined"&&(r=e,e=null),Dj(t,e,_s.extend({schema:hj},r))}function CBe(t,e){return Pj(t,_s.extend({schema:hj},e))}Yh.exports.loadAll=Dj;Yh.exports.load=Pj;Yh.exports.safeLoadAll=dBe;Yh.exports.safeLoad=CBe});var $j=C((yXe,Ax)=>{"use strict";var Gh=SA(),qh=Bc(),mBe=Hh(),IBe=Qc(),vj=Object.prototype.toString,Fj=Object.prototype.hasOwnProperty,EBe=9,jh=10,yBe=13,BBe=32,wBe=33,QBe=34,Rj=35,bBe=37,SBe=38,xBe=39,DBe=42,Lj=44,PBe=45,Nj=58,kBe=61,vBe=62,FBe=63,RBe=64,Mj=91,Oj=93,LBe=96,Kj=123,NBe=124,Tj=125,jr={};jr[0]="\\0";jr[7]="\\a";jr[8]="\\b";jr[9]="\\t";jr[10]="\\n";jr[11]="\\v";jr[12]="\\f";jr[13]="\\r";jr[27]="\\e";jr[34]='\\"';jr[92]="\\\\";jr[133]="\\N";jr[160]="\\_";jr[8232]="\\L";jr[8233]="\\P";var MBe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function OBe(t,e){var r,i,n,s,o,a,l;if(e===null)return{};for(r={},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=t.compiledTypeMap.fallback[o],l&&Fj.call(l.styleAliases,a)&&(a=l.styleAliases[a]),r[o]=a;return r}function Uj(t){var e,r,i;if(e=t.toString(16).toUpperCase(),t<=255)r="x",i=2;else if(t<=65535)r="u",i=4;else if(t<=4294967295)r="U",i=8;else throw new qh("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Gh.repeat("0",i-e.length)+e}function KBe(t){this.schema=t.schema||mBe,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Gh.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=OBe(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Hj(t,e){for(var r=Gh.repeat(" ",e),i=0,n=-1,s="",o,a=t.length;i<a;)n=t.indexOf(`
|
|||
|
`,i),n===-1?(o=t.slice(i),i=a):(o=t.slice(i,n+1),i=n+1),o.length&&o!==`
|
|||
|
`&&(s+=r),s+=o;return s}function lx(t,e){return`
|
|||
|
`+Gh.repeat(" ",t.indent*e)}function TBe(t,e){var r,i,n;for(r=0,i=t.implicitTypes.length;r<i;r+=1)if(n=t.implicitTypes[r],n.resolve(e))return!0;return!1}function cx(t){return t===BBe||t===EBe}function Pc(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==65279||65536<=t&&t<=1114111}function UBe(t){return Pc(t)&&!cx(t)&&t!==65279&&t!==yBe&&t!==jh}function Yj(t,e){return Pc(t)&&t!==65279&&t!==Lj&&t!==Mj&&t!==Oj&&t!==Kj&&t!==Tj&&t!==Nj&&(t!==Rj||e&&UBe(e))}function HBe(t){return Pc(t)&&t!==65279&&!cx(t)&&t!==PBe&&t!==FBe&&t!==Nj&&t!==Lj&&t!==Mj&&t!==Oj&&t!==Kj&&t!==Tj&&t!==Rj&&t!==SBe&&t!==DBe&&t!==wBe&&t!==NBe&&t!==kBe&&t!==vBe&&t!==xBe&&t!==QBe&&t!==bBe&&t!==RBe&&t!==LBe}function Gj(t){var e=/^\n* /;return e.test(t)}var qj=1,jj=2,Jj=3,Wj=4,FI=5;function YBe(t,e,r,i,n){var s,o,a,l=!1,c=!1,u=i!==-1,g=-1,h=HBe(t.charCodeAt(0))&&!cx(t.charCodeAt(t.length-1));if(e)for(s=0;s<t.length;s++){if(o=t.charCodeAt(s),!Pc(o))return FI;a=s>0?t.charCodeAt(s-1):null,h=h&&Yj(o,a)}else{for(s=0;s<t.length;s++){if(o=t.charCodeAt(s),o===jh)l=!0,u&&(c=c||s-g-1>i&&t[g+1]!==" ",g=s);else if(!Pc(o))return FI;a=s>0?t.charCodeAt(s-1):null,h=h&&Yj(o,a)}c=c||u&&s-g-1>i&&t[g+1]!==" "}return!l&&!c?h&&!n(t)?qj:jj:r>9&&Gj(t)?FI:c?Wj:Jj}function jBe(t,e,r,i){t.dump=function(){if(e.length===0)return"''";if(!t.noCompatMode&&MBe.indexOf(e)!==-1)return"'"+e+"'";var n=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-n),o=i||t.flowLevel>-1&&r>=t.flowLevel;function a(l){return TBe(t,l)}switch(YBe(e,o,t.indent,s,a)){case qj:return e;case jj:return"'"+e.replace(/'/g,"''")+"'";case Jj:return"|"+zj(e,t.indent)+Vj(Hj(e,n));case Wj:return">"+zj(e,t.indent)+Vj(Hj(GBe(e,s),n));case FI:return'"'+qBe(e,s)+'"';default:throw new qh("impossible error: invalid scalar style")}}()}function zj(t,e){var r=Gj(t)?String(e):"",i=t[t.length-1]===`
|
|||
|
`,n=i&&(t[t.length-2]===`
|
|||
|
`||t===`
|
|||
|
`),s=n?"+":i?"":"-";return r+s+`
|
|||
|
`}function Vj(t){return t[t.length-1]===`
|
|||
|
`?t.slice(0,-1):t}function GBe(t,e){for(var r=/(\n+)([^\n]*)/g,i=function(){var c=t.indexOf(`
|
|||
|
`);return c=c!==-1?c:t.length,r.lastIndex=c,Xj(t.slice(0,c),e)}(),n=t[0]===`
|
|||
|
`||t[0]===" ",s,o;o=r.exec(t);){var a=o[1],l=o[2];s=l[0]===" ",i+=a+(!n&&!s&&l!==""?`
|
|||
|
`:"")+Xj(l,e),n=s}return i}function Xj(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,i,n=0,s,o=0,a=0,l="";i=r.exec(t);)a=i.index,a-n>e&&(s=o>n?o:a,l+=`
|
|||
|
`+t.slice(n,s),n=s+1),o=a;return l+=`
|
|||
|
`,t.length-n>e&&o>n?l+=t.slice(n,o)+`
|
|||
|
`+t.slice(o+1):l+=t.slice(n),l.slice(1)}function qBe(t){for(var e="",r,i,n,s=0;s<t.length;s++){if(r=t.charCodeAt(s),r>=55296&&r<=56319&&(i=t.charCodeAt(s+1),i>=56320&&i<=57343)){e+=Uj((r-55296)*1024+i-56320+65536),s++;continue}n=jr[r],e+=!n&&Pc(r)?t[s]:n||Uj(r)}return e}function JBe(t,e,r){var i="",n=t.tag,s,o;for(s=0,o=r.length;s<o;s+=1)kA(t,e,r[s],!1,!1)&&(s!==0&&(i+=","+(t.condenseFlow?"":" ")),i+=t.dump);t.tag=n,t.dump="["+i+"]"}function WBe(t,e,r,i){var n="",s=t.tag,o,a;for(o=0,a=r.length;o<a;o+=1)kA(t,e+1,r[o],!0,!0)&&((!i||o!==0)&&(n+=lx(t,e)),t.dump&&jh===t.dump.charCodeAt(0)?n+="-":n+="- ",n+=t.dump);t.tag=s,t.dump=n||"[]"}function zBe(t,e,r){var i="",n=t.tag,s=Object.keys(r),o,a,l,c,u;for(o=0,a=s.length;o<a;o+=1)u="",o!==0&&(u+=", "),t.condenseFlow&&(u+='"'),l=s[o],c=r[l],!!kA(t,e,l,!1,!1)&&(t.dump.length>1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),!!kA(t,e,c,!1,!1)&&(u+=t.dump,i+=u));t.tag=n,t.dump="{"+i+"}"}function VBe(t,e,r,i){var n="",s=t.tag,o=Object.keys(r),a,l,c,u,g,h;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new qh("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)h="",(!i||a!==0)&&(h+=lx(t,e)),c=o[a],u=r[c],!!kA(t,e+1,c,!0,!0,!0)&&(g=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,g&&(t.dump&&jh===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,g&&(h+=lx(t,e)),!!kA(t,e+1,u,!0,g)&&(t.dump&&jh===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,n+=h));t.tag=s,t.dump=n||"{}"}function Zj(t,e,r){var i,n,s,o,a,l;for(n=r?t.explicitTypes:t.implicitTypes,s=0,o=n.length;s<o;s+=1)if(a=n[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(t.tag=r?a.tag:"?",a.represent){if(l=t.styleMap[a.tag]||a.defaultStyle,vj.call(a.represent)==="[object Function]")i=a.represent(e,l);else if(Fj.call(a.represent,l))i=a.represent[l](e,l);else throw new qh("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');t.dump=i}return!0}return!1}function kA(t,e,r,i,n,s){t.tag=null,t.dump=r,Zj(t,r,!1)||Zj(t,r,!0);var o=vj.call(t.dump);i&&(i=t.flowLevel<0||t.flowLevel>e);var a=o==="[object Object]"||o==="[object Array]",l,c;if(a&&(l=t.duplicates.indexOf(r),c=l!==-1),(t.tag!==null&&t.tag!=="?"||c||t.indent!==2&&e>0)&&(n=!1),c&&t.usedDuplicates[l])t.dump="*ref_"+l;else{if(a&&c&&!t.usedDuplicates[l]&&(t.usedDuplicates[l]=!0),o==="[object Object]")i&&Object.keys(t.dump).length!==0?(VBe(t,e,t.dump,n),c&&(t.dump="&ref_"+l+t.dump)):(zBe(t,e,t.dump),c&&(t.dump="&ref_"+l+" "+t.dump));else if(o==="[object Array]"){var u=t.noArrayIndent&&e>0?e-1:e;i&&t.dump.length!==0?(WBe(t,u,t.dump,n),c&&(t.dump="&ref_"+l+t.dump)):(JBe(t,u,t.dump),c&&(t.dump="&ref_"+l+" "+t.dump))}else if(o==="[object String]")t.tag!=="?"&&jBe(t,t.dump,e,s);else{if(t.skipInvalid)return!1;throw new qh("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function XBe(t,e){var r=[],i=[],n,s;for(ux(t,r,i),n=0,s=i.length;n<s;n+=1)e.duplicates.push(r[i[n]]);e.usedDuplicates=new Array(s)}function ux(t,e,r){var i,n,s;if(t!==null&&typeof t=="object")if(n=e.indexOf(t),n!==-1)r.indexOf(n)===-1&&r.push(n);else if(e.push(t),Array.isArray(t))for(n=0,s=t.length;n<s;n+=1)ux(t[n],e,r);else for(i=Object.keys(t),n=0,s=i.length;n<s;n+=1)ux(t[i[n]],e,r)}function _j(t,e){e=e||{};var r=new KBe(e);return r.noRefs||XBe(t,r),kA(r,0,t,!0,!0)?r.dump+`
|
|||
|
`:""}function ZBe(t,e){return _j(t,Gh.extend({schema:IBe},e))}Ax.exports.dump=_j;Ax.exports.safeDump=ZBe});var tJ=C((BXe,_t)=>{"use strict";var RI=kj(),eJ=$j();function LI(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}_t.exports.Type=Er();_t.exports.Schema=xA();_t.exports.FAILSAFE_SCHEMA=SI();_t.exports.JSON_SCHEMA=rx();_t.exports.CORE_SCHEMA=ix();_t.exports.DEFAULT_SAFE_SCHEMA=Qc();_t.exports.DEFAULT_FULL_SCHEMA=Hh();_t.exports.load=RI.load;_t.exports.loadAll=RI.loadAll;_t.exports.safeLoad=RI.safeLoad;_t.exports.safeLoadAll=RI.safeLoadAll;_t.exports.dump=eJ.dump;_t.exports.safeDump=eJ.safeDump;_t.exports.YAMLException=Bc();_t.exports.MINIMAL_SCHEMA=SI();_t.exports.SAFE_SCHEMA=Qc();_t.exports.DEFAULT_SCHEMA=Hh();_t.exports.scan=LI("scan");_t.exports.parse=LI("parse");_t.exports.compose=LI("compose");_t.exports.addConstructor=LI("addConstructor")});var iJ=C((wXe,rJ)=>{"use strict";var _Be=tJ();rJ.exports=_Be});var sJ=C((QXe,nJ)=>{"use strict";function $Be(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function vA(t,e,r,i){this.message=t,this.expected=e,this.found=r,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,vA)}$Be(vA,Error);vA.buildMessage=function(t,e){var r={literal:function(c){return`"${n(c.text)}"`},class:function(c){var u="",g;for(g=0;g<c.parts.length;g++)u+=c.parts[g]instanceof Array?`${s(c.parts[g][0])}-${s(c.parts[g][1])}`:s(c.parts[g]);return`[${c.inverted?"^":""}${u}]`},any:function(c){return"any character"},end:function(c){return"end of input"},other:function(c){return c.description}};function i(c){return c.charCodeAt(0).toString(16).toUpperCase()}function n(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return`\\x0${i(u)}`}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return`\\x${i(u)}`})}function s(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return`\\x0${i(u)}`}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return`\\x${i(u)}`})}function o(c){return r[c.type](c)}function a(c){var u=new Array(c.length),g,h;for(g=0;g<c.length;g++)u[g]=o(c[g]);if(u.sort(),u.length>0){for(g=1,h=1;g<u.length;g++)u[g-1]!==u[g]&&(u[h]=u[g],h++);u.length=h}switch(u.length){case 1:return u[0];case 2:return`${u[0]} or ${u[1]}`;default:return`${u.slice(0,-1).join(", ")}, or ${u[u.length-1]}`}}function l(c){return c?`"${n(c)}"`:"end of input"}return`Expected ${a(t)} but ${l(e)} found.`};function ewe(t,e){e=e!==void 0?e:{};var r={},i={Start:rC},n=rC,s=function(x){return[].concat(...x)},o="-",a=Mt("-",!1),l=function(x){return x},c=function(x){return Object.assign({},...x)},u="#",g=Mt("#",!1),h=nw(),f=function(){return{}},p=":",m=Mt(":",!1),I=function(x,T){return{[x]:T}},y=",",B=Mt(",",!1),D=function(x,T){return T},F=function(x,T,G){return Object.assign({},...[x].concat(T).map(ye=>({[ye]:G})))},N=function(x){return x},U=function(x){return x},v=bo("correct indentation"),J=" ",oe=Mt(" ",!1),K=function(x){return x.length===xl*aC},A=function(x){return x.length===(xl+1)*aC},W=function(){return xl++,!0},$=function(){return xl--,!0},re=function(){return Zd()},H=bo("pseudostring"),R=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,ke=zn(["\r",`
|
|||
|
`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),Le=/^[^\r\n\t ,\][{}:#"']/,qe=zn(["\r",`
|
|||
|
`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),Ke=function(){return Zd().replace(/^ *| *$/g,"")},ie="--",le=Mt("--",!1),Se=/^[a-zA-Z\/0-9]/,he=zn([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),Ie=/^[^\r\n\t :,]/,pe=zn(["\r",`
|
|||
|
`," "," ",":",","],!0,!1),De="null",Z=Mt("null",!1),X=function(){return null},ae="true",ue=Mt("true",!1),we=function(){return!0},lt="false",Ct=Mt("false",!1),Dt=function(){return!1},Sn=bo("string"),di='"',Xt=Mt('"',!1),Xi=function(){return""},Wn=function(x){return x},$u=function(x){return x.join("")},Kd=/^[^"\\\0-\x1F\x7F]/,Ss=zn(['"',"\\",["\0",""],"\x7F"],!0,!1),eg='\\"',Td=Mt('\\"',!1),qB=function(){return'"'},tg="\\\\",Ud=Mt("\\\\",!1),Hd=function(){return"\\"},Yd="\\/",jB=Mt("\\/",!1),JB=function(){return"/"},rg="\\b",WB=Mt("\\b",!1),zB=function(){return"\b"},Gd="\\f",te=Mt("\\f",!1),Qo=function(){return"\f"},xs="\\n",Zi=Mt("\\n",!1),_i=function(){return`
|
|||
|
`},ig="\\r",qd=Mt("\\r",!1),wl=function(){return"\r"},ng="\\t",jd=Mt("\\t",!1),sg=function(){return" "},Ql="\\u",og=Mt("\\u",!1),ag=function(x,T,G,ye){return String.fromCharCode(parseInt(`0x${x}${T}${G}${ye}`))},VB=/^[0-9a-fA-F]/,XB=zn([["0","9"],["a","f"],["A","F"]],!1,!1),ZB=bo("blank space"),Jd=/^[ \t]/,Wd=zn([" "," "],!1,!1),_B=bo("white space"),zd=/^[ \t\n\r]/,Vd=zn([" "," ",`
|
|||
|
`,"\r"],!1,!1),Xd=`\r
|
|||
|
`,$B=Mt(`\r
|
|||
|
`,!1),ew=`
|
|||
|
`,tw=Mt(`
|
|||
|
`,!1),rw="\r",iw=Mt("\r",!1),O=0,rt=0,bl=[{line:1,column:1}],Ni=0,Ag=[],Oe=0,Oa;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "${e.startRule}".`);n=i[e.startRule]}function Zd(){return t.substring(rt,O)}function cL(){return So(rt,O)}function Ka(x,T){throw T=T!==void 0?T:So(rt,O),tC([bo(x)],t.substring(rt,O),T)}function _d(x,T){throw T=T!==void 0?T:So(rt,O),sw(x,T)}function Mt(x,T){return{type:"literal",text:x,ignoreCase:T}}function zn(x,T,G){return{type:"class",parts:x,inverted:T,ignoreCase:G}}function nw(){return{type:"any"}}function $d(){return{type:"end"}}function bo(x){return{type:"other",description:x}}function eC(x){var T=bl[x],G;if(T)return T;for(G=x-1;!bl[G];)G--;for(T=bl[G],T={line:T.line,column:T.column};G<x;)t.charCodeAt(G)===10?(T.line++,T.column=1):T.column++,G++;return bl[x]=T,T}function So(x,T){var G=eC(x),ye=eC(T);return{start:{offset:x,line:G.line,column:G.column},end:{offset:T,line:ye.line,column:ye.column}}}function We(x){O<Ni||(O>Ni&&(Ni=O,Ag=[]),Ag.push(x))}function sw(x,T){return new vA(x,null,null,T)}function tC(x,T,G){return new vA(vA.buildMessage(x,T),x,T,G)}function rC(){var x;return x=cg(),x}function iC(){var x,T,G;for(x=O,T=[],G=lg();G!==r;)T.push(G),G=lg();return T!==r&&(rt=x,T=s(T)),x=T,x}function lg(){var x,T,G,ye,Ce;return x=O,T=Ua(),T!==r?(t.charCodeAt(O)===45?(G=o,O++):(G=r,Oe===0&&We(a)),G!==r?(ye=hr(),ye!==r?(Ce=Ta(),Ce!==r?(rt=x,T=l(Ce),x=T):(O=x,x=r)):(O=x,x=r)):(O=x,x=r)):(O=x,x=r),x}function cg(){var x,T,G;for(x=O,T=[],G=ug();G!==r;)T.push(G),G=ug();return T!==r&&(rt=x,T=c(T)),x=T,x}function ug(){var x,T,G,ye,Ce,Me,tt,Ot,ks;if(x=O,T=hr(),T===r&&(T=null),T!==r){if(G=O,t.charCodeAt(O)===35?(ye=u,O++):(ye=r,Oe===0&&We(g)),ye!==r){if(Ce=[],Me=O,tt=O,Oe++,Ot=Ps(),Oe--,Ot===r?tt=void 0:(O=tt,tt=r),tt!==r?(t.length>O?(Ot=t.charAt(O),O++):(Ot=r,Oe===0&&We(h)),Ot!==r?(tt=[tt,Ot],Me=tt):(O=Me,Me=r)):(O=Me,Me=r),Me!==r)for(;Me!==r;)Ce.push(Me),Me=O,tt=O,Oe++,Ot=Ps(),Oe--,Ot===r?tt=void 0:(O=tt,tt=r),tt!==r?(t.length>O?(Ot=t.charAt(O),O++):(Ot=r,Oe===0&&We(h)),Ot!==r?(tt=[tt,Ot],Me=tt):(O=Me,Me=r)):(O=Me,Me=r);else Ce=r;Ce!==r?(ye=[ye,Ce],G=ye):(O=G,G=r)}else O=G,G=r;if(G===r&&(G=null),G!==r){if(ye=[],Ce=Kr(),Ce!==r)for(;Ce!==r;)ye.push(Ce),Ce=Kr();else ye=r;ye!==r?(rt=x,T=f(),x=T):(O=x,x=r)}else O=x,x=r}else O=x,x=r;if(x===r&&(x=O,T=Ua(),T!==r?(G=oC(),G!==r?(ye=hr(),ye===r&&(ye=null),ye!==r?(t.charCodeAt(O)===58?(Ce=p,O++):(Ce=r,Oe===0&&We(m)),Ce!==r?(Me=hr(),Me===r&&(Me=null),Me!==r?(tt=Ta(),tt!==r?(rt=x,T=I(G,tt),x=T):(O=x,x=r)):(O=x,x=r)):(O=x,x=r)):(O=x,x=r)):(O=x,x=r)):(O=x,x=r),x===r&&(x=O,T=Ua(),T!==r?(G=xo(),G!==r?(ye=hr(),ye===r&&(ye=null),ye!==r?(t.charCodeAt(O)===58?(Ce=p,O++):(Ce=r,Oe===0&&We(m)),Ce!==r?(Me=hr(),Me===r&&(Me=null),Me!==r?(tt=Ta(),tt!==r?(rt=x,T=I(G,tt),x=T):(O=x,x=r)):(O=x,x=r)):(O=x,x=r)):(O=x,x=r)):(O=x,x=r)):(O=x,x=r),x===r))){if(x=O,T=Ua(),T!==r)if(G=xo(),G!==r)if(ye=hr(),ye!==r)if(Ce=Ne(),Ce!==r){if(Me=[],tt=Kr(),tt!==r)for(;tt!==r;)Me.push(tt),tt=Kr();else Me=r;Me!==r?(rt=x,T=I(G,Ce),x=T):(O=x,x=r)}else O=x,x=r;else O=x,x=r;else O=x,x=r;else O=x,x=r;if(x===r)if(x=O,T=Ua(),T!==r)if(G=xo(),G!==r){if(ye=[],Ce=O,Me=hr(),Me===r&&(Me=null),Me!==r?(t.charCodeAt(O)===44?(tt=y,O++):(tt=r,Oe===0&&We(B)),tt!==r?(Ot=hr(),Ot===r&&(Ot=null),Ot!==r?(ks=xo(),ks!==r?(rt=Ce,Me=D(G,ks),Ce=Me):(O=Ce,Ce=r)):(O=Ce,Ce=r)):(O=Ce,Ce=r)):(O=Ce,Ce=r),Ce!==r)for(;Ce!==r;)ye.push(Ce),Ce=O,Me=hr(),Me===r&&(Me=null),Me!==r?(t.charCodeAt(O)===44?(tt=y,O++):(tt=r,Oe===0&&We(B)),tt!==r?(Ot=hr(),Ot===r&&(Ot=null),Ot!==r?(ks=xo(),ks!==r?(rt=Ce,Me=D(G,ks),Ce=Me):(O=Ce,Ce=r)):(O=Ce,Ce=r)):(O=Ce,Ce=r)):(O=Ce,Ce=r);else ye=r;ye!==r?(Ce=hr(),Ce===r&&(Ce=null),Ce!==r?(t.charCodeAt(O)===58?(Me=p,O++):(Me=r,Oe===0&&We(m)),Me!==r?(tt=hr(),tt===r&&(tt=null),tt!==r?(Ot=Ta(),Ot!==r?(rt=x,T=F(G,ye,Ot),x=T):(O=x,x=r)):(O=x,x=r)):(O=x,x=r)):(O=x,x=r)):(O=x,x=r)}else O=x,x=r;else O=x,x=r}return x}function Ta(){var x,T,G,ye,Ce,Me,tt;if(x=O,T=O,Oe++,G=O,ye=Ps(),ye!==r?(Ce=ow(),Ce!==r?(t.charCodeAt(O)===45?(Me=o,O++):(Me=r,Oe===0&&We(a)),Me!==r?(tt=hr(),tt!==r?(ye=[ye,C
|
|||
|
`,n=Buffer.byteLength(i),s=Math.floor(Math.log(n)/Math.log(10))+1;return n+s>=Math.pow(10,s)&&(s+=1),s+n+i}};iE.parse=(t,e,r)=>new iE(Ibe(Ebe(t),e),r);var Ibe=(t,e)=>e?Object.keys(t).reduce((r,i)=>(r[i]=t[i],r),e):t,Ebe=t=>t.replace(/\n$/,"").split(`
|
|||
|
`).reduce(ybe,Object.create(null)),ybe=(t,e)=>{let r=parseInt(e,10);if(r!==Buffer.byteLength(e)+1)return t;e=e.substr((r+" ").length);let i=e.split("="),n=i.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!n)return t;let s=i.join("=");return t[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(s*1e3):/^[0-9]+$/.test(s)?+s:s,t};w3.exports=iE});var sE=C((m_e,Q3)=>{"use strict";Q3.exports=t=>class extends t{warn(e,r,i={}){this.file&&(i.file=this.file),this.cwd&&(i.cwd=this.cwd),i.code=r instanceof Error&&r.code||e,i.tarCode=e,!this.strict&&i.recoverable!==!1?(r instanceof Error&&(i=Object.assign(r,i),r=r.message),this.emit("warn",i.tarCode,r,i)):r instanceof Error?this.emit("error",Object.assign(r,i)):this.emit("error",Object.assign(new Error(`${e}: ${r}`),i))}}});var Wx=C((I_e,b3)=>{"use strict";var oE=["|","<",">","?",":"],Jx=oE.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),Bbe=new Map(oE.map((t,e)=>[t,Jx[e]])),wbe=new Map(Jx.map((t,e)=>[t,oE[e]]));b3.exports={encode:t=>oE.reduce((e,r)=>e.split(r).join(Bbe.get(r)),t),decode:t=>Jx.reduce((e,r)=>e.split(r).join(wbe.get(r)),t)}});var x3=C((E_e,S3)=>{"use strict";S3.exports=(t,e,r)=>(t&=4095,r&&(t=(t|384)&~18),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t)});var eD=C((b_e,D3)=>{"use strict";var P3=Rc(),k3=nE(),v3=Mc(),y_e=Af(),cs=require("fs"),Oc=require("path"),B_e=af(),Qbe=16*1024*1024,F3=Symbol("process"),R3=Symbol("file"),L3=Symbol("directory"),zx=Symbol("symlink"),N3=Symbol("hardlink"),lf=Symbol("header"),aE=Symbol("read"),Vx=Symbol("lstat"),AE=Symbol("onlstat"),Xx=Symbol("onread"),Zx=Symbol("onreadlink"),_x=Symbol("openfile"),$x=Symbol("onopenfile"),UA=Symbol("close"),lE=Symbol("mode"),M3=sE(),bbe=Wx(),O3=x3(),cE=M3(class extends P3{constructor(e,r){if(r=r||{},super(r),typeof e!="string")throw new TypeError("path is required");this.path=e,this.portable=!!r.portable,this.myuid=process.getuid&&process.getuid(),this.myuser=process.env.USER||"",this.maxReadSize=r.maxReadSize||Qbe,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=r.cwd||process.cwd(),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime||null,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let i=!1;if(!this.preservePaths&&Oc.win32.isAbsolute(e)){let n=Oc.win32.parse(e);this.path=e.substr(n.root.length),i=n.root}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=bbe.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=r.absolute||Oc.resolve(this.cwd,e),this.path===""&&(this.path="./"),i&&this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path}),this.statCache.has(this.absolute)?this[AE](this.statCache.get(this.absolute)):this[Vx]()}[Vx](){cs.lstat(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[AE](r)})}[AE](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=Sbe(e),this.emit("stat",e),this[F3]()}[F3](){switch(this.type){case"File":return this[R3]();case"Directory":return this[L3]();case"SymbolicLink":return this[zx]();default:return this.end()}}[lE](e){return O3(e,this.type==="Directory",this.portable)}[lf](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new v3({path:this.path,linkpath:this.linkpath,mode:this[lE](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&this.write(new k3({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this.path,linkpath:this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.d
|
|||
|
`}),a},i})});var sz=C((T$e,ZD)=>{"use strict";var mSe=t=>{let e=!1,r=!1,i=!1;for(let n=0;n<t.length;n++){let s=t[n];e&&/[a-zA-Z]/.test(s)&&s.toUpperCase()===s?(t=t.slice(0,n)+"-"+t.slice(n),e=!1,i=r,r=!0,n++):r&&i&&/[a-zA-Z]/.test(s)&&s.toLowerCase()===s?(t=t.slice(0,n-1)+"-"+t.slice(n-1),i=r,r=!1,e=!0):(e=s.toLowerCase()===s&&s.toUpperCase()!==s,i=r,r=s.toUpperCase()===s&&s.toLowerCase()!==s)}return t},nz=(t,e)=>{if(!(typeof t=="string"||Array.isArray(t)))throw new TypeError("Expected the input to be `string | string[]`");e=Object.assign({pascalCase:!1},e);let r=n=>e.pascalCase?n.charAt(0).toUpperCase()+n.slice(1):n;return Array.isArray(t)?t=t.map(n=>n.trim()).filter(n=>n.length).join("-"):t=t.trim(),t.length===0?"":t.length===1?e.pascalCase?t.toUpperCase():t.toLowerCase():(t!==t.toLowerCase()&&(t=mSe(t)),t=t.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(n,s)=>s.toUpperCase()).replace(/\d+(\w|$)/g,n=>n.toUpperCase()),r(t))};ZD.exports=nz;ZD.exports.default=nz});var lo=C(AP=>{"use strict";Object.defineProperty(AP,"__esModule",{value:!0});AP.default=gz;function gz(){}gz.prototype={diff:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=i.callback;typeof i=="function"&&(n=i,i={}),this.options=i;var s=this;function o(m){return n?(setTimeout(function(){n(void 0,m)},0),!0):m}e=this.castInput(e),r=this.castInput(r),e=this.removeEmpty(this.tokenize(e)),r=this.removeEmpty(this.tokenize(r));var a=r.length,l=e.length,c=1,u=a+l,g=[{newPos:-1,components:[]}],h=this.extractCommon(g[0],r,e,0);if(g[0].newPos+1>=a&&h+1>=l)return o([{value:this.join(r),count:r.length}]);function f(){for(var m=-1*c;m<=c;m+=2){var I=void 0,y=g[m-1],B=g[m+1],D=(B?B.newPos:0)-m;y&&(g[m-1]=void 0);var F=y&&y.newPos+1<a,N=B&&0<=D&&D<l;if(!F&&!N){g[m]=void 0;continue}if(!F||N&&y.newPos<B.newPos?(I=bSe(B),s.pushComponent(I.components,void 0,!0)):(I=y,I.newPos++,s.pushComponent(I.components,!0,void 0)),D=s.extractCommon(I,r,e,m),I.newPos+1>=a&&D+1>=l)return o(QSe(s,I.components,r,e,s.useLongestToken));g[m]=I}c++}if(n)(function m(){setTimeout(function(){if(c>u)return n();f()||m()},0)})();else for(;c<=u;){var p=f();if(p)return p}},pushComponent:function(e,r,i){var n=e[e.length-1];n&&n.added===r&&n.removed===i?e[e.length-1]={count:n.count+1,added:r,removed:i}:e.push({count:1,added:r,removed:i})},extractCommon:function(e,r,i,n){for(var s=r.length,o=i.length,a=e.newPos,l=a-n,c=0;a+1<s&&l+1<o&&this.equals(r[a+1],i[l+1]);)a++,l++,c++;return c&&e.components.push({count:c}),e.newPos=a,l},equals:function(e,r){return this.options.comparator?this.options.comparator(e,r):e===r||this.options.ignoreCase&&e.toLowerCase()===r.toLowerCase()},removeEmpty:function(e){for(var r=[],i=0;i<e.length;i++)e[i]&&r.push(e[i]);return r},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function QSe(t,e,r,i,n){for(var s=0,o=e.length,a=0,l=0;s<o;s++){var c=e[s];if(c.removed){if(c.value=t.join(i.slice(l,l+c.count)),l+=c.count,s&&e[s-1].added){var g=e[s-1];e[s-1]=e[s],e[s]=g}}else{if(!c.added&&n){var u=r.slice(a,a+c.count);u=u.map(function(f,p){var m=i[l+p];return m.length>f.length?m:f}),c.value=t.join(u)}else c.value=t.join(r.slice(a,a+c.count));a+=c.count,c.added||(l+=c.count)}}var h=e[o-1];return o>1&&typeof h.value=="string"&&(h.added||h.removed)&&t.equals("",h.value)&&(e[o-2].value+=h.value,e.pop()),e}function bSe(t){return{newPos:t.newPos,components:t.components.slice(0)}}});var fz=C(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});Bf.diffChars=SSe;Bf.characterDiff=void 0;var DSe=xSe(lo());function xSe(t){return t&&t.__esModule?t:{default:t}}var hz=new DSe.default;Bf.characterDiff=hz;function SSe(t,e,r){return hz.diff(t,e,r)}});var cP=C(lP=>{"use strict";Object.defineProperty(lP,"__esModule",{value:!0});lP.generateOptions=PSe;function PSe(t,e){if(typeof t=="function")e.callback=t;else if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}});var Cz=C(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.diffWords=kSe;eu.diffWordsWithSpace=vS
|
|||
|
`),m==="+"?f++:m==="-"?p++:m===" "&&(f++,p++);else break}if(!f&&h.newLines===1&&(h.newLines=0),!p&&h.oldLines===1&&(h.oldLines=0),e.strict){if(f!==h.newLines)throw new Error("Added line count did not match for hunk at line "+(c+1));if(p!==h.oldLines)throw new Error("Removed line count did not match for hunk at line "+(c+1))}return h}for(;s<r.length;)o();return n}});var wz=C(fP=>{"use strict";Object.defineProperty(fP,"__esModule",{value:!0});fP.default=exe;function exe(t,e,r){var i=!0,n=!1,s=!1,o=1;return function a(){if(i&&!s){if(n?o++:i=!1,t+o<=r)return o;s=!0}if(!n)return s||(i=!0),e<=t-o?-o++:(n=!0,a())}}});var Sz=C($E=>{"use strict";Object.defineProperty($E,"__esModule",{value:!0});$E.applyPatch=Qz;$E.applyPatches=txe;var bz=_E(),ixe=rxe(wz());function rxe(t){return t&&t.__esModule?t:{default:t}}function Qz(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string"&&(e=(0,bz.parsePatch)(e)),Array.isArray(e)){if(e.length>1)throw new Error("applyPatch only works with a single input.");e=e[0]}var i=t.split(/\r\n|[\n\v\f\r\x85]/),n=t.match(/\r\n|[\n\v\f\r\x85]/g)||[],s=e.hunks,o=r.compareLine||function(H,R,ke,Le){return R===Le},a=0,l=r.fuzzFactor||0,c=0,u=0,g,h;function f(H,R){for(var ke=0;ke<H.lines.length;ke++){var Le=H.lines[ke],qe=Le.length>0?Le[0]:" ",Ke=Le.length>0?Le.substr(1):Le;if(qe===" "||qe==="-"){if(!o(R+1,i[R],qe,Ke)&&(a++,a>l))return!1;R++}}return!0}for(var p=0;p<s.length;p++){for(var m=s[p],I=i.length-m.oldLines,y=0,B=u+m.oldStart-1,D=(0,ixe.default)(B,c,I);y!==void 0;y=D())if(f(m,B+y)){m.offset=u+=y;break}if(y===void 0)return!1;c=m.offset+m.oldStart+m.oldLines}for(var F=0,N=0;N<s.length;N++){var U=s[N],v=U.oldStart+U.offset+F-1;F+=U.newLines-U.oldLines,v<0&&(v=0);for(var J=0;J<U.lines.length;J++){var oe=U.lines[J],K=oe.length>0?oe[0]:" ",A=oe.length>0?oe.substr(1):oe,W=U.linedelimiters[J];if(K===" ")v++;else if(K==="-")i.splice(v,1),n.splice(v,1);else if(K==="+")i.splice(v,0,A),n.splice(v,0,W),v++;else if(K==="\\"){var $=U.lines[J-1]?U.lines[J-1][0]:null;$==="+"?g=!0:$==="-"&&(h=!0)}}}if(g)for(;!i[i.length-1];)i.pop(),n.pop();else h&&(i.push(""),n.push(`
|
|||
|
`));for(var re=0;re<i.length-1;re++)i[re]=i[re]+n[re];return i.join("")}function txe(t,e){typeof t=="string"&&(t=(0,bz.parsePatch)(t));var r=0;function i(){var n=t[r++];if(!n)return e.complete();e.loadFile(n,function(s,o){if(s)return e.complete(s);var a=Qz(o,n,e);e.patched(n,a,function(l){if(l)return e.complete(l);i()})})}i()}});var dP=C(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.structuredPatch=xz;Df.createTwoFilesPatch=Dz;Df.createPatch=nxe;var sxe=VE();function pP(t){return Axe(t)||axe(t)||oxe()}function oxe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function axe(t){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]")return Array.from(t)}function Axe(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}function xz(t,e,r,i,n,s,o){o||(o={}),typeof o.context=="undefined"&&(o.context=4);var a=(0,sxe.diffLines)(r,i,o);a.push({value:"",lines:[]});function l(y){return y.map(function(B){return" "+B})}for(var c=[],u=0,g=0,h=[],f=1,p=1,m=function(B){var D=a[B],F=D.lines||D.value.replace(/\n$/,"").split(`
|
|||
|
`);if(D.lines=F,D.added||D.removed){var N;if(!u){var U=a[B-1];u=f,g=p,U&&(h=o.context>0?l(U.lines.slice(-o.context)):[],u-=h.length,g-=h.length)}(N=h).push.apply(N,pP(F.map(function(re){return(D.added?"+":"-")+re}))),D.added?p+=F.length:f+=F.length}else{if(u)if(F.length<=o.context*2&&B<a.length-2){var v;(v=h).push.apply(v,pP(l(F)))}else{var J,oe=Math.min(F.length,o.context);(J=h).push.apply(J,pP(l(F.slice(0,oe))));var K={oldStart:u,oldLines:f-u+oe,newStart:g,newLines:p-g+oe,lines:h};if(B>=a.length-2&&F.length<=o.context){var A=/\n$/.test(r),W=/\n$/.test(i),$=F.length==0&&h.length>K.oldLines;!A&&$&&h.splice(K.oldLines,0,"\\ No newline at end of file"),(!A&&!$||!W)&&h.push("\\ No newline at end of file")}c.push(K),u=0,g=0,h=[]}f+=F.length,p+=F.length}},I=0;I<a.length;I++)m(I);return{oldFileName:t,newFileName:e,oldHeader:n,newHeader:s,hunks:c}}function Dz(t,e,r,i,n,s,o){var a=xz(t,e,r,i,n,s,o),l=[];t==e&&l.push("Index: "+t),l.push("==================================================================="),l.push("--- "+a.oldFileName+(typeof a.oldHeader=="undefined"?"":" "+a.oldHeader)),l.push("+++ "+a.newFileName+(typeof a.newHeader=="undefined"?"":" "+a.newHeader));for(var c=0;c<a.hunks.length;c++){var u=a.hunks[c];l.push("@@ -"+u.oldStart+","+u.oldLines+" +"+u.newStart+","+u.newLines+" @@"),l.push.apply(l,u.lines)}return l.join(`
|
|||
|
`)+`
|
|||
|
`}function nxe(t,e,r,i,n,s){return Dz(t,t,e,r,i,n,s)}});var kz=C(ey=>{"use strict";Object.defineProperty(ey,"__esModule",{value:!0});ey.arrayEqual=lxe;ey.arrayStartsWith=Pz;function lxe(t,e){return t.length!==e.length?!1:Pz(t,e)}function Pz(t,e){if(e.length>t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}});var Hz=C(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.calcLineCount=vz;ty.merge=cxe;var uxe=dP(),gxe=_E(),CP=kz();function iu(t){return pxe(t)||fxe(t)||hxe()}function hxe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function fxe(t){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]")return Array.from(t)}function pxe(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}function vz(t){var e=mP(t.lines),r=e.oldLines,i=e.newLines;r!==void 0?t.oldLines=r:delete t.oldLines,i!==void 0?t.newLines=i:delete t.newLines}function cxe(t,e,r){t=Fz(t,r),e=Fz(e,r);var i={};(t.index||e.index)&&(i.index=t.index||e.index),(t.newFileName||e.newFileName)&&(Rz(t)?Rz(e)?(i.oldFileName=ry(i,t.oldFileName,e.oldFileName),i.newFileName=ry(i,t.newFileName,e.newFileName),i.oldHeader=ry(i,t.oldHeader,e.oldHeader),i.newHeader=ry(i,t.newHeader,e.newHeader)):(i.oldFileName=t.oldFileName,i.newFileName=t.newFileName,i.oldHeader=t.oldHeader,i.newHeader=t.newHeader):(i.oldFileName=e.oldFileName||t.oldFileName,i.newFileName=e.newFileName||t.newFileName,i.oldHeader=e.oldHeader||t.oldHeader,i.newHeader=e.newHeader||t.newHeader)),i.hunks=[];for(var n=0,s=0,o=0,a=0;n<t.hunks.length||s<e.hunks.length;){var l=t.hunks[n]||{oldStart:Infinity},c=e.hunks[s]||{oldStart:Infinity};if(Lz(l,c))i.hunks.push(Nz(l,o)),n++,a+=l.newLines-l.oldLines;else if(Lz(c,l))i.hunks.push(Nz(c,a)),s++,o+=c.newLines-c.oldLines;else{var u={oldStart:Math.min(l.oldStart,c.oldStart),oldLines:0,newStart:Math.min(l.newStart+o,c.oldStart+a),newLines:0,lines:[]};dxe(u,l.oldStart,l.lines,c.oldStart,c.lines),s++,n++,i.hunks.push(u)}}return i}function Fz(t,e){if(typeof t=="string"){if(/^@@/m.test(t)||/^Index:/m.test(t))return(0,gxe.parsePatch)(t)[0];if(!e)throw new Error("Must provide a base reference or pass in a patch");return(0,uxe.structuredPatch)(void 0,void 0,e,t)}return t}function Rz(t){return t.newFileName&&t.newFileName!==t.oldFileName}function ry(t,e,r){return e===r?e:(t.conflict=!0,{mine:e,theirs:r})}function Lz(t,e){return t.oldStart<e.oldStart&&t.oldStart+t.oldLines<e.oldStart}function Nz(t,e){return{oldStart:t.oldStart,oldLines:t.oldLines,newStart:t.newStart+e,newLines:t.newLines,lines:t.lines}}function dxe(t,e,r,i,n){var s={offset:e,lines:r,index:0},o={offset:i,lines:n,index:0};for(Oz(t,s,o),Oz(t,o,s);s.index<s.lines.length&&o.index<o.lines.length;){var a=s.lines[s.index],l=o.lines[o.index];if((a[0]==="-"||a[0]==="+")&&(l[0]==="-"||l[0]==="+"))Cxe(t,s,o);else if(a[0]==="+"&&l[0]===" "){var c;(c=t.lines).push.apply(c,iu(_A(s)))}else if(l[0]==="+"&&a[0]===" "){var u;(u=t.lines).push.apply(u,iu(_A(o)))}else a[0]==="-"&&l[0]===" "?Mz(t,s,o):l[0]==="-"&&a[0]===" "?Mz(t,o,s,!0):a===l?(t.lines.push(a),s.index++,o.index++):IP(t,_A(s),_A(o))}Kz(t,s),Kz(t,o),vz(t)}function Cxe(t,e,r){var i=_A(e),n=_A(r);if(Tz(i)&&Tz(n)){if((0,CP.arrayStartsWith)(i,n)&&Uz(r,i,i.length-n.length)){var s;(s=t.lines).push.apply(s,iu(i));return}else if((0,CP.arrayStartsWith)(n,i)&&Uz(e,n,n.length-i.length)){var o;(o=t.lines).push.apply(o,iu(n));return}}else if((0,CP.arrayEqual)(i,n)){var a;(a=t.lines).push.apply(a,iu(i));return}IP(t,i,n)}function Mz(t,e,r,i){var n=_A(e),s=mxe(r,n);if(s.merged){var o;(o=t.lines).push.apply(o,iu(s.merged))}else IP(t,i?s:n,i?n:s)}function IP(t,e,r){t.conflict=!0,t.lines.push({conflict:!0,mine:e,theirs:r})}function Oz(t,e,r){for(;e.offset<r.offset&&e.index<e.lines.length;){var i=e.lines[e.index++];t.lines.push(i),e.offset++}}function Kz(t,e){for(;e.index<e.lines.length;){var r=e.lines[e.index++];t.lines.push(r)}}function _A(t){for(var e=[],r=t.lines[t.index][0];t.index<t.lines.length;){var i=t.lines[t.index];if(r==="-"&&i[0]===
|
|||
|
|
|||
|
attempted value: ${s}
|
|||
|
`+(o!==s?`result of cast: ${o}`:""))}return n}_cast(e,r){let i=e===void 0?e:this.transforms.reduce((n,s)=>s.call(this,n,e,this),e);return i===void 0&&(i=this.getDefault()),i}_validate(e,r={},i){let{sync:n,path:s,from:o=[],originalValue:a=e,strict:l=this.spec.strict,abortEarly:c=this.spec.abortEarly}=r,u=e;l||(u=this._cast(u,yn({assert:!1},r)));let g={value:u,path:s,options:r,originalValue:a,schema:this,label:this.spec.label,sync:n,from:o},h=[];this._typeError&&h.push(this._typeError),this._whitelistError&&h.push(this._whitelistError),this._blacklistError&&h.push(this._blacklistError),(0,j7.default)({args:g,value:u,path:s,sync:n,tests:h,endEarly:c},f=>{if(f)return void i(f,u);(0,j7.default)({tests:this.tests,args:g,path:s,sync:n,value:u,endEarly:c},i)})}validate(e,r,i){let n=this.resolve(yn({},r,{value:e}));return typeof i=="function"?n._validate(e,r,i):new Promise((s,o)=>n._validate(e,r,(a,l)=>{a?o(a):s(l)}))}validateSync(e,r){let i=this.resolve(yn({},r,{value:e})),n;return i._validate(e,yn({},r,{sync:!0}),(s,o)=>{if(s)throw s;n=o}),n}isValid(e,r){return this.validate(e,r).then(()=>!0,i=>{if(W7.default.isError(i))return!1;throw i})}isValidSync(e,r){try{return this.validateSync(e,r),!0}catch(i){if(W7.default.isError(i))return!1;throw i}}_getDefault(){let e=this.spec.default;return e==null?e:typeof e=="function"?e.call(this):(0,q7.default)(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){var r=this.clone();return r.spec.strict=e,r}_isPresent(e){return e!=null}defined(e=Cu.mixed.defined){return this.test({message:e,name:"defined",exclusive:!0,test(r){return r!==void 0}})}required(e=Cu.mixed.required){return this.clone({presence:"required"}).withMutation(r=>r.test({message:e,name:"required",exclusive:!0,test(i){return this.schema._isPresent(i)}}))}notRequired(){var e=this.clone({presence:"optional"});return e.tests=e.tests.filter(r=>r.OPTIONS.name!=="required"),e}nullable(e=!0){var r=this.clone({nullable:e!==!1});return r}transform(e){var r=this.clone();return r.transforms.push(e),r}test(...e){let r;if(e.length===1?typeof e[0]=="function"?r={test:e[0]}:r=e[0]:e.length===2?r={name:e[0],test:e[1]}:r={name:e[0],message:e[1],test:e[2]},r.message===void 0&&(r.message=Cu.mixed.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),n=(0,Ny.default)(r),s=r.exclusive||r.name&&i.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(i.exclusiveTests[r.name]=!!r.exclusive),i.tests=i.tests.filter(o=>!(o.OPTIONS.name===r.name&&(s||o.OPTIONS.test===n.OPTIONS.test))),i.tests.push(n),i}when(e,r){!Array.isArray(e)&&typeof e!="string"&&(r=e,e=".");let i=this.clone(),n=(0,aMe.default)(e).map(s=>new sMe.default(s));return n.forEach(s=>{s.isSibling&&i.deps.push(s.key)}),i.conditions.push(new nMe.default(n,r)),i}typeError(e){var r=this.clone();return r._typeError=(0,Ny.default)({message:e,name:"typeError",test(i){return i!==void 0&&!this.schema.isType(i)?this.createError({params:{type:this.schema._type}}):!0}}),r}oneOf(e,r=Cu.mixed.oneOf){var i=this.clone();return e.forEach(n=>{i._whitelist.add(n),i._blacklist.delete(n)}),i._whitelistError=(0,Ny.default)({message:r,name:"oneOf",test(n){if(n===void 0)return!0;let s=this.schema._whitelist;return s.has(n,this.resolve)?!0:this.createError({params:{values:s.toArray().join(", ")}})}}),i}notOneOf(e,r=Cu.mixed.notOneOf){var i=this.clone();return e.forEach(n=>{i._blacklist.add(n),i._whitelist.delete(n)}),i._blacklistError=(0,Ny.default)({message:r,name:"notOneOf",test(n){let s=this.schema._blacklist;return s.has(n,this.resolve)?this.createError({params:{values:s.toArray().join(", ")}}):!0}}),i}strip(e=!0){let r=this.clone();return r.spec.strip=e,r}describe(){let e=this.clone(),{label:r,meta:i}=e.spec;return{meta:i,label:r,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(s=>({name:s.OPTIONS.name,params:s.OP
|
|||
|
`),c=o.length;for(c>0&&o.includes("unstyle")&&(o=[...new Set(["unstyle",...o])].reverse());c-- >0;)a=r(t.styles[o[c]],a,l);return a},n=(s,o,a)=>{t.styles[s]=e({name:s,codes:o}),(t.keys[a]||(t.keys[a]=[])).push(s),Reflect.defineProperty(t,s,{configurable:!0,enumerable:!0,set(c){t.alias(s,c)},get(){let c=u=>i(u,c.stack);return Reflect.setPrototypeOf(c,t),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"),t.ansiRegex=QKe,t.hasColor=t.hasAnsi=s=>(t.ansiRegex.lastIndex=0,typeof s=="string"&&s!==""&&t.ansiRegex.test(s)),t.alias=(s,o)=>{let a=typeof o=="string"?t[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}),t.styles[s]=a,a.stack=[s]),Reflect.defineProperty(t,s,{configurable:!0,enumerable:!0,set(l){t.alias(s,l)},get(){let l=c=>i(c,l.stack);return Reflect.setPrototypeOf(l,t),l.stack=this.stack?this.stack.concat(a.stack):a.stack,l}})},t.theme=s=>{if(!wKe(s))throw new TypeError("Expected theme to be an object");for(let o of Object.keys(s))t.alias(o,s[o]);return t},t.alias("unstyle",s=>typeof s=="string"&&s!==""?(t.ansiRegex.lastIndex=0,s.replace(t.ansiRegex,"")):""),t.alias("noop",s=>s),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=SZ(),t.define=n,t};Uk.exports=xZ();Uk.exports.create=xZ});var Xr=C(ht=>{"use strict";var bKe=Object.prototype.toString,Bn=Hn(),DZ=!1,Hk=[],PZ={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};ht.longest=(t,e)=>t.reduce((r,i)=>Math.max(r,e?i[e].length:i.length),0);ht.hasColor=t=>!!t&&Bn.hasColor(t);var Jy=ht.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);ht.nativeType=t=>bKe.call(t).slice(8,-1).toLowerCase().replace(/\s/g,"");ht.isAsyncFn=t=>ht.nativeType(t)==="asyncfunction";ht.isPrimitive=t=>t!=null&&typeof t!="object"&&typeof t!="function";ht.resolve=(t,e,...r)=>typeof e=="function"?e.call(t,...r):e;ht.scrollDown=(t=[])=>[...t.slice(1),t[0]];ht.scrollUp=(t=[])=>[t.pop(),...t];ht.reorder=(t=[])=>{let e=t.slice();return e.sort((r,i)=>r.index>i.index?1:r.index<i.index?-1:0),e};ht.swap=(t,e,r)=>{let i=t.length,n=r===i?0:r<0?i-1:r,s=t[e];t[e]=t[n],t[n]=s};ht.width=(t,e=80)=>{let r=t&&t.columns?t.columns:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[0]),process.platform==="win32"?r-1:r};ht.height=(t,e=20)=>{let r=t&&t.rows?t.rows:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[1]),r};ht.wordWrap=(t,e={})=>{if(!t)return t;typeof e=="number"&&(e={width:e});let{indent:r="",newline:i=`
|
|||
|
`+r,width:n=80}=e;n-=((i+r).match(/[^\S\n]/g)||[]).length;let o=`.{1,${n}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,a=t.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," "))),r+c.join(i)};ht.unmute=t=>{let e=t.stack.find(i=>Bn.keys.color.includes(i));return e?Bn[e]:t.stack.find(i=>i.slice(2)==="bg")?Bn[e.slice(2)]:i=>i};ht.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"";ht.inverse=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>Bn.keys.color.includes(i));if(e){let i=Bn["bg"+ht.pascal(e)];return i?i.black:t}let r=t.stack.find(i=>i.slice(0,2)==="bg");return r?Bn[r.slice(2).toLowerCase()]||t:Bn.none};ht.complement=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>Bn.keys.color.includes(i)),r=t.stack.find(i=>i.slice(0,2)==="bg");if(e&&!r)return Bn[PZ[e]||e];if(r){let i=r.slice(2).toLowerCase(),n=PZ[i];return n&&Bn["bg"+ht.pascal(n)]||t}return Bn.none};ht.meridiem=t=>{let e=t.getHours(),r=t.getMinutes(),i=e>=12?"pm":"am";e=e%12;let n=e===0?12:e,s=r<10?"0"+r:r;return n+":"+s+" "+i};ht.set=(t={},e="",r)=>e.split(".").reduce((i,n,s,o)=>{let a=o.length-1>s?i[n]||{}:r;return!ht.isObject(a)&&s<o.length-1&&(a={}),i[n]=a},t);ht.get=(t={},e="",r)=>{let i=t[e]==null?e.split(".").reduce((n,s)=>n&&n[s],t):t[e];return i==null?r:i};ht.mixin=(t,e)=>{if(!Jy(t))return e;if(!Jy(e))return t;for(let r of Object.keys(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i.hasOwnProperty("value"))if(t.hasOwnProperty(r)&&Jy(i.value)){let n=Object.getOwnPropertyDescriptor(t,r);Jy(n.value)?t[r]=ht.merge({},t[r],e[r]):Reflect.defineProperty(t,r,i)}else Reflect.defineProperty(t,r,i);else Reflect.defineProperty(t,r,i)}return t};ht.merge=(...t)=>{let e={};for(let r of t)ht.mixin(e,r);return e};ht.mixinEmitter=(t,e)=>{let r=e.constructor.prototype;for(let i of Object.keys(r)){let n=r[i];typeof n=="function"?ht.define(t,i,n.bind(e)):ht.define(t,i,n)}};ht.onExit=t=>{let e=(r,i)=>{DZ||(DZ=!0,Hk.forEach(n=>n()),r===!0&&process.exit(128+i))};Hk.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),Hk.push(t)};ht.define=(t,e,r)=>{Reflect.defineProperty(t,e,{value:r})};ht.defineExport=(t,e,r)=>{let i;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(n){i=n},get(){return i?i():r()}})}});var kZ=C(wu=>{"use strict";wu.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"};wu.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};wu.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};wu.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};wu.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 RZ=C((Cot,vZ)=>{"use strict";var FZ=require("readline"),SKe=kZ(),xKe=/^(?:\x1b)([a-zA-Z0-9])$/,DKe=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,PKe={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:"clear",
|
|||
|
`)i.name="enter";else if(t===" ")i.name="tab";else if(t==="\b"||t==="\x7F"||t==="\x7F"||t==="\b")i.name="backspace",i.meta=t.charAt(0)==="";else if(t===""||t==="")i.name="escape",i.meta=t.length===2;else if(t===" "||t===" ")i.name="space",i.meta=t.length===2;else if(t<="")i.name=String.fromCharCode(t.charCodeAt(0)+"a".charCodeAt(0)-1),i.ctrl=!0;else if(t.length===1&&t>="0"&&t<="9")i.name="number";else if(t.length===1&&t>="a"&&t<="z")i.name=t;else if(t.length===1&&t>="A"&&t<="Z")i.name=t.toLowerCase(),i.shift=!0;else if(r=xKe.exec(t))i.meta=!0,i.shift=/^[A-Z]$/.test(r[1]);else if(r=DKe.exec(t)){let n=[...t];n[0]===""&&n[1]===""&&(i.option=!0);let s=[r[1],r[2],r[4],r[6]].filter(Boolean).join(""),o=(r[3]||r[5]||1)-1;i.ctrl=!!(o&4),i.meta=!!(o&10),i.shift=!!(o&1),i.code=s,i.name=PKe[s],i.shift=kKe(s)||i.shift,i.ctrl=vKe(s)||i.ctrl}return i};Wy.listen=(t={},e)=>{let{stdin:r}=t;if(!r||r!==process.stdin&&!r.isTTY)throw new Error("Invalid stream passed");let i=FZ.createInterface({terminal:!0,input:r});FZ.emitKeypressEvents(r,i);let n=(a,l)=>e(a,Wy(a,l),i),s=r.isRaw;return r.isTTY&&r.setRawMode(!0),r.on("keypress",n),i.resume(),()=>{r.isTTY&&r.setRawMode(s),r.removeListener("keypress",n),i.pause(),i.close()}};Wy.action=(t,e,r)=>{let i=k(k({},SKe),r);return e.ctrl?(e.action=i.ctrl[e.name],e):e.option&&i.option?(e.action=i.option[e.name],e):e.shift?(e.action=i.shift[e.name],e):(e.action=i.keys[e.name],e)};vZ.exports=Wy});var NZ=C((mot,LZ)=>{"use strict";LZ.exports=t=>{t.timers=t.timers||{};let e=t.options.timers;if(!!e)for(let r of Object.keys(e)){let i=e[r];typeof i=="number"&&(i={interval:i}),FKe(t,r,i)}};function FKe(t,e,r={}){let i=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},n=r.interval||120;i.frames=r.frames||[],i.loading=!0;let s=setInterval(()=>{i.ms=Date.now()-i.start,i.tick++,t.render()},n);return i.stop=()=>{i.loading=!1,clearInterval(s)},Reflect.defineProperty(i,"interval",{value:s}),t.once("close",()=>i.stop()),i.stop}});var KZ=C((Iot,MZ)=>{"use strict";var{define:RKe,width:LKe}=Xr(),OZ=class{constructor(e){let r=e.options;RKe(this,"_prompt",e),this.type=e.type,this.name=e.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=LKe(r.stdout||process.stdout),Object.assign(this,r),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e=k({},this);return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let r=this._color||e[this.status];return typeof r=="function"?r:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};MZ.exports=OZ});var UZ=C((Eot,TZ)=>{"use strict";var Yk=Xr(),Mr=Hn(),Gk={default:Mr.noop,noop:Mr.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||Yk.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||Yk.complement(this.primary)},primary:Mr.cyan,success:Mr.green,danger:Mr.magenta,strong:Mr.bold,warning:Mr.yellow,muted:Mr.dim,disabled:Mr.gray,dark:Mr.dim.gray,underline:Mr.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typing(){return this._typing||this.dim},s
|
|||
|
`),c=l[0],u=l[l.length-1],h=(i+(r?" "+r:"")).length,f=h<c.length?c.slice(h+1):"";return{header:o,prompt:c,after:f,rest:l.slice(1),last:u}}async submit(){this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit&&await this.options.onSubmit.call(this,this.name,this.value,this);let e=this.state.error||await this.validate(this.value,this.state);if(e!==!0){let r=`
|
|||
|
`+this.symbols.pointer+" ";typeof e=="string"?r+=e.trim():r+="Invalid input",this.state.error=`
|
|||
|
`+this.styles.danger(r),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(e){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel=="function"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit("cancel",await this.error(e))}async close(){this.state.closed=!0;try{let e=this.sections(),r=Math.ceil(e.prompt.length/this.width);e.rest&&this.write(Al.cursor.down(e.rest.length)),this.write(`
|
|||
|
`.repeat(r))}catch(e){}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=Vk.listen(this,this.keypress.bind(this)),this.once("close",this.stop))}async skip(){return this.skipped=this.options.skip===!0,typeof this.options.skip=="function"&&(this.skipped=await this.options.skip.call(this,this.name,this.value)),this.skipped}async initialize(){let{format:e,options:r,result:i}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>i.call(this,this.value),typeof r.initial=="function"&&(this.initial=await r.initial.call(this,this)),typeof r.onRun=="function"&&await r.onRun.call(this,this),typeof r.onSubmit=="function"){let n=r.onSubmit.bind(this),s=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await n(this.name,this.value,this),s())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise(async(e,r)=>{if(this.once("submit",e),this.once("cancel",r),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(e,r,i){let{options:n,state:s,symbols:o,timers:a}=this,l=a&&a[e];s.timer=l;let c=n[e]||s[e]||o[e],u=r&&r[e]!=null?r[e]:await c;if(u==="")return u;let g=await this.resolve(u,s,r,i);return!g&&r&&r[e]?this.resolve(c,s,r,i):g}async prefix(){let e=await this.element("prefix")||this.symbols,r=this.timers&&this.timers.prefix,i=this.state;return i.timer=r,ki.isObject(e)&&(e=e[i.status]||e.pending),ki.hasColor(e)?e:(this.styles[i.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return ki.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,r=this.timers&&this.timers.separator,i=this.state;i.timer=r;let n=e[i.status]||e.pending||i.separator,s=await this.resolve(n,i);return ki.isObject(s)&&(s=s[i.status]||s.pending),ki.hasColor(s)?s:this.styles.muted(s)}async pointer(e,r){let i=await this.element("pointer",e,r);if(typeof i=="string"&&ki.hasColor(i))return i;if(i){let n=this.styles,s=this.index===r,o=s?n.primary:c=>c,a=await this.resolve(i[s?"on":"off"]||i,this.state),l=ki.hasColor(a)?a:o(a);return s?l:" ".repeat(a.length)}}async indicator(e,r){let i=await this.element("indicator",e,r);if(typeof i=="string"&&ki.hasColor(i))return i;if(i){let n=this.styles,s=e.enabled===!0,o=s?n.success:n.dark,a=i[s?"on":"off"]||i;return ki.hasColor(a)?a:o(a)}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let e=await this.element("hint");return ki.hasColor(e)?e:this.styles.muted(e)}}error(e){return this.state.submitted?"":e||this.state.error}format(e){return e}result(e){return e}validate(e){return this.options.required===!0?this.isValue(e):!0}isValue(e){return e!=null&&e!==""}resolve(e,...r){return ki.resolve(this,e,...r)}get base(){return zy.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||ki.height(this.stdout,25)}get width(){return this.options.columns||ki.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:r}=this.state,i=[r,e].find(this.isValue.bind(this));return this.isValue(i)?i:this.initial}static get prompt(){return e=>new this(e).run()}};function qKe(t){let e=n=>t[n]===void 0||typeof t[n]=="function",r=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],i=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let n of Object.keys(t.options)){if(r.includes(n)||/^on[A-Z]/.test(n))continue;let s=t.options[n];typeof s=="function"&&e(n)?i.includes(n)||(t[n]=s.bind(t)):typeof t[n]!="function"&&(t[n]=s)}}function jKe(t
|
|||
|
`:" ",i=[];for(let n=0;n<4;n++){let s=r(n);e[n]?i.push(s.repeat(e[n])):i.push("")}return i}XZ.exports=zy});var e_=C((Qot,_Z)=>{"use strict";var JKe=Xr(),$Z={default(t,e){return e},checkbox(t,e){throw new Error("checkbox role is not implemented yet")},editable(t,e){throw new Error("editable role is not implemented yet")},expandable(t,e){throw new Error("expandable role is not implemented yet")},heading(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||"",e},input(t,e){throw new Error("input role is not implemented yet")},option(t,e){return $Z.default(t,e)},radio(t,e){throw new Error("radio role is not implemented yet")},separator(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||t.symbols.line.repeat(5),e},spacer(t,e){return e}};_Z.exports=(t,e={})=>{let r=JKe.merge({},$Z,e.roles);return r[t]||r.default}});var lp=C((bot,t_)=>{"use strict";var WKe=Hn(),zKe=Qu(),VKe=e_(),Vy=Xr(),{reorder:Xk,scrollUp:XKe,scrollDown:ZKe,isObject:r_,swap:_Ke}=Vy,i_=class extends zKe{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:r,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");r_(r)&&(r=Object.keys(r)),Array.isArray(r)?(i!=null&&(this.index=this.findIndex(i)),r.forEach(s=>this.enable(this.find(s))),await this.render()):(i!=null&&(r=i),typeof r=="string"&&(r=this.findIndex(r)),typeof r=="number"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,r){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,r).then(o=>(this.state.loadingChoices=!1,o))}async toChoice(e,r,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=VKe(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=r,e.cursor=0,Vy.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,WKe.unstyle(e.message).length));let o=k({},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,r)),e}async onChoice(e,r){this.emit("choice",e,r,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,r)}async addChoice(e,r,i){let n=await this.toChoice(e,r,i);return this.choices.push(n),this.index=this.choices.length-1,this.limit=this.choices.length,n}async newItem(e,r,i){let n=k({name:"New choice name?",editable:!0,newChoice:!0},e),s=await this.addChoice(n,r,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,r){if(this.mul
|
|||
|
`),n;return this.options.choicesHeader&&(n=await this.resolve(this.options.choicesHeader,this.state)),[n,i].filter(Boolean).join(`
|
|||
|
`)}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map(e=>this.styles.primary(e.name)).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:r}=this.state,i="",n=await this.header(),s=await this.prefix(),o=await this.separator(),a=await this.message();this.options.promptLine!==!1&&(i=[s,a,o,""].join(" "),this.state.prompt=i);let l=await this.format(),c=await this.error()||await this.hint(),u=await this.renderChoices(),g=await this.footer();l&&(i+=l),c&&!i.includes(c)&&(i+=" "+c),e&&!l&&!u.trim()&&this.multiple&&this.emptyError!=null&&(i+=this.styles.danger(this.emptyError)),this.clear(r),this.write([n,i,u,g].filter(Boolean).join(`
|
|||
|
`)),this.write(this.margin[2]),this.restore()}};s_.exports=o_});var l_=C((xot,a_)=>{"use strict";var eTe=Ia(),tTe=(t,e)=>{let r=t.toLowerCase();return i=>{let s=i.toLowerCase().indexOf(r),o=e(i.slice(s,s+r.length));return s>=0?i.slice(0,s)+o+i.slice(s+r.length):i}},A_=class extends eTe{constructor(e){super(e);this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:r,input:i}=this.state;return this.input=i.slice(0,r)+e+i.slice(r),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:r}=this.state;return r?(this.input=r.slice(0,e-1)+r.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:r}=this.state;return r[e]===void 0?this.alert():(this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,r=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,e,r);let i=e.toLowerCase();return r.filter(n=>n.message.toLowerCase().includes(i))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(", ");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let e=this.options.highlight?this.options.highlight.bind(this):this.styles.placeholder,r=tTe(this.input,e),i=this.choices;this.choices=i.map(n=>V(k({},n),{message:r(n.message)})),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};a_.exports=A_});var $k=C((Dot,c_)=>{"use strict";var _k=Xr();c_.exports=(t,e={})=>{t.cursorHide();let{input:r="",initial:i="",pos:n,showCursor:s=!0,color:o}=e,a=o||t.styles.placeholder,l=_k.inverse(t.styles.primary),c=m=>l(t.styles.black(m)),u=r,g=" ",h=c(g);if(t.blink&&t.blink.off===!0&&(c=m=>m,h=""),s&&n===0&&i===""&&r==="")return c(g);if(s&&n===0&&(r===i||r===""))return c(i[0])+a(i.slice(1));i=_k.isPrimitive(i)?`${i}`:"",r=_k.isPrimitive(r)?`${r}`:"";let f=i&&i.startsWith(r)&&i!==r,p=f?c(i[r.length]):h;if(n!==r.length&&s===!0&&(u=r.slice(0,n)+c(r[n])+r.slice(n+1),p=""),s===!1&&(p=""),f){let m=t.styles.unstyle(u+p);return u+p+a(i.slice(m.length))}return u+p}});var Xy=C((Pot,u_)=>{"use strict";var rTe=Hn(),iTe=Ia(),nTe=$k(),g_=class extends iTe{constructor(e){super(V(k({},e),{multiple:!0}));this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(r=>r!=null),this.emptyError="",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(r=>r.reset&&r.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let r=this.focused;if(!r)return this.alert();let{cursor:i,input:n}=r;return r.value=r.input=n.slice(0,i)+e+n.slice(i),r.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:r,input:i}=e;return e.value=e.input=i.slice(0,r-1)+i.slice(r),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:r,input:i}=e;if(i[r]===void 0)return this.alert();let n=`${i}`.slice(0,r)+`${i}`.slice(r+1);return e.value=e.input=n,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,r){return this.dispatch(e,r)}number(e,r){return this.dispatch(e,r)}next(){let e=this.focused;if(!e)return this.alert();let{initial:r,input:i}=e;return r&&r.startsWith(i)&
|
|||
|
`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};m_.exports=I_});var B_=C((Rot,E_)=>{"use strict";var gTe=Zy(),y_=class extends gTe{constructor(e){super(e);this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};E_.exports=y_});var b_=C((Lot,w_)=>{"use strict";var hTe=Ia(),fTe=Xy(),bu=fTe.prototype,Q_=class extends hTe{constructor(e){super(V(k({},e),{multiple:!0}));this.align=[this.options.align,"left"].find(r=>r!=null),this.emptyError="",this.values={}}dispatch(e,r){let i=this.focused,n=i.parent||{};return!i.editable&&!n.editable&&(e==="a"||e==="i")?super[e]():bu.dispatch.call(this,e,r)}append(e,r){return bu.append.call(this,e,r)}delete(e,r){return bu.delete.call(this,e,r)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?bu.next.call(this):super.next()}prev(){return this.focused.editable?bu.prev.call(this):super.prev()}async indicator(e,r){let i=e.indicator||"",n=e.editable?i:super.indicator(e,r);return await this.resolve(n,this.state,e,r)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,r){return e.indent="",e.editable?bu.renderChoice.call(this,e,r):super.renderChoice(e,r)}error(){return""}footer(){return this.state.error}async validate(){let e=!0;for(let r of this.choices){if(typeof r.validate!="function"||r.role==="heading")continue;let i=r.parent?this.value[r.parent.name]:this.value;if(r.editable?i=r.value===r.name?r.initial||"":r.value:this.isDisabled(r)||(i=r.enabled===!0),e=await r.validate(i,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e=="string"?e:"Invalid Input"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let r=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}e.editable?r[e.name]=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(r[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};w_.exports=Q_});var ll=C((Not,S_)=>{"use strict";var pTe=Qu(),dTe=$k(),{isPrimitive:CTe}=Xr(),x_=class extends pTe{constructor(e){super(e);this.initial=CTe(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,r={}){let i=this.state.prevKeypress;return this.state.prevKeypress=r,this.options.multiline===!0&&r.name==="return"&&(!i||i.name!=="return")?this.append(`
|
|||
|
`,r):super.keypress(e,r)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(e,r){if(!e||r.ctrl||r.code)return this.alert();this.append(e)}append(e){let{cursor:r,input:i}=this.state;this.input=`${i}`.slice(0,r)+e+`${i}`.slice(r),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:r}=this.state;if(e<=0)return this.alert();this.input=`${r}`.slice(0,e-1)+`${r}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:r}=this.state;if(r[e]===void 0)return this.alert();this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.render()}cutForward(){let e=this.cursor;if(this.input.length<=e)return this.alert();this.state.clipboard.push(this.input.slice(e)),this.input=this.input.slice(0,e),this.render()}cutLeft(){let e=this.cursor;if(e===0)return this.alert();let r=this.input.slice(0,e),i=this.input.slice(e),n=r.split(" ");this.state.clipboard.push(n.pop()),this.input=n.join(" "),this.cursor=this.input.length,this.input+=i,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let e=this.initial!=null?String(this.initial):"";if(!e||!e.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(e){return!!e}async format(e=this.value){let r=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||r):dTe(this,{input:e,initial:r,pos:this.cursor})}async render(){let e=this.state.size,r=await this.prefix(),i=await this.separator(),n=await this.message(),s=[r,n,i].filter(Boolean).join(" ");this.state.prompt=s;let o=await this.header(),a=await this.format(),l=await this.error()||await this.hint(),c=await this.footer();l&&!a.includes(l)&&(a+=" "+l),s+=" "+a,this.clear(e),this.write([o,s,c].filter(Boolean).join(`
|
|||
|
`)),this.restore()}};S_.exports=x_});var P_=C((Mot,D_)=>{"use strict";var mTe=t=>t.filter((e,r)=>t.lastIndexOf(e)===r),_y=t=>mTe(t).filter(Boolean);D_.exports=(t,e={},r="")=>{let{past:i=[],present:n=""}=e,s,o;switch(t){case"prev":case"undo":return s=i.slice(0,i.length-1),o=i[i.length-1]||"",{past:_y([r,...s]),present:o};case"next":case"redo":return s=i.slice(1),o=i[0]||"",{past:_y([...s,r]),present:o};case"save":return{past:_y([...i,r]),present:""};case"remove":return o=_y(i.filter(a=>a!==r)),n="",o.length&&(n=o.pop()),{past:o,present:n};default:throw new Error(`Invalid action: "${t}"`)}}});var tv=C((Oot,k_)=>{"use strict";var ITe=ll(),v_=P_(),F_=class extends ITe{constructor(e){super(e);let r=this.options.history;if(r&&r.store){let i=r.values||this.initial;this.autosave=!!r.autosave,this.store=r.store,this.data=this.store.get("values")||{past:[],present:i},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=v_(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){!this.store||(this.data=v_("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};k_.exports=F_});var N_=C((Kot,R_)=>{"use strict";var ETe=ll(),L_=class extends ETe{format(){return""}};R_.exports=L_});var K_=C((Tot,M_)=>{"use strict";var yTe=ll(),O_=class extends yTe{constructor(e={}){super(e);this.sep=this.options.separator||/, */,this.initial=e.initial||""}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:r=>r;return this.list.map(e).join(", ")}async submit(e){let r=this.state.error||await this.validate(this.list,this.state);return r!==!0?(this.state.error=r,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};M_.exports=O_});var H_=C((Uot,T_)=>{"use strict";var BTe=Ia(),U_=class extends BTe{constructor(e){super(V(k({},e),{multiple:!0}))}};T_.exports=U_});var rv=C((Hot,Y_)=>{"use strict";var wTe=ll(),G_=class extends wTe{constructor(e={}){super(k({style:"number"},e));this.min=this.isValue(e.min)?this.toNumber(e.min):-Infinity,this.max=this.isValue(e.max)?this.toNumber(e.max):Infinity,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let r=e||this.minor,i=this.toNumber(this.input);return i>this.max+r?this.alert():(this.input=`${i+r}`,this.render())}down(e){let r=e||this.minor,i=this.toNumber(this.input);return i<this.min-r?this.alert():(this.input=`${i-r}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(e=this.input){return typeof this.options.format=="function"?this.options.format.call(this,e):this.styles.info(e)}toNumber(e=""){return this.float?+e:Math.round(+e)}isValue(e){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(e)}submit(){let e=[this.input,this.initial].find(r=>this.isValue(r));return this.value=this.toNumber(e||0),super.submit()}};Y_.exports=G_});var j_=C((Yot,q_)=>{q_.exports=rv()});var z_=C((Got,J_)=>{"use strict";var QTe=ll(),W_=class extends QTe{constructor(e){super(e);this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):""}};J_.exports=W_});var __=C((qot,V_)=>{"use strict";var bTe=Hn(),S
|
|||
|
`;let r=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((i,n)=>({name:n+r})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let e=0;for(let r of this.choices){e=Math.max(e,r.message.length),r.scaleIndex=r.initial||2,r.scale=[];for(let i=0;i<this.scale.length;i++)r.scale.push({index:i})}this.widths[0]=Math.min(this.widths[0],e+3)}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}heading(e,r,i){return this.styles.strong(e)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIndex>=this.scale.length-1?this.alert():(e.scaleIndex++,this.render())}left(){let e=this.focused;return e.scaleIndex<=0?this.alert():(e.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.index)).join(", "):""}pointer(){return""}renderScaleKey(){if(this.scaleKey===!1||this.state.submitted)return"";let e=this.scale.map(i=>` ${i.name} - ${i.message}`);return["",...e].map(i=>this.styles.muted(i)).join(`
|
|||
|
`)}renderScaleHeading(e){let r=this.scale.map(l=>l.name);typeof this.options.renderScaleHeading=="function"&&(r=this.options.renderScaleHeading.call(this,e));let i=this.scaleLength-r.join("").length,n=Math.round(i/(r.length-1)),o=r.map(l=>this.styles.strong(l)).join(" ".repeat(n)),a=" ".repeat(this.widths[0]);return this.margin[3]+a+this.margin[1]+o}scaleIndicator(e,r,i){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,r,i);let n=e.scaleIndex===r.index;return r.disabled?this.styles.hint(this.symbols.radio.disabled):n?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,r){let i=e.scale.map(s=>this.scaleIndicator(e,s,r)),n=this.term==="Hyper"?"":" ";return i.join(n+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,r){await this.onChoice(e,r);let i=this.index===r,n=await this.pointer(e,r),s=await e.hint;s&&!X_.hasColor(s)&&(s=this.styles.muted(s));let o=p=>this.margin[3]+p.replace(/\s+$/,"").padEnd(this.widths[0]," "),a=this.newline,l=this.indent(e),c=await this.resolve(e.message,this.state,e,r),u=await this.renderScale(e,r),g=this.margin[1]+this.margin[3];this.scaleLength=bTe.unstyle(u).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-g.length);let f=X_.wordWrap(c,{width:this.widths[0],newline:a}).split(`
|
|||
|
`).map(p=>o(p)+this.margin[1]);return i&&(u=this.styles.info(u),f=f.map(p=>this.styles.info(p))),f[0]+=u,this.linebreak&&f.push(""),[l+n,f.join(`
|
|||
|
`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let e=this.visible.map(async(n,s)=>await this.renderChoice(n,s)),r=await Promise.all(e),i=await this.renderScaleHeading();return this.margin[0]+[i,...r.map(n=>n.join(" "))].join(`
|
|||
|
`)}async render(){let{submitted:e,size:r}=this.state,i=await this.prefix(),n=await this.separator(),s=await this.message(),o="";this.options.promptLine!==!1&&(o=[i,s,n,""].join(" "),this.state.prompt=o);let a=await this.header(),l=await this.format(),c=await this.renderScaleKey(),u=await this.error()||await this.hint(),g=await this.renderChoices(),h=await this.footer(),f=this.emptyError;l&&(o+=l),u&&!o.includes(u)&&(o+=" "+u),e&&!l&&!g.trim()&&this.multiple&&f!=null&&(o+=this.styles.danger(f)),this.clear(r),this.write([a,o,c,g,h].filter(Boolean).join(`
|
|||
|
`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIndex;return this.base.submit.call(this)}};V_.exports=Z_});var r$=C((jot,$_)=>{"use strict";var e$=Hn(),xTe=(t="")=>typeof t=="string"?t.replace(/^['"]|['"]$/g,""):"",t$=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=xTe(e.initial||this.field.initial||""),this.message=e.message||this.name,this.cursor=0,this.input="",this.lines=[]}},DTe=async(t={},e={},r=i=>i)=>{let i=new Set,n=t.fields||[],s=t.template,o=[],a=[],l=[],c=1;typeof s=="function"&&(s=await s());let u=-1,g=()=>s[++u],h=()=>s[u+1],f=p=>{p.line=c,o.push(p)};for(f({type:"bos",value:""});u<s.length-1;){let p=g();if(/^[^\S\n ]$/.test(p)){f({type:"text",value:p});continue}if(p===`
|
|||
|
`){f({type:"newline",value:p}),c++;continue}if(p==="\\"){p+=g(),f({type:"text",value:p});continue}if((p==="$"||p==="#"||p==="{")&&h()==="{"){p+=g();let y={type:"template",open:p,inner:"",close:"",value:p},B;for(;B=g();){if(B==="}"){h()==="}"&&(B+=g()),y.value+=B,y.close=B;break}B===":"?(y.initial="",y.key=y.inner):y.initial!==void 0&&(y.initial+=B),y.value+=B,y.inner+=B}y.template=y.open+(y.initial||y.inner)+y.close,y.key=y.key||y.inner,e.hasOwnProperty(y.key)&&(y.initial=e[y.key]),y=r(y),f(y),l.push(y.key),i.add(y.key);let D=a.find(F=>F.name===y.key);y.field=n.find(F=>F.name===y.key),D||(D=new t$(y),a.push(D)),D.lines.push(y.line-1);continue}let m=o[o.length-1];m.type==="text"&&m.line===c?m.value+=p:f({type:"text",value:p})}return f({type:"eos",value:""}),{input:s,tabstops:o,unique:i,keys:l,items:a}};$_.exports=async t=>{let e=t.options,r=new Set(e.required===!0?[]:e.required||[]),i=k(k({},e.values),e.initial),{tabstops:n,items:s,keys:o}=await DTe(e,i),a=iv("result",t,e),l=iv("format",t,e),c=iv("validate",t,e,!0),u=t.isValue.bind(t);return async(g={},h=!1)=>{let f=0;g.required=r,g.items=s,g.keys=o,g.output="";let p=async(B,D,F,N)=>{let U=await c(B,D,F,N);return U===!1?"Invalid field "+F.name:U};for(let B of n){let D=B.value,F=B.key;if(B.type!=="template"){D&&(g.output+=D);continue}if(B.type==="template"){let N=s.find(K=>K.name===F);e.required===!0&&g.required.add(N.name);let U=[N.input,g.values[N.value],N.value,D].find(u),J=(N.field||{}).message||B.inner;if(h){let K=await p(g.values[F],g,N,f);if(K&&typeof K=="string"||K===!1){g.invalid.set(F,K);continue}g.invalid.delete(F);let A=await a(g.values[F],g,N,f);g.output+=e$.unstyle(A);continue}N.placeholder=!1;let oe=D;D=await l(D,g,N,f),U!==D?(g.values[F]=U,D=t.styles.typing(U),g.missing.delete(J)):(g.values[F]=void 0,U=`<${J}>`,D=t.styles.primary(U),N.placeholder=!0,g.required.has(F)&&g.missing.add(J)),g.missing.has(J)&&g.validating&&(D=t.styles.warning(U)),g.invalid.has(F)&&g.validating&&(D=t.styles.danger(U)),f===g.index&&(oe!==D?D=t.styles.underline(D):D=t.styles.heading(e$.unstyle(D))),f++}D&&(g.output+=D)}let m=g.output.split(`
|
|||
|
`).map(B=>" "+B),I=s.length,y=0;for(let B of s)g.invalid.has(B.name)&&B.lines.forEach(D=>{m[D][0]===" "&&(m[D]=g.styles.danger(g.symbols.bullet)+m[D].slice(1))}),t.isValue(g.values[B.name])&&y++;return g.completed=(y/I*100).toFixed(0),g.output=m.join(`
|
|||
|
`),g.output}};function iv(t,e,r,i){return(n,s,o,a)=>typeof o.field[t]=="function"?o.field[t].call(e,n,s,o,a):[i,n].find(l=>e.isValue(l))}});var s$=C((Jot,i$)=>{"use strict";var PTe=Hn(),kTe=r$(),vTe=Qu(),n$=class extends vTe{constructor(e){super(e);this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await kTe(this),await super.initialize()}async reset(e){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},e!==!0&&(await this.initialize(),await this.render())}moveCursor(e){let r=this.getItem();this.cursor+=e,r.cursor+=e}dispatch(e,r){if(!r.code&&!r.ctrl&&e!=null&&this.getItem()){this.append(e,r);return}this.alert()}append(e,r){let i=this.getItem(),n=i.input.slice(0,this.cursor),s=i.input.slice(this.cursor);this.input=i.input=`${n}${e}${s}`,this.moveCursor(1),this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let r=e.input.slice(this.cursor),i=e.input.slice(0,this.cursor-1);this.input=e.input=`${i}${r}`,this.moveCursor(-1),this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(e){let r=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(r=this.styles.danger),r(`${this.state.completed}% completed`)}async render(){let{index:e,keys:r=[],submitted:i,size:n}=this.state,s=[this.options.newline,`
|
|||
|
`].find(B=>B!=null),o=await this.prefix(),a=await this.separator(),l=await this.message(),c=[o,l,a].filter(Boolean).join(" ");this.state.prompt=c;let u=await this.header(),g=await this.error()||"",h=await this.hint()||"",f=i?"":await this.interpolate(this.state),p=this.state.key=r[e]||"",m=await this.format(p),I=await this.footer();m&&(c+=" "+m),h&&!m&&this.state.completed===0&&(c+=" "+h),this.clear(n);let y=[u,c,f,I,g.trim()];this.write(y.filter(Boolean).join(s)),this.restore()}getItem(e){let{items:r,keys:i,index:n}=this.state,s=r.find(o=>o.name===i[n]);return s&&s.input!=null&&(this.input=s.input,this.cursor=s.cursor),s}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:r,output:i,values:n}=this.state;if(e.size){let a="";for(let[l,c]of e)a+=`Invalid ${l}: ${c}
|
|||
|
`;return this.state.error=a,super.submit()}if(r.size)return this.state.error="Required: "+[...r.keys()].join(", "),super.submit();let o=PTe.unstyle(i).split(`
|
|||
|
`).map(a=>a.slice(1)).join(`
|
|||
|
`);return this.value={values:n,result:o},super.submit()}};i$.exports=n$});var A$=C((Wot,o$)=>{"use strict";var FTe="(Use <shift>+<up/down> to sort)",RTe=Ia(),a$=class extends RTe{constructor(e){super(V(k({},e),{reorder:!1,sort:!0,multiple:!0}));this.state.hint=[this.options.hint,FTe].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,r){let i=await super.renderChoice(e,r),n=this.symbols.identicalTo+" ",s=this.index===r&&this.sorting?this.styles.muted(n):" ";return this.options.drag===!1&&(s=""),this.options.numbered===!0?s+`${r+1} - `+i:s+i}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};o$.exports=a$});var u$=C((zot,l$)=>{"use strict";var LTe=lp(),c$=class extends LTe{constructor(e={}){super(e);if(this.emptyError=e.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let r=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];r=r.map(i=>this.styles.muted(i)),this.state.header=r.join(`
|
|||
|
`)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let r=await super.toChoices(...e);for(let i of r)i.scale=NTe(5,this.options),i.scaleIdx=2;return r}dispatch(){this.alert()}space(){let e=this.focused,r=e.scale[e.scaleIdx],i=r.selected;return e.scale.forEach(n=>n.selected=!1),r.selected=!i,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIdx>=e.scale.length-1?this.alert():(e.scaleIdx++,this.render())}left(){let e=this.focused;return e.scaleIdx<=0?this.alert():(e.scaleIdx--,this.render())}indent(){return" "}async renderChoice(e,r){await this.onChoice(e,r);let i=this.index===r,n=this.term==="Hyper",s=n?9:8,o=n?"":" ",a=this.symbols.line.repeat(s),l=" ".repeat(s+(n?0:1)),c=D=>(D?this.styles.success("\u25C9"):"\u25EF")+o,u=r+1+".",g=i?this.styles.heading:this.styles.noop,h=await this.resolve(e.message,this.state,e,r),f=this.indent(e),p=f+e.scale.map((D,F)=>c(F===e.scaleIdx)).join(a),m=D=>D===e.scaleIdx?g(D):D,I=f+e.scale.map((D,F)=>m(F)).join(l),y=()=>[u,h].filter(Boolean).join(" "),B=()=>[y(),p,I," "].filter(Boolean).join(`
|
|||
|
`);return i&&(p=this.styles.cyan(p),I=this.styles.cyan(I)),B()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map(async(i,n)=>await this.renderChoice(i,n)),r=await Promise.all(e);return r.length||r.push(this.styles.danger("No matching choices")),r.join(`
|
|||
|
`)}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.scaleIdx)).join(", "):""}async render(){let{submitted:e,size:r}=this.state,i=await this.prefix(),n=await this.separator(),s=await this.message(),o=[i,s,n].filter(Boolean).join(" ");this.state.prompt=o;let a=await this.header(),l=await this.format(),c=await this.error()||await this.hint(),u=await this.renderChoices(),g=await this.footer();(l||!c)&&(o+=" "+l),c&&!o.includes(c)&&(o+=" "+c),e&&!l&&!u&&this.multiple&&this.type!=="form"&&(o+=this.styles.danger(this.emptyError)),this.clear(r),this.write([o,a,u,g].filter(Boolean).join(`
|
|||
|
`)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function NTe(t,e={}){if(Array.isArray(e.scale))return e.scale.map(i=>k({},i));let r=[];for(let i=1;i<t+1;i++)r.push({i,selected:!1});return r}l$.exports=c$});var h$=C((Vot,g$)=>{g$.exports=tv()});var d$=C((Xot,f$)=>{"use strict";var MTe=Zy(),p$=class extends MTe{async initialize(){await super.initialize(),this.value=this.initial=!!this.options.initial,this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e="",r){switch(e.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let e=i=>this.styles.primary.underline(i);return[this.value?this.disabled:e(this.disabled),this.value?e(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:e}=this.state,r=await this.header(),i=await this.prefix(),n=await this.separator(),s=await this.message(),o=await this.format(),a=await this.error()||await this.hint(),l=await this.footer(),c=[i,s,n,o].join(" ");this.state.prompt=c,a&&!c.includes(a)&&(c+=" "+a),this.clear(e),this.write([r,c,l].filter(Boolean).join(`
|
|||
|
`)),this.write(this.margin[2]),this.restore()}};f$.exports=p$});var I$=C((Zot,C$)=>{"use strict";var OTe=Ia(),m$=class extends OTe{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,r){let i=await super.toChoices(e,r);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)}}};C$.exports=m$});var y$=C(nv=>{"use strict";var E$=Xr(),wr=(t,e)=>{E$.defineExport(nv,t,e),E$.defineExport(nv,t.toLowerCase(),e)};wr("AutoComplete",()=>l_());wr("BasicAuth",()=>C_());wr("Confirm",()=>B_());wr("Editable",()=>b_());wr("Form",()=>Xy());wr("Input",()=>tv());wr("Invisible",()=>N_());wr("List",()=>K_());wr("MultiSelect",()=>H_());wr("Numeral",()=>j_());wr("Password",()=>z_());wr("Scale",()=>__());wr("Select",()=>Ia());wr("Snippet",()=>s$());wr("Sort",()=>A$());wr("Survey",()=>u$());wr("Text",()=>h$());wr("Toggle",()=>d$());wr("Quiz",()=>I$())});var w$=C(($ot,B$)=>{B$.exports={ArrayPrompt:lp(),AuthPrompt:ev(),BooleanPrompt:Zy(),NumberPrompt:rv(),StringPrompt:ll()}});var up=C((eat,Q$)=>{"use strict";var b$=require("assert"),sv=require("events"),Ea=Xr(),Is=class extends sv{constructor(e,r){super();this.options=Ea.merge({},e),this.answers=k({},r)}register(e,r){if(Ea.isObject(e)){for(let n of Object.keys(e))this.register(n,e[n]);return this}b$.equal(typeof r,"function","expected a function");let i=e.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[i]=r:this.prompts[i]=r(this.Prompt,this),this}async prompt(e=[]){for(let r of[].concat(e))try{typeof r=="function"&&(r=await r.call(this)),await this.ask(Ea.merge({},this.options,r))}catch(i){return Promise.reject(i)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let r=Ea.merge({},this.options,e),{type:i,name:n}=e,{set:s,get:o}=Ea;if(typeof i=="function"&&(i=await i.call(this,e,this.answers)),!i)return this.answers[n];b$(this.prompts[i],`Prompt "${i}" is not registered`);let a=new this.prompts[i](r),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),r.autofill&&l!=null?(a.value=a.input=l,r.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||Qu()}static get prompts(){return y$()}static get types(){return w$()}static get prompt(){let e=(r,...i)=>{let n=new this(...i),s=n.emit.bind(n);return n.emit=(...o)=>(e.emit(...o),s(...o)),n.prompt(r)};return Ea.mixinEmitter(e,new sv),e}};Ea.mixinEmitter(Is,new sv);var ov=Is.prompts;for(let t of Object.keys(ov)){let e=t.toLowerCase(),r=i=>new ov[t](i).run();Is.prompt[e]=r,Is[e]=r,Is[t]||Reflect.defineProperty(Is,t,{get:()=>ov[t]})}var cp=t=>{Ea.defineExport(Is,t,()=>Is.types[t])};cp("ArrayPrompt");cp("AuthPrompt");cp("BooleanPrompt");cp("NumberPrompt");cp("StringPrompt");Q$.exports=Is});var M$=C((Yat,N$)=>{function HTe(t,e){for(var r=-1,i=t==null?0:t.length;++r<i&&e(t[r],r,t)!==!1;);return t}N$.exports=HTe});var Su=C((Gat,O$)=>{var YTe=ay(),GTe=lu();function qTe(t,e,r,i){var n=!r;r||(r={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=i?i(r[a],t[a],a,r,t):void 0;l===void 0&&(l=t[a]),n?GTe(r,a,l):YTe(r,a,l)}return r}O$.exports=qTe});var T$=C((qat,K$)=>{var jTe=Su(),JTe=fu();function WTe(t,e){return t&&jTe(e,JTe(e),t)}K$.exports=WTe});var H$=C((jat,U$)=>{function zTe(t)
|
|||
|
`:"";return o?g+=`@IF EXIST ${o} (\r
|
|||
|
${o} ${l} ${n} ${u}%*\r
|
|||
|
) ELSE (\r
|
|||
|
@SETLOCAL\r
|
|||
|
@SET PATHEXT=%PATHEXT:;.JS;=;%\r
|
|||
|
${a} ${l} ${n} ${u}%*\r
|
|||
|
)\r
|
|||
|
`:g+=`@${a} ${l} ${n} ${u}%*\r
|
|||
|
`,g}function kGe(t,e,r){let i=wn.relative(wn.dirname(e),t),n=r.prog&&r.prog.split("\\").join("/"),s;i=i.split("\\").join("/");let o=wn.isAbsolute(i)?`"${i}"`:`"$basedir/${i}"`,a=r.args||"",l=TF(r.nodePath).posix;n?(s=`"$basedir/${r.prog}"`,i=o):(n=o,a="",i="");let c=r.progArgs?`${r.progArgs.join(" ")} `:"",u=`#!/bin/sh
|
|||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
|
|||
|
|
|||
|
case \`uname\` in
|
|||
|
*CYGWIN*) basedir=\`cygpath -w "$basedir"\`;;
|
|||
|
esac
|
|||
|
|
|||
|
`,g=r.nodePath?`export NODE_PATH="${l}"
|
|||
|
`:"";return s?u+=`${g}if [ -x ${s} ]; then
|
|||
|
exec ${s} ${a} ${i} ${c}"$@"
|
|||
|
else
|
|||
|
exec ${n} ${a} ${i} ${c}"$@"
|
|||
|
fi
|
|||
|
`:u+=`${g}${n} ${a} ${i} ${c}"$@"
|
|||
|
exit $?
|
|||
|
`,u}function vGe(t,e,r){let i=wn.relative(wn.dirname(e),t),n=r.prog&&r.prog.split("\\").join("/"),s=n&&`"${n}$exe"`,o;i=i.split("\\").join("/");let a=wn.isAbsolute(i)?`"${i}"`:`"$basedir/${i}"`,l=r.args||"",c=TF(r.nodePath),u=c.win32,g=c.posix;s?(o=`"$basedir/${r.prog}$exe"`,i=a):(s=a,l="",i="");let h=r.progArgs?`${r.progArgs.join(" ")} `:"",f=`#!/usr/bin/env pwsh
|
|||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
|||
|
|
|||
|
$exe=""
|
|||
|
${r.nodePath?`$env_node_path=$env:NODE_PATH
|
|||
|
$env:NODE_PATH="${u}"
|
|||
|
`:""}if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
|||
|
# Fix case when both the Windows and Linux builds of Node
|
|||
|
# are installed in the same directory
|
|||
|
$exe=".exe"
|
|||
|
}`;return r.nodePath&&(f+=` else {
|
|||
|
$env:NODE_PATH="${g}"
|
|||
|
}`),o?f+=`
|
|||
|
$ret=0
|
|||
|
if (Test-Path ${o}) {
|
|||
|
# Support pipeline input
|
|||
|
if ($MyInvocation.ExpectingInput) {
|
|||
|
$input | & ${o} ${l} ${i} ${h}$args
|
|||
|
} else {
|
|||
|
& ${o} ${l} ${i} ${h}$args
|
|||
|
}
|
|||
|
$ret=$LASTEXITCODE
|
|||
|
} else {
|
|||
|
# Support pipeline input
|
|||
|
if ($MyInvocation.ExpectingInput) {
|
|||
|
$input | & ${s} ${l} ${i} ${h}$args
|
|||
|
} else {
|
|||
|
& ${s} ${l} ${i} ${h}$args
|
|||
|
}
|
|||
|
$ret=$LASTEXITCODE
|
|||
|
}
|
|||
|
${r.nodePath?`$env:NODE_PATH=$env_node_path
|
|||
|
`:""}exit $ret
|
|||
|
`:f+=`
|
|||
|
# Support pipeline input
|
|||
|
if ($MyInvocation.ExpectingInput) {
|
|||
|
$input | & ${s} ${l} ${i} ${h}$args
|
|||
|
} else {
|
|||
|
& ${s} ${l} ${i} ${h}$args
|
|||
|
}
|
|||
|
${r.nodePath?`$env:NODE_PATH=$env_node_path
|
|||
|
`:""}exit $LASTEXITCODE
|
|||
|
`,f}function RGe(t,e){return e.fs_.chmod(t,493)}function TF(t){if(!t)return{win32:"",posix:""};let e=typeof t=="string"?t.split(wn.delimiter):Array.from(t),r={};for(let i=0;i<e.length;i++){let n=e[i].split("/").join("\\"),s=Kie()?e[i].split("\\").join("/").replace(/^([^:\\/]*):/,(o,a)=>`/mnt/${a.toLowerCase()}`):e[i];r.win32=r.win32?`${r.win32};${n}`:n,r.posix=r.posix?`${r.posix}:${s}`:s,r[i]={win32:n,posix:s}}return r}Oie.exports=KF});var sR=C((HEt,ine)=>{ine.exports=require("stream")});var ane=C((YEt,nne)=>{"use strict";function sne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function eqe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sne(Object(r),!0).forEach(function(i){$Ge(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sne(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function $Ge(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tqe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function one(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function rqe(t,e,r){return e&&one(t.prototype,e),r&&one(t,r),t}var iqe=require("buffer"),pB=iqe.Buffer,nqe=require("util"),oR=nqe.inspect,sqe=oR&&oR.custom||"inspect";function oqe(t,e,r){pB.prototype.copy.call(t,e,r)}nne.exports=function(){function t(){tqe(this,t),this.head=null,this.tail=null,this.length=0}return rqe(t,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return pB.alloc(0);for(var i=pB.allocUnsafe(r>>>0),n=this.head,s=0;n;)oqe(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,s=i.data;for(r-=s.length;i=i.next;){var o=i.data,a=r>o.length?o.length:r;if(a===o.length?s+=o:s+=o.slice(0,r),r-=a,r===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(r){var i=pB.allocUnsafe(r),n=this.head,s=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var o=n.data,a=r>o.length?o.length:r;if(o.copy(i,i.length-r,0,a),r-=a,r===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:sqe,value:function(r,i){return oR(this,eqe({},i,{depth:0,customInspect:!1}))}}]),t}()});var AR=C((GEt,Ane)=>{"use strict";function aqe(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(aR,this,t)):process.nextTick(aR,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(
|
|||
|
`)),t.linkname&&(e+=OR(" linkpath="+t.linkname+`
|
|||
|
`));var r=t.pax;if(r)for(var i in r)e+=OR(" "+i+"="+r[i]+`
|
|||
|
`);return Buffer.from(e)};qu.decodePax=function(t){for(var e={};t.length;){for(var r=0;r<t.length&&t[r]!==32;)r++;var i=parseInt(t.slice(0,r).toString(),10);if(!i)return e;var n=t.slice(r+1,i-1).toString(),s=n.indexOf("=");if(s===-1)return e;e[n.slice(0,s)]=n.slice(s+1),t=t.slice(i)}return e};qu.encode=function(t){var e=tJe(512),r=t.name,i="";if(t.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var n=r.indexOf("/");if(n===-1)return null;i+=i?"/"+r.slice(0,n):r.slice(0,n),r=r.slice(n+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(i)>155||t.linkname&&Buffer.byteLength(t.linkname)>100?null:(e.write(r),e.write(Na(t.mode&aJe,6),100),e.write(Na(t.uid,6),108),e.write(Na(t.gid,6),116),e.write(Na(t.size,11),124),e.write(Na(t.mtime.getTime()/1e3|0,11),136),e[156]=lse+cJe(t.type),t.linkname&&e.write(t.linkname,157),cse.copy(e,pd),nJe.copy(e,MR),t.uname&&e.write(t.uname,265),t.gname&&e.write(t.gname,297),e.write(Na(t.devmajor||0,6),329),e.write(Na(t.devminor||0,6),337),i&&e.write(i,345),e.write(Na(gse(e),6),148),e)};qu.decode=function(t,e,r){var i=t[156]===0?0:t[156]-lse,n=ju(t,0,100,e),s=Ma(t,100,8),o=Ma(t,108,8),a=Ma(t,116,8),l=Ma(t,124,12),c=Ma(t,136,12),u=lJe(i),g=t[157]===0?null:ju(t,157,100,e),h=ju(t,265,32),f=ju(t,297,32),p=Ma(t,329,8),m=Ma(t,337,8),I=gse(t);if(I===8*32)return null;if(I!==Ma(t,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(cse.compare(t,pd,pd+6)===0)t[345]&&(n=ju(t,345,155,e)+"/"+n);else if(!(sJe.compare(t,pd,pd+6)===0&&oJe.compare(t,MR,MR+2)===0)){if(!r)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:h,gname:f,devmajor:p,devminor:m}}});var Ise=C((lyt,hse)=>{var fse=require("util"),gJe=Ase(),dd=KR(),pse=Gu().Writable,dse=Gu().PassThrough,Cse=function(){},mse=function(t){return t&=511,t&&512-t},hJe=function(t,e){var r=new vB(t,e);return r.end(),r},fJe=function(t,e){return e.path&&(t.name=e.path),e.linkpath&&(t.linkname=e.linkpath),e.size&&(t.size=parseInt(e.size,10)),t.pax=e,t},vB=function(t,e){this._parent=t,this.offset=e,dse.call(this,{autoDestroy:!1})};fse.inherits(vB,dse);vB.prototype.destroy=function(t){this._parent.destroy(t)};var Bo=function(t){if(!(this instanceof Bo))return new Bo(t);pse.call(this,t),t=t||{},this._offset=0,this._buffer=gJe(),this._missing=0,this._partial=!1,this._onparse=Cse,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,r=e._buffer,i=function(){e._continue()},n=function(h){if(e._locked=!1,h)return e.destroy(h);e._stream||i()},s=function(){e._stream=null;var h=mse(e._header.size);h?e._parse(h,o):e._parse(512,g),e._locked||i()},o=function(){e._buffer.consume(mse(e._header.size)),e._parse(512,g),i()},a=function(){var h=e._header.size;e._paxGlobal=dd.decodePax(r.slice(0,h)),r.consume(h),s()},l=function(){var h=e._header.size;e._pax=dd.decodePax(r.slice(0,h)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),r.consume(h),s()},c=function(){var h=e._header.size;this._gnuLongPath=dd.decodeLongPath(r.slice(0,h),t.filenameEncoding),r.consume(h),s()},u=function(){var h=e._header.size;this._gnuLongLinkPath=dd.decodeLongPath(r.slice(0,h),t.filenameEncoding),r.consume(h),s()},g=function(){var h=e._offset,f;try{f=e._header=dd.decode(r.slice(0,512),t.filenameEncoding,t.allowUnknownFormat)}catch(p){e.emit("error",p)}if(r.consume(512),!f){e._parse(512,g),i();return}if(f.type==="gnu-long-path"){e._parse(f.size,c),i();return}if(f.type==="gnu-long-link-path"){e._parse(f.size,u),i();return}if(f.type==="pax-global-header"){e._parse(f.size,a),i();return}if(f.type==="pax-header"){e._parse(f.size,l),i();return}if(e._gnuLongPath&&(f.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(f.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=f=fJe(f,e._pax),e
|
|||
|
Wanted: ${r.size}
|
|||
|
Found: ${t.length}`);throw a.code="EBADSIZE",a.found=t.length,a.expected=r.size,a.sri=e,a}else{let a=new Error(`Integrity checksum failed when using ${i}: Wanted ${e}, but got ${s}. (${t.length} bytes)`);throw a.code="EINTEGRITY",a.found=s,a.expected=e,a.algorithm=i,a.sri=e,a}}ws.exports.checkStream=JJe;function JJe(t,e,r){r=pi(r);let i=r.Promise||Promise,n=VR(r.concat({integrity:e}));return new i((s,o)=>{t.pipe(n),t.on("error",o),n.on("error",o);let a;n.on("verified",l=>{a=l}),n.on("end",()=>s(a)),n.on("data",()=>{})})}ws.exports.integrityStream=VR;function VR(t){t=pi(t);let e=t.integrity&&Qs(t.integrity,t),r=e&&Object.keys(e).length,i=r&&e.pickAlgorithm(t),n=r&&e[i],s=Array.from(new Set(t.algorithms.concat(i?[i]:[]))),o=s.map(Id.createHash),a=0,l=new MJe({transform(c,u,g){a+=c.length,o.forEach(h=>h.update(c,u)),g(null,c,u)}}).on("end",()=>{let c=t.options&&t.options.length?`?${t.options.join("?")}`:"",u=Qs(o.map((h,f)=>`${s[f]}-${h.digest("base64")}${c}`).join(" "),t),g=r&&u.match(e,t);if(typeof t.size=="number"&&a!==t.size){let h=new Error(`stream size mismatch when checking ${e}.
|
|||
|
Wanted: ${t.size}
|
|||
|
Found: ${a}`);h.code="EBADSIZE",h.found=a,h.expected=t.size,h.sri=e,l.emit("error",h)}else if(t.integrity&&!g){let h=new Error(`${e} integrity checksum failed when using ${i}: wanted ${n} but got ${u}. (${a} bytes)`);h.code="EINTEGRITY",h.found=u,h.expected=n,h.algorithm=i,h.sri=e,l.emit("error",h)}else l.emit("size",a),l.emit("integrity",u),g&&l.emit("verified",g)});return l}ws.exports.create=WJe;function WJe(t){t=pi(t);let e=t.algorithms,r=t.options.length?`?${t.options.join("?")}`:"",i=e.map(Id.createHash);return{update:function(n,s){return i.forEach(o=>o.update(n,s)),this},digest:function(n){return e.reduce((o,a)=>{let l=i.shift().digest("base64"),c=new Bl(`${a}-${l}${r}`,t);if(c.algorithm&&c.digest){let u=c.algorithm;o[u]||(o[u]=[]),o[u].push(c)}return o},new Vu)}}}var zJe=new Set(Id.getHashes()),Yse=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(t=>zJe.has(t));function HJe(t,e){return Yse.indexOf(t.toLowerCase())>=Yse.indexOf(e.toLowerCase())?t:e}});var Kf={};$e(Kf,{BuildType:()=>Wi,Cache:()=>gt,Configuration:()=>Ae,DEFAULT_LOCK_FILENAME:()=>iP,DEFAULT_RC_FILENAME:()=>rP,FormatType:()=>XA,LightReport:()=>Ao,LinkType:()=>At,Manifest:()=>ze,MessageName:()=>z,PackageExtensionStatus:()=>Yr,PackageExtensionType:()=>Sr,Project:()=>Fe,ProjectLookup:()=>da,Report:()=>ai,ReportError:()=>Ze,SettingsType:()=>ge,StreamReport:()=>xe,TAG_REGEXP:()=>_c,TelemetryManager:()=>Of,ThrowReport:()=>Br,VirtualFetcher:()=>Ef,Workspace:()=>Mf,WorkspaceResolver:()=>fi,YarnVersion:()=>Gi,execUtils:()=>pr,folderUtils:()=>Uw,formatUtils:()=>ce,hashUtils:()=>wi,httpUtils:()=>Ut,miscUtils:()=>de,scriptUtils:()=>bt,semverUtils:()=>vt,structUtils:()=>Q,tgzUtils:()=>gr,treeUtils:()=>Tn});var pr={};$e(pr,{EndStrategy:()=>rn,execvp:()=>Lae,pipevp:()=>Ls});var vg={};$e(vg,{AliasFS:()=>Wa,CwdFS:()=>yt,DEFAULT_COMPRESSION_LEVEL:()=>Ja,FakeFS:()=>Dn,Filename:()=>mt,JailFS:()=>Fs,LazyFS:()=>Sg,LinkStrategy:()=>Eg,NoFS:()=>EC,NodeFS:()=>wt,PortablePath:()=>Ee,PosixFS:()=>xg,ProxiedFS:()=>fr,VirtualFS:()=>rr,ZipFS:()=>Qr,ZipOpenFS:()=>tn,extendFs:()=>BC,normalizeLineEndings:()=>Pl,npath:()=>L,opendir:()=>Ya,patchFs:()=>kg,ppath:()=>w,statUtils:()=>hw,toFilename:()=>jt,xfs:()=>M});var hw={};$e(hw,{BigIntStatsEntry:()=>Cg,DirEntry:()=>QL,StatEntry:()=>vo,areStatsEqual:()=>pw,clearStats:()=>gC,convertToBigIntStats:()=>hC,makeDefaultStats:()=>mg,makeEmptyStats:()=>Voe});var fw=ee(require("util"));var $i=61440,Po=16384,vs=32768,ko=40960;var QL=class{constructor(){this.name="";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&$i)===Po}isFIFO(){return!1}isFile(){return(this.mode&$i)===vs}isSocket(){return!1}isSymbolicLink(){return(this.mode&$i)===ko}},vo=class{constructor(){this.uid=0;this.gid=0;this.size=0;this.blksize=0;this.atimeMs=0;this.mtimeMs=0;this.ctimeMs=0;this.birthtimeMs=0;this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=0;this.ino=0;this.mode=vs|420;this.nlink=1;this.rdev=0;this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&$i)===Po}isFIFO(){return!1}isFile(){return(this.mode&$i)===vs}isSocket(){return!1}isSymbolicLink(){return(this.mode&$i)===ko}},Cg=class{constructor(){this.uid=BigInt(0);this.gid=BigInt(0);this.size=BigInt(0);this.blksize=BigInt(0);this.atimeMs=BigInt(0);this.mtimeMs=BigInt(0);this.ctimeMs=BigInt(0);this.birthtimeMs=BigInt(0);this.atimeNs=BigInt(0);this.mtimeNs=BigInt(0);this.ctimeNs=BigInt(0);this.birthtimeNs=BigInt(0);this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=BigInt(0);this.ino=BigInt(0);this.mode=BigInt(vs|420);this.nlink=BigInt(1);this.rdev=BigInt(0);this.blocks=BigInt(1)}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&BigInt($i))===BigInt(Po)}isFIFO(){return!1}isFile(){return(this.mode&BigInt($i))===BigInt(vs)}isSocket(){return!1}isSymbolicLink(){return(this.mode&BigInt($i))===BigInt(
|
|||
|
`)}writeJsonSync(e,r){return this.writeFileSync(e,`${JSON.stringify(r,null,2)}
|
|||
|
`)}async preserveTimePromise(e,r){let i=await this.lstatPromise(e),n=await r();typeof n!="undefined"&&(e=n),this.lutimesPromise?await this.lutimesPromise(e,i.atime,i.mtime):i.isSymbolicLink()||await this.utimesPromise(e,i.atime,i.mtime)}async preserveTimeSync(e,r){let i=this.lstatSync(e),n=r();typeof n!="undefined"&&(e=n),this.lutimesSync?this.lutimesSync(e,i.atime,i.mtime):i.isSymbolicLink()||this.utimesSync(e,i.atime,i.mtime)}};Dn.DEFAULT_TIME=315532800;var Ga=class extends Dn{constructor(){super(w)}};function tae(t){let e=t.match(/\r?\n/g);if(e===null)return KL.EOL;let r=e.filter(n=>n===`\r
|
|||
|
`).length,i=e.length-r;return r>i?`\r
|
|||
|
`:`
|
|||
|
`}function Pl(t,e){return e.replace(/\r?\n/g,tae(t))}var kl=ee(require("fs")),yw=ee(require("stream")),YL=ee(require("util")),Bw=ee(require("zlib"));var TL=ee(require("fs"));var wt=class extends Ga{constructor(e=TL.default){super();this.realFs=e,typeof this.realFs.lutimes!="undefined"&&(this.lutimesPromise=this.lutimesPromiseImpl,this.lutimesSync=this.lutimesSyncImpl)}getExtractHint(){return!1}getRealPath(){return Ee.root}resolve(e){return w.resolve(e)}async openPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.open(L.fromPortablePath(e),r,i,this.makeCallback(n,s))})}openSync(e,r,i){return this.realFs.openSync(L.fromPortablePath(e),r,i)}async opendirPromise(e,r){return await new Promise((i,n)=>{typeof r!="undefined"?this.realFs.opendir(L.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.opendir(L.fromPortablePath(e),this.makeCallback(i,n))}).then(i=>Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0}))}opendirSync(e,r){let i=typeof r!="undefined"?this.realFs.opendirSync(L.fromPortablePath(e),r):this.realFs.opendirSync(L.fromPortablePath(e));return Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0})}async readPromise(e,r,i=0,n=0,s=-1){return await new Promise((o,a)=>{this.realFs.read(e,r,i,n,s,(l,c)=>{l?a(l):o(c)})})}readSync(e,r,i,n,s){return this.realFs.readSync(e,r,i,n,s)}async writePromise(e,r,i,n,s){return await new Promise((o,a)=>typeof r=="string"?this.realFs.write(e,r,i,this.makeCallback(o,a)):this.realFs.write(e,r,i,n,s,this.makeCallback(o,a)))}writeSync(e,r,i,n,s){return typeof r=="string"?this.realFs.writeSync(e,r,i):this.realFs.writeSync(e,r,i,n,s)}async closePromise(e){await new Promise((r,i)=>{this.realFs.close(e,this.makeCallback(r,i))})}closeSync(e){this.realFs.closeSync(e)}createReadStream(e,r){let i=e!==null?L.fromPortablePath(e):e;return this.realFs.createReadStream(i,r)}createWriteStream(e,r){let i=e!==null?L.fromPortablePath(e):e;return this.realFs.createWriteStream(i,r)}async realpathPromise(e){return await new Promise((r,i)=>{this.realFs.realpath(L.fromPortablePath(e),{},this.makeCallback(r,i))}).then(r=>L.toPortablePath(r))}realpathSync(e){return L.toPortablePath(this.realFs.realpathSync(L.fromPortablePath(e),{}))}async existsPromise(e){return await new Promise(r=>{this.realFs.exists(L.fromPortablePath(e),r)})}accessSync(e,r){return this.realFs.accessSync(L.fromPortablePath(e),r)}async accessPromise(e,r){return await new Promise((i,n)=>{this.realFs.access(L.fromPortablePath(e),r,this.makeCallback(i,n))})}existsSync(e){return this.realFs.existsSync(L.fromPortablePath(e))}async statPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.stat(L.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.stat(L.fromPortablePath(e),this.makeCallback(i,n))})}statSync(e,r){return r?this.realFs.statSync(L.fromPortablePath(e),r):this.realFs.statSync(L.fromPortablePath(e))}async fstatPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.fstat(e,r,this.makeCallback(i,n)):this.realFs.fstat(e,this.makeCallback(i,n))})}fstatSync(e,r){return r?this.realFs.fstatSync(e,r):this.realFs.fstatSync(e)}async lstatPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.lstat(L.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.lstat(L.fromPortablePath(e),this.makeCallback(i,n))})}lstatSync(e,r){return r?this.realFs.lstatSync(L.fromPortablePath(e),r):this.realFs.lstatSync(L.fromPortablePath(e))}async chmodPromise(e,r){return await new Promise((i,n)=>{this.realFs.chmod(L.fromPortablePath(e),r,this.makeCallback(i,n))})}chmodSync(e,r){return this.realFs.chmodSync(L.fromPortablePath(e),r)}async chownPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.chown(L.fromPortablePath(e),r,i,this.makeCallback(n,s))})}chownSync(e,r,i){return this.realFs.chownSync(L.fromPortablePath(e),r,i)}async renamePromise(e,r){return await new Promise((i,n)=>{this.realFs.rename(L.fromPortablePath(e),L.fromPortablePath(r),this.makeCallback(i,n))})}renameSync(e,r){return this.realFs.renameSync(L.fromPortablePath(e),L.fromPortablePath(r))}async copyFilePromise(e,r,i=0){retu
|
|||
|
|
|||
|
${I}`),{code:Tw(f,p),stdout:m,stderr:I}))})})}var Nae=new Map([["SIGINT",2],["SIGQUIT",3],["SIGKILL",9],["SIGTERM",15]]);function Tw(t,e){let r=Nae.get(e);return typeof r!="undefined"?128+r:t!=null?t:1}var Uw={};$e(Uw,{getDefaultGlobalFolder:()=>Yw,getHomeFolder:()=>Fg,isFolderInside:()=>Gw});var Hw=ee(require("os"));function Yw(){if(process.platform==="win32"){let t=L.toPortablePath(process.env.LOCALAPPDATA||L.join((0,Hw.homedir)(),"AppData","Local"));return w.resolve(t,"Yarn/Berry")}if(process.env.XDG_DATA_HOME){let t=L.toPortablePath(process.env.XDG_DATA_HOME);return w.resolve(t,"yarn/berry")}return w.resolve(Fg(),".yarn/berry")}function Fg(){return L.toPortablePath((0,Hw.homedir)()||"/usr/local/share")}function Gw(t,e){let r=w.relative(e,t);return r&&!r.startsWith("..")&&!w.isAbsolute(r)}var ce={};$e(ce,{LogLevel:()=>Ln,Style:()=>pA,Type:()=>ve,addLogFilterSupport:()=>Bh,applyColor:()=>Hi,applyHyperlink:()=>ic,applyStyle:()=>Hm,json:()=>nc,mark:()=>e0,pretty:()=>je,prettyField:()=>CA,prettyList:()=>u0,supportsColor:()=>Tm,supportsHyperlinks:()=>l0,tuple:()=>dA});var yh=ee($w()),U2=ee(Mg()),H2=ee(Ti()),Y2=ee(PO());var z;(function(te){te[te.UNNAMED=0]="UNNAMED",te[te.EXCEPTION=1]="EXCEPTION",te[te.MISSING_PEER_DEPENDENCY=2]="MISSING_PEER_DEPENDENCY",te[te.CYCLIC_DEPENDENCIES=3]="CYCLIC_DEPENDENCIES",te[te.DISABLED_BUILD_SCRIPTS=4]="DISABLED_BUILD_SCRIPTS",te[te.BUILD_DISABLED=5]="BUILD_DISABLED",te[te.SOFT_LINK_BUILD=6]="SOFT_LINK_BUILD",te[te.MUST_BUILD=7]="MUST_BUILD",te[te.MUST_REBUILD=8]="MUST_REBUILD",te[te.BUILD_FAILED=9]="BUILD_FAILED",te[te.RESOLVER_NOT_FOUND=10]="RESOLVER_NOT_FOUND",te[te.FETCHER_NOT_FOUND=11]="FETCHER_NOT_FOUND",te[te.LINKER_NOT_FOUND=12]="LINKER_NOT_FOUND",te[te.FETCH_NOT_CACHED=13]="FETCH_NOT_CACHED",te[te.YARN_IMPORT_FAILED=14]="YARN_IMPORT_FAILED",te[te.REMOTE_INVALID=15]="REMOTE_INVALID",te[te.REMOTE_NOT_FOUND=16]="REMOTE_NOT_FOUND",te[te.RESOLUTION_PACK=17]="RESOLUTION_PACK",te[te.CACHE_CHECKSUM_MISMATCH=18]="CACHE_CHECKSUM_MISMATCH",te[te.UNUSED_CACHE_ENTRY=19]="UNUSED_CACHE_ENTRY",te[te.MISSING_LOCKFILE_ENTRY=20]="MISSING_LOCKFILE_ENTRY",te[te.WORKSPACE_NOT_FOUND=21]="WORKSPACE_NOT_FOUND",te[te.TOO_MANY_MATCHING_WORKSPACES=22]="TOO_MANY_MATCHING_WORKSPACES",te[te.CONSTRAINTS_MISSING_DEPENDENCY=23]="CONSTRAINTS_MISSING_DEPENDENCY",te[te.CONSTRAINTS_INCOMPATIBLE_DEPENDENCY=24]="CONSTRAINTS_INCOMPATIBLE_DEPENDENCY",te[te.CONSTRAINTS_EXTRANEOUS_DEPENDENCY=25]="CONSTRAINTS_EXTRANEOUS_DEPENDENCY",te[te.CONSTRAINTS_INVALID_DEPENDENCY=26]="CONSTRAINTS_INVALID_DEPENDENCY",te[te.CANT_SUGGEST_RESOLUTIONS=27]="CANT_SUGGEST_RESOLUTIONS",te[te.FROZEN_LOCKFILE_EXCEPTION=28]="FROZEN_LOCKFILE_EXCEPTION",te[te.CROSS_DRIVE_VIRTUAL_LOCAL=29]="CROSS_DRIVE_VIRTUAL_LOCAL",te[te.FETCH_FAILED=30]="FETCH_FAILED",te[te.DANGEROUS_NODE_MODULES=31]="DANGEROUS_NODE_MODULES",te[te.NODE_GYP_INJECTED=32]="NODE_GYP_INJECTED",te[te.AUTHENTICATION_NOT_FOUND=33]="AUTHENTICATION_NOT_FOUND",te[te.INVALID_CONFIGURATION_KEY=34]="INVALID_CONFIGURATION_KEY",te[te.NETWORK_ERROR=35]="NETWORK_ERROR",te[te.LIFECYCLE_SCRIPT=36]="LIFECYCLE_SCRIPT",te[te.CONSTRAINTS_MISSING_FIELD=37]="CONSTRAINTS_MISSING_FIELD",te[te.CONSTRAINTS_INCOMPATIBLE_FIELD=38]="CONSTRAINTS_INCOMPATIBLE_FIELD",te[te.CONSTRAINTS_EXTRANEOUS_FIELD=39]="CONSTRAINTS_EXTRANEOUS_FIELD",te[te.CONSTRAINTS_INVALID_FIELD=40]="CONSTRAINTS_INVALID_FIELD",te[te.AUTHENTICATION_INVALID=41]="AUTHENTICATION_INVALID",te[te.PROLOG_UNKNOWN_ERROR=42]="PROLOG_UNKNOWN_ERROR",te[te.PROLOG_SYNTAX_ERROR=43]="PROLOG_SYNTAX_ERROR",te[te.PROLOG_EXISTENCE_ERROR=44]="PROLOG_EXISTENCE_ERROR",te[te.STACK_OVERFLOW_RESOLUTION=45]="STACK_OVERFLOW_RESOLUTION",te[te.AUTOMERGE_FAILED_TO_PARSE=46]="AUTOMERGE_FAILED_TO_PARSE",te[te.AUTOMERGE_IMMUTABLE=47]="AUTOMERGE_IMMUTABLE",te[te.AUTOMERGE_SUCCESS=48]="AUTOMERGE_SUCCESS",te[te.AUTOMERGE_REQUIRED=49]="AUTOMERGE_REQUIRED",te[te.DEPRECATED_CLI_SETTINGS=50]="DEPRECATED_CLI_SETTINGS",te[te.PLUGIN_NAME_NOT_FOUND=51]="PLUGIN_NAME_NOT_FOUND",te[te.INVALID_PLUGIN_REFERENCE=52]="INVALID_PLUGIN_REFERENCE",te[te.CONSTRAINTS_AMBIGUITY=53]="CONSTRAINTS_AMBIGUITY
|
|||
|
|
|||
|
${this.candidates.map(({usage:n})=>`$ ${n}`).join(`
|
|||
|
`)}`}else if(this.candidates.length===1){let[{usage:i}]=this.candidates;this.message=`Command not found; did you mean:
|
|||
|
|
|||
|
$ ${i}
|
|||
|
${mQ(e)}`}else this.message=`Command not found; did you mean one of:
|
|||
|
|
|||
|
${this.candidates.map(({usage:i},n)=>`${`${n}.`.padStart(4)} ${i}`).join(`
|
|||
|
`)}
|
|||
|
|
|||
|
${mQ(e)}`}},IQ=class extends Error{constructor(e,r){super();this.input=e,this.usages=r,this.clipanion={type:"none"},this.name="AmbiguousSyntaxError",this.message=`Cannot find which to pick amongst the following alternatives:
|
|||
|
|
|||
|
${this.usages.map((i,n)=>`${`${n}.`.padStart(4)} ${i}`).join(`
|
|||
|
`)}
|
|||
|
|
|||
|
${mQ(e)}`}},mQ=t=>`While running ${t.filter(e=>e!==Fr).map(e=>{let r=JSON.stringify(e);return e.match(/\s/)||e.length===0||r!==`"${e}"`?r:e}).join(" ")}`;var Gg=Symbol("clipanion/isOption");function ti(t){return V(k({},t),{[Gg]:!0})}function $n(t,e){return typeof t=="undefined"?[t,e]:typeof t=="object"&&t!==null&&!Array.isArray(t)?[void 0,t]:[t,e]}function MC(t,e=!1){let r=t.replace(/^\.: /,"");return e&&(r=r[0].toLowerCase()+r.slice(1)),r}function qg(t,e){return e.length===1?new me(`${t}: ${MC(e[0],!0)}`):new me(`${t}:
|
|||
|
${e.map(r=>`
|
|||
|
- ${MC(r)}`).join("")}`)}function OC(t,e,r){if(typeof r=="undefined")return e;let i=[],n=[],s=a=>{let l=e;return e=a,s.bind(null,l)};if(!r(e,{errors:i,coercions:n,coercion:s}))throw qg(`Invalid value for ${t}`,i);for(let[,a]of n)a();return e}var fe=class{constructor(){this.help=!1}static Usage(e){return e}async catch(e){throw e}async validateAndExecute(){let r=this.constructor.schema;if(typeof r!="undefined"){let{isDict:n,isUnknown:s,applyCascade:o}=await Promise.resolve().then(()=>(No(),Ul)),a=o(n(s()),r),l=[],c=[];if(!a(this,{errors:l,coercions:c}))throw qg("Invalid option schema",l);for(let[,g]of c)g()}let i=await this.execute();return typeof i!="undefined"?i:0}};fe.isOption=Gg;fe.Default=[];function yi(t){vO&&console.log(t)}var HO={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:Tl};function YO(){return{nodes:[ri(),ri(),ri()]}}function nce(t){let e=YO(),r=[],i=e.nodes.length;for(let n of t){r.push(i);for(let s=0;s<n.nodes.length;++s)GO(s)||e.nodes.push(ice(n.nodes[s],i));i+=n.nodes.length-2}for(let n of r)Yl(e,_a,n);return e}function kn(t,e){return t.nodes.push(e),t.nodes.length-1}function sce(t){let e=new Set,r=i=>{if(e.has(i))return;e.add(i);let n=t.nodes[i];for(let o of Object.values(n.statics))for(let{to:a}of o)r(a);for(let[,{to:o}]of n.dynamics)r(o);for(let{to:o}of n.shortcuts)r(o);let s=new Set(n.shortcuts.map(({to:o})=>o));for(;n.shortcuts.length>0;){let{to:o}=n.shortcuts.shift(),a=t.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:h})=>g.to===h)||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))}};r(_a)}function oce(t,{prefix:e=""}={}){yi(`${e}Nodes are:`);for(let r=0;r<t.nodes.length;++r)yi(`${e} ${r}: ${JSON.stringify(t.nodes[r])}`)}function qO(t,e,r=!1){yi(`Running a vm on ${JSON.stringify(e)}`);let i=[{node:_a,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null}}];oce(t,{prefix:" "});let n=[pQ,...e];for(let s=0;s<n.length;++s){let o=n[s];yi(` Processing ${JSON.stringify(o)}`);let a=[];for(let{node:l,state:c}of i){yi(` Current node is ${l}`);let u=t.nodes[l];if(l===ei){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(!r||s<n.length-1||g)if(g){let h=u.statics[o];for(let{to:f,reducer:p}of h)a.push({node:f,state:typeof p!="undefined"?TC(bQ,p,c,o):c}),yi(` Static transition to ${f} found`)}else yi(" No static transition found");else{let h=!1;for(let f of Object.keys(u.statics))if(!!f.startsWith(o)){if(o===f)for(let{to:p,reducer:m}of u.statics[f])a.push({node:p,state:typeof m!="undefined"?TC(bQ,m,c,o):c}),yi(` Static transition to ${p} found`);else for(let{to:p}of u.statics[f])a.push({node:p,state:V(k({},c),{remainder:f.slice(o.length)})}),yi(` Static transition to ${p} found (partial match)`);h=!0}h||yi(" No partial static transition found")}if(o!==Fr)for(let[h,{to:f,reducer:p}]of u.dynamics)TC(UC,h,c,o)&&(a.push({node:f,state:typeof p!="undefined"?TC(bQ,p,c,o):c}),yi(` Dynamic transition to ${f} found (via ${h})`))}if(a.length===0&&o===Fr&&e.length===1)return[{node:_a,state:HO}];if(a.length===0)throw new Yg(e,i.filter(({node:l})=>l!==ei).map(({state:l})=>({usage:l.candidateUsage,reason:null})));if(a.every(({node:l})=>l===ei))throw new Yg(e,a.map(({state:l})=>({usage:l.candidateUsage,reason:l.errorMessage})));i=ace(a)}if(i.length>0){yi(" Results:");for(let s of i)yi(` - ${s.node} -> ${JSON.stringify(s.state)}`)}else yi(" No results");return i}function Ace(t,e){if(e.selectedIndex!==null)return!0;if(Object.prototype.hasOwnProperty.call(t.statics,Fr)){for(let{to:r}of t.statics[Fr])if(r===Hg)return!0}return!1}function cce(t,
|
|||
|
`),t=t.replace(/^[\t ]+|[\t ]+$/gm,""),t=t.replace(/^\n+|\n+$/g,""),t=t.replace(/^-([^\n]*?)\n+/gm,`-$1
|
|||
|
|
|||
|
`),t=t.replace(/\n(\n)?\n*/g,"$1"),r&&(t=t.split(/\n/).map(i=>{let n=i.match(/^[*-][\t ]+(.*)/);return n?n[1].match(/(.{1,78})(?: |$)/g).map((s,o)=>(o===0?"- ":" ")+s).join(`
|
|||
|
`):i.match(/(.{1,80})(?: |$)/g).join(`
|
|||
|
`)}).join(`
|
|||
|
|
|||
|
`)),t=t.replace(/(`+)((?:.|[\n])*?)\1/g,(i,n,s)=>e.code(n+s+n)),t=t.replace(/(\*\*)((?:.|[\n])*?)\1/g,(i,n,s)=>e.bold(n+s+n)),t?`${t}
|
|||
|
`:""}var Jg=class extends fe{constructor(e){super();this.contexts=e,this.commands=[]}static from(e,r){let i=new Jg(r);i.path=e.path;for(let n of e.options)switch(n.name){case"-c":i.commands.push(Number(n.value));break;case"-i":i.index=Number(n.value);break}return i}async execute(){let e=this.commands;if(typeof this.index!="undefined"&&this.index>=0&&this.index<e.length&&(e=[e[this.index]]),e.length===0)this.context.stdout.write(this.cli.usage());else if(e.length===1)this.context.stdout.write(this.cli.usage(this.contexts[e[0]].commandClass,{detailed:!0}));else if(e.length>1){this.context.stdout.write(`Multiple commands match your selection:
|
|||
|
`),this.context.stdout.write(`
|
|||
|
`);let r=0;for(let i of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[i].commandClass,{prefix:`${r++}. `.padStart(5)}));this.context.stdout.write(`
|
|||
|
`),this.context.stdout.write(`Run again with -h=<index> to see the longer details of any of those commands.
|
|||
|
`)}}};var VO=Symbol("clipanion/errorCommand");function fce(){return process.env.FORCE_COLOR==="0"?!1:!!(process.env.FORCE_COLOR==="1"||typeof process.stdout!="undefined"&&process.stdout.isTTY)}var es=class{constructor({binaryLabel:e,binaryName:r="...",binaryVersion:i,enableColors:n=fce()}={}){this.registrations=new Map,this.builder=new jg({binaryName:r}),this.binaryLabel=e,this.binaryName=r,this.binaryVersion=i,this.enableColors=n}static from(e,r={}){let i=new es(r);for(let n of e)i.register(n);return i}register(e){var r;let i=new Map,n=new e;for(let l in n){let c=n[l];typeof c=="object"&&c!==null&&c[fe.isOption]&&i.set(l,c)}let s=this.builder.command(),o=s.cliIndex,a=(r=e.paths)!==null&&r!==void 0?r:n.paths;if(typeof a!="undefined")for(let l of a)s.addPath(l);this.registrations.set(e,{specs:i,builder:s,index:o});for(let[l,{definition:c}]of i.entries())c(s,l);s.setContext({commandClass:e})}process(e){let{contexts:r,process:i}=this.builder.compile(),n=i(e);switch(n.selectedIndex){case Tl:return Jg.from(n,r);default:{let{commandClass:s}=r[n.selectedIndex],o=this.registrations.get(s);if(typeof o=="undefined")throw new Error("Assertion failed: Expected the command class to have been registered.");let a=new s;a.path=n.path;try{for(let[l,{transformer:c}]of o.specs.entries())a[l]=c(o.builder,l,n);return a}catch(l){throw l[VO]=a,l}}break}}async run(e,r){let i;if(!Array.isArray(e))i=e;else try{i=this.process(e)}catch(s){return r.stdout.write(this.error(s)),1}if(i.help)return r.stdout.write(this.usage(i,{detailed:!0})),0;i.context=r,i.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableColors:this.enableColors,definitions:()=>this.definitions(),error:(s,o)=>this.error(s,o),process:s=>this.process(s),run:(s,o)=>this.run(s,k(k({},r),o)),usage:(s,o)=>this.usage(s,o)};let n;try{n=await i.validateAndExecute().catch(s=>i.catch(s).then(()=>0))}catch(s){return r.stdout.write(this.error(s,{command:i})),1}return n}async runExit(e,r){process.exitCode=await this.run(e,r)}suggest(e,r){let{suggest:i}=this.builder.compile();return i(e,r)}definitions({colored:e=!1}={}){let r=[];for(let[i,{index:n}]of this.registrations){if(typeof i.usage=="undefined")continue;let{usage:s}=this.getUsageByIndex(n,{detailed:!1}),{usage:o,options:a}=this.getUsageByIndex(n,{detailed:!0,inlineOptions:!1}),l=typeof i.usage.category!="undefined"?on(i.usage.category,{format:this.format(e),paragraphs:!1}):void 0,c=typeof i.usage.description!="undefined"?on(i.usage.description,{format:this.format(e),paragraphs:!1}):void 0,u=typeof i.usage.details!="undefined"?on(i.usage.details,{format:this.format(e),paragraphs:!0}):void 0,g=typeof i.usage.examples!="undefined"?i.usage.examples.map(([h,f])=>[on(h,{format:this.format(e),paragraphs:!1}),f.replace(/\$0/g,this.binaryName)]):void 0;r.push({path:s,usage:o,category:l,description:c,details:u,examples:g,options:a})}return r}usage(e=null,{colored:r,detailed:i=!1,prefix:n="$ "}={}){let s=e!==null&&e instanceof fe?e.constructor:e,o="";if(s)if(i){let{description:a="",details:l="",examples:c=[]}=s.usage||{};a!==""&&(o+=on(a,{format:this.format(r),paragraphs:!1}).replace(/^./,h=>h.toUpperCase()),o+=`
|
|||
|
`),(l!==""||c.length>0)&&(o+=`${this.format(r).header("Usage")}
|
|||
|
`,o+=`
|
|||
|
`);let{usage:u,options:g}=this.getUsageByRegistration(s,{inlineOptions:!1});if(o+=`${this.format(r).bold(n)}${u}
|
|||
|
`,g.length>0){o+=`
|
|||
|
`,o+=`${DQ.header("Options")}
|
|||
|
`;let h=g.reduce((f,p)=>Math.max(f,p.definition.length),0);o+=`
|
|||
|
`;for(let{definition:f,description:p}of g)o+=` ${this.format(r).bold(f.padEnd(h))} ${on(p,{format:this.format(r),paragraphs:!1})}`}if(l!==""&&(o+=`
|
|||
|
`,o+=`${this.format(r).header("Details")}
|
|||
|
`,o+=`
|
|||
|
`,o+=on(l,{format:this.format(r),paragraphs:!0})),c.length>0){o+=`
|
|||
|
`,o+=`${this.format(r).header("Examples")}
|
|||
|
`;for(let[h,f]of c)o+=`
|
|||
|
`,o+=on(h,{format:this.format(r),paragraphs:!1}),o+=`${f.replace(/^/m,` ${this.format(r).bold(n)}`).replace(/\$0/g,this.binaryName)}
|
|||
|
`}}else{let{usage:a}=this.getUsageByRegistration(s);o+=`${this.format(r).bold(n)}${a}
|
|||
|
`}else{let a=new Map;for(let[g,{index:h}]of this.registrations.entries()){if(typeof g.usage=="undefined")continue;let f=typeof g.usage.category!="undefined"?on(g.usage.category,{format:this.format(r),paragraphs:!1}):null,p=a.get(f);typeof p=="undefined"&&a.set(f,p=[]);let{usage:m}=this.getUsageByIndex(h);p.push({commandClass:g,usage:m})}let l=Array.from(a.keys()).sort((g,h)=>g===null?-1:h===null?1:g.localeCompare(h,"en",{usage:"sort",caseFirst:"upper"})),c=typeof this.binaryLabel!="undefined",u=typeof this.binaryVersion!="undefined";c||u?(c&&u?o+=`${this.format(r).header(`${this.binaryLabel} - ${this.binaryVersion}`)}
|
|||
|
|
|||
|
`:c?o+=`${this.format(r).header(`${this.binaryLabel}`)}
|
|||
|
`:o+=`${this.format(r).header(`${this.binaryVersion}`)}
|
|||
|
`,o+=` ${this.format(r).bold(n)}${this.binaryName} <command>
|
|||
|
`):o+=`${this.format(r).bold(n)}${this.binaryName} <command>
|
|||
|
`;for(let g of l){let h=a.get(g).slice().sort((p,m)=>p.usage.localeCompare(m.usage,"en",{usage:"sort",caseFirst:"upper"})),f=g!==null?g.trim():"General commands";o+=`
|
|||
|
`,o+=`${this.format(r).header(`${f}`)}
|
|||
|
`;for(let{commandClass:p,usage:m}of h){let I=p.usage.description||"undocumented";o+=`
|
|||
|
`,o+=` ${this.format(r).bold(m)}
|
|||
|
`,o+=` ${on(I,{format:this.format(r),paragraphs:!1})}`}}o+=`
|
|||
|
`,o+=on("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(r),paragraphs:!0})}return o}error(e,r){var i,{colored:n,command:s=(i=e[VO])!==null&&i!==void 0?i:null}=r===void 0?{}:r;e instanceof Error||(e=new Error(`Execution failed with a non-error rejection (rejected value: ${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}
|
|||
|
`;let l=e.clipanion;return typeof l!="undefined"?l.type==="usage"&&(o+=`
|
|||
|
`,o+=this.usage(s)):e.stack&&(o+=`${e.stack.replace(/^.*\n/,"")}
|
|||
|
`),o}getUsageByRegistration(e,r){let i=this.registrations.get(e);if(typeof i=="undefined")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(i.index,r)}getUsageByIndex(e,r){return this.builder.getBuilderByIndex(e).usage(r)}format(e=this.enableColors){return e?DQ:zO}};es.defaultContext={stdin:process.stdin,stdout:process.stdout,stderr:process.stderr};var PQ={};$e(PQ,{DefinitionsCommand:()=>HC,HelpCommand:()=>YC,VersionCommand:()=>GC});var HC=class extends fe{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}
|
|||
|
`)}};HC.path=[["--clipanion=definitions"]];var YC=class extends fe{async execute(){this.context.stdout.write(this.cli.usage(null))}};YC.paths=[["-h"],["--help"]];var GC=class extends fe{async execute(){var e;this.context.stdout.write(`${(e=this.cli.binaryVersion)!==null&&e!==void 0?e:"<unknown>"}
|
|||
|
`)}};GC.paths=[["-v"],["--version"]];var j={};$e(j,{Array:()=>XO,Boolean:()=>ZO,Counter:()=>_O,Proxy:()=>$O,Rest:()=>eK,String:()=>tK,applyValidator:()=>OC,cleanValidationError:()=>MC,formatError:()=>qg,isOptionSymbol:()=>Gg,makeCommandOption:()=>ti,rerouteArguments:()=>$n});function XO(t,e,r){let[i,n]=$n(e,r!=null?r:{}),{arity:s=1}=n,o=t.split(","),a=new Set(o);return ti({definition(l){l.addOption({names:o,arity:s,hidden:n==null?void 0:n.hidden,description:n==null?void 0:n.description,required:n.required})},transformer(l,c,u){let g=typeof i!="undefined"?[...i]:void 0;for(let{name:h,value:f}of u.options)!a.has(h)||(g=g!=null?g:[],g.push(f));return g}})}function ZO(t,e,r){let[i,n]=$n(e,r!=null?r:{}),s=t.split(","),o=new Set(s);return ti({definition(a){a.addOption({names:s,allowBinding:!1,arity:0,hidden:n.hidden,description:n.description,required:n.required})},transformer(a,l,c){let u=i;for(let{name:g,value:h}of c.options)!o.has(g)||(u=h);return u}})}function _O(t,e,r){let[i,n]=$n(e,r!=null?r:{}),s=t.split(","),o=new Set(s);return ti({definition(a){a.addOption({names:s,allowBinding:!1,arity:0,hidden:n.hidden,description:n.description,required:n.required})},transformer(a,l,c){let u=i;for(let{name:g,value:h}of c.options)!o.has(g)||(u!=null||(u=0),h?u+=1:u=0);return u}})}function $O(t={}){return ti({definition(e,r){var i;e.addProxy({name:(i=t.name)!==null&&i!==void 0?i:r,required:t.required})},transformer(e,r,i){return i.positionals.map(({value:n})=>n)}})}function eK(t={}){return ti({definition(e,r){var i;e.addRest({name:(i=t.name)!==null&&i!==void 0?i:r,required:t.required})},transformer(e,r,i){let n=o=>{let a=i.positionals[o];return a.extra===Ui||a.extra===!1&&o<e.arity.leading.length},s=0;for(;s<i.positionals.length&&n(s);)s+=1;return i.positionals.splice(0,s).map(({value:o})=>o)}})}function pce(t,e,r){let[i,n]=$n(e,r!=null?r:{}),{arity:s=1}=n,o=t.split(","),a=new Set(o);return ti({definition(l){l.addOption({names:o,arity:n.tolerateBoolean?0:s,hidden:n.hidden,description:n.description,required:n.required})},transformer(l,c,u){let g,h=i;for(let{name:f,value:p}of u.options)!a.has(f)||(g=f,h=p);return typeof h=="string"?OC(g!=null?g:c,h,n.validator):h}})}function dce(t={}){let{required:e=!0}=t;return ti({definition(r,i){var n;r.addPositional({name:(n=t.name)!==null&&n!==void 0?n:i,required:t.required})},transformer(r,i,n){for(let s=0;s<n.positionals.length;++s){if(n.positionals[s].extra===Ui||e&&n.positionals[s].extra===!0||!e&&n.positionals[s].extra===!1)continue;let[o]=n.positionals.splice(s,1);return o.value}}})}function tK(t,...e){return typeof t=="string"?pce(t,...e):dce(t)}var rK=ee(Ti()),kQ=ee(require("stream"));function Cce(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vQ(t){}function FQ(t){throw new Error(`Assertion failed: Unexpected object '${t}'`)}function mce(t,e){if(!Object.values(t).includes(e))throw new Error("Assertion failed: Invalid value for enumeration");return e}function tA(t,e){let r=[];for(let i of t){let n=e(i);n!==iK&&r.push(n)}return r}var iK=Symbol();tA.skip=iK;function sK(t,e){for(let r of t){let i=e(r);if(i!==nK)return i}}var nK=Symbol();sK.skip=nK;function RQ(t){return typeof t=="object"&&t!==null}function qC(t){if(t instanceof Map&&(t=Object.fromEntries(t)),RQ(t))for(let e of Object.keys(t)){let r=t[e];RQ(r)&&(t[e]=qC(r))}return t}function Os(t,e,r){let i=t.get(e);return typeof i=="undefined"&&t.set(e,i=r()),i}function Gl(t,e){let r=t.get(e);return typeof r=="undefined"&&t.set(e,r=[]),r}function rA(t,e){let r=t.get(e);return typeof r=="undefined"&&t.set(e,r=new Set),r}function ql(t,e){let r=t.get(e);return typeof r=="undefined"&&t.set(e,r=new Map),r}async function Ice(t,e){if(e==null)return await t();try{return await t()}finally{await e()}}async function jC(t,e){try{return await t()}catch(r){throw r.message=e(r.message),r}}function zg(t,e){try{return t()}catch(r){throw r.message=e(r.message),r}}async function Vg(t){return await new Promise((e,r)=>{let i=[];t.on("error",n=>{r(n)}),t.on("data",n=>{i.push(n)}),t.on("end",()=>{e(Buffer.concat(i))})})}var oK=class extends kQ.Transform{
|
|||
|
`),a!==-1){let l=n+o.substr(0,a);o=o.substr(a+1),n="",e!==null?this.reportInfo(null,`${e} ${l}`):this.reportInfo(null,l)}while(a!==-1);n+=o}),r.on("end",()=>{let s=i.end();s!==""&&(e!==null?this.reportInfo(null,`${e} ${s}`):this.reportInfo(null,s))}),r}};var PG=ee(sI()),kG=new Map,vG=new Map,uIe=new DG.Agent({keepAlive:!0}),gIe=new xG.Agent({keepAlive:!0});function FG(t){let e=new oI.URL(t),r={host:e.hostname,headers:{}};return e.port&&(r.port=Number(e.port)),{proxy:r}}async function hIe(t){return Os(vG,t,()=>M.readFilePromise(t).then(e=>(vG.set(t,e),e)))}function fIe({statusCode:t,statusMessage:e},r){let i=je(r,t,ve.NUMBER),n=`https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/${t}`;return ic(r,`${i}${e?` (${e})`:""}`,n)}async function aI(t,{configuration:e,customErrorMessage:r}){var i,n;try{return await t}catch(s){if(s.name!=="HTTPError")throw s;let o=(n=r==null?void 0:r(s))!=null?n:(i=s.response.body)==null?void 0:i.error;o==null&&(s.message.startsWith("Response code")?o="The remote server failed to provide the requested resource":o=s.message),s instanceof SG.TimeoutError&&s.event==="socket"&&(o+=`(can be increased via ${je(e,"httpTimeout",ve.SETTING)})`);let a=new Ze(z.NETWORK_ERROR,o,l=>{s.response&&l.reportError(z.NETWORK_ERROR,` ${CA(e,{label:"Response Code",value:dA(ve.NO_HINT,fIe(s.response,e))})}`),s.request&&(l.reportError(z.NETWORK_ERROR,` ${CA(e,{label:"Request Method",value:dA(ve.NO_HINT,s.request.options.method)})}`),l.reportError(z.NETWORK_ERROR,` ${CA(e,{label:"Request URL",value:dA(ve.URL,s.request.requestUrl)})}`)),s.request.redirects.length>0&&l.reportError(z.NETWORK_ERROR,` ${CA(e,{label:"Request Redirects",value:dA(ve.NO_HINT,u0(e,s.request.redirects,ve.URL))})}`),s.request.retryCount===s.request.options.retry.limit&&l.reportError(z.NETWORK_ERROR,` ${CA(e,{label:"Request Retry Count",value:dA(ve.NO_HINT,`${je(e,s.request.retryCount,ve.NUMBER)} (can be increased via ${je(e,"httpRetry",ve.SETTING)})`)})}`)});throw a.originalError=s,a}}function RG(t,e){let r=[...e.configuration.get("networkSettings")].sort(([o],[a])=>a.length-o.length),i={enableNetwork:void 0,caFilePath:void 0,httpProxy:void 0,httpsProxy:void 0},n=Object.keys(i),s=typeof t=="string"?new oI.URL(t):t;for(let[o,a]of r)if(SS.default.isMatch(s.hostname,o))for(let l of n){let c=a.get(l);c!==null&&typeof i[l]=="undefined"&&(i[l]=c)}for(let o of n)typeof i[o]=="undefined"&&(i[o]=e.configuration.get(o));return i}var IA;(function(n){n.GET="GET",n.PUT="PUT",n.POST="POST",n.DELETE="DELETE"})(IA||(IA={}));async function Rh(t,e,{configuration:r,headers:i,jsonRequest:n,jsonResponse:s,method:o=IA.GET}){let a=typeof t=="string"?new oI.URL(t):t,l=RG(a,{configuration:r});if(l.enableNetwork===!1)throw new Error(`Request to '${a.href}' has been blocked because of your configuration settings`);if(a.protocol==="http:"&&!SS.default.isMatch(a.hostname,r.get("unsafeHttpWhitelist")))throw new Error(`Unsafe http requests must be explicitly whitelisted in your configuration (${a.hostname})`);let u={agent:{http:l.httpProxy?xS.default.httpOverHttp(FG(l.httpProxy)):uIe,https:l.httpsProxy?xS.default.httpsOverHttp(FG(l.httpsProxy)):gIe},headers:i,method:o};u.responseType=s?"json":"buffer",e!==null&&(Buffer.isBuffer(e)||!n&&typeof e=="string"?u.body=e:u.json=e);let g=r.get("httpTimeout"),h=r.get("httpRetry"),f=r.get("enableStrictSsl"),p=l.caFilePath,{default:m}=await Promise.resolve().then(()=>ee(sI())),I=p?await hIe(p):void 0,y=m.extend(k({timeout:{socket:g},retry:h,https:{rejectUnauthorized:f,certificateAuthority:I}},u));return r.getLimit("networkConcurrency")(()=>y(a))}async function pIe(t,n){var s=n,{configuration:e,jsonResponse:r}=s,i=vr(s,["configuration","jsonResponse"]);let o=Os(kG,t,()=>aI(Rh(t,null,k({configuration:e},i)),{configuration:e}).then(a=>(kG.set(t,a.body),a.body)));return Buffer.isBuffer(o)===!1&&(o=await o),r?JSON.parse(o.toString()):o}async function dIe(t,e,n){var s=n,{customErrorMessage:r}=s,i=vr(s,["customErrorMessage"]);return(await aI(Rh(t,e,V(k({},i),{method:IA.PUT})),i)).body}async function DS(t,e,n){var s=n,{customErrorMessage:r
|
|||
|
`;if(typeof t=="number"||typeof t=="boolean")return`${t.toString()}
|
|||
|
`;if(typeof t=="string")return`${AJ(t)}
|
|||
|
`;if(Array.isArray(t)){if(t.length===0)return`[]
|
|||
|
`;let i=" ".repeat(e);return`
|
|||
|
${t.map(s=>`${i}- ${hx(s,e+1,!1)}`).join("")}`}if(typeof t=="object"&&t){let i,n;t instanceof gx?(i=t.data,n=!1):(i=t,n=!0);let s=" ".repeat(e),o=Object.keys(i);n&&o.sort((l,c)=>{let u=aJ.indexOf(l),g=aJ.indexOf(c);return u===-1&&g===-1?l<c?-1:l>c?1:0:u!==-1&&g===-1?-1:u===-1&&g!==-1?1:u-g});let a=o.filter(l=>!lJ(i[l])).map((l,c)=>{let u=i[l],g=AJ(l),h=hx(u,e+1,!0),f=c>0||r?s:"";return h.startsWith(`
|
|||
|
`)?`${f}${g}:${h}`:`${f}${g}: ${h}`}).join(e===0?`
|
|||
|
`:"")||`
|
|||
|
`;return r?`
|
|||
|
${a}`:`${a}`}throw new Error(`Unsupported value type (${t})`)}function $s(t){try{let e=hx(t,0,!1);return e!==`
|
|||
|
`?e:""}catch(e){throw e.location&&(e.message=e.message.replace(/(\.)?$/,` (line ${e.location.start.line}, column ${e.location.start.column})$1`)),e}}$s.PreserveOrdering=gx;function rwe(t){return t.endsWith(`
|
|||
|
`)||(t+=`
|
|||
|
`),(0,oJ.parse)(t)}var iwe=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i;function nwe(t){if(iwe.test(t))return rwe(t);let e=(0,NI.safeLoad)(t,{schema:NI.FAILSAFE_SCHEMA,json:!0});if(e==null)return{};if(typeof e!="object")throw new Error(`Expected an indexed object, got a ${typeof e} instead. Does your file follow Yaml's rules?`);if(Array.isArray(e))throw new Error("Expected an indexed object, got an array instead. Does your file follow Yaml's rules?");return e}function Nr(t){return nwe(t)}var yJ=ee($w()),BJ=ee(require("os")),Yi=ee(require("stream")),wJ=ee(require("util"));var ra=class extends Error{constructor(e){super(e);this.name="ShellError"}};var MI={};$e(MI,{fastGlobOptions:()=>gJ,isBraceExpansion:()=>hJ,isGlobPattern:()=>swe,match:()=>owe,micromatchOptions:()=>KI});var cJ=ee(Qm()),uJ=ee(require("fs")),OI=ee(Ti()),KI={strictBrackets:!0},gJ={onlyDirectories:!1,onlyFiles:!1};function swe(t){if(!OI.default.scan(t,KI).isGlob)return!1;try{OI.default.parse(t,KI)}catch{return!1}return!0}function owe(t,{cwd:e,baseFs:r}){return(0,cJ.default)(t,V(k({},gJ),{cwd:L.fromPortablePath(e),fs:BC(uJ.default,new xg(r))}))}function hJ(t){return OI.default.scan(t,KI).isBrace}var fJ=ee(Nw()),as=ee(require("stream")),pJ=ee(require("string_decoder")),xi;(function(i){i[i.STDIN=0]="STDIN",i[i.STDOUT=1]="STDOUT",i[i.STDERR=2]="STDERR"})(xi||(xi={}));var FA=new Set;function fx(){}function px(){for(let t of FA)t.kill()}function dJ(t,e,r,i){return n=>{let s=n[0]instanceof as.Transform?"pipe":n[0],o=n[1]instanceof as.Transform?"pipe":n[1],a=n[2]instanceof as.Transform?"pipe":n[2],l=(0,fJ.default)(t,e,V(k({},i),{stdio:[s,o,a]}));return FA.add(l),FA.size===1&&(process.on("SIGINT",fx),process.on("SIGTERM",px)),n[0]instanceof as.Transform&&n[0].pipe(l.stdin),n[1]instanceof as.Transform&&l.stdout.pipe(n[1],{end:!1}),n[2]instanceof as.Transform&&l.stderr.pipe(n[2],{end:!1}),{stdin:l.stdin,promise:new Promise(c=>{l.on("error",u=>{switch(FA.delete(l),FA.size===0&&(process.off("SIGINT",fx),process.off("SIGTERM",px)),u.code){case"ENOENT":n[2].write(`command not found: ${t}
|
|||
|
`),c(127);break;case"EACCES":n[2].write(`permission denied: ${t}
|
|||
|
`),c(128);break;default:n[2].write(`uncaught error: ${u.message}
|
|||
|
`),c(1);break}}),l.on("exit",u=>{FA.delete(l),FA.size===0&&(process.off("SIGINT",fx),process.off("SIGTERM",px)),c(u!==null?u:129)})})}}}function CJ(t){return e=>{let r=e[0]==="pipe"?new as.PassThrough:e[0];return{stdin:r,promise:Promise.resolve().then(()=>t({stdin:r,stdout:e[1],stderr:e[2]}))}}}var Mn=class{constructor(e){this.stream=e}close(){}get(){return this.stream}},mJ=class{constructor(){this.stream=null}close(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");this.stream.end()}attach(e){this.stream=e}get(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");return this.stream}},Wh=class{constructor(e,r){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=e,this.implementation=r}static start(e,{stdin:r,stdout:i,stderr:n}){let s=new Wh(null,e);return s.stdin=r,s.stdout=i,s.stderr=n,s}pipeTo(e,r=1){let i=new Wh(this,e),n=new mJ;return i.pipe=n,i.stdout=this.stdout,i.stderr=this.stderr,(r&1)==1?this.stdout=n:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(r&2)==2?this.stderr=n:this.ancestor!==null&&(this.stderr=this.ancestor.stderr),i}async exec(){let e=["ignore","ignore","ignore"];if(this.pipe)e[0]="pipe";else{if(this.stdin===null)throw new Error("Assertion failed: No input stream registered");e[0]=this.stdin.get()}let r;if(this.stdout===null)throw new Error("Assertion failed: No output stream registered");r=this.stdout,e[1]=r.get();let i;if(this.stderr===null)throw new Error("Assertion failed: No error stream registered");i=this.stderr,e[2]=i.get();let n=this.implementation(e);return this.pipe&&this.pipe.attach(n.stdin),await n.promise.then(s=>(r.close(),i.close(),s))}async run(){let e=[];for(let i=this;i;i=i.ancestor)e.push(i.exec());return(await Promise.all(e))[0]}};function TI(t,e){return Wh.start(t,e)}function IJ(t,e=null){let r=new as.PassThrough,i=new pJ.StringDecoder,n="";return r.on("data",s=>{let o=i.write(s),a;do if(a=o.indexOf(`
|
|||
|
`),a!==-1){let l=n+o.substr(0,a);o=o.substr(a+1),n="",t(e!==null?`${e} ${l}`:l)}while(a!==-1);n+=o}),r.on("end",()=>{let s=i.end();s!==""&&t(e!==null?`${e} ${s}`:s)}),r}function EJ(t,{prefix:e}){return{stdout:IJ(r=>t.stdout.write(`${r}
|
|||
|
`),t.stdout.isTTY?e:null),stderr:IJ(r=>t.stderr.write(`${r}
|
|||
|
`),t.stderr.isTTY?e:null)}}var awe=(0,wJ.promisify)(setTimeout);var Jr;(function(r){r[r.Readable=1]="Readable",r[r.Writable=2]="Writable"})(Jr||(Jr={}));function QJ(t,e,r){let i=new Yi.PassThrough({autoDestroy:!0});switch(t){case xi.STDIN:(e&1)==1&&r.stdin.pipe(i,{end:!1}),(e&2)==2&&r.stdin instanceof Yi.Writable&&i.pipe(r.stdin,{end:!1});break;case xi.STDOUT:(e&1)==1&&r.stdout.pipe(i,{end:!1}),(e&2)==2&&i.pipe(r.stdout,{end:!1});break;case xi.STDERR:(e&1)==1&&r.stderr.pipe(i,{end:!1}),(e&2)==2&&i.pipe(r.stderr,{end:!1});break;default:throw new ra(`Bad file descriptor: "${t}"`)}return i}function UI(t,e={}){let r=k(k({},t),e);return r.environment=k(k({},t.environment),e.environment),r.variables=k(k({},t.variables),e.variables),r}var Awe=new Map([["cd",async([t=(0,BJ.homedir)(),...e],r,i)=>{let n=w.resolve(i.cwd,L.toPortablePath(t));return(await r.baseFs.statPromise(n)).isDirectory()?(i.cwd=n,0):(i.stderr.write(`cd: not a directory
|
|||
|
`),1)}],["pwd",async(t,e,r)=>(r.stdout.write(`${L.fromPortablePath(r.cwd)}
|
|||
|
`),0)],[":",async(t,e,r)=>0],["true",async(t,e,r)=>0],["false",async(t,e,r)=>1],["exit",async([t,...e],r,i)=>i.exitCode=parseInt(t!=null?t:i.variables["?"],10)],["echo",async(t,e,r)=>(r.stdout.write(`${t.join(" ")}
|
|||
|
`),0)],["sleep",async([t],e,r)=>{if(typeof t=="undefined")return r.stderr.write(`sleep: missing operand
|
|||
|
`),1;let i=Number(t);return Number.isNaN(i)?(r.stderr.write(`sleep: invalid time interval '${t}'
|
|||
|
`),1):await awe(1e3*i,0)}],["__ysh_run_procedure",async(t,e,r)=>{let i=r.procedures[t[0]];return await TI(i,{stdin:new Mn(r.stdin),stdout:new Mn(r.stdout),stderr:new Mn(r.stderr)}).run()}],["__ysh_set_redirects",async(t,e,r)=>{let i=r.stdin,n=r.stdout,s=r.stderr,o=[],a=[],l=[],c=0;for(;t[c]!=="--";){let g=t[c++],{type:h,fd:f}=JSON.parse(g),p=B=>{switch(f){case null:case 0:o.push(B);break;default:throw new Error(`Unsupported file descriptor: "${f}"`)}},m=B=>{switch(f){case null:case 1:a.push(B);break;case 2:l.push(B);break;default:throw new Error(`Unsupported file descriptor: "${f}"`)}},I=Number(t[c++]),y=c+I;for(let B=c;B<y;++c,++B)switch(h){case"<":p(()=>e.baseFs.createReadStream(w.resolve(r.cwd,L.toPortablePath(t[B]))));break;case"<<<":p(()=>{let D=new Yi.PassThrough;return process.nextTick(()=>{D.write(`${t[B]}
|
|||
|
`),D.end()}),D});break;case"<&":p(()=>QJ(Number(t[B]),1,r));break;case">":case">>":{let D=w.resolve(r.cwd,L.toPortablePath(t[B]));m(D==="/dev/null"?new Yi.Writable({autoDestroy:!0,emitClose:!0,write(F,N,U){setImmediate(U)}}):e.baseFs.createWriteStream(D,h===">>"?{flags:"a"}:void 0))}break;case">&":m(QJ(Number(t[B]),2,r));break;default:throw new Error(`Assertion failed: Unsupported redirection type: "${h}"`)}}if(o.length>0){let g=new Yi.PassThrough;i=g;let h=f=>{if(f===o.length)g.end();else{let p=o[f]();p.pipe(g,{end:!1}),p.on("end",()=>{h(f+1)})}};h(0)}if(a.length>0){let g=new Yi.PassThrough;n=g;for(let h of a)g.pipe(h)}if(l.length>0){let g=new Yi.PassThrough;s=g;for(let h of l)g.pipe(h)}let u=await TI(Vh(t.slice(c+1),e,r),{stdin:new Mn(i),stdout:new Mn(n),stderr:new Mn(s)}).run();return await Promise.all(a.map(g=>new Promise((h,f)=>{g.on("error",p=>{f(p)}),g.on("close",()=>{h()}),g.end()}))),await Promise.all(l.map(g=>new Promise((h,f)=>{g.on("error",p=>{f(p)}),g.on("close",()=>{h()}),g.end()}))),u}]]);async function lwe(t,e,r){let i=[],n=new Yi.PassThrough;return n.on("data",s=>i.push(s)),await HI(t,e,UI(r,{stdout:n})),Buffer.concat(i).toString().replace(/[\r\n]+$/,"")}async function bJ(t,e,r){let i=t.map(async s=>{let o=await RA(s.args,e,r);return{name:s.name,value:o.join(" ")}});return(await Promise.all(i)).reduce((s,o)=>(s[o.name]=o.value,s),{})}function dx(t){return t.match(/[^ \r\n\t]+/g)||[]}async function SJ(t,e,r,i,n=i){switch(t.name){case"$":i(String(process.pid));break;case"#":i(String(e.args.length));break;case"@":if(t.quoted)for(let s of e.args)n(s);else for(let s of e.args){let o=dx(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(t.quoted)i(s);else for(let o of dx(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(t.name,10);if(Number.isFinite(s))if(s>=0&&s<e.args.length)i(e.args[s]);else if(t.defaultValue)i((await RA(t.defaultValue,e,r)).join(" "));else throw new ra(`Unbound argument #${s}`);else if(Object.prototype.hasOwnProperty.call(r.variables,t.name))i(r.variables[t.name]);else if(Object.prototype.hasOwnProperty.call(r.environment,t.name))i(r.environment[t.name]);else if(t.defaultValue)i((await RA(t.defaultValue,e,r)).join(" "));else throw new ra(`Unbound variable "${t.name}"`)}break}}var cwe={addition:(t,e)=>t+e,subtraction:(t,e)=>t-e,multiplication:(t,e)=>t*e,division:(t,e)=>Math.trunc(t/e)};async function Xh(t,e,r){if(t.type==="number"){if(Number.isInteger(t.value))return t.value;throw new Error(`Invalid number: "${t.value}", only integers are allowed`)}else if(t.type==="variable"){let i=[];await SJ(V(k({},t),{quoted:!0}),e,r,s=>i.push(s));let n=Number(i.join(" "));return Number.isNaN(n)?Xh({type:"variable",name:i.join(" ")},e,r):Xh({type:"number",value:n},e,r)}else return cwe[t.type](await Xh(t.left,e,r),await Xh(t.right,e,r))}async function RA(t,e,r){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,h)=>{let f=JSON.stringify({type:u,fd:g}),p=i.get(f);typeof p=="undefined"&&i.set(f,p=[]),p.push(h)};for(let u of t){let g=!1;switch(u.type){case"redirection":{let h=await RA(u.args,e,r);for(let f of h)c(u.subtype,u.fd,f)}break;case"argument":for(let h of u.segments)switch(h.type){case"text":o(h.text);break;case"glob":o(h.pattern),g=!0;break;case"shell":{let f=await lwe(h.shell,e,r);if(h.quoted)o(f);else{let p=dx(f);for(let m=0;m<p.length-1;++m)l(p[m]);o(p[p.length-1])}}break;case"variable":await SJ(h,e,r,o,l);break;case"arithmetic":o(String(await Xh(h.arithmetic,e,r)));break}break}if(a(),g){let h=n.pop();if(typeof h=="undefined")throw new Error("Assertion failed: Expected a glob pattern to have been set");let f=await e.glob.match(h,{cwd:r.cwd,baseFs:e.baseFs});if(f.length===0){let p=hJ(h)?". Note: Brace expansion of arbitrary strings isn't currently supported. For more details, please read this issue: https://github.com/yarnpkg/berry/issues/22":"";throw new ra(`No matches found: "${h}"${p}`)}for(let p of
|
|||
|
`)).finally(()=>{r.stdout.isTTY&&r.stdout.write(`Job ${l}, '${o(Ec(t))}' has ended
|
|||
|
`)})),0}return await DJ(t,e,r)}async function fwe(t,e,r,{background:i=!1}={}){let n,s=a=>{n=a,r.variables["?"]=String(a)},o=async a=>{try{return await hwe(a.chain,e,r,{background:i&&typeof a.then=="undefined"})}catch(l){if(!(l instanceof ra))throw l;return r.stderr.write(`${l.message}
|
|||
|
`),1}};for(s(await o(t));t.then;){if(r.exitCode!==null)return r.exitCode;switch(t.then.type){case"&&":n===0&&s(await o(t.then.line));break;case"||":n!==0&&s(await o(t.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${t.then.type}"`)}t=t.then.line}return n}async function HI(t,e,r){let i=r.backgroundJobs;r.backgroundJobs=[];let n=0;for(let{command:s,type:o}of t){if(n=await fwe(s,e,r,{background:o==="&"}),r.exitCode!==null)return r.exitCode;r.variables["?"]=String(n)}return await Promise.all(r.backgroundJobs),r.backgroundJobs=i,n}function PJ(t){switch(t.type){case"variable":return t.name==="@"||t.name==="#"||t.name==="*"||Number.isFinite(parseInt(t.name,10))||"defaultValue"in t&&!!t.defaultValue&&t.defaultValue.some(e=>YI(e));case"arithmetic":return Cx(t.arithmetic);case"shell":return mx(t.shell);default:return!1}}function YI(t){switch(t.type){case"redirection":return t.args.some(e=>YI(e));case"argument":return t.segments.some(e=>PJ(e));default:throw new Error(`Assertion failed: Unsupported argument type: "${t.type}"`)}}function Cx(t){switch(t.type){case"variable":return PJ(t);case"number":return!1;default:return Cx(t.left)||Cx(t.right)}}function mx(t){return t.some(({command:e})=>{for(;e;){let r=e.chain;for(;r;){let i;switch(r.type){case"subshell":i=mx(r.subshell);break;case"command":i=r.envs.some(n=>n.args.some(s=>YI(s)))||r.args.some(n=>YI(n));break}if(i)return!0;if(!r.then)break;r=r.then.chain}if(!e.then)break;e=e.then.line}return!1})}async function GI(t,e=[],{baseFs:r=new wt,builtins:i={},cwd:n=L.toPortablePath(process.cwd()),env:s=process.env,stdin:o=process.stdin,stdout:a=process.stdout,stderr:l=process.stderr,variables:c={},glob:u=MI}={}){let g={};for(let[p,m]of Object.entries(s))typeof m!="undefined"&&(g[p]=m);let h=new Map(Awe);for(let[p,m]of Object.entries(i))h.set(p,m);o===null&&(o=new Yi.PassThrough,o.end());let f=II(t,u);if(!mx(f)&&f.length>0&&e.length>0){let{command:p}=f[f.length-1];for(;p.then;)p=p.then.line;let m=p.chain;for(;m.then;)m=m.then.chain;m.type==="command"&&(m.args=m.args.concat(e.map(I=>({type:"argument",segments:[{type:"text",text:I}]}))))}return await HI(f,{args:e,baseFs:r,builtins:h,initialStdin:o,initialStdout:a,initialStderr:l,glob:u},{cwd:n,environment:g,exitCode:null,procedures:{},stdin:o,stdout:a,stderr:l,variables:Object.assign({},c,{["?"]:0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}var KW=ee(Qx()),TW=ee(jI()),vc=ee(require("stream"));var xW=ee(Cr());var vt={};$e(vt,{SemVer:()=>QW.SemVer,satisfiesWithPrereleases:()=>_h,validRange:()=>Kn});var JI=ee(Cr()),QW=ee(Cr()),bW=new Map;function _h(t,e,r=!1){if(!t)return!1;let i=`${e}${r}`,n=bW.get(i);if(typeof n=="undefined")try{n=new JI.default.Range(e,{includePrerelease:!0,loose:r})}catch{return!1}finally{bW.set(i,n||null)}else if(n===null)return!1;let s;try{s=new JI.default.SemVer(t,n),s.prerelease&&(s.prerelease=[])}catch(o){return!1}return n.set.some(o=>{for(let a of o)a.semver.prerelease&&(a.semver.prerelease=[]);return o.every(a=>a.test(s))})}var SW=new Map;function Kn(t){if(t.indexOf(":")!==-1)return null;let e=SW.get(t);if(typeof e!="undefined")return e;try{e=new JI.default.Range(t)}catch{e=null}return SW.set(t,e),e}var ia=class{constructor(){this.indent=" ";this.name=null;this.version=null;this.os=null;this.cpu=null;this.type=null;this.private=!1;this.license=null;this.main=null;this.module=null;this.browser=null;this.languageName=null;this.bin=new Map;this.scripts=new Map;this.dependencies=new Map;this.devDependencies=new Map;this.peerDependencies=new Map;this.workspaceDefinitions=[];this.dependenciesMeta=new Map;this.peerDependenciesMeta=new Map;this.resolutions=[];this.files=null;this.publishConfig=null;this.installConfig=null;this.preferUnplugged=null;this.raw={};this.errors=[]}static async tryFind(e,{baseFs:r=new wt}={}){let i=w.join(e,"package.json");return await r.existsPromise(i)?await ia.fromFile(i,{baseFs:r}):null}static async find(e,{baseFs:r}={}){let i=await ia.tryFind(e,{baseFs:r});if(i===null)throw new Error("Manifest not found");return i}static async fromFile(e,{baseFs:r=new
|
|||
|
`,end:t=>`::endgroup::
|
|||
|
`}:process.env.TRAVIS?{start:t=>`travis_fold:start:${t}
|
|||
|
`,end:t=>`travis_fold:end:${t}
|
|||
|
`}:process.env.GITLAB_CI?{start:t=>`section_start:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}\r[0K${t}
|
|||
|
`,end:t=>`section_end:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}\r[0K`}:null,MW=new Date,KQe=["iTerm.app","Apple_Terminal"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,TQe=t=>t,VI=TQe({patrick:{date:[17,3],chars:["\u{1F340}","\u{1F331}"],size:40},simba:{date:[19,7],chars:["\u{1F981}","\u{1F334}"],size:40},jack:{date:[31,10],chars:["\u{1F383}","\u{1F987}"],size:40},hogsfather:{date:[31,12],chars:["\u{1F389}","\u{1F384}"],size:40},default:{chars:["=","-"],size:80}}),UQe=KQe&&Object.keys(VI).find(t=>{let e=VI[t];return!(e.date&&(e.date[0]!==MW.getDate()||e.date[1]!==MW.getMonth()+1))})||"default";function OW(t,{configuration:e,json:r}){if(!e.get("enableMessageNames"))return"";let n=LC(t===null?0:t);return!r&&t===null?je(e,n,"grey"):n}function Sx(t,{configuration:e,json:r}){let i=OW(t,{configuration:e,json:r});if(!i||t===null||t===z.UNNAMED)return i;let n=z[t],s=`https://yarnpkg.com/advanced/error-codes#${i}---${n}`.toLowerCase();return ic(e,i,s)}var xe=class extends ai{constructor({configuration:e,stdout:r,json:i=!1,includeFooter:n=!0,includeLogs:s=!i,includeInfos:o=s,includeWarnings:a=s,forgettableBufferSize:l=OQe,forgettableNames:c=new Set}){super();this.uncommitted=new Set;this.cacheHitCount=0;this.cacheMissCount=0;this.lastCacheMiss=null;this.warningCount=0;this.errorCount=0;this.startTime=Date.now();this.indent=0;this.progress=new Map;this.progressTime=0;this.progressFrame=0;this.progressTimeout=null;this.forgettableLines=[];Bh(this,{configuration:e}),this.configuration=e,this.forgettableBufferSize=l,this.forgettableNames=new Set([...c,...MQe]),this.includeFooter=n,this.includeInfos=o,this.includeWarnings=a,this.json=i,this.stdout=r;let u=this.configuration.get("progressBarStyle")||UQe;if(!Object.prototype.hasOwnProperty.call(VI,u))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=VI[u];let g="\u27A4 YN0000: \u250C ".length,h=Math.max(0,Math.min(process.stdout.columns-g,80));this.progressMaxScaledSize=Math.floor(this.progressStyle.size*h/80)}static async start(e,r){let i=new this(e),n=process.emitWarning;process.emitWarning=(s,o)=>{if(typeof s!="string"){let l=s;s=l.message,o=o!=null?o:l.name}let a=typeof o!="undefined"?`${o}: ${s}`:s;i.reportWarning(z.UNNAMED,a)};try{await r(i)}catch(s){i.reportExceptionOnce(s)}finally{await i.finalize(),process.emitWarning=n}return i}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(e){this.cacheHitCount+=1}reportCacheMiss(e,r){this.lastCacheMiss=e,this.cacheMissCount+=1,typeof r!="undefined"&&!this.configuration.get("preferAggregateCacheInfo")&&this.reportInfo(z.FETCH_NOT_CACHED,r)}startTimerSync(e,r,i){let n=typeof r=="function"?{}:r,s=typeof r=="function"?r:i,o={committed:!1,action:()=>{this.reportInfo(null,`\u250C ${e}`),this.indent+=1,na!==null&&!this.json&&this.includeInfos&&this.stdout.write(na.start(e))}};n.skipIfEmpty?this.uncommitted.add(o):(o.action(),o.committed=!0);let a=Date.now();try{return s()}catch(l){throw this.reportExceptionOnce(l),l}finally{let l=Date.now();this.uncommitted.delete(o),o.committed&&(this.indent-=1,na!==null&&!this.json&&this.includeInfos&&this.stdout.write(na.end(e)),this.configuration.get("enableTimers")&&l-a>200?this.reportInfo(null,`\u2514 Completed in ${je(this.configuration,l-a,ve.DURATION)}`):this.reportInfo(null,"\u2514 Completed"))}}async startTimerPromise(e,r,i){let n=typeof r=="function"?{}:r,s=typeof r=="function"?r:i,o={committed:!1,action:()=>{this.reportInfo(null,`\u250C ${e}`),this.indent+=1,na!==null&&!this.json&&this.includeInfos&&this.stdout.write(na.start(e))}};n.skipIfEmpty?this.uncommitted.add(o):(o.action(),o.committed=!0);let a=Date.now();try{return await s()}catch(l){throw this.reportExceptionOnce(l),l}finally{let l=Date.now();this.uncommitted.delete(o),o.committed&&(this.indent-=1,na!==null&&!this.json&&this.includeInfos&&this.stdout.write(na.end(e)),this.configuration.get("enableTimers")&&l-a>200?this.reportInfo(null,`\u2514 Completed in ${je(this.configuration,l-a,ve.DURATION)}`):this.reportInfo(null,"\u2
|
|||
|
`),this.writeProgress()}writeLineWithForgettableReset(e,{truncate:r}={}){this.forgettableLines=[],this.writeLine(e,{truncate:r})}writeLines(e,{truncate:r}={}){this.clearProgress({delta:e.length});for(let i of e)this.stdout.write(`${this.truncate(i,{truncate:r})}
|
|||
|
`);this.writeProgress()}reportCacheChanges({cacheHitCount:e,cacheMissCount:r}){let i=this.cacheHitCount-e,n=this.cacheMissCount-r;if(i===0&&n===0)return;let s="";this.cacheHitCount>1?s+=`${this.cacheHitCount} packages were already cached`:this.cacheHitCount===1?s+=" - one package was already cached":s+="No packages were cached",this.cacheHitCount>0?this.cacheMissCount>1?s+=`, ${this.cacheMissCount} had to be fetched`:this.cacheMissCount===1&&(s+=`, one had to be fetched (${it(this.configuration,this.lastCacheMiss)})`):this.cacheMissCount>1?s+=` - ${this.cacheMissCount} packages had to be fetched`:this.cacheMissCount===1&&(s+=` - one package had to be fetched (${it(this.configuration,this.lastCacheMiss)})`),this.reportInfo(z.FETCH_NOT_CACHED,s)}commit(){let e=this.uncommitted;this.uncommitted=new Set;for(let r of e)r.committed=!0,r.action()}clearProgress({delta:e=0,clear:r=!1}){!this.configuration.get("enableProgressBars")||this.json||this.progress.size+e>0&&(this.stdout.write(`[${this.progress.size+e}A`),(e>0||r)&&this.stdout.write("[0J"))}writeProgress(){if(!this.configuration.get("enableProgressBars")||this.json||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let e=Date.now();e-this.progressTime>NW&&(this.progressFrame=(this.progressFrame+1)%LW.length,this.progressTime=e);let r=LW[this.progressFrame];for(let i of this.progress.values()){let n=this.progressStyle.chars[0].repeat(i.lastScaledSize),s=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-i.lastScaledSize),o=this.formatName(null),a=o?`${o}: `:"";this.stdout.write(`${je(this.configuration,"\u27A4","blueBright")} ${a}${r} ${n}${s}
|
|||
|
`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress()},NW)}refreshProgress(e=0){let r=!1;if(this.progress.size===0)r=!0;else for(let i of this.progress.values()){let n=Math.trunc(this.progressMaxScaledSize*i.definition.progress),s=i.lastScaledSize;if(i.lastScaledSize=n,n!==s){r=!0;break}}r&&(this.clearProgress({delta:e}),this.writeProgress())}truncate(e,{truncate:r}={}){return this.configuration.get("enableProgressBars")||(r=!1),typeof r=="undefined"&&(r=this.configuration.get("preferTruncatedLines")),r&&(e=(0,RW.default)(e,0,process.stdout.columns-1)),e}formatName(e){return OW(e,{configuration:this.configuration,json:this.json})}formatNameWithHyperlink(e){return Sx(e,{configuration:this.configuration,json:this.json})}formatIndent(){return"\u2502 ".repeat(this.indent)}};var Gi="3.0.0-rc.6.git.20210701.hash-bf2d4bcd";var ls;(function(n){n.Yarn1="Yarn Classic",n.Yarn2="Yarn",n.Npm="npm",n.Pnpm="pnpm"})(ls||(ls={}));async function eo(t,e,r,i=[]){if(process.platform==="win32"){let n=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${r}" ${i.map(s=>`"${s.replace('"','""')}"`).join(" ")} %*`;await M.writeFilePromise(w.format({dir:t,name:e,ext:".cmd"}),n)}await M.writeFilePromise(w.join(t,e),`#!/bin/sh
|
|||
|
exec "${r}" ${i.map(n=>`'${n.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@"
|
|||
|
`),await M.chmodPromise(w.join(t,e),493)}async function HQe(t){let e=null;try{e=await M.readFilePromise(w.join(t,mt.lockfile),"utf8")}catch{}return e!==null?e.match(/^__metadata:$/m)?{packageManager:ls.Yarn2,reason:'"__metadata" key found in yarn.lock'}:{packageManager:ls.Yarn1,reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:M.existsSync(w.join(t,"package-lock.json"))?{packageManager:ls.Npm,reason:`found npm's "package-lock.json" lockfile`}:M.existsSync(w.join(t,"pnpm-lock.yaml"))?{packageManager:ls.Pnpm,reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}async function $h({project:t,locator:e,binFolder:r,lifecycleScript:i}){var a,l;let n={};for(let[c,u]of Object.entries(process.env))typeof u!="undefined"&&(n[c.toLowerCase()!=="path"?c:"PATH"]=u);let s=L.fromPortablePath(r);if(n.BERRY_BIN_FOLDER=L.fromPortablePath(s),await Promise.all([eo(r,"node",process.execPath),...Gi!==null?[eo(r,"run",process.execPath,[process.argv[1],"run"]),eo(r,"yarn",process.execPath,[process.argv[1]]),eo(r,"yarnpkg",process.execPath,[process.argv[1]]),eo(r,"node-gyp",process.execPath,[process.argv[1],"run","--top-level","node-gyp"])]:[]]),t&&(n.INIT_CWD=L.fromPortablePath(t.configuration.startingCwd),n.PROJECT_CWD=L.fromPortablePath(t.cwd)),n.PATH=n.PATH?`${s}${L.delimiter}${n.PATH}`:`${s}`,n.npm_execpath=`${s}${L.sep}yarn`,n.npm_node_execpath=`${s}${L.sep}node`,e){if(!t)throw new Error("Assertion failed: Missing project");let c=t.tryWorkspaceByLocator(e),u=c?(a=c.manifest.version)!=null?a:"":(l=t.storedPackages.get(e.locatorHash).version)!=null?l:"";n.npm_package_name=pt(e),n.npm_package_version=u}let o=Gi!==null?`yarn/${Gi}`:`yarn/${vn("@yarnpkg/core").version}-core`;return n.npm_config_user_agent=`${o} npm/? node/${process.versions.node} ${process.platform} ${process.arch}`,i&&(n.npm_lifecycle_event=i),t&&await t.configuration.triggerHook(c=>c.setupScriptEnvironment,t,n,async(c,u,g)=>await eo(r,jt(c),u,g)),n}var YQe=2,GQe=(0,TW.default)(YQe);async function qQe(t,e,{configuration:r,report:i,workspace:n=null,locator:s=null}){await GQe(async()=>{await M.mktempPromise(async o=>{let a=w.join(o,"pack.log"),l=null,{stdout:c,stderr:u}=r.getSubprocessStreams(a,{prefix:L.fromPortablePath(t),report:i}),g=s&&ns(s)?dh(s):s,h=g?cn(g):"an external project";c.write(`Packing ${h} from sources
|
|||
|
`);let f=await HQe(t),p;f!==null?(c.write(`Using ${f.packageManager} for bootstrap. Reason: ${f.reason}
|
|||
|
|
|||
|
`),p=f.packageManager):(c.write(`No package manager configuration detected; defaulting to Yarn
|
|||
|
|
|||
|
`),p=ls.Yarn2),await M.mktempPromise(async m=>{let I=await $h({binFolder:m}),B=new Map([[ls.Yarn1,async()=>{let F=n!==null?["workspace",n]:[],N=await Ls("yarn",["set","version","classic","--only-if-needed"],{cwd:t,env:I,stdin:l,stdout:c,stderr:u,end:rn.ErrorCode});if(N.code!==0)return N.code;await M.appendFilePromise(w.join(t,".npmignore"),`/.yarn
|
|||
|
`),c.write(`
|
|||
|
`);let U=await Ls("yarn",["install"],{cwd:t,env:I,stdin:l,stdout:c,stderr:u,end:rn.ErrorCode});if(U.code!==0)return U.code;c.write(`
|
|||
|
`);let v=await Ls("yarn",[...F,"pack","--filename",L.fromPortablePath(e)],{cwd:t,env:I,stdin:l,stdout:c,stderr:u});return v.code!==0?v.code:0}],[ls.Yarn2,async()=>{let F=n!==null?["workspace",n]:[];I.YARN_ENABLE_INLINE_BUILDS="1";let N=w.join(t,mt.lockfile);await M.existsPromise(N)||await M.writeFilePromise(N,"");let U=await Ls("yarn",[...F,"pack","--install-if-needed","--filename",L.fromPortablePath(e)],{cwd:t,env:I,stdin:l,stdout:c,stderr:u});return U.code!==0?U.code:0}],[ls.Npm,async()=>{if(n!==null)throw new Error(`Workspaces aren't supported by npm, which has been detected as the primary package manager for ${t}`);delete I.npm_config_user_agent;let F=await Ls("npm",["install"],{cwd:t,env:I,stdin:l,stdout:c,stderr:u,end:rn.ErrorCode});if(F.code!==0)return F.code;let N=new vc.PassThrough,U=Vg(N);N.pipe(c);let v=await Ls("npm",["pack","--silent"],{cwd:t,env:I,stdin:l,stdout:N,stderr:u});if(v.code!==0)return v.code;let J=(await U).toString().trim(),oe=w.resolve(t,L.toPortablePath(J));return await M.renamePromise(oe,e),0}]]).get(p);if(typeof B=="undefined")throw new Error("Assertion failed: Unsupported workflow");let D=await B();if(!(D===0||typeof D=="undefined"))throw M.detachTemp(o),new Ze(z.PACKAGE_PREPARATION_FAILED,`Packing the package failed (exit code ${D}, logs can be found here: ${a})`)})})})}async function jQe(t,e,{project:r}){let i=r.tryWorkspaceByLocator(t);if(i!==null)return xx(i,e);let n=r.storedPackages.get(t.locatorHash);if(!n)throw new Error(`Package for ${it(r.configuration,t)} not found in the project`);return await tn.openPromise(async s=>{let o=r.configuration,a=r.configuration.getLinkers(),l={project:r,report:new xe({stdout:new vc.PassThrough,configuration:o})},c=a.find(f=>f.supportsPackage(n,l));if(!c)throw new Error(`The package ${it(r.configuration,n)} isn't supported by any of the available linkers`);let u=await c.findPackageLocation(n,l),g=new yt(u,{baseFs:s});return(await ze.find(Ee.dot,{baseFs:g})).scripts.has(e)},{libzip:await li()})}async function XI(t,e,r,{cwd:i,project:n,stdin:s,stdout:o,stderr:a}){return await M.mktempPromise(async l=>{let{manifest:c,env:u,cwd:g}=await UW(t,{project:n,binFolder:l,cwd:i,lifecycleScript:e}),h=c.scripts.get(e);if(typeof h=="undefined")return 1;let f=async()=>await GI(h,r,{cwd:g,env:u,stdin:s,stdout:o,stderr:a});return await(await n.configuration.reduceHook(m=>m.wrapScriptExecution,f,n,t,e,{script:h,args:r,cwd:g,env:u,stdin:s,stdout:o,stderr:a}))()})}async function Dx(t,e,r,{cwd:i,project:n,stdin:s,stdout:o,stderr:a}){return await M.mktempPromise(async l=>{let{env:c,cwd:u}=await UW(t,{project:n,binFolder:l,cwd:i});return await GI(e,r,{cwd:u,env:c,stdin:s,stdout:o,stderr:a})})}async function JQe(t,{binFolder:e,cwd:r,lifecycleScript:i}){let n=await $h({project:t.project,locator:t.anchoredLocator,binFolder:e,lifecycleScript:i});return await Promise.all(Array.from(await HW(t),([s,[,o]])=>eo(e,jt(s),process.execPath,[o]))),typeof r=="undefined"&&(r=w.dirname(await M.realpathPromise(w.join(t.cwd,"package.json")))),{manifest:t.manifest,binFolder:e,env:n,cwd:r}}async function UW(t,{project:e,binFolder:r,cwd:i,lifecycleScript:n}){let s=e.tryWorkspaceByLocator(t);if(s!==null)return JQe(s,{binFolder:r,cwd:i,lifecycleScript:n});let o=e.storedPackages.get(t.locatorHash);if(!o)throw new Error(`Package for ${it(e.configuration,t)} not found in the project`);return await tn.openPromise(async a=>{let l=e.configuration,c=e.configuration.getLinkers(),u={project:e,report:new xe({stdout:new vc.PassThrough,configuration:l})},g=c.find(I=>I.supportsPackage(o,u));if(!g)throw new Error(`The package ${it(e.configuration,o)} isn't supported by any of the available linkers`);let h=await $h({project:e,locator:t,binFolder:r,lifecycleScript:n});await Promise.all(Array.from(await ZI(t,{project:e}),([I,[,y]])=>eo(r,jt(I),process.execPath,[y])));let f=await g.findPackageLocation(o,u),p=new yt(f,{baseFs:a}),m=await ze.find(Ee.dot,{baseFs:p});return typeof i=="undefined"&&(i=f),{manifest:m,binFolder:r,env:h,cwd:i}},{libzip:await li()})}async function YW(t,e,r,{cwd:i,stdin:n,stdout:s,stderr:o})
|
|||
|
`,{stdout:c,stderr:u}=n.getSubprocessStreams(a,{report:i,prefix:it(n,t.anchoredLocator),header:l});i.reportInfo(z.LIFECYCLE_SCRIPT,`Calling the "${e}" lifecycle script`);let g=await YW(t,e,[],{cwd:r,stdin:s,stdout:c,stderr:u});if(c.end(),u.end(),g!==0)throw M.detachTemp(o),new Ze(z.LIFECYCLE_SCRIPT,`${(0,KW.default)(e)} script failed (exit code ${je(n,g,ve.NUMBER)}, logs can be found here: ${je(n,a,ve.PATH)}); run ${je(n,`yarn ${e}`,ve.CODE)} to investigate`)})}async function WQe(t,e,r){xx(t,e)&&await GW(t,e,r)}async function ZI(t,{project:e}){let r=e.configuration,i=new Map,n=e.storedPackages.get(t.locatorHash);if(!n)throw new Error(`Package for ${it(r,t)} not found in the project`);let s=new vc.Writable,o=r.getLinkers(),a={project:e,report:new xe({configuration:r,stdout:s})},l=new Set([t.locatorHash]);for(let u of n.dependencies.values()){let g=e.storedResolutions.get(u.descriptorHash);if(!g)throw new Error(`Assertion failed: The resolution (${Kt(r,u)}) should have been registered`);l.add(g)}let c=await Promise.all(Array.from(l,async u=>{let g=e.storedPackages.get(u);if(!g)throw new Error(`Assertion failed: The package (${u}) should have been registered`);if(g.bin.size===0)return tA.skip;let h=o.find(p=>p.supportsPackage(g,a));if(!h)return tA.skip;let f=null;try{f=await h.findPackageLocation(g,a)}catch(p){if(p.code==="LOCATOR_NOT_INSTALLED")return tA.skip;throw p}return{dependency:g,packageLocation:f}}));for(let u of c){if(u===tA.skip)continue;let{dependency:g,packageLocation:h}=u;for(let[f,p]of g.bin)i.set(f,[g,L.fromPortablePath(w.resolve(h,p))])}return i}async function HW(t){return await ZI(t.anchoredLocator,{project:t.project})}async function qW(t,e,r,{cwd:i,project:n,stdin:s,stdout:o,stderr:a,nodeArgs:l=[],packageAccessibleBinaries:c}){c!=null||(c=await ZI(t,{project:n}));let u=c.get(e);if(!u)throw new Error(`Binary not found (${e}) for ${it(n.configuration,t)}`);return await M.mktempPromise(async g=>{let[,h]=u,f=await $h({project:n,locator:t,binFolder:g});await Promise.all(Array.from(c,([m,[,I]])=>eo(f.BERRY_BIN_FOLDER,jt(m),process.execPath,[I])));let p;try{p=await Ls(process.execPath,[...l,h,...r],{cwd:i,env:f,stdin:s,stdout:o,stderr:a})}finally{await M.removePromise(f.BERRY_BIN_FOLDER)}return p.code})}async function zQe(t,e,r,{cwd:i,stdin:n,stdout:s,stderr:o,packageAccessibleBinaries:a}){return await qW(t.anchoredLocator,e,r,{project:t.project,cwd:i,stdin:n,stdout:s,stderr:o,packageAccessibleBinaries:a})}var gr={};$e(gr,{convertToZip:()=>gSe,extractArchiveTo:()=>fSe,makeArchiveFromDirectory:()=>uSe,safeTime:()=>Ji});var z8=ee(require("stream")),V8=ee(k8());var G8=ee(require("os")),q8=ee(Y8()),j8=ee(require("worker_threads")),JD=class{constructor(e){this.source=e;this.pool=[];this.queue=new q8.default({concurrency:(0,G8.cpus)().length});let r=setTimeout(()=>{if(!(this.queue.size!==0||this.queue.pending!==0)){for(let i of this.pool)i.terminate();this.pool=[]}},1e3).unref();this.queue.on("idle",()=>{r.refresh()})}run(e){return this.queue.add(()=>{var i;let r=(i=this.pool.pop())!=null?i:new j8.Worker(this.source,{eval:!0,execArgv:[...process.execArgv,"--unhandled-rejections=strict"]});return r.ref(),new Promise((n,s)=>{let o=a=>{a!==0&&s(new Error(`Worker exited with code ${a}`))};r.once("message",a=>{this.pool.push(r),r.unref(),r.off("error",s),r.off("exit",o),n(a)}),r.once("error",s),r.once("exit",o),r.postMessage(e)})})}};var X8=ee(W8()),Ji=456789e3;async function uSe(t,{baseFs:e=new wt,prefixPath:r=Ee.root,compressionLevel:i,inMemory:n=!1}={}){let s=await li(),o;if(n)o=new Qr(null,{libzip:s,level:i});else{let l=await M.mktempPromise(),c=w.join(l,"archive.zip");o=new Qr(c,{create:!0,libzip:s,level:i})}let a=w.resolve(Ee.root,r);return await o.copyPromise(a,t,{baseFs:e,stableTime:!0,stableSort:!0}),o}var Z8;async function gSe(t,e){let r=await M.mktempPromise(),i=w.join(r,"archive.zip");return Z8||(Z8=new JD((0,X8.getContent)())),await Z8.run({tmpFile:i,tgz:t,opts:e}),new Qr(i,{libzip:await li(),level:e.compressionLevel})}async function*hSe(t){let e=new V8.default.Parse,r=new z8.PassThrough({objectMode:!0,autoDe
|
|||
|
`);return}let s=(0,ez.asTree)(tz(t,{configuration:e}),!1,!1);if(n>=1&&(s=s.replace(/^([├└]─)/gm,`\u2502
|
|||
|
$1`).replace(/^│\n/,"")),n>=2)for(let a=0;a<2;++a)s=s.replace(/^([│ ].{2}[├│ ].{2}[^\n]+\n)(([│ ]).{2}[├└].{2}[^\n]*\n[│ ].{2}[│ ].{2}[├└]─)/gm,`$1$3 \u2502
|
|||
|
$2`).replace(/^│\n/,"");if(n>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");r.write(s)}var VD=ee(require("fs"));var dSe=8,gt=class{constructor(e,{configuration:r,immutable:i=r.get("enableImmutableCache"),check:n=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.configuration=r,this.cwd=e,this.immutable=i,this.check=n;let s=r.get("cacheKeyOverride");if(s!==null)this.cacheKey=`${s}`;else{let o=r.get("compressionLevel"),a=o!==Ja?`c${o}`:"";this.cacheKey=[dSe,a].join("")}}static async find(e,{immutable:r,check:i}={}){let n=new gt(e.get("cacheFolder"),{configuration:e,immutable:r,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`${tc(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,r){let n=CSe(r).slice(0,10);return`${tc(e)}-${n}.zip`}getLocatorPath(e,r){return this.mirrorCwd===null?w.resolve(this.cwd,this.getVersionFilename(e)):r===null||XD(r)!==this.cacheKey?null:w.resolve(this.cwd,this.getChecksumFilename(e,r))}getLocatorMirrorPath(e){let r=this.mirrorCwd;return r!==null?w.resolve(r,this.getVersionFilename(e)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await M.existsPromise(this.cwd))throw new Ze(z.IMMUTABLE_CACHE,"Cache path does not exist.")}else{await M.mkdirPromise(this.cwd,{recursive:!0});let e=w.resolve(this.cwd,".gitignore");await M.changeFilePromise(e,`/.gitignore
|
|||
|
*.flock
|
|||
|
`)}(this.mirrorCwd||!this.immutable)&&await M.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(e,r,{onHit:i,onMiss:n,loader:s,skipIntegrityCheck:o}){let a=this.getLocatorMirrorPath(e),l=new wt,c=async(N,U=null)=>{let v=!o||!r?`${this.cacheKey}/${await vm(N)}`:r;if(U!==null){let J=!o||!r?`${this.cacheKey}/${await vm(U)}`:r;if(v!==J)throw new Ze(z.CACHE_CHECKSUM_MISMATCH,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}if(r!==null&&v!==r){let J;switch(this.check?J="throw":XD(r)!==XD(v)?J="update":J=this.configuration.get("checksumBehavior"),J){case"ignore":return r;case"update":return v;default:case"throw":throw new Ze(z.CACHE_CHECKSUM_MISMATCH,"The remote archive doesn't match the expected checksum")}}return v},u=async N=>{if(!s)throw new Error(`Cache check required but no loader configured for ${it(this.configuration,e)}`);let U=await s(),v=U.getRealPath();return U.saveAndClose(),await M.chmodPromise(v,420),await c(N,v)},g=async()=>{if(a===null||!await M.existsPromise(a)){let v=await s(),J=v.getRealPath();return v.saveAndClose(),{source:"loader",path:J}}let N=await M.mktempPromise(),U=w.join(N,this.getVersionFilename(e));return await M.copyFilePromise(a,U,VD.default.constants.COPYFILE_FICLONE),{source:"mirror",path:U}},h=async()=>{if(!s)throw new Error(`Cache entry required but missing for ${it(this.configuration,e)}`);if(this.immutable)throw new Ze(z.IMMUTABLE_CACHE,`Cache entry required but missing for ${it(this.configuration,e)}`);let{path:N,source:U}=await g();await M.chmodPromise(N,420);let v=await c(N),J=this.getLocatorPath(e,v);if(!J)throw new Error("Assertion failed: Expected the cache path to be available");let oe=null;if(U!=="mirror"&&a!==null){let K=await M.mktempPromise();oe=w.join(K,this.getVersionFilename(e)),await M.copyFilePromise(N,oe,VD.default.constants.COPYFILE_FICLONE)}return await this.writeFileWithLock(J,async()=>await this.writeFileWithLock(U==="mirror"?null:a,async()=>(await M.movePromise(N,J),oe&&a&&await M.movePromise(oe,a),[J,v])))},f=async()=>{let U=(async()=>{let v=this.getLocatorPath(e,r),J=v!==null?await l.existsPromise(v):!1,oe=J?i:n;if(oe&&oe(),J){let K=null,A=v;return this.check?K=await u(A):K=await c(A),[A,K]}else return h()})();this.mutexes.set(e.locatorHash,U);try{return await U}finally{this.mutexes.delete(e.locatorHash)}};for(let N;N=this.mutexes.get(e.locatorHash);)await N;let[p,m]=await f();this.markedFiles.add(p);let I=null,y=await li(),B=new Sg(()=>zg(()=>I=new Qr(p,{baseFs:l,libzip:y,readOnly:!0}),N=>`Failed to open the cache entry for ${it(this.configuration,e)}: ${N}`),w);return[new Wa(p,{baseFs:B,pathUtils:w}),()=>{I!==null&&I.discardAndClose()},m]}async writeFileWithLock(e,r){return e===null?await r():await M.lockPromise(e,async()=>await r())}};function XD(t){let e=t.indexOf("/");return e!==-1?t.slice(0,e):null}function CSe(t){let e=t.indexOf("/");return e!==-1?t.slice(e+1):t}var cz=ee(sz()),qE=ee(Mg());var uz=ee(jI()),tP=ee(require("stream"));var oz={hooks:{reduceDependency:(t,e,r,i,{resolver:n,resolveOptions:s})=>{for(let{pattern:o,reference:a}of e.topLevelWorkspace.manifest.resolutions){if(o.from&&o.from.fullName!==pt(r)||o.from&&o.from.description&&o.from.description!==r.reference||o.descriptor.fullName!==pt(t)||o.descriptor.description&&o.descriptor.description!==t.range)continue;return n.bindDescriptor(Wt(t,a),e.topLevelWorkspace.anchoredLocator,s)}return t},validateProject:async(t,e)=>{for(let r of t.workspaces){let i=Eh(t.configuration,r);await t.configuration.triggerHook(n=>n.validateWorkspace,r,{reportWarning:(n,s)=>e.reportWarning(n,`${i}: ${s}`),reportError:(n,s)=>e.reportError(n,`${i}: ${s}`)})}},validateWorkspace:async(t,e)=>{let{manifest:r}=t;r.resolutions.length&&t.cwd!==t.project.cwd&&r.errors.push(new Error("Resolutions field will be ignored"));for(let i of r.errors)e.reportWarning(z.INVALID_MANIFEST,i.message)}}};var _D=class{constructor(e){this.fetchers=e}supports(e,r){return!!this.tryFetcher(e,r)}getLocalPath(e,r){return this.getFetcher(e,r).getLocalPath(e,r)}async fetch(e,r){
|
|||
|
`);return{stdout:s,stderr:o}}makeResolver(){let e=[];for(let r of this.plugins.values())for(let i of r.resolvers||[])e.push(new i);return new Zc([new GE,new fi,new $D,...e])}makeFetcher(){let e=[];for(let r of this.plugins.values())for(let i of r.fetchers||[])e.push(new i);return new _D([new Ef,new eP,...e])}getLinkers(){let e=[];for(let r of this.plugins.values())for(let i of r.linkers||[])e.push(new i);return e}async refreshPackageExtensions(){this.packageExtensions=new Map;let e=this.packageExtensions,r=(i,n,{userProvided:s=!1}={})=>{if(!Kn(i.range))throw new Error("Only semver ranges are allowed as keys for the lockfileExtensions setting");let o=new ze;o.load(n,{yamlCompatibilityMode:!0});let a=Gl(e,i.identHash),l=[];a.push([i.range,l]);let c={status:Yr.Inactive,userProvided:s,parentDescriptor:i};for(let u of o.dependencies.values())l.push(V(k({},c),{type:Sr.Dependency,descriptor:u}));for(let u of o.peerDependencies.values())l.push(V(k({},c),{type:Sr.PeerDependency,descriptor:u}));for(let[u,g]of o.peerDependenciesMeta)for(let[h,f]of Object.entries(g))l.push(V(k({},c),{type:Sr.PeerDependencyMeta,selector:u,key:h,value:f}))};await this.triggerHook(i=>i.registerPackageExtensions,this,r);for(let[i,n]of this.get("packageExtensions"))r(jo(i,!0),qC(n),{userProvided:!0})}normalizePackage(e){let r=fh(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(!!_h(s,o))for(let l of a)switch(l.status===Yr.Inactive&&(l.status=Yr.Redundant),l.type){case Sr.Dependency:typeof r.dependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=Yr.Active,r.dependencies.set(l.descriptor.identHash,l.descriptor));break;case Sr.PeerDependency:typeof r.peerDependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=Yr.Active,r.peerDependencies.set(l.descriptor.identHash,l.descriptor));break;case Sr.PeerDependencyMeta:{let c=r.peerDependenciesMeta.get(l.selector);(typeof c=="undefined"||!Object.prototype.hasOwnProperty.call(c,l.key)||c[l.key]!==l.value)&&(l.status=Yr.Active,Os(r.peerDependenciesMeta,l.selector,()=>({}))[l.key]=l.value)}break;default:FQ(l);break}}}let n=s=>s.scope?`${s.scope}__${s.name}`:`${s.name}`;for(let s of r.peerDependencies.values()){if(s.scope==="types")continue;let o=n(s),a=Go("types",o),l=pt(a);r.peerDependencies.has(a.identHash)||r.peerDependenciesMeta.has(l)||r.peerDependenciesMeta.set(l,{optional:!0})}for(let s of r.peerDependenciesMeta.keys()){let o=Qi(s);r.peerDependencies.has(o.identHash)||r.peerDependencies.set(o.identHash,Wt(o,"*"))}return r.dependencies=new Map(Bi(r.dependencies,([,s])=>bi(s))),r.peerDependencies=new Map(Bi(r.peerDependencies,([,s])=>bi(s))),r}getLimit(e){return Os(this.limits,e,()=>(0,uz.default)(this.get(e)))}async triggerHook(e,...r){for(let i of this.plugins.values()){let n=i.hooks;if(!n)continue;let s=e(n);!s||await s(...r)}}async triggerMultipleHooks(e,r){for(let i of r)await this.triggerHook(e,...i)}async reduceHook(e,r,...i){let n=r;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,...r){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(...r);if(typeof o!="undefined")return o}return null}},Ae=ao;Ae.telemetry=null;var Wi;(function(r){r[r.SCRIPT=0]="SCRIPT",r[r.SHELLCODE=1]="SHELLCODE"})(Wi||(Wi={}));var Ao=class extends ai{constructor({configuration:e,stdout:r,suggestInstall:i=!0}){super();this.errorCount=0;Bh(this,{configuration:e}),this.configuration=e,this.stdout=r,this.suggestInstall=i}static async start(e,r){let i=new this(e);try{await r(i)}catch(n){i.reportExceptionOnce(n)}finally{await i.finalize()}return i}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(e){}reportCacheMiss(e){}startTimerSync(e,r,i){return(typeof r=="function"?r:i)()}async startTimerPromise(e,r,i){return await(typeof r=="function"?r:i)()}async start
|
|||
|
`)}reportProgress(e){let r=Promise.resolve().then(async()=>{for await(let{}of e);}),i=()=>{};return V(k({},r),{stop:i})}reportJson(e){}async finalize(){this.errorCount>0&&(this.stdout.write(`
|
|||
|
`),this.stdout.write(`${je(this.configuration,"\u27A4","redBright")} Errors happened when preparing the environment required to run this command.
|
|||
|
`),this.suggestInstall&&this.stdout.write(`${je(this.configuration,"\u27A4","redBright")} This might be caused by packages being missing from the lockfile, in which case running "yarn install" might help.
|
|||
|
`))}formatNameWithHyperlink(e){return Sx(e,{configuration:this.configuration,json:!1})}};var gy=ee(require("crypto")),i9=ee(zz()),hy=ee(t9()),n9=ee(jI()),s9=ee(Cr()),LP=ee(require("util")),NP=ee(require("v8")),MP=ee(require("zlib"));var ove=[[/^(git(?:\+(?:https|ssh))?:\/\/.*(?:\.git)?)#(.*)$/,(t,e,r,i)=>`${r}#commit=${i}`],[/^https:\/\/((?:[^/]+?)@)?codeload\.github\.com\/([^/]+\/[^/]+)\/tar\.gz\/([0-9a-f]+)$/,(t,e,r="",i,n)=>`https://${r}github.com/${i}.git#commit=${n}`],[/^https:\/\/((?:[^/]+?)@)?github\.com\/([^/]+\/[^/]+?)(?:\.git)?#([0-9a-f]+)$/,(t,e,r="",i,n)=>`https://${r}github.com/${i}.git#commit=${n}`],[/^https?:\/\/[^/]+\/(?:[^/]+\/)*(?:@.+(?:\/|(?:%2f)))?([^/]+)\/(?:-|download)\/\1-[^/]+\.tgz(?:#|$)/,t=>`npm:${t}`],[/^https:\/\/npm\.pkg\.github\.com\/download\/(?:@[^/]+)\/(?:[^/]+)\/(?:[^/]+)\/(?:[0-9a-f]+)$/,t=>`npm:${t}`],[/^https:\/\/npm\.fontawesome\.com\/(?:@[^/]+)\/([^/]+)\/-\/([^/]+)\/\1-\2.tgz(?:#|$)/,t=>`npm:${t}`],[/^https?:\/\/(?:[^\\.]+)\.jfrog\.io\/.*\/(@[^/]+)\/([^/]+)\/-\/\1\/\2-(?:[.\d\w-]+)\.tgz(?:#|$)/,(t,e)=>Om({protocol:"npm:",source:null,selector:t,params:{__archiveUrl:e}})],[/^[^/]+\.tgz#[0-9a-f]+$/,t=>`npm:${t}`]],FP=class{constructor(){this.resolutions=null}async setup(e,{report:r}){let i=w.join(e.cwd,e.configuration.get("lockfileFilename"));if(!M.existsSync(i))return;let n=await M.readFilePromise(i,"utf8"),s=Nr(n);if(Object.prototype.hasOwnProperty.call(s,"__metadata"))return;let o=this.resolutions=new Map;for(let a of Object.keys(s)){let l=mh(a);if(!l){r.reportWarning(z.YARN_IMPORT_FAILED,`Failed to parse the string "${a}" into a proper descriptor`);continue}Kn(l.range)&&(l=Wt(l,`npm:${l.range}`));let{version:c,resolved:u}=s[a];if(!u)continue;let g;for(let[f,p]of ove){let m=u.match(f);if(m){g=p(c,...m);break}}if(!g){r.reportWarning(z.YARN_IMPORT_FAILED,`${Kt(e.configuration,l)}: Only some patterns can be imported from legacy lockfiles (not "${u}")`);continue}let h=l;try{let f=ec(l.range),p=mh(f.selector,!0);p&&(h=p)}catch{}o.set(l.descriptorHash,si(h,g))}}supportsDescriptor(e,r){return this.resolutions?this.resolutions.has(e.descriptorHash):!1}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}bindDescriptor(e,r,i){return e}getResolutionDependencies(e,r){return[]}async getCandidates(e,r,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[n]}async getSatisfying(e,r,i){return null}async resolve(e,r){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}};var uy=class{supportsDescriptor(e,r){return!!(r.project.storedResolutions.get(e.descriptorHash)||r.project.originalPackages.has(Nm(e).locatorHash))}supportsLocator(e,r){return!!r.project.originalPackages.has(e.locatorHash)}shouldPersistResolution(e,r){throw new Error("The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes")}bindDescriptor(e,r,i){return e}getResolutionDependencies(e,r){return[]}async getCandidates(e,r,i){let n=i.project.originalPackages.get(Nm(e).locatorHash);if(n)return[n];let s=i.project.storedResolutions.get(e.descriptorHash);if(!s)throw new Error("Expected the resolution to have been successful - resolution not found");if(n=i.project.originalPackages.get(s),!n)throw new Error("Expected the resolution to have been successful - package not found");return[n]}async getSatisfying(e,r,i){return null}async resolve(e,r){let i=r.project.originalPackages.get(e.locatorHash);if(!i)throw new Error("The lockfile resolver isn't meant to resolve packages - they should already have been stored into a cache");return i}};var RP=class{constructor(e){this.resolver=e}supportsDescriptor(e,r){return this.resolver.supportsDescriptor(e,r)}supportsLocator(e,r){return this.resolver.supportsLocator(e,r)}shouldPersistResolution(e,r){return this.resolver.
|
|||
|
`;await M.changeFilePromise(r,i,{automaticNewlines:!0}),this.manifest.raw=e}};var OP=4,ave=1,Ave=/ *, */g,o9=/\/$/,lve=32,cve=(0,LP.promisify)(MP.default.gzip),uve=(0,LP.promisify)(MP.default.gunzip),KP={restoreInstallersCustomData:["installersCustomData"],restoreResolutions:["accessibleLocators","optionalBuilds","storedDescriptors","storedResolutions","storedPackages","lockFileChecksum"],restoreBuildState:["storedBuildState"]},Fe=class{constructor(e,{configuration:r}){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.originalPackages=new Map;this.optionalBuilds=new Set;this.peerRequirements=new Map;this.installersCustomData=new Map;this.lockFileChecksum=null;this.installStateChecksum=null;this.configuration=r,this.cwd=e}static async find(e,r){var c,u,g;if(!e.projectCwd)throw new me(`No project found in ${r}`);let i=e.projectCwd,n=r,s=null;for(;s!==e.projectCwd;){if(s=n,M.existsSync(w.join(s,mt.manifest))){i=s;break}n=w.dirname(s)}let o=new Fe(e.projectCwd,{configuration:e});(c=Ae.telemetry)==null||c.reportProject(o.cwd),await o.setupResolutions(),await o.setupWorkspaces(),(u=Ae.telemetry)==null||u.reportWorkspaceCount(o.workspaces.length),(g=Ae.telemetry)==null||g.reportDependencyCount(o.workspaces.reduce((h,f)=>h+f.manifest.dependencies.size+f.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};throw new me(`The nearest package directory (${je(e,i,ve.PATH)}) doesn't seem to be part of the project declared in ${je(e,o.cwd,ve.PATH)}.
|
|||
|
|
|||
|
- If the project directory is right, it might be that you forgot to list ${je(e,w.relative(o.cwd,i),ve.PATH)} as a workspace.
|
|||
|
- If it isn't, it's likely because you have a yarn.lock or package.json file there, confusing the project root detection.`)}async setupResolutions(){this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let e=w.join(this.cwd,this.configuration.get("lockfileFilename")),r=this.configuration.get("defaultLanguageName");if(M.existsSync(e)){let i=await M.readFilePromise(e,"utf8");this.lockFileChecksum=ni(`${ave}`,i);let n=Nr(i);if(n.__metadata){let s=n.__metadata.version,o=n.__metadata.cacheKey;for(let a of Object.keys(n)){if(a==="__metadata")continue;let l=n[a];if(typeof l.resolution=="undefined")throw new Error(`Assertion failed: Expected the lockfile entry to have a resolution field (${a})`);let c=fA(l.resolution,!0),u=new ze;u.load(l,{yamlCompatibilityMode:!0});let g=u.version,h=u.languageName||r,f=l.linkType.toUpperCase(),p=u.dependencies,m=u.peerDependencies,I=u.dependenciesMeta,y=u.peerDependenciesMeta,B=u.bin;if(l.checksum!=null){let D=typeof o!="undefined"&&!l.checksum.includes("/")?`${o}/${l.checksum}`:l.checksum;this.storedChecksums.set(c.locatorHash,D)}if(s>=OP){let D=V(k({},c),{version:g,languageName:h,linkType:f,dependencies:p,peerDependencies:m,dependenciesMeta:I,peerDependenciesMeta:y,bin:B});this.originalPackages.set(D.locatorHash,D)}for(let D of a.split(Ave)){let F=jo(D);if(this.storedDescriptors.set(F.descriptorHash,F),s>=OP)this.storedResolutions.set(F.descriptorHash,c.locatorHash);else{let N=Mm(c);N.descriptorHash!==F.descriptorHash&&(this.storedDescriptors.set(N.descriptorHash,N),this.resolutionAliases.set(F.descriptorHash,N.descriptorHash))}}}}}}async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Map,this.workspacesByIdent=new Map;let e=[this.cwd];for(;e.length>0;){let r=e;e=[];for(let i of r){if(this.workspacesByCwd.has(i))continue;let n=await this.addWorkspace(i),s=this.storedPackages.get(n.anchoredLocator.locatorHash);s&&(n.dependencies=s.dependencies);for(let o of n.workspacesCwds)e.push(o)}}}async addWorkspace(e){let r=new Mf(e,{project:this});await r.setup();let i=this.workspacesByIdent.get(r.locator.identHash);if(typeof i!="undefined")throw new Error(`Duplicate workspace name ${mr(this.configuration,r.locator)}: ${L.fromPortablePath(e)} conflicts with ${L.fromPortablePath(i.cwd)}`);return this.workspaces.push(r),this.workspacesByCwd.set(e,r),this.workspacesByIdent.set(r.locator.identHash,r),r}get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(e){w.isAbsolute(e)||(e=w.resolve(this.cwd,e)),e=w.normalize(e).replace(/\/+$/,"");let r=this.workspacesByCwd.get(e);return r||null}getWorkspaceByCwd(e){let r=this.tryWorkspaceByCwd(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByFilePath(e){let r=null;for(let i of this.workspaces)w.relative(i.cwd,e).startsWith("../")||r&&r.cwd.length>=i.cwd.length||(r=i);return r||null}getWorkspaceByFilePath(e){let r=this.tryWorkspaceByFilePath(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByIdent(e){let r=this.workspacesByIdent.get(e.identHash);return typeof r=="undefined"?null:r}getWorkspaceByIdent(e){let r=this.tryWorkspaceByIdent(e);if(!r)throw new Error(`Workspace not found (${mr(this.configuration,e)})`);return r}tryWorkspaceByDescriptor(e){let r=this.tryWorkspaceByIdent(e);return r===null||(qo(e)&&(e=ph(e)),!r.accepts(e.range))?null:r}getWorkspaceByDescriptor(e){let r=this.tryWorkspaceByDescriptor(e);if(r===null)throw new Error(`Workspace not found (${Kt(this.configuration,e)})`);return r}tryWorkspaceByLocator(e){let r=this.tryWorkspaceByIdent(e);return r===null||(ns(e)&&(e=dh(e)),r.locator.locatorHash!==e.locatorHash&&r.anchoredLocator.locatorHash!==e.locatorHash)?null:r}getWorkspaceByLocator(e){let r=this.tryWorkspaceByLocator(e);if(!r)throw new Error(`Workspace not found (${it(this.configuration,e)})`);return r}refreshWorkspaceDependencies(){for(let e of this.workspaces){let r=this.storedPackages.get(e.anchoredLocator.locatorHash);if(!r)throw new Error(`Assertion failed: Expected workspace ${Eh(thi
|
|||
|
`;switch(Le){case Wi.SCRIPT:Ke+=`# Script name: ${qe}
|
|||
|
`;break;case Wi.SHELLCODE:Ke+=`# Script code: ${qe}
|
|||
|
`;break}let ie=null;if(!await M.mktempPromise(async Se=>{let he=w.join(Se,"build.log"),{stdout:Ie,stderr:pe}=this.configuration.getSubprocessStreams(he,{header:Ke,prefix:it(this.configuration,$),report:r}),De;try{switch(Le){case Wi.SCRIPT:De=await XI($,qe,[],{cwd:ke,project:this,stdin:ie,stdout:Ie,stderr:pe});break;case Wi.SHELLCODE:De=await Dx($,qe,[],{cwd:ke,project:this,stdin:ie,stdout:Ie,stderr:pe});break}}catch(X){pe.write(X.stack),De=1}if(Ie.end(),pe.end(),De===0)return v.set($.locatorHash,R),!0;M.detachTemp(Se);let Z=`${it(this.configuration,$)} couldn't be built successfully (exit code ${je(this.configuration,De,ve.NUMBER)}, logs can be found here: ${je(this.configuration,he,ve.PATH)})`;return this.optionalBuilds.has($.locatorHash)?(r.reportInfo(z.BUILD_FAILED,Z),v.set($.locatorHash,R),!0):(r.reportError(z.BUILD_FAILED,Z),!1)}))return}})())}}if(await Promise.all(A),K===y.size){let W=Array.from(y).map($=>{let re=this.storedPackages.get($);if(!re)throw new Error("Assertion failed: The package should have been registered");return it(this.configuration,re)}).join(", ");r.reportError(z.CYCLIC_DEPENDENCIES,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won't be built (affected packages are: ${W})`);break}}this.storedBuildState=v}async install(e){var a,l;let r=this.configuration.get("nodeLinker");(a=Ae.telemetry)==null||a.reportInstall(r),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=Yr.Inactive;let i=w.join(this.cwd,this.configuration.get("lockfileFilename")),n=null;if(e.immutable)try{n=await M.readFilePromise(i,"utf8")}catch(c){throw c.code==="ENOENT"?new Ze(z.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 h=je(this.configuration,g,ve.PACKAGE_EXTENSION);switch(g.status){case Yr.Inactive:e.report.reportWarning(z.UNUSED_PACKAGE_EXTENSION,`${h}: No matching package in the dependency tree; you may not need this rule anymore.`);break;case Yr.Redundant:e.report.reportWarning(z.REDUNDANT_PACKAGE_EXTENSION,`${h}: This rule seems redundant when applied on the original package; the extension may have been applied upstream.`);break}}if(n!==null){let c=Pl(n,this.generateLockfile());if(c!==n){let u=(0,i9.structuredPatch)(i,i,n,c);e.report.reportSeparator();for(let g of u.hunks){e.report.reportInfo(null,`@@ -${g.oldStart},${g.oldLines} +${g.newStart},${g.newLines} @@`);for(let h of g.lines)h.startsWith("+")?e.report.reportError(z.FROZEN_LOCKFILE_EXCEPTION,je(this.configuration,h,ve.ADDED)):h.startsWith("-")?e.report.reportError(z.FROZEN_LOCKFILE_EXCEPTION,je(this.configuration,h,ve.REMOVED)):e.report.reportInfo(null,je(this.configuration,h,"grey"))}throw e.report.reportSeparator(),new Ze(z.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===Yr.Active&&((l=Ae.telemetry)==null||l.reportPackageExtension(nc(g,ve.PACKAGE_EXTENSION)));await e.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(e),(typeof e.persistProject=="undefined"||e.persistProject)&&await this.cacheCleanup(e)});let s=e.immutable?[...new Set(this.configuration.get("immutablePatterns"))].sort():[],o=await Promise.all(s.map(async c=>Fm(c,{cwd:this.cwd})));(typeof e.persistProject=="undefined"||e.persistProject)&&await this.persist(),await e.report.startTimerPromis
|
|||
|
`,`# Manual changes might be lost - proceed with caution!
|
|||
|
`].join("")}
|
|||
|
`+$s(r)}async persistLockfile(){let e=w.join(this.cwd,this.configuration.get("lockfileFilename")),r=this.generateLockfile();await M.changeFilePromise(e,r,{automaticNewlines:!0})}async persistInstallStateFile(){let e=[];for(let o of Object.values(KP))e.push(...o);let r=(0,hy.default)(this,e),i=NP.default.serialize(r),n=ni(i);if(this.installStateChecksum===n)return;let s=this.configuration.get("installStatePath");await M.mkdirPromise(w.dirname(s),{recursive:!0}),await M.writeFilePromise(s,await cve(i)),this.installStateChecksum=n}async restoreInstallState({restoreInstallersCustomData:e=!0,restoreResolutions:r=!0,restoreBuildState:i=!0}={}){let n=this.configuration.get("installStatePath");if(!M.existsSync(n)){r&&await this.applyLightResolution();return}let s=await uve(await M.readFilePromise(n));this.installStateChecksum=ni(s);let o=NP.default.deserialize(s);e&&typeof o.installersCustomData!="undefined"&&(this.installersCustomData=o.installersCustomData),i&&Object.assign(this,(0,hy.default)(o,KP.restoreBuildState)),r&&(o.lockFileChecksum===this.lockFileChecksum?(Object.assign(this,(0,hy.default)(o,KP.restoreResolutions)),this.refreshWorkspaceDependencies()):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new Br}),await this.persistInstallStateFile()}async persist(){await this.persistLockfile();for(let e of this.workspacesByCwd.values())await e.persistManifest()}async cacheCleanup({cache:e,report:r}){let i=new Set([".gitignore"]);if(!Gw(e.cwd,this.cwd)||!await M.existsPromise(e.cwd))return;let n=this.configuration.get("preferAggregateCacheInfo"),s=0,o=null;for(let a of await M.readdirPromise(e.cwd)){if(i.has(a))continue;let l=w.resolve(e.cwd,a);e.markedFiles.has(l)||(o=a,e.immutable?r.reportError(z.IMMUTABLE_CACHE,`${je(this.configuration,w.basename(l),"magenta")} appears to be unused and would be marked for deletion, but the cache is immutable`):(n?s+=1:r.reportInfo(z.UNUSED_CACHE_ENTRY,`${je(this.configuration,w.basename(l),"magenta")} appears to be unused - removing`),await M.removePromise(l)))}n&&s!==0&&r.reportInfo(z.UNUSED_CACHE_ENTRY,s>1?`${s} packages appeared to be unused and were removed`:`${o} appeared to be unused and was removed`),e.markedFiles.clear()}};function gve({project:t,allDescriptors:e,allResolutions:r,allPackages:i,accessibleLocators:n=new Set,optionalBuilds:s=new Set,volatileDescriptors:o=new Set,peerRequirements:a=new Map,report:l,tolerateMissingPackages:c=!1}){var oe;let u=new Map,g=[],h=new Map,f=new Map,p=new Map,m=new Map,I=new Map,y=new Map(t.workspaces.map(K=>{let A=K.anchoredLocator.locatorHash,W=i.get(A);if(typeof W=="undefined"){if(c)return[A,null];throw new Error("Assertion failed: The workspace should have an associated package")}return[A,fh(W)]})),B=()=>{let K=M.mktempSync(),A=w.join(K,"stacktrace.log"),W=String(g.length+1).length,$=g.map((re,H)=>`${`${H+1}.`.padStart(W," ")} ${cn(re)}
|
|||
|
`).join("");throw M.writeFileSync(A,$),M.detachTemp(K),new Ze(z.STACK_OVERFLOW_RESOLUTION,`Encountered a stack overflow when resolving peer dependencies; cf ${L.fromPortablePath(A)}`)},D=K=>{let A=r.get(K.descriptorHash);if(typeof A=="undefined")throw new Error("Assertion failed: The resolution should have been registered");let W=i.get(A);if(!W)throw new Error("Assertion failed: The package could not be found");return W},F=(K,A,{top:W,optional:$})=>{g.length>1e3&&B(),g.push(K);let re=N(K,A,{top:W,optional:$});return g.pop(),re},N=(K,A,{top:W,optional:$})=>{if(n.has(K.locatorHash))return;n.add(K.locatorHash),$||s.delete(K.locatorHash);let re=i.get(K.locatorHash);if(!re){if(c)return;throw new Error(`Assertion failed: The package (${it(t.configuration,K)}) should have been registered`)}let H=[],R=[],ke=[],Le=[],qe=[];for(let ie of Array.from(re.dependencies.values())){if(re.peerDependencies.has(ie.identHash)&&re.locatorHash!==W)continue;if(qo(ie))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");o.delete(ie.descriptorHash);let le=$;if(!le){let ae=re.dependenciesMeta.get(pt(ie));if(typeof ae!="undefined"){let ue=ae.get(null);typeof ue!="undefined"&&ue.optional&&(le=!0)}}let Se=r.get(ie.descriptorHash);if(!Se){if(c)continue;throw new Error(`Assertion failed: The resolution (${Kt(t.configuration,ie)}) should have been registered`)}let he=y.get(Se)||i.get(Se);if(!he)throw new Error(`Assertion failed: The package (${Se}, resolved from ${Kt(t.configuration,ie)}) should have been registered`);if(he.peerDependencies.size===0){F(he,new Map,{top:W,optional:le});continue}let Ie=u.get(he.locatorHash);typeof Ie=="number"&&Ie>=2&&B();let pe,De,Z=new Set,X;R.push(()=>{pe=t0(ie,K.locatorHash),De=r0(he,K.locatorHash),re.dependencies.delete(ie.identHash),re.dependencies.set(pe.identHash,pe),r.set(pe.descriptorHash,De.locatorHash),e.set(pe.descriptorHash,pe),i.set(De.locatorHash,De),H.push([he,pe,De])}),ke.push(()=>{var ae;X=new Map;for(let ue of De.peerDependencies.values()){let we=re.dependencies.get(ue.identHash);if(!we&&Ch(K,ue)&&(we=Mm(K),e.set(we.descriptorHash,we),r.set(we.descriptorHash,K.locatorHash),o.delete(we.descriptorHash)),(!we||we.range==="missing:")&&De.dependencies.has(ue.identHash)){De.peerDependencies.delete(ue.identHash);continue}we||(we=Wt(ue,"missing:")),De.dependencies.set(we.identHash,we),qo(we)&&rA(p,we.descriptorHash).add(De.locatorHash),h.set(we.identHash,we),we.range==="missing:"&&Z.add(we.identHash),X.set(ue.identHash,(ae=A.get(ue.identHash))!=null?ae:De.locatorHash)}De.dependencies=new Map(Bi(De.dependencies,([ue,we])=>pt(we)))}),Le.push(()=>{if(!i.has(De.locatorHash))return;let ae=u.get(he.locatorHash),ue=typeof ae!="undefined"?ae+1:1;u.set(he.locatorHash,ue),F(De,X,{top:W,optional:le}),u.set(he.locatorHash,ue-1)}),qe.push(()=>{let ae=re.dependencies.get(ie.identHash);if(typeof ae=="undefined")throw new Error("Assertion failed: Expected the peer dependency to have been turned into a dependency");let ue=r.get(ae.descriptorHash);if(typeof ue=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");if(rA(I,ue).add(K.locatorHash),!!i.has(De.locatorHash)){for(let we of De.peerDependencies.values()){let lt=X.get(we.identHash);if(typeof lt=="undefined")throw new Error("Assertion failed: Expected the peer dependency ident to be registered");Gl(ql(m,lt),pt(we)).push(De.locatorHash)}for(let we of Z)De.dependencies.delete(we)}})}for(let ie of[...R,...ke])ie();let Ke;do{Ke=!0;for(let[ie,le,Se]of H){if(!i.has(Se.locatorHash))continue;let he=ql(f,ie.locatorHash),Ie=ni(...[...Se.dependencies.values()].map(X=>{let ae=X.range!=="missing:"?r.get(X.descriptorHash):"missing:";if(typeof ae=="undefined")throw new Error(`Assertion failed: Expected the resolution for ${Kt(t.configuration,X)} to have been registered`);return ae===W?`${ae} (top)`:ae}),le.identHash),pe=he.get(Ie);if(typeof pe=="undefined"){he.set(Ie,le);continue}if(pe===le)continue;Ke=!1,i.delete(Se.locatorHash),e.delete(le.descriptorHash),r.delete(le.descriptorHash),n.delete(Se.lo
|
|||
|
`),(await xe.start({configuration:e,json:this.json,stdout:this.context.stdout,includeLogs:!this.context.quiet},async I=>{await r.install({cache:n,report:I})})).exitCode()}};fp.paths=[["add"]],fp.usage=fe.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 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","$0 add lodash"],["Add a specific version for a package to the current workspace","$0 add lodash@1.2.3"],["Add a package from a GitHub repository (the master branch) to the current workspace using a URL","$0 add lodash@https://github.com/lodash/lodash"],["Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol","$0 add lodash@github:lodash/lodash"],["Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol (shorthand)","$0 add lodash@lodash/lodash"],["Add a package from a specific branch of a GitHub repository to the current workspace using the GitHub protocol (shorthand)","$0 add lodash-es@lodash/lodash#es"]]});var k$=fp;function UTe(t,e,{dev:r,peer:i,preferDev:n,optional:s}){let o=t.m
|
|||
|
`),0}return(await xe.start({configuration:e,json:this.json,stdout:this.context.stdout},async s=>{let o=await bt.getPackageAccessibleBinaries(i,{project:r}),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:Q.stringifyIdent(u),path:g});if(this.verbose)for(let[c,[u]]of o)s.reportInfo(null,`${c.padEnd(l," ")} ${Q.prettyLocator(e,u)}`);else for(let c of o.keys())s.reportInfo(null,c)})).exitCode()}};pp.paths=[["bin"]],pp.usage=fe.Usage({description:"get the path to a binary script",details:`
|
|||
|
When used without arguments, this command will print the list of all the binaries available in the current workspace. Adding the \`-v,--verbose\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary.
|
|||
|
|
|||
|
When an argument is specified, this command will just print the path to the binary on the standard output and exit. Note that the reported path may be stored within a zip archive.
|
|||
|
`,examples:[["List all the available binaries","$0 bin"],["Print the path to a specific binary","$0 bin eslint"]]});var v$=pp;var dp=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),r=await gt.find(e);return(await xe.start({configuration:e,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&r.mirrorCwd!==null,s=!this.mirror;n&&(await M.removePromise(r.mirrorCwd),await e.triggerHook(o=>o.cleanGlobalArtifacts,e)),s&&await M.removePromise(r.cwd)})).exitCode()}};dp.paths=[["cache","clean"],["cache","clear"]],dp.usage=fe.Usage({description:"remove the shared cache files",details:`
|
|||
|
This command will remove all the files from the cache.
|
|||
|
`,examples:[["Remove all the local archives","$0 cache clean"],["Remove all the archives stored in the ~/.yarn directory","$0 cache clean --mirror"]]});var F$=dp;var R$=ee(xy()),uv=ee(require("util")),Cp=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),r=this.name.replace(/[.[].*$/,""),i=this.name.replace(/^[^.[]*/,"");if(typeof e.settings.get(r)=="undefined")throw new me(`Couldn't find a configuration settings named "${r}"`);let s=e.getSpecial(r,{hideSecrets:!this.unsafe,getNativePaths:!0}),o=de.convertMapsToIndexableObjects(s),a=i?(0,R$.default)(o,i):o,l=await xe.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}
|
|||
|
`),l.exitCode();uv.inspect.styles.name="cyan",this.context.stdout.write(`${(0,uv.inspect)(a,{depth:Infinity,colors:e.get("enableColors"),compact:!1})}
|
|||
|
`)}return l.exitCode()}};Cp.paths=[["config","get"]],Cp.usage=fe.Usage({description:"read a configuration settings",details:`
|
|||
|
This command will print a configuration setting.
|
|||
|
|
|||
|
Secrets (such as tokens) will be redacted from the output by default. If this behavior isn't desired, set the \`--no-redacted\` to get the untransformed value.
|
|||
|
`,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",`yarn config get '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 L$=Cp;var Jee=ee(Cv()),Wee=ee(xy()),zee=ee(jee()),mv=ee(require("util")),Ip=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),r=()=>{if(!e.projectCwd)throw new me("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 me(`Couldn't find a configuration settings named "${i}"`);let o=this.json?JSON.parse(this.value):this.value;await(this.home?f=>Ae.updateHomeConfiguration(f):f=>Ae.updateConfiguration(r(),f))(f=>{if(n){let p=(0,Jee.default)(f);return(0,zee.default)(p,this.name,o),p}else return V(k({},f),{[i]:o})});let c=(await Ae.find(this.context.cwd,this.context.plugins)).getSpecial(i,{hideSecrets:!0,getNativePaths:!0}),u=de.convertMapsToIndexableObjects(c),g=n?(0,Wee.default)(u,n):u;return(await xe.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async f=>{mv.inspect.styles.name="cyan",f.reportInfo(z.UNNAMED,`Successfully set ${this.name} to ${(0,mv.inspect)(g,{depth:Infinity,colors:e.get("enableColors"),compact:!1})}`)})).exitCode()}};Ip.paths=[["config","set"]],Ip.usage=fe.Usage({description:"change a configuration settings",details:`
|
|||
|
This command will set a configuration setting.
|
|||
|
|
|||
|
When used without the \`--json\` flag, it can only set a simple configuration setting (a string, a number, or a boolean).
|
|||
|
|
|||
|
When used with the \`--json\` flag, it can set both simple and complex configuration settings, including Arrays and Objects.
|
|||
|
`,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",`yarn config set unsafeHttpWhitelist --json '["*.example.com", "example.com"]'`],["Set a complex configuration setting (an Object) using the `--json` flag",`yarn config set packageExtensions --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",`yarn config set 'npmRegistries["//npm.example.com"].npmAuthToken' "ffffffff-ffff-ffff-ffff-ffffffffffff"`]]});var Vee=Ip;var nte=ee(Cv()),ste=ee(ite()),Ep=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),r=()=>{if(!e.projectCwd)throw new me("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 me(`Couldn't find a configuration settings named "${i}"`);return await(this.home?l=>Ae.updateHomeConfiguration(l):l=>Ae.updateConfiguration(r(),l))(l=>{let c=n?(0,nte.default)(l):k({},l);return(0,ste.default)(c,this.name),c}),(await xe.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async l=>{l.reportInfo(z.UNNAMED,`Successfully unset ${this.name}`)})).exitCode()}};Ep.paths=[["config","unset"]],Ep.usage=fe.Usage({description:"unset a configuration setting",details:`
|
|||
|
This command will unset a configuration setting.
|
|||
|
`,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 ote=Ep;var Iv=ee(require("util")),yp=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins,{strict:!1});return(await xe.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(z.INVALID_CONFIGURATION_KEY,`Invalid configuration key "${n}" in ${s}`);i.reportSeparator()}if(this.json){let n=de.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(k({key:s,effective:a,source:l},o))}}else{let n=de.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(`Assertion failed: This settings ("${c}") should have been registered`);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,Iv.inspect)(e.getSpecial(c,{hideSecrets:!0,getNativePaths:!0}),o)}`)}else for(let a of n)i.reportInfo(null,`${a.padEnd(s," ")} ${(0,Iv.inspect)(e.getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),o)}`)}})).exitCode()}};yp.paths=[["config"]],yp.usage=fe.Usage({description:"display the current configuration",details:`
|
|||
|
This command prints the current active configuration settings.
|
|||
|
`,examples:[["Print the active configuration settings","$0 config"]]});var ate=yp;No();var Ev={};$e(Ev,{Strategy:()=>ul,acceptedStrategies:()=>G2e,dedupe:()=>yv});var Ate=ee(Ti()),ul;(function(e){e.HIGHEST="highest"})(ul||(ul={}));var G2e=new Set(Object.values(ul)),q2e={highest:async(t,e,{resolver:r,fetcher:i,resolveOptions:n,fetchOptions:s})=>{let o=new Map;for(let[a,l]of t.storedResolutions){let c=t.storedDescriptors.get(a);if(typeof c=="undefined")throw new Error(`Assertion failed: The descriptor (${a}) should have been registered`);de.getSetWithDefault(o,c.identHash).add(l)}return Array.from(t.storedDescriptors.values(),async a=>{if(e.length&&!Ate.default.isMatch(Q.stringifyIdent(a),e))return null;let l=t.storedResolutions.get(a.descriptorHash);if(typeof l=="undefined")throw new Error(`Assertion failed: The resolution (${a.descriptorHash}) should have been registered`);let c=t.originalPackages.get(l);if(typeof c=="undefined"||!r.shouldPersistResolution(c,n))return null;let u=o.get(a.identHash);if(typeof u=="undefined")throw new Error(`Assertion failed: The resolutions (${a.identHash}) should have been registered`);if(u.size===1)return null;let g=[...u].map(I=>{let y=t.originalPackages.get(I);if(typeof y=="undefined")throw new Error(`Assertion failed: The package (${I}) should have been registered`);return y.reference}),h=await r.getSatisfying(a,g,n),f=h==null?void 0:h[0];if(typeof f=="undefined")return null;let p=f.locatorHash,m=t.originalPackages.get(p);if(typeof m=="undefined")throw new Error(`Assertion failed: The package (${p}) should have been registered`);return p===l?null:{descriptor:a,currentPackage:c,updatedPackage:m}})}};async function yv(t,{strategy:e,patterns:r,cache:i,report:n}){let{configuration:s}=t,o=new Br,a=s.makeResolver(),l=s.makeFetcher(),c={cache:i,checksums:t.storedChecksums,fetcher:l,project:t,report:o,skipIntegrityCheck:!0},u={project:t,resolver:a,report:o,fetchOptions:c};return await n.startTimerPromise("Deduplication step",async()=>{let h=await q2e[e](t,r,{resolver:a,resolveOptions:u,fetcher:l,fetchOptions:c}),f=ai.progressViaCounter(h.length);n.reportProgress(f);let p=0;await Promise.all(h.map(y=>y.then(B=>{if(B===null)return;p++;let{descriptor:D,currentPackage:F,updatedPackage:N}=B;n.reportInfo(z.UNNAMED,`${Q.prettyDescriptor(s,D)} can be deduped from ${Q.prettyLocator(s,F)} to ${Q.prettyLocator(s,N)}`),n.reportJson({descriptor:Q.stringifyDescriptor(D),currentResolution:Q.stringifyLocator(F),updatedResolution:Q.stringifyLocator(N)}),t.storedResolutions.set(D.descriptorHash,N.locatorHash)}).finally(()=>f.tick())));let m;switch(p){case 0:m="No packages";break;case 1:m="One package";break;default:m=`${p} packages`}let I=ce.pretty(s,e,ce.Type.CODE);return n.reportInfo(z.UNNAMED,`${m} can be deduped using the ${I} strategy`),p})}var Bp=class extends Be{constructor(){super(...arguments);this.strategy=j.String("-s,--strategy",ul.HIGHEST,{description:"The strategy to use when deduping dependencies",validator:Hl(ul)});this.check=j.Boolean("-c,--check",!1,{description:"Exit with exit code 1 when duplicates are found, without persisting the dependency tree"});this.json=j.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=j.Rest()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r}=await Fe.find(e,this.context.cwd),i=await gt.find(e);await r.restoreInstallState({restoreResolutions:!1});let n=0,s=await xe.start({configuration:e,includeFooter:!1,stdout:this.context.stdout,json:this.json},async o=>{n=await yv(r,{strategy:this.strategy,patterns:this.patterns,cache:i,report:o})});return s.hasErrors()?s.exitCode():this.check?n?1:0:(await xe.start({configuration:e,stdout:this.context.stdout,json:this.json},async a=>{await r.install({cache:i,report:a})})).exitCode()}};Bp.paths=[["dedupe"]],Bp.usage=fe.Usage({description:"deduplicate dependencies with overlapping ranges",details:"\n Duplicates are defined as descriptors with overlapping ranges being resolved and locked to different locators. They are a natural consequence of Ya
|
|||
|
`)}};rB.paths=[["--clipanion=definitions"]];var gte=rB;var iB=class extends fe{async execute(){this.context.stdout.write(this.cli.usage(null))}};iB.paths=[["help"],["--help"],["-h"]];var hte=iB;var Bv=class extends fe{constructor(){super(...arguments);this.leadingArgument=j.String();this.args=j.Proxy()}async execute(){if(this.leadingArgument.match(/[\\/]/)&&!Q.tryParseIdent(this.leadingArgument)){let e=w.resolve(this.context.cwd,L.toPortablePath(this.leadingArgument));return await this.cli.run(this.args,{cwd:e})}else return await this.cli.run(["run",this.leadingArgument,...this.args])}},fte=Bv;var nB=class extends fe{async execute(){this.context.stdout.write(`${Gi||"<unknown>"}
|
|||
|
`)}};nB.paths=[["-v"],["--version"]];var pte=nB;var wp=class extends Be{constructor(){super(...arguments);this.commandName=j.String();this.args=j.Proxy()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,locator:i}=await Fe.find(e,this.context.cwd);return await M.mktempPromise(async n=>{let{code:s}=await pr.pipevp(this.commandName,this.args,{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:await bt.makeScriptEnv({project:r,locator:i,binFolder:n})});return s})}};wp.paths=[["exec"]],wp.usage=fe.Usage({description:"execute a shell command",details:`
|
|||
|
This command simply executes a shell binary within the context of the root directory of the active workspace.
|
|||
|
|
|||
|
It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
|
|||
|
`,examples:[["Execute a shell command","$0 exec echo Hello World"]]});var dte=wp;No();var Qp=class extends Be{constructor(){super(...arguments);this.hash=j.String({required:!1,validator:BQ(yQ(),[wQ(/^p[0-9a-f]{5}$/)])})}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r}=await Fe.find(e,this.context.cwd);return await r.restoreInstallState({restoreResolutions:!1}),await r.applyLightResolution(),typeof this.hash!="undefined"?await j2e(this.hash,r,{stdout:this.context.stdout}):(await xe.start({configuration:e,stdout:this.context.stdout,includeFooter:!1},async n=>{var o;let s=[([,a])=>Q.stringifyLocator(r.storedPackages.get(a.subject)),([,a])=>Q.stringifyIdent(a.requested)];for(let[a,l]of de.sortMap(r.peerRequirements,s)){let c=r.storedPackages.get(l.subject);if(typeof c=="undefined")throw new Error("Assertion failed: Expected the subject package to have been registered");let u=r.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,h=ce.pretty(e,a,ce.Type.CODE),f=Q.prettyLocator(e,c),p=Q.prettyIdent(e,l.requested),m=Q.prettyIdent(e,u),I=l.allRequesters.length-1,y=`descendant${I===1?"":"s"}`,B=I>0?` and ${I} ${y}`:"",D=g!==null?"provides":"doesn't provide";n.reportInfo(null,`${h} \u2192 ${f} ${D} ${p} to ${m}${B}`)}})).exitCode()}};Qp.paths=[["explain","peer-requirements"]],Qp.usage=fe.Usage({description:"explain a set of peer requirements",details:`
|
|||
|
A set of peer requirements represents all peer requirements that a dependent must satisfy when providing a given peer request to a requester and its descendants.
|
|||
|
|
|||
|
When the hash argument is specified, this command prints a detailed explanation of all requirements of the set corresponding to the hash and whether they're satisfied or not.
|
|||
|
|
|||
|
When used without arguments, this command lists all sets of peer requirements and the corresponding hash that can be used to get detailed information about a given set.
|
|||
|
|
|||
|
**Note:** A hash is a six-letter p-prefixed code that can be obtained from peer dependency warnings or from the list of all peer requirements (\`yarn explain peer-requirements\`).
|
|||
|
`,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 Cte=Qp;async function j2e(t,e,r){let{configuration:i}=e,n=e.peerRequirements.get(t);if(typeof n=="undefined")throw new Error(`No peerDependency requirements found for hash: "${t}"`);return(await xe.start({configuration:i,stdout:r.stdout,includeFooter:!1},async o=>{var y,B;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=(y=a.dependencies.get(n.requested.identHash))!=null?y: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 h=[...n.allRequesters.values()].map(D=>{let F=e.storedPackages.get(D);if(typeof F=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let N=Q.devirtualizeLocator(F),U=e.storedPackages.get(N.locatorHash);if(typeof U=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let v=U.peerDependencies.get(n.requested.identHash);if(typeof v=="undefined")throw new Error("Assertion failed: Expected the peer dependency to be registered");return{pkg:F,peerDependency:v}});if(g!==null){let D=h.every(({peerDependency:F})=>vt.satisfiesWithPrereleases(g.version,F.range));o.reportInfo(z.UNNAMED,`${Q.prettyLocator(i,a)} provides ${Q.prettyLocator(i,g)} with version ${Q.prettyReference(i,(B=g.version)!=null?B:"<missing>")}, which ${D?"satisfies":"doesn't satisfy"} the following requirements:`)}else o.reportInfo(z.UNNAMED,`${Q.prettyLocator(i,a)} doesn't provide ${Q.prettyIdent(i,n.requested)}, breaking the following requirements:`);o.reportSeparator();let f=ce.mark(i),p=[];for(let{pkg:D,peerDependency:F}of de.sortMap(h,N=>Q.stringifyLocator(N.pkg))){let U=(g!==null?vt.satisfiesWithPrereleases(g.version,F.range):!1)?f.Check:f.Cross;p.push({stringifiedLocator:Q.stringifyLocator(D),prettyLocator:Q.prettyLocator(i,D),prettyRange:Q.prettyRange(i,F.range),mark:U})}let m=Math.max(...p.map(({stringifiedLocator:D})=>D.length)),I=Math.max(...p.map(({prettyRange:D})=>D.length));for(let{stringifiedLocator:D,prettyLocator:F,prettyRange:N,mark:U}of de.sortMap(p,({stringifiedLocator:v})=>v))o.reportInfo(null,`${F.padEnd(m+(F.length-D.length)," ")} \u2192 ${N.padEnd(I," ")} ${U}`);p.length>1&&(o.reportSeparator(),o.reportInfo(z.UNNAMED,`Note: these requirements start with ${Q.prettyLocator(e.configuration,l)}`))})).exitCode()}var mte=ee(Ti()),bp=class extends Be{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 Ae.fin
|
|||
|
This command setup your project if needed. The installation is splitted in four different steps that each have their own characteristics:
|
|||
|
|
|||
|
- **Resolution:** First the package manager will resolve your dependencies. The exact way a dependency version is privileged over another isn't standardized outside of the regular semver guarantees. If a package doesn't resolve to what you would expect, check that all dependencies are correctly declared (also check our website for more information: ).
|
|||
|
|
|||
|
- **Fetch:** Then we download all the dependencies if needed, and make sure that they're all stored within our cache (check the value of \`cacheFolder\` in \`yarn config\` to see where are stored the cache files).
|
|||
|
|
|||
|
- **Link:** Then we send the dependency tree information to internal plugins tasked from writing them on the disk in some form (for example by generating the .pnp.cjs file you might know).
|
|||
|
|
|||
|
- **Build:** Once the dependency tree has been written on the disk, the package manager will now be free to run the build scripts for all packages that might need it, in a topological order compatible with the way they depend on one another.
|
|||
|
|
|||
|
Note that running this command is not part of the recommended workflow. Yarn supports zero-installs, which means that as long as you store your cache and your .pnp.cjs file inside your repository, everything will work without requiring any install right after cloning your repository or switching branches.
|
|||
|
|
|||
|
If the \`--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.
|
|||
|
|
|||
|
If the \`--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).
|
|||
|
|
|||
|
If the \`--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.
|
|||
|
|
|||
|
If the \`--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.
|
|||
|
|
|||
|
If the \`--skip-builds\` option is set, Yarn 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.
|
|||
|
`,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 Ete=Sp,W2e="|||||||",z2e=">>>>>>>",V2e="=======",yte="<<<<<<<";async function J2e(t,e){if(!t.projectCwd)return!1;let r=w.join(t.projectCwd,t.get("lockfileFilename"));if(!await M.existsPromise(r))return!1;let i=await M.readFilePromise(r,"utf8");if(!i.includes(yte))return!1;if(e)throw new Ze(z.AUTOMERGE_IMMUTABLE,"Cannot autofix a lockfile when running an immutable install");let[n,s]=X2e(i),o,a;try{o=Nr(n),a=Nr(s)}catch(c){throw new Ze(z.AUTOMERGE_FAILED_TO_PARSE,"The individual variants of the lockfile failed to parse")}let l=k(k({},o),a);for(let[c,u]of Object.entries(l))typeof u=="string"&&delete l[c];return await M.changeFilePromise(r,$s(l),{automaticNewlines:!0}),!0}function X2e(t){let e=[[],[]],r=t.split(/\r?\n/g),i=!1;for(;r.length>0;){let n=r.shift();if(typeof n=="undefined")throw new Error("Assertion failed: Some lines should remain");if(n.startsWith(yte)){for(;r.length>0;){let s=r.shift();if(typeof s=="undefined")throw new Error("Assertion failed: Some lines should remain");if(s===V2e){i=!1;break}else if(i||s.startsWith(W2e)){i=!0;continue}else e[0].push(s)}for(;r.length>0;){let s=r.shift();if(typeof s=="undefined")throw new Error("Assertion failed: Some lines should remain");if(s.startsWith(z2e))break;e[1].push(s)}}else e[0].push(n),e[1].push(n)}return[e[0].join(`
|
|||
|
`),e[1].join(`
|
|||
|
`)]}var xp=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(!i)throw new Xe(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=w.resolve(this.context.cwd,L.toPortablePath(this.destination)),o=await Ae.find(s,this.context.plugins,{useRc:!1,strict:!1}),{project:a,workspace:l}=await Fe.find(o,s);if(r.cwd===a.cwd)throw new me("Invalid destination; Can't link the project to itself");if(!l)throw new Xe(a.cwd,s);let c=r.topLevelWorkspace,u=[];if(this.all){for(let h of a.workspaces)h.manifest.name&&(!h.manifest.private||this.private)&&u.push(h);if(u.length===0)throw new me("No workspace found to be linked in the target project")}else{if(!l.manifest.name)throw new me("The target workspace doesn't have a name and thus cannot be linked");if(l.manifest.private&&!this.private)throw new me("The target workspace is marked private - use the --private flag to link it anyway");u.push(l)}for(let h of u){let f=Q.stringifyIdent(h.locator),p=this.relative?w.relative(r.cwd,h.cwd):h.cwd;c.manifest.resolutions.push({pattern:{descriptor:{fullName:f}},reference:`portal:${p}`})}return(await xe.start({configuration:e,stdout:this.context.stdout},async h=>{await r.install({cache:n,report:h})})).exitCode()}};xp.paths=[["link"]],xp.usage=fe.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 Bte=xp;var Dp=class extends Be{constructor(){super(...arguments);this.args=j.Proxy()}async execute(){return this.cli.run(["exec","node",...this.args])}};Dp.paths=[["node"]],Dp.usage=fe.Usage({description:"run node with the hook already setup",details:`
|
|||
|
This command simply runs Node. It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
|
|||
|
|
|||
|
The Node process will use the exact same version of Node as the one used to run Yarn itself, which might be a good way to ensure that your commands always use a consistent Node version.
|
|||
|
`,examples:[["Run a Node script","$0 node ./my-script.js"]]});var wte=Dp;var Lte=ee(require("os"));var xte=ee(require("os"));var Z2e="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function gl(t){let e=await Ut.get(Z2e,{configuration:t});return Nr(e.toString())}var Pp=class extends Be{constructor(){super(...arguments);this.json=j.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins);return(await xe.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{let n=await gl(e);for(let s of Object.entries(n)){let[l,o]=s,a=o,{experimental:c}=a,u=vr(a,["experimental"]);let g=l;c&&(g+=" [experimental]"),i.reportJson(k({name:l,experimental:c},u)),i.reportInfo(null,g)}})).exitCode()}};Pp.paths=[["plugin","list"]],Pp.usage=fe.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 `yarn plugin import`.\n ",examples:[["List the official plugins","$0 plugin list"]]});var Qte=Pp;var bte=ee(Cr()),kp=class extends Be{constructor(){super(...arguments);this.onlyIfNeeded=j.Boolean("--only-if-needed",!1,{description:"Only lock the Yarn version if it isn't already locked"});this.version=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins);if(e.get("yarnPath")&&this.onlyIfNeeded)return 0;let r;if(this.version==="latest"||this.version==="berry")r="https://github.com/yarnpkg/berry/raw/master/packages/yarnpkg-cli/bin/yarn.js";else if(this.version==="classic")r="https://nightly.yarnpkg.com/latest.js";else if(vt.satisfiesWithPrereleases(this.version,">=2.0.0"))r=`https://github.com/yarnpkg/berry/raw/%40yarnpkg/cli/${this.version}/packages/yarnpkg-cli/bin/yarn.js`;else if(vt.satisfiesWithPrereleases(this.version,"^0.x || ^1.x"))r=`https://github.com/yarnpkg/yarn/releases/download/v${this.version}/yarn-${this.version}.js`;else throw vt.validRange(this.version)?new me("Support for ranges got removed - please use the exact version you want to install, or 'latest' to get the latest build available"):new me(`Invalid version descriptor "${this.version}"`);return(await xe.start({configuration:e,stdout:this.context.stdout},async n=>{n.reportInfo(z.UNNAMED,`Downloading ${ce.pretty(e,r,"green")}`);let s=await Ut.get(r,{configuration:e});await wv(e,null,s,{report:n})})).exitCode()}};kp.paths=[["set","version"]],kp.usage=fe.Usage({description:"lock the Yarn version used by the project",details:"\n This command will download a specific release of Yarn directly from the Yarn GitHub repository, will store it inside your project, and will change the `yarnPath` settings from your project `.yarnrc.yml` file to point to the new file.\n\n A very good use case for this command is to enforce the version of Yarn used by the any single member of your team inside a same project - by doing this you ensure that you have control on Yarn upgrades and downgrades (including on your deployment servers), and get rid of most of the headaches related to someone using a slightly different version and getting a different behavior than you.\n ",examples:[["Download the latest release from the Yarn repository","$0 set version latest"],["Download the latest classic release from the Yarn repository","$0 set version classic"],["Download a specific Yarn 2 build","$0 set version 2.0.0-rc.30"],["Switch back to a specific Yarn 1 release","$0 set version 1.22.1"]]});var Ste=kp;async function wv(t,e,r,{report:i}){var g;e===null&&await M.mktempPromise(async h=>{let f=w.join(h,"yarn.cjs");await M.writeFilePromise(f,r);let{stdout:p}=await pr.execvp(process.execPath,[L.fromPortablePath(f),"--version"],{cwd:h,env:V(k({},process.env),{YARN_IGNORE_PATH:"1"})});if(e=p.trim(),!bte.default.valid(e))throw new Error(`Invalid semver version. ${ce.pretty(t,"yarn --version",ce.Type.CODE)} returned:
|
|||
|
${e}`)});let n=(g=t.projectCwd)!=null?g:t.startingCwd,s=w.resolve(n,".yarn/releases"),o=w.resolve(s,`yarn-${e}.cjs`),a=w.relative(t.startingCwd,o),l=w.relative(n,o),c=t.get("yarnPath"),u=c===null||c.startsWith(`${s}/`);i.reportInfo(z.UNNAMED,`Saving the new release in ${ce.pretty(t,a,"magenta")}`),await M.removePromise(w.dirname(o)),await M.mkdirPromise(w.dirname(o),{recursive:!0}),await M.writeFilePromise(o,r),await M.chmodPromise(o,493),u&&await Ae.updateConfiguration(n,{yarnPath:l})}var _2e=/^[0-9]+$/;function Dte(t){return _2e.test(t)?`pull/${t}/head`:t}var $2e=({repository:t,branch:e},r)=>[["git","init",L.fromPortablePath(r)],["git","remote","add","origin",t],["git","fetch","origin",Dte(e)],["git","reset","--hard","FETCH_HEAD"]],eHe=({branch:t})=>[["git","fetch","origin",Dte(t),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx"]],tHe=({plugins:t,noMinify:e},r)=>[["yarn","build:cli",...new Array().concat(...t.map(i=>["--plugin",w.resolve(r,i)])),...e?["--no-minify"]:[],"|"]],vp=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),{project:r}=await Fe.find(e,this.context.cwd),i=typeof this.installPath!="undefined"?w.resolve(this.context.cwd,L.toPortablePath(this.installPath)):w.resolve(L.toPortablePath((0,xte.tmpdir)()),"yarnpkg-sources",wi.makeHash(this.repository).slice(0,6));return(await xe.start({configuration:e,stdout:this.context.stdout},async s=>{await bv(this,{configuration:e,report:s,target:i}),s.reportSeparator(),s.reportInfo(z.UNNAMED,"Building a fresh bundle"),s.reportSeparator(),await Fp(tHe(this,i),{configuration:e,context:this.context,target:i}),s.reportSeparator();let o=w.resolve(i,"packages/yarnpkg-cli/bundles/yarn.js"),a=await M.readFilePromise(o);await wv(e,"sources",a,{report:s}),this.skipPlugins||await rHe(this,{project:r,report:s,target:i})})).exitCode()}};vp.paths=[["set","version","from","sources"]],vp.usage=fe.Usage({description:"build Yarn from master",details:`
|
|||
|
This command will clone the Yarn repository into a temporary folder, then build it. The resulting bundle will then be copied into the local project.
|
|||
|
|
|||
|
By default, it also updates all contrib plugins to the same commit the bundle is built from. This behavior can be disabled by using the \`--skip-plugins\` flag.
|
|||
|
`,examples:[["Build Yarn from master","$0 set version from sources"]]});var Pte=vp;async function Fp(t,{configuration:e,context:r,target:i}){for(let[n,...s]of t){let o=s[s.length-1]==="|";if(o&&s.pop(),o)await pr.pipevp(n,s,{cwd:i,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,strict:!0});else{r.stdout.write(`${ce.pretty(e,` $ ${[n,...s].join(" ")}`,"grey")}
|
|||
|
`);try{await pr.execvp(n,s,{cwd:i,strict:!0})}catch(a){throw r.stdout.write(a.stdout||a.stack),a}}}}async function bv(t,{configuration:e,report:r,target:i}){let n=!1;if(!t.force&&M.existsSync(w.join(i,".git"))){r.reportInfo(z.UNNAMED,"Fetching the latest commits"),r.reportSeparator();try{await Fp(eHe(t),{configuration:e,context:t.context,target:i}),n=!0}catch(s){r.reportSeparator(),r.reportWarning(z.UNNAMED,"Repository update failed; we'll try to regenerate it")}}n||(r.reportInfo(z.UNNAMED,"Cloning the remote repository"),r.reportSeparator(),await M.removePromise(i),await M.mkdirPromise(i,{recursive:!0}),await Fp($2e(t,i),{configuration:e,context:t.context,target:i}))}async function rHe(t,{project:e,report:r,target:i}){let n=await gl(e.configuration),s=new Set(Object.keys(n));for(let o of e.configuration.plugins.keys())!s.has(o)||await Qv(o,t,{project:e,report:r,target:i})}var kte=ee(Cr()),vte=ee(require("url")),Fte=ee(require("vm"));var Rp=class extends Be{constructor(){super(...arguments);this.name=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins);return(await xe.start({configuration:e,stdout:this.context.stdout},async i=>{let{project:n}=await Fe.find(e,this.context.cwd),s,o;if(this.name.match(/^\.{0,2}[\\/]/)||L.isAbsolute(this.name)){let a=w.resolve(this.context.cwd,L.toPortablePath(this.name));i.reportInfo(z.UNNAMED,`Reading ${ce.pretty(e,a,ce.Type.PATH)}`),s=w.relative(n.cwd,a),o=await M.readFilePromise(a)}else{let a;if(this.name.match(/^https?:/)){try{new vte.URL(this.name)}catch{throw new Ze(z.INVALID_PLUGIN_REFERENCE,`Plugin specifier "${this.name}" is neither a plugin name nor a valid url`)}s=this.name,a=this.name}else{let l=Q.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(l.reference!=="unknown"&&!kte.default.valid(l.reference))throw new Ze(z.UNNAMED,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let c=Q.stringifyIdent(l),u=await gl(e);if(!Object.prototype.hasOwnProperty.call(u,c))throw new Ze(z.PLUGIN_NAME_NOT_FOUND,`Couldn't find a plugin named "${c}" on the remote registry. Note that only the plugins referenced on our website (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}/`):Gi!==null&&(a=a.replace(/\/master\//,`/@yarnpkg/cli/${Gi}/`))}i.reportInfo(z.UNNAMED,`Downloading ${ce.pretty(e,a,"green")}`),o=await Ut.get(a,{configuration:e})}await Sv(s,o,{project:n,report:i})})).exitCode()}};Rp.paths=[["plugin","import"]],Rp.usage=fe.Usage({category:"Plugin-related commands",description:"download a plugin",details:`
|
|||
|
This command downloads the specified plugin from its remote location and updates the configuration to reference it in further CLI invocations.
|
|||
|
|
|||
|
Three types of plugin references are accepted:
|
|||
|
|
|||
|
- If the plugin is stored within the Yarn repository, it can be referenced by name.
|
|||
|
- Third-party plugins can be referenced directly through their public urls.
|
|||
|
- Local plugins can be referenced by their path on the disk.
|
|||
|
|
|||
|
Plugins cannot be downloaded from the npm registry, and aren't allowed to have dependencies (they need to be bundled into a single file, possibly thanks to the \`@yarnpkg/builder\` package).
|
|||
|
`,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 Rte=Rp;async function Sv(t,e,{project:r,report:i}){let{configuration:n}=r,s={},o={exports:s};(0,Fte.runInNewContext)(e.toString(),{module:o,exports:s});let a=o.exports.name,l=`.yarn/plugins/${a}.cjs`,c=w.resolve(r.cwd,l);i.reportInfo(z.UNNAMED,`Saving the new plugin in ${ce.pretty(n,l,"magenta")}`),await M.mkdirPromise(w.dirname(c),{recursive:!0}),await M.writeFilePromise(c,e);let u={path:l,spec:t};await Ae.updateConfiguration(r.cwd,g=>{let h=[],f=!1;for(let p of g.plugins||[]){let m=typeof p!="string"?p.path:p,I=w.resolve(r.cwd,L.toPortablePath(m)),{name:y}=de.dynamicRequire(L.fromPortablePath(I));y!==a?h.push(p):(h.push(u),f=!0)}return f||h.push(u),V(k({},g),{plugins:h})})}var iHe=({pluginName:t,noMinify:e},r)=>[["yarn",`build:${t}`,...e?["--no-minify"]:[],"|"]],Lp=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),r=typeof this.installPath!="undefined"?w.resolve(this.context.cwd,L.toPortablePath(this.installPath)):w.resolve(L.toPortablePath((0,Lte.tmpdir)()),"yarnpkg-sources",wi.makeHash(this.repository).slice(0,6));return(await xe.start({configuration:e,stdout:this.context.stdout},async n=>{let{project:s}=await Fe.find(e,this.context.cwd),o=Q.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),a=Q.stringifyIdent(o),l=await gl(e);if(!Object.prototype.hasOwnProperty.call(l,a))throw new Ze(z.PLUGIN_NAME_NOT_FOUND,`Couldn't find a plugin named "${a}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let c=a;await bv(this,{configuration:e,report:n,target:r}),await Qv(c,this,{project:s,report:n,target:r})})).exitCode()}};Lp.paths=[["plugin","import","from","sources"]],Lp.usage=fe.Usage({category:"Plugin-related commands",description:"build a plugin from sources",details:`
|
|||
|
This command clones the Yarn repository into a temporary folder, builds the specified contrib plugin and updates the configuration to reference it in further CLI invocations.
|
|||
|
|
|||
|
The plugins can be referenced by their short name if sourced from the official Yarn repository.
|
|||
|
`,examples:[['Build and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import from sources @yarnpkg/plugin-exec"],['Build and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import from sources exec"]]});var Nte=Lp;async function Qv(t,{context:e,noMinify:r},{project:i,report:n,target:s}){let o=t.replace(/@yarnpkg\//,""),{configuration:a}=i;n.reportSeparator(),n.reportInfo(z.UNNAMED,`Building a fresh ${o}`),n.reportSeparator(),await Fp(iHe({pluginName:o,noMinify:r},s),{configuration:a,context:e,target:s}),n.reportSeparator();let l=w.resolve(s,`packages/${o}/bundles/${t}.js`),c=await M.readFilePromise(l);await Sv(t,c,{project:i,report:n})}var Np=class extends Be{constructor(){super(...arguments);this.name=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r}=await Fe.find(e,this.context.cwd);return(await xe.start({configuration:e,stdout:this.context.stdout},async n=>{let s=this.name,o=Q.parseIdent(s);if(!e.plugins.has(s))throw new me(`${Q.prettyIdent(e,o)} isn't referenced by the current configuration`);let a=`.yarn/plugins/${s}.cjs`,l=w.resolve(r.cwd,a);M.existsSync(l)&&(n.reportInfo(z.UNNAMED,`Removing ${ce.pretty(e,a,ce.Type.PATH)}...`),await M.removePromise(l)),n.reportInfo(z.UNNAMED,"Updating the configuration..."),await Ae.updateConfiguration(r.cwd,c=>{if(!Array.isArray(c.plugins))return c;let u=c.plugins.filter(g=>g.path!==a);return c.plugins.length===u.length?c:V(k({},c),{plugins:u})})})).exitCode()}};Np.paths=[["plugin","remove"]],Np.usage=fe.Usage({category:"Plugin-related commands",description:"remove a plugin",details:`
|
|||
|
This command deletes the specified plugin from the .yarn/plugins folder and removes it from the configuration.
|
|||
|
|
|||
|
**Note:** The plugins have to be referenced by their name property, which can be obtained using the \`yarn plugin runtime\` command. Shorthands are not allowed.
|
|||
|
`,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 Mte=Np;var Mp=class extends Be{constructor(){super(...arguments);this.json=j.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins);return(await xe.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()}};Mp.paths=[["plugin","runtime"]],Mp.usage=fe.Usage({category:"Plugin-related commands",description:"list the active plugins",details:`
|
|||
|
This command prints the currently active plugins. Will be displayed both builtin plugins and external plugins.
|
|||
|
`,examples:[["List the currently active plugins","$0 plugin runtime"]]});var Ote=Mp;var Op=class extends Be{constructor(){super(...arguments);this.idents=j.Rest()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(!i)throw new Xe(r.cwd,this.context.cwd);let s=new Set;for(let a of this.idents)s.add(Q.parseIdent(a).identHash);if(await r.restoreInstallState({restoreResolutions:!1}),await r.resolveEverything({cache:n,report:new Br}),s.size>0)for(let a of r.storedPackages.values())s.has(a.identHash)&&r.storedBuildState.delete(a.locatorHash);else r.storedBuildState.clear();return(await xe.start({configuration:e,stdout:this.context.stdout,includeLogs:!this.context.quiet},async a=>{await r.install({cache:n,report:a})})).exitCode()}};Op.paths=[["rebuild"]],Op.usage=fe.Usage({description:"rebuild the project's native packages",details:`
|
|||
|
This command will automatically cause Yarn to forget about previous compilations of the given packages and to run them again.
|
|||
|
|
|||
|
Note that while Yarn forgets the compilation, the previous artifacts aren't erased from the filesystem and may affect the next builds (in good or bad). To avoid this, you may remove the .yarn/unplugged folder, or any other relevant location where packages might have been stored (Yarn may offer a way to do that automatically in the future).
|
|||
|
|
|||
|
By default all packages will be rebuilt, but you can filter the list by specifying the names of the packages you want to clear from memory.
|
|||
|
`,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]});var Kte=Op;var xv=ee(Ti());var Kp=class extends Be{constructor(){super(...arguments);this.all=j.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.patterns=j.Rest()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(!i)throw new Xe(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=this.all?r.workspaces:[i],o=[er.REGULAR,er.DEVELOPMENT,er.PEER],a=[],l=!1,c=[];for(let f of this.patterns){let p=!1,m=Q.parseIdent(f);for(let I of s){let y=[...I.manifest.peerDependenciesMeta.keys()];for(let B of(0,xv.default)(y,f))I.manifest.peerDependenciesMeta.delete(B),l=!0,p=!0;for(let B of o){let D=I.manifest.getForScope(B),F=[...D.values()].map(N=>Q.stringifyIdent(N));for(let N of(0,xv.default)(F,Q.stringifyIdent(m))){let{identHash:U}=Q.parseIdent(N),v=D.get(U);if(typeof v=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");I.manifest[B].delete(U),c.push([I,B,v]),l=!0,p=!0}}}p||a.push(f)}let u=a.length>1?"Patterns":"Pattern",g=a.length>1?"don't":"doesn't",h=this.all?"any":"this";if(a.length>0)throw new me(`${u} ${ce.prettyList(e,a,XA.CODE)} ${g} match any packages referenced by ${h} workspace`);return l?(await e.triggerMultipleHooks(p=>p.afterWorkspaceDependencyRemoval,c),(await xe.start({configuration:e,stdout:this.context.stdout},async p=>{await r.install({cache:n,report:p})})).exitCode()):0}};Kp.paths=[["remove"]],Kp.usage=fe.Usage({description:"remove dependencies from the project",details:`
|
|||
|
This command will remove the packages matching the specified patterns from the current workspace.
|
|||
|
|
|||
|
This command accepts glob patterns as arguments (if valid Idents 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.
|
|||
|
`,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 Tte=Kp;var Ute=ee(require("util")),sB=class extends Be{async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd);if(!i)throw new Xe(r.cwd,this.context.cwd);return(await xe.start({configuration:e,stdout:this.context.stdout},async s=>{let o=i.manifest.scripts,a=de.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,Ute.inspect)(g,l)}`)})).exitCode()}};sB.paths=[["run"]];var Hte=sB;var Tp=class extends Be{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,{hidden:!0});this.binariesOnly=j.Boolean("-B,--binaries-only",!1,{hidden:!0});this.silent=j.Boolean("--silent",{hidden:!0});this.scriptName=j.String();this.args=j.Proxy()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i,locator:n}=await Fe.find(e,this.context.cwd);await r.restoreInstallState();let s=this.topLevel?r.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await bt.hasPackageScript(s,this.scriptName,{project:r}))return await bt.executePackageScript(s,this.scriptName,this.args,{project:r,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let o=await bt.getPackageAccessibleBinaries(s,{project:r});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 bt.executePackageAccessibleBinary(s,this.scriptName,this.args,{cwd:this.context.cwd,project:r,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(r.workspaces.map(async u=>u.manifest.scripts.has(this.scriptName)?u:null))).filter(u=>u!==null);if(c.length===1)return await bt.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 me(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${Q.prettyLocator(e,n)}). This typically happens because some package depends on "node-gyp" to build itself, but didn't list it in their dependencies. To fix that, please run "yarn add node-gyp" into your top-level workspace. You also can open an issue on the repository of the specified package to suggest them to use an optional peer dependency.`):new me(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${Q.prettyLocator(e,n)}).`);{if(this.scriptName==="global")throw new me("The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead");let l=[this.scriptName].concat(this.args);for(let[c,u]of cu)for(let g of u)if(l.length>=g.length&&JSON.stringify(l.slice(0,g.length))===JSON.stringify(g))throw new me(`Couldn't find a script named "${this.scriptName}", but a matching command can be found in the ${c} plugin. You can install it with "yarn plugin import ${c}".`);throw new me(`Couldn't find a script named "${this.s
|
|||
|
This command will run a tool. The exact tool that will be executed will depend on the current state of your workspace:
|
|||
|
|
|||
|
- If the \`scripts\` field from your local package.json contains a matching script name, its definition will get executed.
|
|||
|
|
|||
|
- Otherwise, if one of the local workspace's dependencies exposes a binary with a matching name, this binary will get executed.
|
|||
|
|
|||
|
- Otherwise, if the specified name contains a colon character and if one of the workspaces in the project contains exactly one script with a matching name, then this script will get executed.
|
|||
|
|
|||
|
Whatever happens, the cwd of the spawned process will be the workspace that declares the script (which makes it possible to call commands cross-workspaces using the third syntax).
|
|||
|
`,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 Yte=Tp;var Up=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(await r.restoreInstallState({restoreResolutions:!1}),!i)throw new Xe(r.cwd,this.context.cwd);let s=Q.parseDescriptor(this.descriptor,!0),o=Q.makeDescriptor(s,this.resolution);return r.storedDescriptors.set(s.descriptorHash,s),r.storedDescriptors.set(o.descriptorHash,o),r.resolutionAliases.set(s.descriptorHash,o.descriptorHash),(await xe.start({configuration:e,stdout:this.context.stdout},async l=>{await r.install({cache:n,report:l})})).exitCode()}};Up.paths=[["set","resolution"]],Up.usage=fe.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 Gte=Up;var qte=ee(Ti()),Hp=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(!i)throw new Xe(r.cwd,this.context.cwd);let s=r.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=w.resolve(this.context.cwd,L.toPortablePath(l));if(de.isPathLike(l)){let u=await Ae.find(c,this.context.plugins,{useRc:!1,strict:!1}),{project:g,workspace:h}=await Fe.find(u,c);if(!h)throw new Xe(g.cwd,c);if(this.all){for(let f of g.workspaces)f.manifest.name&&o.add(Q.stringifyIdent(f.locator));if(o.size===0)throw new me("No workspace found to be unlinked in the target project")}else{if(!h.manifest.name)throw new me("The target workspace doesn't have a name and thus cannot be unlinked");o.add(Q.stringifyIdent(h.locator))}}else{let u=[...s.manifest.resolutions.map(({pattern:g})=>g.descriptor.fullName)];for(let g of(0,qte.default)(u,l))o.add(g)}}return s.manifest.resolutions=s.manifest.resolutions.filter(({pattern:l})=>!o.has(l.descriptor.fullName)),(await xe.start({configuration:e,stdout:this.context.stdout},async l=>{await r.install({cache:n,report:l})})).exitCode()}};Hp.paths=[["unlink"]],Hp.usage=fe.Usage({description:"disconnect the local project from another one",details:`
|
|||
|
This command will remove any resolutions in the project-level manifest that would have been added via a yarn link with similar arguments.
|
|||
|
`,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 jte=Hp;var Jte=ee(up()),Dv=ee(Ti());No();var Pu=class extends Be{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.patterns=j.Rest()}async execute(){return this.recursive?await this.executeUpRecursive():await this.executeUpClassic()}async executeUpRecursive(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(!i)throw new Xe(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=[...r.storedDescriptors.values()],o=s.map(u=>Q.stringifyIdent(u)),a=new Set;for(let u of this.patterns){if(Q.parseDescriptor(u).range!=="unknown")throw new me("Ranges aren't allowed when using --recursive");for(let g of(0,Dv.default)(o,u)){let h=Q.parseIdent(g);a.add(h.identHash)}}let l=s.filter(u=>a.has(u.identHash));for(let u of l)r.storedDescriptors.delete(u.descriptorHash),r.storedResolutions.delete(u.descriptorHash);return(await xe.start({configuration:e,stdout:this.context.stdout},async u=>{await r.install({cache:n,report:u})})).exitCode()}async executeUpClassic(){var m;let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(!i)throw new Xe(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=(m=this.interactive)!=null?m:e.get("preferInteractive"),o=gp(this,r),a=s?[sr.KEEP,sr.REUSE,sr.PROJECT,sr.LATEST]:[sr.PROJECT,sr.LATEST],l=[],c=[];for(let I of this.patterns){let y=!1,B=Q.parseDescriptor(I);for(let D of r.workspaces)for(let F of[er.REGULAR,er.DEVELOPMENT]){let U=[...D.manifest.getForScope(F).values()].map(v=>Q.stringifyIdent(v));for(let v of(0,Dv.default)(U,Q.stringifyIdent(B))){let J=Q.parseIdent(v),oe=D.manifest[F].get(J.identHash);if(typeof oe=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");let K=Q.makeDescriptor(J,B.range);l.push(Promise.resolve().then(async()=>[D,F,oe,await hp(K,{project:r,workspace:D,cache:n,target:F,modifier:o,strategies:a})])),y=!0}}y||c.push(I)}if(c.length>1)throw new me(`Patterns ${ce.prettyList(e,c,XA.CODE)} don't match any packages referenced by any workspace`);if(c.length>0)throw new me(`Pattern ${ce.prettyList(e,c,XA.CODE)} doesn't match any packages referenced by any workspace`);let u=await Promise.all(l),g=await Ao.start({configuration:e,stdout:this.context.stdout,suggestInstall:!1},async I=>{for(let[,,y,{suggestions:B,rejections:D}]of u){let F=B.filter(N=>N.descriptor!==null);if(F.length===0){let[N]=D;if(typeof N=="undefined")throw new Error("Assertion failed: Expected an error to have been set");let U=this.cli.error(N);r.configuration.get("enableNetwork")?I.reportError(z.CANT_SUGGEST_RESOLUTIONS,`${Q.prettyDescriptor(e,y)} can't be resolved to a satisfying range
|
|||
|
|
|||
|
${U}`):I.reportError(z.CANT_SUGGEST_RESOLUTIONS,`${Q.prettyDescriptor(e,y)} can't be resolved to a satisfying range (note: network resolution has been disabled)
|
|||
|
|
|||
|
${U}`)}else F.length>1&&!s&&I.reportError(z.CANT_SUGGEST_RESOLUTIONS,`${Q.prettyDescriptor(e,y)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(g.hasErrors())return g.exitCode();let h=!1,f=[];for(let[I,y,,{suggestions:B}]of u){let D,F=B.filter(J=>J.descriptor!==null),N=F[0].descriptor,U=F.every(J=>Q.areDescriptorsEqual(J.descriptor,N));F.length===1||U?D=N:(h=!0,{answer:D}=await(0,Jte.prompt)({type:"select",name:"answer",message:`Which range to you want to use in ${Q.prettyWorkspace(e,I)} \u276F ${y}?`,choices:B.map(({descriptor:J,name:oe,reason:K})=>J?{name:oe,hint:K,descriptor:J}:{name:oe,hint:K,disabled:!0}),onCancel:()=>process.exit(130),result(J){return this.find(J,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let v=I.manifest[y].get(D.identHash);if(typeof v=="undefined")throw new Error("Assertion failed: This descriptor should have a matching entry");if(v.descriptorHash!==D.descriptorHash)I.manifest[y].set(D.identHash,D),f.push([I,y,v,D]);else{let J=e.makeResolver(),oe={project:r,resolver:J},K=J.bindDescriptor(v,I.anchoredLocator,oe);r.forgetResolution(K)}}return await e.triggerMultipleHooks(I=>I.afterWorkspaceDependencyReplacement,f),h&&this.context.stdout.write(`
|
|||
|
`),(await xe.start({configuration:e,stdout:this.context.stdout},async I=>{await r.install({cache:n,report:I})})).exitCode()}};Pu.paths=[["up"]],Pu.usage=fe.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 `yarn up` 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 `yarn up` and `yarn up -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 Generally you can see `yarn up` as a counterpart to what was `yarn upgrade --latest` in Yarn 1 (ie it ignores the ranges previously listed in your manifests), but unlike `yarn upgrade` which only upgraded dependencies in the current workspace, `yarn up` 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'"]]}),Pu.schema=[QQ("recursive",eA.Forbids,["interactive","exact","tilde","caret"],{ignore:[void 0,!1]})];var Wte=Pu;var Yp=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd);if(!i)throw new Xe(r.cwd,this.context.cwd);await r.restoreInstallState();let n=Q.parseIdent(this.package).identHash,s=this.recursive?sHe(r,n,{configuration:e,peers:this.peers}):nHe(r,n,{configuration:e,peers:this.peers});Tn.emitTree(s,{configuration:e,stdout:this.context.stdout,json:this.json,separators:1})}};Yp.paths=[["why"]],Yp.usage=fe.Usage({description:"display the reason why a package is needed",details:`
|
|||
|
This command prints the exact reasons why a package appears in the dependency tree.
|
|||
|
|
|||
|
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 zte=Yp;function nHe(t,e,{configuration:r,peers:i}){let n=de.sortMap(t.storedPackages.values(),a=>Q.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=t.storedResolutions.get(u.descriptorHash);if(!g)throw new Error("Assertion failed: The resolution should have been registered");let h=t.storedPackages.get(g);if(!h)throw new Error("Assertion failed: The package should have been registered");if(h.identHash!==e)continue;if(c===null){let p=Q.stringifyLocator(a);s[p]={value:[a,ce.Type.LOCATOR],children:l}}let f=Q.stringifyLocator(h);l[f]={value:[{descriptor:u,locator:h},ce.Type.DEPENDENT]}}}return o}function sHe(t,e,{configuration:r,peers:i}){let n=de.sortMap(t.workspaces,h=>Q.stringifyLocator(h.anchoredLocator)),s=new Set,o=new Set,a=h=>{if(s.has(h.locatorHash))return o.has(h.locatorHash);if(s.add(h.locatorHash),h.identHash===e)return o.add(h.locatorHash),!0;let f=!1;h.identHash===e&&(f=!0);for(let p of h.dependencies.values()){if(!i&&h.peerDependencies.has(p.identHash))continue;let m=t.storedResolutions.get(p.descriptorHash);if(!m)throw new Error("Assertion failed: The resolution should have been registered");let I=t.storedPackages.get(m);if(!I)throw new Error("Assertion failed: The package should have been registered");a(I)&&(f=!0)}return f&&o.add(h.locatorHash),f};for(let h of n){let f=t.storedPackages.get(h.anchoredLocator.locatorHash);if(!f)throw new Error("Assertion failed: The package should have been registered");a(f)}let l=new Set,c={},u={children:c},g=(h,f,p)=>{if(!o.has(h.locatorHash))return;let m=p!==null?ce.tuple(ce.Type.DEPENDENT,{locator:h,descriptor:p}):ce.tuple(ce.Type.LOCATOR,h),I={},y={value:m,children:I},B=Q.stringifyLocator(h);if(f[B]=y,!l.has(h.locatorHash)&&(l.add(h.locatorHash),!(p!==null&&t.tryWorkspaceByLocator(h))))for(let D of h.dependencies.values()){if(!i&&h.peerDependencies.has(D.identHash))continue;let F=t.storedResolutions.get(D.descriptorHash);if(!F)throw new Error("Assertion failed: The resolution should have been registered");let N=t.storedPackages.get(F);if(!N)throw new Error("Assertion failed: The package should have been registered");g(N,I,D)}};for(let h of n){let f=t.storedPackages.get(h.anchoredLocator.locatorHash);if(!f)throw new Error("Assertion failed: The package should have been registered");g(f,c,null)}return u}var Gp=class extends Be{constructor(){super(...arguments);this.verbose=j.Boolean("-v,--verbose",!1,{description:"Also return the cross-dependencies between workspaces"});this.json=j.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r}=await Fe.find(e,this.context.cwd);return(await xe.start({configuration:e,json:this.json,stdout:this.context.stdout},async n=>{for(let s of r.workspaces){let{manifest:o}=s,a;if(this.verbose){let l=new Set,c=new Set;for(let u of ze.hardDependencies)for(let[g,h]of o.getForScope(u)){let f=r.tryWorkspaceByDescriptor(h);f===null?r.workspacesByIdent.has(g)&&c.add(h):l.add(f)}a={workspaceDependencies:Array.from(l).map(u=>u.relativeCwd),mismatchedWorkspaceDependencies:Array.from(c).map(u=>Q.stringifyDescriptor(u))}}n.reportInfo(null,`${s.relativeCwd}`),n.reportJson(k({location:s.relativeCwd,name:o.name?Q.stringifyIdent(o.name):null},a))}})).exitCode()}};Gp.paths=[["workspaces","list"]],Gp.usage=fe.Usage({category:"Workspace-related commands",description:"list all available workspaces",details:"\n This command will print the list of all workspaces in the project. If both the `-v,--verbose` and `--json` options are set, Yarn will also return the cross-dependencies between each workspaces (useful when you wish to automatically generate Buck / Bazel rules).\n "});var Vte=Gp;var qp=class extends fe{constructor(){super(...arguments);this.workspaceName=j.String();this.commandName=j.String();this.args=j.Proxy()}async execute(){let e=await Ae.fi
|
|||
|
- ${a.join(`
|
|||
|
- `)}?`)}return this.cli.run([this.commandName,...this.args],{cwd:o.cwd})}};qp.paths=[["workspace"]],qp.usage=fe.Usage({category:"Workspace-related commands",description:"run a command within the specified workspace",details:`
|
|||
|
This command will run a given sub-command on a single workspace.
|
|||
|
`,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 Xte=qp;var oHe={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:ge.BOOLEAN,default:Zte.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:ge.STRING,values:["^","~",""],default:cl.CARET}},commands:[F$,L$,Vee,ote,Gte,Pte,Ste,Vte,gte,hte,fte,pte,k$,v$,ate,lte,dte,Cte,Ite,Ete,Bte,jte,wte,Nte,Rte,Mte,Qte,Ote,Kte,Tte,Hte,Yte,Wte,zte,Xte]},aHe=oHe;var Rv={};$e(Rv,{default:()=>lHe});var Zr={optional:!0},_te=[["@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:Zr,zenObservable:Zr}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:Zr,zenObservable:Zr}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{["supports-color"]:Zr}}],["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"]:Zr,["postcss-jsx"]:Zr,["postcss-less"]:Zr,["postcss-markdown"]:Zr,["postcss-scss"]:Zr}}],["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@*",{peerDependenciesMeta:{webpack:Zr}}],["snowpack@>=3.3.0",{dependencies:{["node-gyp"]:"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:Zr}}],["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@*",{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@*",{peerDependencies:{eslint:">= 6",typescript:">= 2.7",webpack:">= 4","vue-template-compiler":"*"},peerDependenciesMeta:{eslint:Zr,"vue-template-compiler":Zr}}],["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:Zr,"utf-8-validate":Zr}}],["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-plugin-favicon@*",{peerDepen
|
|||
|
`),await M.writeFilePromise(w.join(r,"yarn.lock"),"");let i=w.join(r,".yarnrc.yml"),n=await Ae.findProjectCwd(this.context.cwd,mt.lockfile),s=!(await Ae.find(this.context.cwd,null,{strict:!1})).get("enableGlobalCache"),o=n!==null?w.join(n,".yarnrc.yml"):null;o!==null&&M.existsSync(o)?(await M.copyFilePromise(o,i),await Ae.updateConfiguration(r,m=>{let I=V(k({},m),{enableGlobalCache:s,enableTelemetry:!1});return Array.isArray(m.plugins)&&(I.plugins=m.plugins.map(y=>{let B=typeof y=="string"?y:y.path,D=L.isAbsolute(B)?B:L.resolve(L.fromPortablePath(n),B);return typeof y=="string"?D:{path:D,spec:y.spec}})),I})):await M.writeFilePromise(i,`enableGlobalCache: ${s}
|
|||
|
enableTelemetry: false
|
|||
|
`);let a=(p=this.packages)!=null?p:[this.command],l=Q.parseDescriptor(this.command).name,c=await this.cli.run(["add","--",...a],{cwd:r,quiet:this.quiet});if(c!==0)return c;this.quiet||this.context.stdout.write(`
|
|||
|
`);let u=await Ae.find(r,this.context.plugins),{project:g,workspace:h}=await Fe.find(u,r);if(h===null)throw new Xe(g.cwd,r);await g.restoreInstallState();let f=await bt.getWorkspaceAccessibleBinaries(h);return f.has(l)===!1&&f.size===1&&typeof this.packages=="undefined"&&(l=Array.from(f)[0][0]),await bt.executeWorkspaceAccessibleBinary(h,l,this.args,{packageAccessibleBinaries:f,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};jp.paths=[["dlx"]],jp.usage=fe.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 `yarn dlx` as a replacement of `yarn add` 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"]]});var nre=jp;var cHe={commands:[ire,nre]},uHe=cHe;var Gv={};$e(Gv,{default:()=>fHe,fileUtils:()=>Nv});var ku=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,Jp=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,or="file:";var Nv={};$e(Nv,{makeArchiveFromLocator:()=>aB,makeBufferFromLocator:()=>Kv,makeLocator:()=>Ov,makeSpec:()=>sre,parseSpec:()=>Mv});function Mv(t){let{params:e,selector:r}=Q.parseRange(t),i=L.toPortablePath(r);return{parentLocator:e&&typeof e.locator=="string"?Q.parseLocator(e.locator):null,path:i}}function sre({parentLocator:t,path:e,folderHash:r,protocol:i}){let n=t!==null?{locator:Q.stringifyLocator(t)}:{},s=typeof r!="undefined"?{hash:r}:{};return Q.makeRange({protocol:i,source:e,selector:e,params:k(k({},s),n)})}function Ov(t,{parentLocator:e,path:r,folderHash:i,protocol:n}){return Q.makeLocator(t,sre({parentLocator:e,path:r,folderHash:i,protocol:n}))}async function aB(t,{protocol:e,fetchOptions:r,inMemory:i=!1}){let{parentLocator:n,path:s}=Q.parseFileStyleRange(t.reference,{protocol:e}),o=w.isAbsolute(s)?{packageFs:new yt(Ee.root),prefixPath:Ee.dot,localPath:Ee.root}:await r.fetcher.fetch(n,r),a=o.localPath?{packageFs:new yt(Ee.root),prefixPath:w.relative(Ee.root,o.localPath)}:o;o!==a&&o.releaseFs&&o.releaseFs();let l=a.packageFs,c=w.join(a.prefixPath,s);return await de.releaseAfterUseAsync(async()=>await gr.makeArchiveFromDirectory(c,{baseFs:l,prefixPath:Q.getIdentVendorPath(t),compressionLevel:r.project.configuration.get("compressionLevel"),inMemory:i}),a.releaseFs)}async function Kv(t,{protocol:e,fetchOptions:r}){return(await aB(t,{protocol:e,fetchOptions:r,inMemory:!0})).getBufferAndClose()}var Tv=class{supports(e,r){return!!e.reference.startsWith(or)}getLocalPath(e,r){let{parentLocator:i,path:n}=Q.parseFileStyleRange(e.reference,{protocol:or});if(w.isAbsolute(n))return n;let s=r.fetcher.getLocalPath(i,r);return s===null?null:w.resolve(s,n)}async fetch(e,r){let i=r.checksums.get(e.locatorHash)||null,[n,s,o]=await r.cache.fetchPackageFromCache(e,i,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${Q.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFromDisk(e,r),skipIntegrityCheck:r.skipIntegrityCheck});return{packageFs:n,releaseFs:s,prefixPath:Q.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:o}}async fetchFromDisk(e,r){return aB(e,{protocol:or,fetchOptions:r})}};var gHe=1,Uv=class{supportsDescriptor(e,r){return e.range.match(ku)?!0:!!e.range.startsWith(or)}supportsLocator(e,r){return!!e.reference.startsWith(or)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,i){return ku.test(e.range)&&(e=Q.makeDescriptor(e,`${or}${e.range}`)),Q.bindDescriptor(e,{locator:Q.stringifyLocator(r)})}getResolutionDependencies(e,r){return
|
|||
|
`);let s=["--assume-fresh-project"];return this.private&&s.push("-p"),this.workspace&&s.push("-w"),this.yes&&s.push("-y"),await M.mktempPromise(async o=>{let{code:a}=await pr.pipevp("yarn",["init",...s],{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:await bt.makeScriptEnv({binFolder:o})});return a})}async executeRegular(e){let r=null;if(!this.assumeFreshProject)try{r=await Fe.find(e,this.context.cwd)}catch{r=null}M.existsSync(this.context.cwd)||await M.mkdirPromise(this.context.cwd,{recursive:!0});let i=new ze,n=Object.fromEntries(e.get("initFields").entries());i.load(n),i.name=Q.makeIdent(e.get("initScope"),w.basename(this.context.cwd)),i.private=this.private||this.workspace,this.workspace&&(await M.mkdirPromise(w.join(this.context.cwd,"packages"),{recursive:!0}),i.workspaceDefinitions=[{pattern:"packages/*"}]);let s={};i.exportTo(s),AF.inspect.styles.name="cyan",this.context.stdout.write(`${(0,AF.inspect)(s,{depth:Infinity,colors:!0,compact:!1})}
|
|||
|
`);let o=w.join(this.context.cwd,ze.fileName);await M.changeFilePromise(o,`${JSON.stringify(s,null,2)}
|
|||
|
`);let a=w.join(this.context.cwd,"README.md");if(M.existsSync(a)||await M.writeFilePromise(a,`# ${Q.stringifyIdent(i.name)}
|
|||
|
`),!r){let l=w.join(this.context.cwd,mt.lockfile);await M.writeFilePromise(l,"");let u=["/.yarn/*","!/.yarn/patches","!/.yarn/plugins","!/.yarn/releases","!/.yarn/sdks","","# 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(m=>`${m}
|
|||
|
`).join(""),g=w.join(this.context.cwd,".gitignore");M.existsSync(g)||await M.writeFilePromise(g,u);let h={["*"]:{endOfLine:"lf",insertFinalNewline:!0},["*.{js,json,yml}"]:{charset:"utf-8",indentStyle:"space",indentSize:2}};(0,eie.default)(h,e.get("initEditorConfig"));let f=`root = true
|
|||
|
`;for(let[m,I]of Object.entries(h)){f+=`
|
|||
|
[${m}]
|
|||
|
`;for(let[y,B]of Object.entries(I))f+=`${y.replace(/[A-Z]/g,F=>`_${F.toLowerCase()}`)} = ${B}
|
|||
|
`}let p=w.join(this.context.cwd,".editorconfig");M.existsSync(p)||await M.writeFilePromise(p,f),await pr.execvp("git",["init"],{cwd:this.context.cwd})}}};_p.paths=[["init"]],_p.usage=fe.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 `yarn set version` 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 tie=_p;var MYe={configuration:{initScope:{description:"Scope used when creating packages via the init command",type:ge.STRING,default:null},initFields:{description:"Additional fields to set when creating packages via the init command",type:ge.MAP,valueDefinition:{description:"",type:ge.ANY}},initEditorConfig:{description:"Extra rules to define in the generator editorconfig",type:ge.MAP,valueDefinition:{description:"",type:ge.ANY}}},commands:[tie]},OYe=MYe;var fF={};$e(fF,{default:()=>TYe});var po="portal:",Co="link:";var cF=class{supports(e,r){return!!e.reference.startsWith(po)}getLocalPath(e,r){let{parentLocator:i,path:n}=Q.parseFileStyleRange(e.reference,{protocol:po});if(w.isAbsolute(n))return n;let s=r.fetcher.getLocalPath(i,r);return s===null?null:w.resolve(s,n)}async fetch(e,r){let{parentLocator:i,path:n}=Q.parseFileStyleRange(e.reference,{protocol:po}),s=w.isAbsolute(n)?{packageFs:new yt(Ee.root),prefixPath:Ee.dot,localPath:Ee.root}:await r.fetcher.fetch(i,r),o=s.localPath?{packageFs:new yt(Ee.root),prefixPath:w.relative(Ee.root,s.localPath)}:s;s!==o&&s.releaseFs&&s.releaseFs();let a=o.packageFs,l=w.join(o.prefixPath,n);return s.localPath?{packageFs:new yt(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Ee.dot,localPath:l}:{packageFs:new Fs(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Ee.dot}}};var uF=class{supportsDescriptor(e,r){return!!e.range.startsWith(po)}supportsLocator(e,r){return!!e.reference.startsWith(po)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,i){return Q.bindDescriptor(e,{locator:Q.stringifyLocator(r)})}getResolutionDependencies(e,r){return[]}async getCandidates(e,r,i){let n=e.range.slice(po.length);return[Q.makeLocator(e,`${po}${L.toPortablePath(n)}`)]}async getSatisfying(e,r,i){return null}async resolve(e,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let i=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),n=await de.releaseAfterUseAsync(async()=>await ze.find(i.prefixPath,{baseFs:i.packageFs}),i.releaseFs);return V(k({},e),{version:n.version||"0.0.0",languageName:r.project.configuration.get("defaultLanguageName"),linkType:At.SOFT,dependencies:new Map([...n.dependencies]),peerDependencies:n.peerDependencies,dependenciesMeta:n.dependenciesMeta,peerDependenciesMeta:n.peerDependenciesMeta,bin:n.bin})}};var gF=class{supports(e,r){return!!e.reference.startsWith(Co)}getLocalPath(e,r){let{parentLocator:i,path:n}=Q.parseFileStyleRange(e.reference,{protocol:Co});if(w.isAbsolute(n))return n;let s=r.fetcher.getLocalPath(i,r);return s===null?null:w.resolve(s,n)}async fetch(e,r){let{parentLocator:i,path:n}=Q.parseFileStyleRange(e.reference,{pro
|
|||
|
${u}, next tree:
|
|||
|
${$p(a)}`);let h=nie(a);if(h)throw new Error(`${h}, after hoisting finished:
|
|||
|
${$p(a)}`)}return s.debugLevel>=2&&console.log($p(a)),HYe(a)},YYe=t=>{let e=t[t.length-1],r=new Map,i=new Set,n=s=>{if(!i.has(s)){i.add(s);for(let o of s.hoistedDependencies.values())r.set(o.name,o);for(let o of s.dependencies.values())s.peerNames.has(o.name)||n(o)}};return n(e),r},GYe=t=>{let e=t[t.length-1],r=new Map,i=new Set,n=new Map;for(let a of t)for(let l of a.dependencies.values())n.set(l.name,l);let s=new Set,o=(a,l)=>{if(i.has(a))return;i.add(a);for(let u of a.hoistedDependencies.values())if(!l.has(u.name)){let g=n.get(u.name);g&&r.set(g.name,g)}let c=new Set;for(let u of a.dependencies.values())c.add(u.name);for(let u of a.dependencies.values())a.peerNames.has(u.name)||o(u,c)};return o(e,s),r},oie=(t,e)=>{if(e.decoupled)return e;let{name:r,references:i,ident:n,locator:s,dependencies:o,originalDependencies:a,hoistedDependencies:l,peerNames:c,reasons:u,isHoistBorder:g}=e,h={name:r,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,hoistedFrom:[]},f=h.dependencies.get(r);return f&&f.ident==h.ident&&h.dependencies.set(r,h),t.dependencies.set(h.name,h),h},qYe=(t,e)=>{let r=new Map([[t.name,[t.ident]]]);for(let n of t.dependencies.values())t.peerNames.has(n.name)||r.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.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(!t.peerNames.has(s)){let a=r.get(s);a||(a=[],r.set(s,a)),a.indexOf(o)<0&&a.push(o)}}return r},IF=t=>{let e=new Set,r=(i,n=new Set)=>{if(!n.has(i)){n.add(i);for(let s of i.peerNames)if(!t.peerNames.has(s)){let o=t.dependencies.get(s);o&&!e.has(o)&&r(o,n)}e.add(i)}};for(let i of t.dependencies.values())t.peerNames.has(i.name)||r(i);return e},mF=(t,e,r,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=JYe(o),l=qYe(o,a),c=t==o?new Map:n.fastLookupPossible?YYe(e):GYe(e),u,g=!1,h=!1,f=new Map(Array.from(l.entries()).map(([m,I])=>[m,I[0]])),p=new Map;do{let m=jYe(t,e,r,c,f,l,i,p,n);m.isGraphChanged&&(h=!0),m.anotherRoundNeeded&&(g=!0),u=!1;for(let[I,y]of l)y.length>1&&!o.dependencies.has(I)&&(f.delete(I),y.shift(),f.set(I,y[0]),u=!0)}while(u);for(let m of o.dependencies.values())if(!o.peerNames.has(m.name)&&!r.has(m.locator)){r.add(m.locator);let I=mF(t,[...e,m],r,p,n);I.isGraphChanged&&(h=!0),I.anotherRoundNeeded&&(g=!0),r.delete(m.locator)}return{anotherRoundNeeded:g,isGraphChanged:h}},WYe=(t,e,r,i,n,s,o,a,{outputReason:l})=>{let c,u=null,g=new Set;l&&(c=`${Array.from(e).map(m=>Fi(m)).join("\u2192")}`);let h=r[r.length-1],p=!(i.ident===h.ident);if(l&&!p&&(u="- self-reference"),p&&(p=!t.peerNames.has(i.name),l&&!p&&(u=`- cannot shadow peer: ${Fi(t.originalDependencies.get(i.name).locator)} at ${c}`)),p){let m=!1,I=n.get(i.name);if(m=!I||I.ident===i.ident,l&&!m&&(u=`- filled by: ${Fi(I.locator)} at ${c}`),m)for(let y=r.length-1;y>=1;y--){let D=r[y].dependencies.get(i.name);if(D&&D.ident!==i.ident){m=!1;let F=a.get(h);F||(F=new Set,a.set(h,F)),F.add(i.name),l&&(u=`- filled by ${Fi(D.locator)} at ${r.slice(0,y).map(N=>Fi(N.locator)).join("\u2192")}`);break}}p=m}if(p&&(p=s.get(i.name)===i.ident,l&&!p&&(u=`- filled by: ${Fi(o.get(i.name)[0])} at ${c}`)),p){let m=!0,I=new Set(i.peerNames);for(let y=r.length-1;y>=1;y--){let B=r[y];for(let D of I){if(B.peerNames.has(D)&&B.originalDependencies.has(D))continue;let F=B.dependencies.get(D);F&&t.dependencies.get(D)!==F&&(y===r.length-1?g.add(F):(g=null,m=!1,l&&(u=`- peer dependency ${Fi(F.locator)} from parent ${Fi(B.locator)} was not hoisted to ${c}`))),I.delete(D)}if(!m)break}p=m}return g!==null&&g.size>0?{isHoistable:2,dependsOn:g,reason:u}:{isHoistable:p?0:1,reason:u}},jYe=(t,e,r,i,n,s,o,a,l)=>{let c=e[e.length-1],u=new Set,g=!1,h=!1,f=(I,y,B,D)=>{if(u.has(B))return;let F=[...y,B.locator],N=new Map,U=new Map;for
|
|||
|
${$p(t)}`)}let oe=IF(B);for(let K of oe)if(v.has(K)){let A=U.get(K);if((n.get(K.name)===K.ident||!B.reasons.has(K.name))&&A.isHoistable!==0&&B.reasons.set(K.name,A.reason),!K.isHoistBorder&&F.indexOf(K.locator)<0){u.add(B);let $=oie(B,K);f([...I,B],[...y,B.locator],$,m),u.delete(B)}}},p,m=new Set(IF(c));do{p=m,m=new Set;for(let I of p){if(I.locator===c.locator||I.isHoistBorder)continue;let y=oie(c,I);f([],Array.from(r),y,m)}}while(m.size>0);return{anotherRoundNeeded:g,isGraphChanged:h}},nie=t=>{let e=[],r=new Set,i=new Set,n=(s,o)=>{if(r.has(s)||(r.add(s),i.has(s)))return;let a=new Map(o);for(let l of s.dependencies.values())s.peerNames.has(l.name)||a.set(l.name,l);for(let l of s.originalDependencies.values()){let c=a.get(l.name),u=()=>`${Array.from(i).concat([s]).map(g=>Fi(g.locator)).join("\u2192")}`;if(s.peerNames.has(l.name)){let g=o.get(l.name);(g!==c||!g||g.ident!==l.ident)&&e.push(`${u()} - broken peer promise: expected ${l.ident} but found ${g&&g.ident}`)}else c?c.ident!==l.ident&&e.push(`${u()} - broken require promise for ${l.name}: expected ${l.ident}, but found: ${c.ident}`):e.push(`${u()} - broken require promise: no required dependency ${l.locator} found`)}i.add(s);for(let l of s.dependencies.values())s.peerNames.has(l.name)||n(l,a);i.delete(s)};return n(t,t.dependencies),e.join(`
|
|||
|
`)},UYe=(t,e)=>{let{identName:r,name:i,reference:n,peerNames:s}=t,o={name:i,references:new Set([n]),locator:CF(r,n),ident:iie(r,n),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(s),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistedFrom:[]},a=new Map([[t,o]]),l=(c,u)=>{let g=a.get(c),h=!!g;if(!g){let{name:f,identName:p,reference:m,peerNames:I}=c,y=e.hoistingLimits.get(u.locator);g={name:f,references:new Set([m]),locator:CF(p,m),ident:iie(p,m),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(I),reasons:new Map,decoupled:!0,isHoistBorder:y?y.has(f):!1,hoistedFrom:[]},a.set(c,g)}if(u.dependencies.set(c.name,g),u.originalDependencies.set(c.name,g),h){let f=new Set,p=m=>{if(!f.has(m)){f.add(m),m.decoupled=!1;for(let I of m.dependencies.values())m.peerNames.has(I.name)||p(I)}};p(g)}else for(let f of c.dependencies)l(f,g)};for(let c of t.dependencies)l(c,o);return o},EF=t=>t.substring(0,t.indexOf("@",1)),HYe=t=>{let e={name:t.name,identName:EF(t.locator),references:new Set(t.references),dependencies:new Set},r=new Set([t]),i=(n,s,o)=>{let a=r.has(n),l;if(s===n)l=o;else{let{name:c,references:u,locator:g}=n;l={name:c,identName:EF(g),references:u,dependencies:new Set}}if(o.dependencies.add(l),!a){r.add(n);for(let c of n.dependencies.values())n.peerNames.has(c.name)||i(c,n,l);r.delete(n)}};for(let n of t.dependencies.values())i(n,t,e);return e},JYe=t=>{let e=new Map,r=new Set([t]),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},e.set(a,l)),l},s=(o,a)=>{let l=!!r.has(a);if(n(a).dependents.add(o.ident),!l){r.add(a);for(let u of a.dependencies.values())a.peerNames.has(u.name)?n(u).peerDependents.add(a.ident):s(a,u)}};for(let o of t.dependencies.values())t.peerNames.has(o.name)||s(t,o);return e},Fi=t=>{let e=t.indexOf("@",1),r=t.substring(0,e);r.endsWith("$wsroot$")&&(r=`wh:${r.replace("$wsroot$","")}`);let i=t.substring(e+1);if(i==="workspace:.")return".";if(i){let n=(i.indexOf("#")>0?i.split("#")[1]:i).replace("npm:","");return i.startsWith("virtual")&&(r=`v:${r}`),n.startsWith("workspace")&&(r=`w:${r}`,n=""),`${r}${n?`@${n}`:""}`}else return`${r}`},aie=5e4,$p=t=>{let e=0,r=(n,s,o="")=>{if(e>aie||s.has(n))return"";e++;let a=Array.from(n.dependencies.values()).sort((c,u)=>c.name.localeCompare(u.name)),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),h=EF(u.locator);l+=`${o}${c<a.length-1?"\u251C\u2500":"\u2514\u2500"}${(s.has(u)?">":"")+(h!==u.name?`a:${u.name}:`:"")+Fi(u.locator)+(g?` ${g}`:"")+(u!==n&&u.hoistedFrom.length>0?`, hoisted from: ${u.hoistedFrom.join(", ")}`:"")}
|
|||
|
`,l+=r(u,s,`${o}${c<a.length-1?"\u2502 ":" "}`)}}return s.delete(n),l};return r(t,new Set)+(e>aie?`
|
|||
|
Tree is too large, part of the tree has been dunped
|
|||
|
`:"")};var ya;(function(r){r.HARD="HARD",r.SOFT="SOFT"})(ya||(ya={}));var Ri;(function(i){i.WORKSPACES="workspaces",i.DEPENDENCIES="dependencies",i.NONE="none"})(Ri||(Ri={}));var Aie="node_modules",AB="$wsroot$";var Ba=(t,e)=>{let{packageTree:r,hoistingLimits:i,errors:n,preserveSymlinksRequired:s}=zYe(t,e),o=null;if(n.length===0){let a=sie(r,{hoistingLimits:i});o=VYe(t,a,e)}return{tree:o,errors:n,preserveSymlinksRequired:s}},Es=t=>`${t.name}@${t.reference}`,yF=t=>{let e=new Map;for(let[r,i]of t.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(r)}for(let r of e.values())r.locations=r.locations.sort((i,n)=>{let s=i.split(w.delimiter).length,o=n.split(w.delimiter).length;return s!==o?o-s:n.localeCompare(i)});return e},lie=(t,e)=>{let r=Q.isVirtualLocator(t)?Q.devirtualizeLocator(t):t,i=Q.isVirtualLocator(e)?Q.devirtualizeLocator(e):e;return Q.areLocatorsEqual(r,i)},zYe=(t,e)=>{let r=t.getDependencyTreeRoots(),i=[],n=!1,s=new Map,o=new Map,a=t.getPackageInformation(t.topLevel);if(a===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let l=t.findPackageLocator(a.packageLocation);if(l===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let c=L.toPortablePath(a.packageLocation),u=Es(l);if(e.project){let I={children:new Map},y=e.project.cwd.split(w.sep);for(let[D,F]of e.project.workspacesByCwd){let N=D.split(w.sep).slice(y.length),U=I;for(let v of N){let J=U.children.get(v);J||(J={children:new Map},U.children.set(v,J)),U=J}U.workspaceLocator={name:Q.stringifyIdent(F.anchoredLocator),reference:F.anchoredLocator.reference}}let B=(D,F)=>{if(D.workspaceLocator){let N=Es(F),U=o.get(N);U||(U=new Set,o.set(N,U)),U.add(D.workspaceLocator)}for(let N of D.children.values())B(N,D.workspaceLocator||F)};for(let D of I.children.values())B(D,I.workspaceLocator)}else for(let I of r)if(I.name!==l.name||I.reference!==l.reference){let y=o.get(u);y||(y=new Set,o.set(u,y)),y.add(I)}let g={name:l.name,identName:l.name,reference:l.reference,peerNames:a.packagePeers,dependencies:new Set},h=new Map,f=(I,y)=>`${Es(y)}:${I}`,p=(I,y)=>{if(I.linkType!==ya.SOFT||!e.project)return!1;let B=L.toPortablePath(t.resolveVirtual&&y.reference&&y.reference.startsWith("virtual:")?t.resolveVirtual(I.packageLocation):I.packageLocation);return w.contains(e.project.cwd,B)===null},m=(I,y,B,D,F,N,U)=>{var $,re;let v=f(I,B),J=h.get(v),oe=!!J;if(!oe&&B.name===l.name&&B.reference===l.reference&&(J=g,h.set(v,g)),J||(J={name:I,identName:B.name,reference:B.reference,dependencies:new Set,peerNames:y.packagePeers},h.set(v,J)),U&&!p(y,B)){let H=Es({name:D.identName,reference:D.reference}),R=s.get(H)||new Set;s.set(H,R),R.add(J.name)}let K=new Map(y.packageDependencies);if(e.project){let H=e.project.workspacesByCwd.get(L.toPortablePath(y.packageLocation.slice(0,-1)));if(H){let R=new Set([...Array.from(H.manifest.peerDependencies.values(),ke=>Q.stringifyIdent(ke)),...Array.from(H.manifest.peerDependenciesMeta.keys())]);for(let ke of R)K.has(ke)||(K.set(ke,F.get(ke)||null),J.peerNames.add(ke))}}let A=Es(B),W=o.get(A);if(W)for(let H of W)K.set(`${H.name}${AB}`,H.reference);if(D.dependencies.add(J),!oe){let H=new Map;for(let[R,ke]of K)if(ke!==null){let Le=t.getLocator(R,ke),qe=t.getLocator(R.replace(AB,""),ke),Ke=t.getPackageInformation(qe);if(Ke===null)throw new Error("Assertion failed: Expected the package to have been registered");let ie=p(Ke,Le);if(e.validateExternalSoftLinks&&e.project&&ie){Ke.packageDependencies.size>0&&(n=!0);for(let[pe,De]of Ke.packageDependencies){let Z=Q.parseLocator(Array.isArray(De)?`${De[0]}@${De[1]}`:`${pe}@${De}`);if(Es(Z)!==Es(Le)){let X=K.get(pe);if(X){let ae=Q.parseLocator(Array.isArray(X)?`${X[0]}@${X[1]}`:`${pe}@${X}`);lie(ae,Z)||i.push({messageName:z.NM_CANT_INSTALL_EXTERNAL_SOFT_LINK,text:`Cannot link ${Q.prettyIdent(e.project.configuration,Q.parseIdent(Le.name))} into ${Q.prettyLocator(e.project.configuration,Q.parseLocator(`${B.name}@${B.refer
|
|||
|
${JSON.stringify(s)}`);this.nodeModulesTree=n,this.watchManager=new dF;let o=L.toPortablePath(e.getPackageInformation(e.topLevel).packageLocation);this.pnpFilePath=w.join(o,mt.pnpCjs),this.watchPnpFile(o)}watchPnpFile(e){this.baseFs.watch(e,{persistent:!1},(r,i)=>{if(i===mt.pnpCjs){let n=cie(this.pnpFilePath);if(!Ba(n,this.options))throw new Error("Assertion failed. Have got non-persistable node_modules graph");this.watchManager.notifyWatchers(o=>BF(o,this.nodeModulesTree))}})}persistPath(e){let r=[],i=e;for(;!this.baseFs.existsSync(i);)r.push(i),i=w.dirname(i);for(let n of r.reverse())this.baseFs.mkdirSync(n)}persistVirtualParentFolder(e){if(typeof e!="number"){let r=this.resolvePath(w.dirname(e));r.dirList&&this.persistPath(r.resolvedPath)}}getExtractHint(e){return this.baseFs.getExtractHint(e)}resolve(e){return this.baseFs.resolve(this.resolvePath(e).resolvedPath)}getBaseFs(){return this.baseFs}resolvePath(e){if(typeof e=="number")return{resolvedPath:e,fullOriginalPath:e};{let r=this.pathUtils.resolve(e);return V(k({},BF(r,this.nodeModulesTree)),{fullOriginalPath:r})}}resolveFilePath(e){return typeof e=="number"?e:this.resolvePath(e).resolvedPath}resolveDirOrFilePath(e){if(typeof e=="number")return e;let r=this.resolvePath(e);return r.forwardedDirPath||r.resolvedPath}resolveLink(e){let{p:r,onSymlink:i,onRealPath:n,statOptions:s}=e,o=this.resolvePath(r);if(o.isSymlink){let a;try{a=this.baseFs.lstatSync(o.resolvedPath,s)}catch(l){}if(a)return i(a,this.pathUtils.relative(this.pathUtils.dirname(o.fullOriginalPath),o.resolvedPath))}return n(o.forwardedDirPath||o.resolvedPath)}static makeSymlinkStats(e){return Object.assign(e,{isFile:()=>!1,isDirectory:()=>!1,isSymbolicLink:()=>!0})}getRealPath(){return this.baseFs.getRealPath()}async openPromise(e,r,i){return hie.test(r)&&this.persistVirtualParentFolder(e),await this.baseFs.openPromise(this.resolveFilePath(e),r,i)}openSync(e,r,i){return hie.test(r)&&this.persistVirtualParentFolder(e),this.baseFs.openSync(this.resolveFilePath(e),r,i)}async opendirPromise(e,r){let i=this.resolvePath(e);if(i.dirList||this.resolvePath(w.join(e,"node_modules")).dirList){let n=[];try{n=await this.baseFs.readdirPromise(i.resolvedPath)}catch(o){}let s=Array.from(i.dirList||["node_modules"]).concat(n).sort();return Ya(this,e,s)}else return await this.baseFs.opendirPromise(i.resolvedPath,r)}opendirSync(e,r){let i=this.resolvePath(e);if(i.dirList||this.resolvePath(w.join(e,"node_modules")).dirList){let n=[];try{n=this.baseFs.readdirSync(i.resolvedPath)}catch(o){}let s=Array.from(i.dirList||["node_modules"]).concat(n).sort();return Ya(this,e,s)}else return this.baseFs.opendirSync(i.resolvedPath,r)}async readPromise(e,r,i,n,s){return await this.baseFs.readPromise(e,r,i,n,s)}readSync(e,r,i,n,s){return this.baseFs.readSync(e,r,i,n,s)}async writePromise(e,r,i,n,s){return typeof r=="string"?await this.baseFs.writePromise(e,r,i):await this.baseFs.writePromise(e,r,i,n,s)}writeSync(e,r,i,n,s){return typeof r=="string"?this.baseFs.writeSync(e,r,i):this.baseFs.writeSync(e,r,i,n,s)}async closePromise(e){await this.baseFs.closePromise(e)}closeSync(e){this.baseFs.closeSync(e)}createReadStream(e,r){return this.baseFs.createReadStream(e!==null?this.resolveFilePath(e):e,r)}createWriteStream(e,r){return this.baseFs.createWriteStream(e!==null?this.resolveDirOrFilePath(e):e,r)}async realpathPromise(e){let r=this.resolvePath(e);return r.dirList?r.resolvedPath:this.baseFs.realpathPromise(r.resolvedPath)}realpathSync(e){let r=this.resolvePath(e);return r.dirList?r.resolvedPath:this.baseFs.realpathSync(r.resolvedPath)}async existsPromise(e){let r=this.resolvePath(e);return r.dirList?!0:await this.baseFs.existsPromise(r.resolvedPath)}existsSync(e){let r=this.resolvePath(e);return r.dirList?!0:this.baseFs.existsSync(r.resolvedPath)}async accessPromise(e,r){return await this.baseFs.accessPromise(this.resolveDirOrFilePath(e),r)}accessSync(e,r){return this.baseFs.accessSync(this.resolveDirOrFilePath(e),r)}async statPromise(e,r){return await this.baseFs.statPromise(this.resolveDirOrFilePath(e),r)}statSync(e,r){return this.baseFs
|
|||
|
`;for(let s=0,o=t.length;s<o;++s)n+=i+lB(String(s),t[s],e,i).replace(/^ +/,""),s+1<o&&(n+=","),n+=`
|
|||
|
`;return n+=r,n+="]",n}function eGe(t,e,r){let i=Object.keys(t),n="";n+="{";for(let s=0,o=i.length;s<o;++s){let a=i[s],l=t[a];typeof l!="undefined"&&(n+=JSON.stringify(a),n+=": ",n+=lB(a,l,e,r).replace(/^ +/g,""),s+1<o&&(n+=", "))}return n+="}",n}function tGe(t,e,r){let i=Object.keys(t),n=`${r} `,s="";s+=r,s+=`{
|
|||
|
`;for(let o=0,a=i.length;o<a;++o){let l=i[o],c=t[l];typeof c!="undefined"&&(s+=n,s+=JSON.stringify(l),s+=": ",s+=lB(l,c,e,n).replace(/^ +/g,""),o+1<a&&(s+=","),s+=`
|
|||
|
`)}return s+=r,s+="}",s}function lB(t,e,r,i){let{next:n}=die[r],s=n[t]||n["*"];return Cie(e,s,i)}function Cie(t,e,r){let{collapsed:i}=die[e];return Array.isArray(t)?i?_Ye(t,e,r):$Ye(t,e,r):typeof t=="object"&&t!==null?i?eGe(t,e,r):tGe(t,e,r):JSON.stringify(t)}function mie(t){return Cie(t,xt.TOP_LEVEL,"")}function td(t,e){let r=Array.from(t);Array.isArray(e)||(e=[e]);let i=[];for(let s of e)i.push(r.map(o=>s(o)));let n=r.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=>r[s])}function rGe(t){let e=new Map,r=td(t.fallbackExclusionList||[],[({name:i,reference:n})=>i,({name:i,reference:n})=>n]);for(let{name:i,reference:n}of r){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 iGe(t){return td(t.fallbackPool||[],([e])=>e)}function nGe(t){let e=[];for(let[r,i]of td(t.packageRegistry,([n])=>n===null?"0":`1${n}`)){let n=[];e.push([r,n]);for(let[s,{packageLocation:o,packageDependencies:a,packagePeers:l,linkType:c,discardFromLookup:u}]of td(i,([g])=>g===null?"0":`1${g}`)){let g=[];r!==null&&s!==null&&!a.has(r)&&g.push([r,s]);for(let[p,m]of td(a.entries(),([I])=>I))g.push([p,m]);let h=l&&l.size>0?Array.from(l):void 0,f=u||void 0;n.push([s,{packageLocation:o,packageDependencies:g,packagePeers:h,linkType:c,discardFromLookup:f}])}}return e}function rd(t){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:t.dependencyTreeRoots,enableTopLevelFallback:t.enableTopLevelFallback||!1,ignorePatternData:t.ignorePattern||null,fallbackExclusionList:rGe(t),fallbackPool:iGe(t),packageRegistryData:nGe(t)}}var yie=ee(Eie());function Bie(t,e){return[t?`${t}
|
|||
|
`:"",`/* eslint-disable */
|
|||
|
|
|||
|
`,`try {
|
|||
|
`,` Object.freeze({}).detectStrictMode = true;
|
|||
|
`,`} catch (error) {
|
|||
|
`," throw new Error(`The whole PnP file got strict-mode-ified, which is known to break (Emscripten libraries aren't strict mode). This usually happens when the file goes through Babel.`);\n",`}
|
|||
|
`,`
|
|||
|
`,`var __non_webpack_module__ = module;
|
|||
|
`,`
|
|||
|
`,`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
|||
|
`,e.replace(/^/gm," "),`}
|
|||
|
`,`
|
|||
|
`,(0,yie.default)()].join("")}function sGe(t){return JSON.stringify(t,null,2)}function oGe(t){return[`return hydrateRuntimeState(${mie(t)}, {basePath: basePath || __dirname});
|
|||
|
`].join("")}function aGe(t){return[`var path = require('path');
|
|||
|
`,`var dataLocation = path.resolve(__dirname, ${JSON.stringify(t)});
|
|||
|
`,`return hydrateRuntimeState(require(dataLocation), {basePath: basePath || path.dirname(dataLocation)});
|
|||
|
`].join("")}function wie(t){let e=rd(t),r=oGe(e);return Bie(t.shebang,r)}function Qie(t){let e=rd(t),r=aGe(t.dataLocation),i=Bie(t.shebang,r);return{dataFile:sGe(e),loaderFile:i}}var Die=ee(require("fs")),uGe=ee(require("path")),Pie=ee(require("util"));function xF(t,{basePath:e}){let r=L.toPortablePath(e),i=w.resolve(r),n=t.ignorePatternData!==null?new RegExp(t.ignorePatternData):null,s=new Map,o=new Map(t.packageRegistryData.map(([g,h])=>[g,new Map(h.map(([f,p])=>{var D;if(g===null!=(f===null))throw new Error("Assertion failed: The name and reference should be null, or neither should");let m=(D=p.discardFromLookup)!=null?D:!1,I={name:g,reference:f},y=s.get(p.packageLocation);y?(y.discardFromLookup=y.discardFromLookup&&m,m||(y.locator=I)):s.set(p.packageLocation,{locator:I,discardFromLookup:m});let B=null;return[f,{packageDependencies:new Map(p.packageDependencies),packagePeers:new Set(p.packagePeers),linkType:p.linkType,discardFromLookup:m,get packageLocation(){return B||(B=w.join(i,p.packageLocation))}}]}))])),a=new Map(t.fallbackExclusionList.map(([g,h])=>[g,new Set(h)])),l=new Map(t.fallbackPool),c=t.dependencyTreeRoots,u=t.enableTopLevelFallback;return{basePath:r,dependencyTreeRoots:c,enableTopLevelFallback:u,fallbackExclusionList:a,fallbackPool:l,ignorePattern:n,packageLocatorsByLocations:s,packageRegistry:o}}var Lu=ee(require("module")),xie=ee(Sie()),PF=ee(require("util"));var Vt;(function(l){l.API_ERROR="API_ERROR",l.BUILTIN_NODE_RESOLUTION_FAILED="BUILTIN_NODE_RESOLUTION_FAILED",l.MISSING_DEPENDENCY="MISSING_DEPENDENCY",l.MISSING_PEER_DEPENDENCY="MISSING_PEER_DEPENDENCY",l.QUALIFIED_PATH_RESOLUTION_FAILED="QUALIFIED_PATH_RESOLUTION_FAILED",l.INTERNAL="INTERNAL",l.UNDECLARED_DEPENDENCY="UNDECLARED_DEPENDENCY",l.UNSUPPORTED="UNSUPPORTED"})(Vt||(Vt={}));var cGe=new Set([Vt.BUILTIN_NODE_RESOLUTION_FAILED,Vt.MISSING_DEPENDENCY,Vt.MISSING_PEER_DEPENDENCY,Vt.QUALIFIED_PATH_RESOLUTION_FAILED,Vt.UNDECLARED_DEPENDENCY]);function Or(t,e,r={}){let i=cGe.has(t)?"MODULE_NOT_FOUND":t,n={configurable:!0,writable:!0,enumerable:!1};return Object.defineProperties(new Error(e),{code:V(k({},n),{value:i}),pnpCode:V(k({},n),{value:t}),data:V(k({},n),{value:r})})}function pl(t){return L.normalize(L.fromPortablePath(t))}function kF(t,e){let r=Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK)>0,i=Number(process.env.PNP_DEBUG_LEVEL),n=new Set(Lu.Module.builtinModules||Object.keys(process.binding("natives"))),s=ie=>n.has(ie)||ie.startsWith("node:"),o=/^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/,a=/^(\/|\.{1,2}(\/|$))/,l=/\/$/,c=/^\.{0,2}\//,u={name:null,reference:null},g=[],h=new Set;if(t.enableTopLevelFallback===!0&&g.push(u),e.compatibilityMode!==!1)for(let ie of["react-scripts","gatsby"]){let le=t.packageRegistry.get(ie);if(le)for(let Se of le.keys()){if(Se===null)throw new Error("Assertion failed: This reference shouldn't be null");g.push({name:ie,reference:Se})}}let{ignorePattern:f,packageRegistry:p,packageLocatorsByLocations:m}=t;function I(ie,le){return{fn:ie,args:le,error:null,result:null}}function y(ie){var pe,De,Z,X,ae,ue;let le=(Z=(De=(pe=process.stderr)==null?void 0:pe.hasColors)==null?void 0:De.call(pe))!=null?Z:process.stdout.isTTY,Se=(we,lt)=>`[${we}m${lt}[0m`,he=ie.error;console.error(he?Se("31;1",`\u2716 ${(X=ie.error)==null?void 0:X.message.replace(/\n.*/s,"")}`):Se("33;1","\u203C Resolution")),ie.args.length>0&&console.error();for(let we of ie.args)console.error(` ${Se("37;1","In \u2190")} ${(0,PF.inspect)(we,{colors:le,compact:!0})}`);ie.result&&(console.error(),console.error(` ${Se("37;1","Out \u2192")} ${(0,PF.inspect)(ie.result,{colors:le,compact:!0})}`));let Ie=(ue=(ae=new Error().stack.match(/(?<=^ +)at.*/gm))==null?void 0:ae.slice(2))!=null?ue:[];if(Ie.length>0){console.error();for(let we of Ie)console.error(` ${Se("38;5;244",we)}`)}console.error()}function B(ie,le){if(e.allowDebug===!1)return le;if(Number.isFinite(i)){if(i>=2)return(...Se)=>{let he=I(ie,Se);try{return he.result=le(...Se)}catch(Ie){throw he.error=Ie}finally{y(he)}};if(i>=1)return(...Se)=>{try{return le(...S
|
|||
|
|
|||
|
Require request: "${he}"
|
|||
|
Required by: ${Ie}
|
|||
|
`,{request:he,issuer:Ie});return L.toPortablePath(Z)}let pe,De=ie.match(o);if(De){if(!le)throw Or(Vt.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:he,issuer:Ie});let[,Z,X]=De,ae=H(le);if(!ae){let Xt=J(ie,le);if(Xt===!1)throw Or(Vt.BUILTIN_NODE_RESOLUTION_FAILED,`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree).
|
|||
|
|
|||
|
Require path: "${he}"
|
|||
|
Required by: ${Ie}
|
|||
|
`,{request:he,issuer:Ie});return L.toPortablePath(Xt)}let we=D(ae).packageDependencies.get(Z),lt=null;if(we==null&&ae.name!==null){let Xt=t.fallbackExclusionList.get(ae.name);if(!Xt||!Xt.has(ae.reference)){for(let Wn=0,$u=g.length;Wn<$u;++Wn){let Ss=D(g[Wn]).packageDependencies.get(Z);if(Ss!=null){r?lt=Ss:we=Ss;break}}if(t.enableTopLevelFallback&&we==null&<===null){let Wn=t.fallbackPool.get(Z);Wn!=null&&(lt=Wn)}}}let Ct=null;if(we===null)if(F(ae))Ct=Or(Vt.MISSING_PEER_DEPENDENCY,`Your application tried to access ${Z} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed.
|
|||
|
|
|||
|
Required package: ${Z}${Z!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${Ie}
|
|||
|
`,{request:he,issuer:Ie,dependencyName:Z});else{let Xt=re(Z,ae);Xt.every(Xi=>F(Xi))?Ct=Or(Vt.MISSING_PEER_DEPENDENCY,`${ae.name} tried to access ${Z} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.
|
|||
|
|
|||
|
Required package: ${Z}${Z!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${ae.name}@${ae.reference} (via ${Ie})
|
|||
|
${Xt.map(Xi=>`Ancestor breaking the chain: ${Xi.name}@${Xi.reference}
|
|||
|
`).join("")}
|
|||
|
`,{request:he,issuer:Ie,issuerLocator:Object.assign({},ae),dependencyName:Z,brokenAncestors:Xt}):Ct=Or(Vt.MISSING_PEER_DEPENDENCY,`${ae.name} tried to access ${Z} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
|
|||
|
|
|||
|
Required package: ${Z}${Z!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${ae.name}@${ae.reference} (via ${Ie})
|
|||
|
|
|||
|
${Xt.map(Xi=>`Ancestor breaking the chain: ${Xi.name}@${Xi.reference}
|
|||
|
`).join("")}
|
|||
|
`,{request:he,issuer:Ie,issuerLocator:Object.assign({},ae),dependencyName:Z,brokenAncestors:Xt})}else we===void 0&&(!Se&&s(ie)?F(ae)?Ct=Or(Vt.UNDECLARED_DEPENDENCY,`Your application tried to access ${Z}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${Z} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.
|
|||
|
|
|||
|
Required package: ${Z}${Z!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${Ie}
|
|||
|
`,{request:he,issuer:Ie,dependencyName:Z}):Ct=Or(Vt.UNDECLARED_DEPENDENCY,`${ae.name} tried to access ${Z}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${Z} isn't otherwise declared in ${ae.name}'s dependencies, this makes the require call ambiguous and unsound.
|
|||
|
|
|||
|
Required package: ${Z}${Z!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${Ie}
|
|||
|
`,{request:he,issuer:Ie,issuerLocator:Object.assign({},ae),dependencyName:Z}):F(ae)?Ct=Or(Vt.UNDECLARED_DEPENDENCY,`Your application tried to access ${Z}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
|
|||
|
|
|||
|
Required package: ${Z}${Z!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${Ie}
|
|||
|
`,{request:he,issuer:Ie,dependencyName:Z}):Ct=Or(Vt.UNDECLARED_DEPENDENCY,`${ae.name} tried to access ${Z}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
|
|||
|
|
|||
|
Required package: ${Z}${Z!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${ae.name}@${ae.reference} (via ${Ie})
|
|||
|
`,{request:he,issuer:Ie,issuerLocator:Object.assign({},ae),dependencyName:Z}));if(we==null){if(lt===null||Ct===null)throw Ct||new Error("Assertion failed: Expected an error to have been set");we=lt;let Xt=Ct.message.replace(/\n.*/g,"");Ct.message=Xt,!h.has(Xt)&&i!==0&&(h.add(Xt),process.emitWarning(Ct))}let Dt=Array.isArray(we)?{name:we[0],reference:we[1]}:{name:Z,reference:we},Sn=D(Dt);if(!Sn.packageLocation)throw Or(Vt.MISSING_DEPENDENCY,`A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod.
|
|||
|
|
|||
|
Required package: ${Dt.name}@${Dt.reference}${Dt.name!==he?` (via "${he}")`:""}
|
|||
|
Required by: ${ae.name}@${ae.reference} (via ${Ie})
|
|||
|
`,{request:he,issuer:Ie,dependencyLocator:Object.assign({},Dt)});let di=Sn.packageLocation;X?pe=w.join(di,X):pe=di}else if(w.isAbsolute(ie))pe=w.normalize(ie);else{if(!le)throw Or(Vt.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:he,issuer:Ie});let Z=w.resolve(le);le.match(l)?pe=w.normalize(w.join(Z,ie)):pe=w.normalize(w.join(w.dirname(Z),ie))}return w.normalize(pe)}function ke(ie,le){if(a.test(ie))return le;let Se=N(le);return Se?w.normalize(Se):le}function Le(ie,{extensions:le=Object.keys(Lu.Module._extensions)}={}){let Se=[],he=U(ie,Se,{extensions:le});if(he)return w.normalize(he);{let Ie=pl(ie);throw Or(Vt.QUALIFIED_PATH_RESOLUTION_FAILED,`Qualified path resolution failed - none of those files can be found on the disk.
|
|||
|
|
|||
|
Source path: ${Ie}
|
|||
|
${Se.map(pe=>`Not found: ${pl(pe)}
|
|||
|
`).join("")}`,{unqualifiedPath:Ie})}}function qe(ie,le,{considerBuiltins:Se,extensions:he}={}){let Ie=R(ie,le,{considerBuiltins:Se});if(Ie===null)return null;let pe=()=>le!==null?oe(le):!1,De=(!Se||!s(ie))&&!pe()?ke(ie,Ie):Ie;try{return Le(De,{extensions:he})}catch(Z){throw Z.pnpCode==="QUALIFIED_PATH_RESOLUTION_FAILED"&&Object.assign(Z.data,{request:pl(ie),issuer:le&&pl(le)}),Z}}function Ke(ie){let le=w.normalize(ie),Se=rr.resolveVirtual(le);return Se!==le?Se:null}return{VERSIONS:K,topLevel:A,getLocator:(ie,le)=>Array.isArray(le)?{name:le[0],reference:le[1]}:{name:ie,reference:le},getDependencyTreeRoots:()=>[...t.dependencyTreeRoots],getAllLocators(){let ie=[];for(let[le,Se]of p)for(let he of Se.keys())le!==null&&he!==null&&ie.push({name:le,reference:he});return ie},getPackageInformation:ie=>{let le=W(ie);if(le===null)return null;let Se=L.fromPortablePath(le.packageLocation);return V(k({},le),{packageLocation:Se})},findPackageLocator:ie=>H(L.toPortablePath(ie)),resolveToUnqualified:B("resolveToUnqualified",(ie,le,Se)=>{let he=le!==null?L.toPortablePath(le):null,Ie=R(L.toPortablePath(ie),he,Se);return Ie===null?null:L.fromPortablePath(Ie)}),resolveUnqualified:B("resolveUnqualified",(ie,le)=>L.fromPortablePath(Le(L.toPortablePath(ie),le))),resolveRequest:B("resolveRequest",(ie,le,Se)=>{let he=le!==null?L.toPortablePath(le):null,Ie=qe(L.toPortablePath(ie),he,Se);return Ie===null?null:L.fromPortablePath(Ie)}),resolveVirtual:B("resolveVirtual",ie=>{let le=Ke(L.toPortablePath(ie));return le!==null?L.fromPortablePath(le):null})}}var XCt=(0,Pie.promisify)(Die.readFile);var kie=(t,e,r)=>{let i=rd(t),n=xF(i,{basePath:e}),s=L.join(e,mt.pnpCjs);return kF(n,{fakeFs:r,pnpapiResolution:s})};var wa={};$e(wa,{checkAndReportManifestCompatibility:()=>vie,extractBuildScripts:()=>cB,getExtractHint:()=>vF,hasBindingGyp:()=>FF});function vie(t,e,r,{configuration:i,report:n}){return ze.isManifestFieldCompatible(e.manifest.os,process.platform)?ze.isManifestFieldCompatible(e.manifest.cpu,process.arch)?!0:(n==null||n.reportWarningOnce(z.INCOMPATIBLE_CPU,`${Q.prettyLocator(i,t)} The CPU architecture ${process.arch} is incompatible with this module, ${r} skipped.`),!1):(n==null||n.reportWarningOnce(z.INCOMPATIBLE_OS,`${Q.prettyLocator(i,t)} The platform ${process.platform} is incompatible with this module, ${r} skipped.`),!1)}function cB(t,e,r,{configuration:i,report:n}){let s=[];for(let a of["preinstall","install","postinstall"])e.manifest.scripts.has(a)&&s.push([Wi.SCRIPT,a]);return!e.manifest.scripts.has("install")&&e.misc.hasBindingGyp&&s.push([Wi.SHELLCODE,"node-gyp rebuild"]),s.length===0?[]:t.linkType!==At.HARD?(n==null||n.reportWarningOnce(z.SOFT_LINK_BUILD,`${Q.prettyLocator(i,t)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`),[]):r&&r.built===!1?(n==null||n.reportInfoOnce(z.BUILD_DISABLED,`${Q.prettyLocator(i,t)} lists build scripts, but its build has been explicitly disabled through configuration.`),[]):!i.get("enableScripts")&&!r.built?(n==null||n.reportWarningOnce(z.DISABLED_BUILD_SCRIPTS,`${Q.prettyLocator(i,t)} lists build scripts, but all build scripts have been disabled.`),[]):vie(t,e,"build",{configuration:i,report:n})?s:[]}var gGe=new Set([".exe",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);function vF(t){return t.packageFs.getExtractHint({relevantExtensions:gGe})}function FF(t){let e=w.join(t.prefixPath,"binding.gyp");return t.packageFs.existsSync(e)}var RF={};$e(RF,{getUnpluggedPath:()=>id});function id(t,{configuration:e}){return w.resolve(e.get("pnpUnpluggedFolder"),Q.slugifyLocator(t))}var hGe=new Set([Q.makeIdent(null,"nan").identHash,Q.makeIdent(null,"node-gyp").identHash,Q.makeIdent(null,"node-pre-gyp").identHash,Q.makeIdent(null,"node-addon-api").identHash,Q.makeIdent(null,"fsevents").identHash]),dl=class{constructor(){this.mode="strict";this.pnpCache=new Map}supportsPackage(e,r){return!(r.project.configuration.get("nodeLinker")!=="pnp"||r.project.configuration.get("pnpMode")!==this.mode)}async findPackageLocation(e,r){let i=Qa
|
|||
|
`,n+=`# cause your node_modules installation to become invalidated.
|
|||
|
`,n+=`
|
|||
|
`,n+=`__metadata:
|
|||
|
`,n+=` version: ${Gie}
|
|||
|
`,n+=` nmMode: ${i}
|
|||
|
`;let s=Array.from(e.keys()).sort(),o=Q.stringifyLocator(t.topLevelWorkspace.anchoredLocator);for(let c of s){let u=e.get(c);n+=`
|
|||
|
`,n+=`${JSON.stringify(c)}:
|
|||
|
`,n+=` locations:
|
|||
|
`;for(let g of u.locations){let h=w.contains(t.cwd,g);if(h===null)throw new Error(`Assertion failed: Expected the path to be within the project (${g})`);n+=` - ${JSON.stringify(h)}
|
|||
|
`}if(u.aliases.length>0){n+=` aliases:
|
|||
|
`;for(let g of u.aliases)n+=` - ${JSON.stringify(g)}
|
|||
|
`}if(c===o&&r.size>0){n+=` bin:
|
|||
|
`;for(let[g,h]of r){let f=w.contains(t.cwd,g);if(f===null)throw new Error(`Assertion failed: Expected the path to be within the project (${g})`);n+=` ${JSON.stringify(f)}:
|
|||
|
`;for(let[p,m]of h){let I=w.relative(w.join(g,kr),m);n+=` ${JSON.stringify(p)}: ${JSON.stringify(I)}
|
|||
|
`}}}}let a=t.cwd,l=w.join(a,kr,qie);await M.changeFilePromise(l,n,{automaticNewlines:!0})}async function GF(t,{unrollAliases:e=!1}={}){let r=t.cwd,i=w.join(r,kr,qie);if(!M.existsSync(i))return null;let n=Nr(await M.readFilePromise(i,"utf8"));if(n.__metadata.version>Gie)return null;let s=n.__metadata.nmMode||Li.CLASSIC,o=new Map,a=new Map;delete n.__metadata;for(let[l,c]of Object.entries(n)){let u=c.locations.map(h=>w.join(r,h)),g=c.bin;if(g)for(let[h,f]of Object.entries(g)){let p=w.join(r,L.toPortablePath(h)),m=de.getMapWithDefault(a,p);for(let[I,y]of Object.entries(f))m.set(jt(I),L.toPortablePath([p,kr,y].join(w.delimiter)))}if(o.set(l,{target:Ee.dot,linkType:At.HARD,locations:u,aliases:c.aliases||[]}),e&&c.aliases)for(let h of c.aliases){let{scope:f,name:p}=Q.parseLocator(l),m=Q.makeLocator(Q.makeIdent(f,p),h),I=Q.stringifyLocator(m);o.set(I,{target:Ee.dot,linkType:At.HARD,locations:u,aliases:[]})}}return{locatorMap:o,binSymlinks:a,locationTree:Wie(o,{skipPrefix:t.cwd}),nmMode:s}}var Ou=async(t,e)=>{if(t.split(w.sep).indexOf(kr)<0)throw new Error(`Assertion failed: trying to remove dir that doesn't contain node_modules: ${t}`);try{if(!e.innerLoop&&(await M.lstatPromise(t)).isSymbolicLink()){await M.unlinkPromise(t);return}let r=await M.readdirPromise(t,{withFileTypes:!0});for(let i of r){let n=w.join(t,jt(i.name));i.isDirectory()?(i.name!==kr||e&&e.innerLoop)&&await Ou(n,{innerLoop:!0,contentsOnly:!1}):await M.unlinkPromise(n)}e.contentsOnly||await M.rmdirPromise(t)}catch(r){if(r.code!=="ENOENT"&&r.code!=="ENOTEMPTY")throw r}},zie=4,uB=(t,{skipPrefix:e})=>{let r=w.contains(e,t);if(r===null)throw new Error(`Assertion failed: Writing attempt prevented to ${t} which is outside project root: ${e}`);let i=r.split(w.sep).filter(l=>l!==""),n=i.indexOf(kr),s=i.slice(0,n).join(w.sep),o=w.join(e,s),a=i.slice(n);return{locationRoot:o,segments:a}},Wie=(t,{skipPrefix:e})=>{let r=new Map;if(t===null)return r;let i=()=>({children:new Map,linkType:At.HARD});for(let[n,s]of t.entries()){if(s.linkType===At.SOFT&&w.contains(e,s.target)!==null){let a=de.getFactoryWithDefault(r,s.target,i);a.locator=n,a.linkType=s.linkType}for(let o of s.locations){let{locationRoot:a,segments:l}=uB(o,{skipPrefix:e}),c=de.getFactoryWithDefault(r,a,i);for(let u=0;u<l.length;++u){let g=l[u];if(g!=="."){let h=de.getFactoryWithDefault(c.children,g,i);c.children.set(g,h),c=h}u===l.length-1&&(c.locator=n,c.linkType=s.linkType)}}}return r},qF=async(t,e)=>{let r;try{process.platform==="win32"&&(r=await M.lstatPromise(t))}catch(i){}process.platform=="win32"&&(!r||r.isDirectory())?await M.symlinkPromise(t,e,"junction"):await M.symlinkPromise(w.relative(w.dirname(e),t),e)};async function Vie(t,e,r){let i=w.join(t,jt(`${UF.default.randomBytes(16).toString("hex")}.tmp`));try{await M.writeFilePromise(i,r);try{await M.linkPromise(i,e)}catch(n){}}finally{await M.unlinkPromise(i)}}async function KGe({srcPath:t,dstPath:e,srcMode:r,globalHardlinksStore:i,baseFs:n,nmMode:s,digest:o}){if(s===Li.HARDLINKS_GLOBAL&&i&&o){let l=w.join(i,o.substring(0,2),`${o.substring(2)}.dat`),c;try{if(await wi.checksumFile(l,{baseFs:M,algorithm:"sha1"})!==o){let g=w.join(i,jt(`${UF.default.randomBytes(16).toString("hex")}.tmp`));await M.renamePromise(l,g);let h=await n.readFilePromise(t);await M.writeFilePromise(g,h);try{await M.linkPromise(g,l),await M.unlinkPromise(g)}catch(f){}}await M.linkPromise(l,e),c=!0}catch(u){c=!1}if(!c){let u=await n.readFilePromise(t);await Vie(i,l,u),await M.linkPromise(l,e)}}else await n.copyFilePromise(t,e);let a=r&511;a!==420&&await M.chmodPromise(e,a)}var ba;(function(i){i.FILE="file",i.DIRECTORY="directory",i.SYMLINK="symlink"})(ba||(ba={}));var TGe=async(t,e,{baseFs:r,globalHardlinksStore:i,nmMode:n,packageChecksum:s})=>{await M.mkdirPromise(t,{recursive:!0});let o=async(l=Ee.dot)=>{let c=w.join(e,l),u=await r.readdirPromise(c,{withFileTypes:!0}),g=new Map;for(let h of u){let f=w.join(l,h.name),p,m=w.join(c,h.name);if(h.isFile()){if(p={kind:ba.FILE,mode:(await r.lstatPromise(m)).mode},n===Li.HARDLINKS_GLOBAL){let I=await wi.checksumFile(m,{baseFs:r,algorithm:"s
|
|||
|
This command checks for known security reports on the packages you use. The reports are by default extracted from the npm registry, and may or may not be relevant to your actual program (not all vulnerabilities affect all code paths).
|
|||
|
|
|||
|
For consistency with our other commands the default is to only check the direct dependencies for the active workspace. To extend this search to all workspaces, use \`-A,--all\`. To extend this search to both direct and transitive dependencies, use \`-R,--recursive\`.
|
|||
|
|
|||
|
Applying the \`--severity\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${KB.map(e=>`\`${e}\``).join(", ")}.
|
|||
|
|
|||
|
If the \`--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.
|
|||
|
|
|||
|
To understand the dependency tree requiring vulnerable packages, check the raw report with the \`--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 toe=Bd;var roe=ee(require("path")),_R=ee(Cr()),$R=ee(require("util")),wd=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),{project:r}=await Fe.find(e,this.context.cwd),i=typeof this.fields!="undefined"?new Set(["name",...this.fields.split(/\s*,\s*/)]):null,n=[],s=!1,o=await xe.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 D=r.topLevelWorkspace;if(!D.manifest.name)throw new me(`Missing 'name' field in ${roe.default.join(D.cwd,"package.json")}`);c=Q.makeDescriptor(D.manifest.name,"unknown")}else c=Q.parseDescriptor(l);let u=Bt.getIdentUrl(c),g=eL(await Bt.get(u,{configuration:e,ident:c,jsonResponse:!0,customErrorMessage:Bt.customPackageError})),h=Object.keys(g.versions).sort(_R.default.compareLoose),p=g["dist-tags"].latest||h[h.length-1],m=vt.validRange(c.range);if(m){let D=_R.default.maxSatisfying(h,m);D!==null?p=D:(a.reportWarning(z.UNNAMED,`Unmet range ${Q.prettyRange(e,c.range)}; falling back to the latest version`),s=!0)}else c.range!=="unknown"&&(a.reportWarning(z.UNNAMED,`Invalid range ${Q.prettyRange(e,c.range)}; falling back to the latest version`),s=!0);let I=g.versions[p],y=V(k(k({},g),I),{version:p,versions:h}),B;if(i!==null){B={};for(let D of i){let F=y[D];if(typeof F!="undefined")B[D]=F;else{a.reportWarning(z.EXCEPTION,`The '${D}' field doesn't exist inside ${Q.prettyIdent(e,c)}'s informations`),s=!0;continue}}}else this.json||(delete y.dist,delete y.readme,delete y.users),B=y;a.reportJson(B),this.json||n.push(B)}});$R.inspect.styles.name="cyan";for(let a of n)(a!==n[0]||s)&&this.context.stdout.write(`
|
|||
|
`),this.context.stdout.write(`${(0,$R.inspect)(a,{depth:Infinity,colors:!0,compact:!1})}
|
|||
|
`);return o.exitCode()}};wd.paths=[["npm","info"]],wd.usage=fe.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command will fetch 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. 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 informations.\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 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 ioe=wd;function eL(t){if(Array.isArray(t)){let e=[];for(let r of t)r=eL(r),r&&e.push(r);return e}else if(typeof t=="object"&&t!==null){let e={};for(let r of Object.keys(t)){if(r.startsWith("_"))continue;let i=eL(t[r]);i&&(e[r]=i)}return e}else return t||null}var noe=ee(up()),Qd=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),r=await TB({configuration:e,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await xe.start({configuration:e,stdout:this.context.stdout},async n=>{let s=await rWe({registry:r,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),o=`/-/user/org.couchdb.user:${encodeURIComponent(s.name)}`,a=await Bt.put(o,s,{attemptedAs:s.name,configuration:e,registry:r,jsonResponse:!0,authType:Bt.AuthType.NO_AUTH});return await tWe(r,a.token,{configuration:e,scope:this.scope}),n.reportInfo(z.UNNAMED,"Successfully logged in")})).exitCode()}};Qd.paths=[["npm","login"]],Qd.usage=fe.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --scope my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]});var soe=Qd;async function TB({scope:t,publish:e,configuration:r,cwd:i}){return t&&e?qt.getScopeRegistry(t,{configuration:r,type:qt.RegistryType.PUBLISH_REGISTRY}):
|
|||
|
This command will list all tags of a package from the npm registry.
|
|||
|
|
|||
|
If the package is not specified, Yarn will default to the current workspace.
|
|||
|
`,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]});var loe=xd;async function Dd(t,e){let r=`/-/package${Bt.getIdentUrl(t)}/dist-tags`;return Bt.get(r,{configuration:e,ident:t,jsonResponse:!0,customErrorMessage:Bt.customPackageError})}var Pd=class extends Be{constructor(){super(...arguments);this.package=j.String();this.tag=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd);if(!i)throw new Xe(r.cwd,this.context.cwd);let n=Q.parseDescriptor(this.package,!0),s=n.range;if(!coe.default.valid(s))throw new me(`The range ${ce.pretty(e,n.range,ce.Type.RANGE)} must be a valid semver version`);let o=qt.getPublishRegistry(i.manifest,{configuration:e}),a=ce.pretty(e,n,ce.Type.IDENT),l=ce.pretty(e,s,ce.Type.RANGE),c=ce.pretty(e,this.tag,ce.Type.CODE);return(await xe.start({configuration:e,stdout:this.context.stdout},async g=>{let h=await Dd(n,e);Object.prototype.hasOwnProperty.call(h,this.tag)&&h[this.tag]===s&&g.reportWarning(z.UNNAMED,`Tag ${c} is already set to version ${l}`);let f=`/-/package${Bt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await Bt.put(f,s,{configuration:e,registry:o,ident:n,jsonRequest:!0,jsonResponse:!0}),g.reportInfo(z.UNNAMED,`Tag ${c} added to version ${l} of package ${a}`)})).exitCode()}};Pd.paths=[["npm","tag","add"]],Pd.usage=fe.Usage({category:"Npm-related commands",description:"add a tag for a specific version of a package",details:`
|
|||
|
This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten.
|
|||
|
`,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 uoe=Pd;var kd=class extends Be{constructor(){super(...arguments);this.package=j.String();this.tag=j.String()}async execute(){if(this.tag==="latest")throw new me("The 'latest' tag cannot be removed.");let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd);if(!i)throw new Xe(r.cwd,this.context.cwd);let n=Q.parseIdent(this.package),s=qt.getPublishRegistry(i.manifest,{configuration:e}),o=ce.pretty(e,this.tag,ce.Type.CODE),a=ce.pretty(e,n,ce.Type.IDENT),l=await Dd(n,e);if(!Object.prototype.hasOwnProperty.call(l,this.tag))throw new me(`${o} is not a tag of package ${a}`);return(await xe.start({configuration:e,stdout:this.context.stdout},async u=>{let g=`/-/package${Bt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await Bt.del(g,{configuration:e,registry:s,ident:n,jsonResponse:!0}),u.reportInfo(z.UNNAMED,`Tag ${o} removed from package ${a}`)})).exitCode()}};kd.paths=[["npm","tag","remove"]],kd.usage=fe.Usage({category:"Npm-related commands",description:"remove a tag from a package",details:`
|
|||
|
This command will remove a tag from a package from the npm registry.
|
|||
|
`,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]});var goe=kd;var vd=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),r;return this.scope&&this.publish?r=qt.getScopeRegistry(this.scope,{configuration:e,type:qt.RegistryType.PUBLISH_REGISTRY}):this.scope?r=qt.getScopeRegistry(this.scope,{configuration:e}):this.publish?r=qt.getPublishRegistry((await Bu(e,this.context.cwd)).manifest,{configuration:e}):r=qt.getDefaultRegistry({configuration:e}),(await xe.start({configuration:e,stdout:this.context.stdout},async n=>{var o,a;let s;try{s=await Bt.get("/-/whoami",{configuration:e,registry:r,authType:Bt.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?Q.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(z.AUTHENTICATION_INVALID,"Authentication failed - your credentials may have expired");return}else throw l}n.reportInfo(z.UNNAMED,s.username)})).exitCode()}};vd.paths=[["npm","whoami"]],vd.usage=fe.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 hoe=vd;var sWe={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:ge.STRING,default:null}},commands:[toe,ioe,soe,aoe,Aoe,uoe,loe,goe,hoe]},oWe=sWe;var lL={};$e(lL,{default:()=>BWe,patchUtils:()=>rL});var rL={};$e(rL,{applyPatchFile:()=>GB,diffFolders:()=>oL,extractPackageToDisk:()=>sL,extractPatchFlags:()=>yoe,isParentRequired:()=>nL,loadPatchFiles:()=>Nd,makeDescriptor:()=>IWe,makeLocator:()=>iL,parseDescriptor:()=>Rd,parseLocator:()=>Ld,parsePatchFile:()=>HB});var Fd=class extends Error{constructor(e,r){super(`Cannot apply hunk #${e+1}`);this.hunk=r}};var aWe=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function Zu(t){return w.relative(Ee.root,w.resolve(Ee.root,L.toPortablePath(t)))}function AWe(t){let e=t.trim().match(aWe);if(!e)throw new Error(`Bad header line: '${t}'`);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 lWe=420,cWe=493,ar;(function(i){i.Context="context",i.Insertion="insertion",i.Deletion="deletion"})(ar||(ar={}));var foe=()=>({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}),uWe=t=>({header:AWe(t),parts:[]}),gWe={["@"]:"header",["-"]:ar.Deletion,["+"]:ar.Insertion,[" "]:ar.Context,["\\"]:"pragma",undefined:ar.Context};function fWe(t){let e=[],r=foe(),i="parsing header",n=null,s=null;function o(){n&&(s&&(n.parts.push(s),s=null),r.hunks.push(n),n=null)}function a(){o(),e.push(r),r=foe()}for(let l=0;l<t.length;l++){let c=t[l];if(i==="parsing header")if(c.startsWith("@@"))i="parsing hunks",r.hunks=[],l-=1;else if(c.startsWith("diff --git ")){r&&r.diffLineFromPath&&
|
|||
|
`)+(n.hunk.parts[0].noNewlineAtEndOfFile?"":`
|
|||
|
`):"";await e.mkdirpPromise(w.dirname(n.path),{chmod:493,utimes:[YB,YB]}),await e.writeFilePromise(n.path,s,{mode:n.mode}),await e.utimesPromise(n.path,YB,YB)}break;case"patch":await _u(e,n.path,async()=>{await dWe(n,{baseFs:e,dryRun:r})});break;case"mode change":{let o=(await e.statPromise(n.path)).mode;if(poe(n.newMode)!==poe(o))continue;await _u(e,n.path,async()=>{await e.chmodPromise(n.path,n.newMode)})}break;default:de.assertNever(n);break}}function poe(t){return(t&64)>0}function doe(t){return t.replace(/\s+$/,"")}function CWe(t,e){return doe(t)===doe(e)}async function dWe({hunks:t,path:e},{baseFs:r,dryRun:i=!1}){let n=await r.statSync(e).mode,o=(await r.readFileSync(e,"utf8")).split(/\n/),a=[],l=0,c=0;for(let g of t){let h=Math.max(c,g.header.patched.start+l),f=Math.max(0,h-c),p=Math.max(0,o.length-h-g.header.original.length),m=Math.max(f,p),I=0,y=0,B=null;for(;I<=m;){if(I<=f&&(y=h-I,B=Coe(g,o,y),B!==null)){I=-I;break}if(I<=p&&(y=h+I,B=Coe(g,o,y),B!==null))break;I+=1}if(B===null)throw new Fd(t.indexOf(g),g);a.push(B),l+=I,c=y+g.header.original.length}if(i)return;let u=0;for(let g of a)for(let h of g)switch(h.type){case"splice":{let f=h.index+u;o.splice(f,h.numToDelete,...h.linesToInsert),u+=h.linesToInsert.length-h.numToDelete}break;case"pop":o.pop();break;case"push":o.push(h.line);break;default:de.assertNever(h);break}await r.writeFilePromise(e,o.join(`
|
|||
|
`),{mode:n})}function Coe(t,e,r){let i=[];for(let n of t.parts)switch(n.type){case ar.Context:case ar.Deletion:{for(let s of n.lines){let o=e[r];if(o==null||!CWe(o,s))return null;r+=1}n.type===ar.Deletion&&(i.push({type:"splice",index:r-n.lines.length,numToDelete:n.lines.length,linesToInsert:[]}),n.noNewlineAtEndOfFile&&i.push({type:"push",line:""}))}break;case ar.Insertion:i.push({type:"splice",index:r,numToDelete:0,linesToInsert:n.lines}),n.noNewlineAtEndOfFile&&i.push({type:"pop"});break;default:de.assertNever(n.type);break}return i}var mWe=/^builtin<([^>]+)>$/;function moe(t,e){let{source:r,selector:i,params:n}=Q.parseRange(t);if(r===null)throw new Error("Patch locators must explicitly define their source");let s=i?i.split(/&/).map(c=>L.toPortablePath(c)):[],o=n&&typeof n.locator=="string"?Q.parseLocator(n.locator):null,a=n&&typeof n.version=="string"?n.version:null,l=e(r);return{parentLocator:o,sourceItem:l,patchPaths:s,sourceVersion:a}}function Rd(t){let i=moe(t.range,Q.parseDescriptor),{sourceItem:e}=i,r=vr(i,["sourceItem"]);return V(k({},r),{sourceDescriptor:e})}function Ld(t){let i=moe(t.reference,Q.parseLocator),{sourceItem:e}=i,r=vr(i,["sourceItem"]);return V(k({},r),{sourceLocator:e})}function Ioe({parentLocator:t,sourceItem:e,patchPaths:r,sourceVersion:i,patchHash:n},s){let o=t!==null?{locator:Q.stringifyLocator(t)}:{},a=typeof i!="undefined"?{version:i}:{},l=typeof n!="undefined"?{hash:n}:{};return Q.makeRange({protocol:"patch:",source:s(e),selector:r.join("&"),params:k(k(k({},a),l),o)})}function IWe(t,{parentLocator:e,sourceDescriptor:r,patchPaths:i}){return Q.makeLocator(t,Ioe({parentLocator:e,sourceItem:r,patchPaths:i},Q.stringifyDescriptor))}function iL(t,{parentLocator:e,sourcePackage:r,patchPaths:i,patchHash:n}){return Q.makeLocator(t,Ioe({parentLocator:e,sourceItem:r,sourceVersion:r.version,patchPaths:i,patchHash:n},Q.stringifyLocator))}function Eoe({onAbsolute:t,onRelative:e,onBuiltin:r},i){i.startsWith("~")&&(i=i.slice(1));let s=i.match(mWe);return s!==null?r(s[1]):w.isAbsolute(i)?t(i):e(i)}function yoe(t){let e=t.startsWith("~");return e&&(t=t.slice(1)),{optional:e}}function nL(t){return Eoe({onAbsolute:()=>!1,onRelative:()=>!0,onBuiltin:()=>!1},t)}async function Nd(t,e,r){let i=t!==null?await r.fetcher.fetch(t,r):null,n=i&&i.localPath?{packageFs:new yt(Ee.root),prefixPath:w.relative(Ee.root,i.localPath)}:i;i&&i!==n&&i.releaseFs&&i.releaseFs();let s=await de.releaseAfterUseAsync(async()=>await Promise.all(e.map(async o=>{let a=yoe(o),l=await Eoe({onAbsolute:async()=>await M.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(w.join(n.prefixPath,o),"utf8")},onBuiltin:async c=>await r.project.configuration.firstHook(u=>u.getBuiltinPatch,r.project,c)},o);return V(k({},a),{source:l})})));for(let o of s)typeof o.source=="string"&&(o.source=o.source.replace(/\r\n?/g,`
|
|||
|
`));return s}async function sL(t,{cache:e,project:r}){let i=r.storedPackages.get(t.locatorHash);if(typeof i=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let n=r.storedChecksums,s=new Br,o=r.configuration.makeFetcher(),a=await o.fetch(t,{cache:e,project:r,fetcher:o,checksums:n,report:s}),l=await M.mktempPromise(),c=w.join(l,"source"),u=w.join(l,"user"),g=w.join(l,".yarn-patch.json");return await Promise.all([M.copyPromise(c,a.prefixPath,{baseFs:a.packageFs}),M.copyPromise(u,a.prefixPath,{baseFs:a.packageFs}),M.writeJsonPromise(g,{locator:Q.stringifyLocator(t),version:i.version})]),M.detachTemp(l),u}async function oL(t,e){let r=L.fromPortablePath(t).replace(/\\/g,"/"),i=L.fromPortablePath(e).replace(/\\/g,"/"),{stdout:n,stderr:s}=await pr.execvp("git",["-c","core.safecrlf=false","diff","--src-prefix=a/","--dst-prefix=b/","--ignore-cr-at-eol","--full-index","--no-index","--text",r,i],{cwd:L.toPortablePath(process.cwd()),env:V(k({},process.env),{GIT_CONFIG_NOSYSTEM:"1",HOME:"",XDG_CONFIG_HOME:"",USERPROFILE:""})});if(s.length>0)throw new Error(`Unable to diff directories. Make sure you have a recent version of 'git' available in PATH.
|
|||
|
The following error was reported by 'git':
|
|||
|
${s}`);let o=r.startsWith("/")?a=>a.slice(1):a=>a;return n.replace(new RegExp(`(a|b)(${de.escapeRegExp(`/${o(r)}/`)})`,"g"),"$1/").replace(new RegExp(`(a|b)${de.escapeRegExp(`/${o(i)}/`)}`,"g"),"$1/").replace(new RegExp(de.escapeRegExp(`${r}/`),"g"),"").replace(new RegExp(de.escapeRegExp(`${i}/`),"g"),"")}function Boe(t,{configuration:e,report:r}){for(let i of t.parts)for(let n of i.lines)switch(i.type){case ar.Context:r.reportInfo(null,` ${ce.pretty(e,n,"grey")}`);break;case ar.Deletion:r.reportError(z.FROZEN_LOCKFILE_EXCEPTION,`- ${ce.pretty(e,n,ce.Type.REMOVED)}`);break;case ar.Insertion:r.reportError(z.FROZEN_LOCKFILE_EXCEPTION,`+ ${ce.pretty(e,n,ce.Type.ADDED)}`);break;default:de.assertNever(i.type)}}var aL=class{supports(e,r){return!!e.reference.startsWith("patch:")}getLocalPath(e,r){return null}async fetch(e,r){let i=r.checksums.get(e.locatorHash)||null,[n,s,o]=await r.cache.fetchPackageFromCache(e,i,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${Q.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.patchPackage(e,r),skipIntegrityCheck:r.skipIntegrityCheck});return{packageFs:n,releaseFs:s,prefixPath:Q.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:o}}async patchPackage(e,r){let{parentLocator:i,sourceLocator:n,sourceVersion:s,patchPaths:o}=Ld(e),a=await Nd(i,o,r),l=await M.mktempPromise(),c=w.join(l,"current.zip"),u=await r.fetcher.fetch(n,r),g=Q.getIdentVendorPath(e),h=await li(),f=new Qr(c,{libzip:h,create:!0,level:r.project.configuration.get("compressionLevel")});await f.mkdirpPromise(g),await de.releaseAfterUseAsync(async()=>{await f.copyPromise(g,u.prefixPath,{baseFs:u.packageFs,stableSort:!0})},u.releaseFs),f.saveAndClose();for(let{source:p,optional:m}of a){if(p===null)continue;let I=new Qr(c,{libzip:h,level:r.project.configuration.get("compressionLevel")}),y=new yt(w.resolve(Ee.root,g),{baseFs:I});try{await GB(HB(p),{baseFs:y,version:s})}catch(B){if(!(B instanceof Fd))throw B;let D=r.project.configuration.get("enableInlineHunks"),F=!D&&!m?" (set enableInlineHunks for details)":"",N=`${Q.prettyLocator(r.project.configuration,e)}: ${B.message}${F}`,U=v=>{!D||Boe(B.hunk,{configuration:r.project.configuration,report:v})};if(I.discardAndClose(),m){r.report.reportWarningOnce(z.PATCH_HUNK_FAILED,N,{reportExtra:U});continue}else throw new Ze(z.PATCH_HUNK_FAILED,N,U)}I.saveAndClose()}return new Qr(c,{libzip:h,level:r.project.configuration.get("compressionLevel")})}};var EWe=2,AL=class{supportsDescriptor(e,r){return!!e.range.startsWith("patch:")}supportsLocator(e,r){return!!e.reference.startsWith("patch:")}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,i){let{patchPaths:n}=Rd(e);return n.every(s=>!nL(s))?e:Q.bindDescriptor(e,{locator:Q.stringifyLocator(r)})}getResolutionDependencies(e,r){let{sourceDescriptor:i}=Rd(e);return[i]}async getCandidates(e,r,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}=Rd(e),a=await Nd(n,o,i.fetchOptions),l=r.get(s.descriptorHash);if(typeof l=="undefined")throw new Error("Assertion failed: The dependency should have been resolved");let c=wi.makeHash(`${EWe}`,...a.map(u=>JSON.stringify(u))).slice(0,6);return[iL(e,{parentLocator:n,sourcePackage:l,patchPaths:o,patchHash:c})]}async getSatisfying(e,r,i){return null}async resolve(e,r){let{sourceLocator:i}=Ld(e),n=await r.resolver.resolve(i,r);return k(k({},n),e)}};var Md=class extends Be{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 Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd);if(!i)throw new Xe(r.cwd,this.context.cwd);await r.restoreInstallState();let n=w.resolve(this.context.cwd,L.toPortablePath(this.patchFolder)),s=w.join(n,"../source"),o=w.join(n,"../.yarn-patch.json");if(!M.existsSync(s))throw new
|
|||
|
${o.map(a=>`
|
|||
|
- ${Q.prettyLocator(e,a)}`).join("")}`);s=o[0]}if(!r.storedPackages.has(s.locatorHash))throw new me("No package found in the project for the given locator");await xe.start({configuration:e,json:this.json,stdout:this.context.stdout},async o=>{let a=await sL(s,{cache:n,project:r});o.reportJson({locator:Q.stringifyLocator(s),path:L.fromPortablePath(a)}),o.reportInfo(z.UNNAMED,`Package ${Q.prettyLocator(e,s)} got extracted with success!`),o.reportInfo(z.UNNAMED,`You can now edit the following folder: ${ce.pretty(e,L.fromPortablePath(a),"magenta")}`),o.reportInfo(z.UNNAMED,`Once you are done run ${ce.pretty(e,`yarn patch-commit ${process.platform==="win32"?'"':""}${L.fromPortablePath(a)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};Od.paths=[["patch"]],Od.usage=fe.Usage({description:"prepare a package for patching",details:'\n This command will cause a package to be extracted in a temporary directory (under a folder named "patch-workdir"). This folder will be editable at will; running `yarn patch` inside it will then cause Yarn to generate a patchfile and register it into your top-level manifest (cf the `patch:` protocol).\n '});var Qoe=Od;var yWe={configuration:{enableInlineHunks:{description:"If true, the installs will print unmatched patch hunks",type:ge.BOOLEAN,default:!1},patchFolder:{description:"Folder where the patch files must be written",type:ge.ABSOLUTE_PATH,default:"./.yarn/patches"}},commands:[woe,Qoe],fetchers:[aL],resolvers:[AL]},BWe=yWe;var jy=()=>({modules:new Map([["@yarnpkg/cli",ap],["@yarnpkg/core",Kf],["@yarnpkg/fslib",vg],["@yarnpkg/libzip",Kh],["@yarnpkg/parsers",Jh],["@yarnpkg/shell",zh],["clipanion",A9(Wg)],["semver",wWe],["typanion",Ul],["yup",QWe],["@yarnpkg/plugin-essentials",Pv],["@yarnpkg/plugin-compat",Rv],["@yarnpkg/plugin-dlx",Lv],["@yarnpkg/plugin-file",Gv],["@yarnpkg/plugin-git",eF],["@yarnpkg/plugin-github",rF],["@yarnpkg/plugin-http",sF],["@yarnpkg/plugin-init",lF],["@yarnpkg/plugin-link",fF],["@yarnpkg/plugin-node-modules",WF],["@yarnpkg/plugin-npm",XR],["@yarnpkg/plugin-npm-cli",tL],["@yarnpkg/plugin-pack",JR],["@yarnpkg/plugin-patch",lL],["@yarnpkg/plugin-pnp",NF]]),plugins:new Set(["@yarnpkg/plugin-essentials","@yarnpkg/plugin-compat","@yarnpkg/plugin-dlx","@yarnpkg/plugin-file","@yarnpkg/plugin-git","@yarnpkg/plugin-github","@yarnpkg/plugin-http","@yarnpkg/plugin-init","@yarnpkg/plugin-link","@yarnpkg/plugin-node-modules","@yarnpkg/plugin-npm","@yarnpkg/plugin-npm-cli","@yarnpkg/plugin-pack","@yarnpkg/plugin-patch","@yarnpkg/plugin-pnp"])});fy({binaryVersion:Gi||"<unknown>",pluginConfiguration:jy()});})();
|
|||
|
/*!
|
|||
|
* buildToken
|
|||
|
* Builds OAuth token prefix (helper function)
|
|||
|
*
|
|||
|
* @name buildToken
|
|||
|
* @function
|
|||
|
* @param {GitUrl} obj The parsed Git url object.
|
|||
|
* @return {String} token prefix
|
|||
|
*/
|
|||
|
/*!
|
|||
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|||
|
*
|
|||
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|||
|
* Licensed under the MIT License.
|
|||
|
*/
|
|||
|
/*!
|
|||
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|||
|
*
|
|||
|
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|||
|
* Licensed under the MIT License.
|
|||
|
*/
|
|||
|
/*!
|
|||
|
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|||
|
*
|
|||
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|||
|
* Released under the MIT License.
|
|||
|
*/
|
|||
|
/*!
|
|||
|
* is-number <https://github.com/jonschlinkert/is-number>
|
|||
|
*
|
|||
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|||
|
* Released under the MIT License.
|
|||
|
*/
|
|||
|
/*!
|
|||
|
* is-windows <https://github.com/jonschlinkert/is-windows>
|
|||
|
*
|
|||
|
* Copyright © 2015-2018, Jon Schlinkert.
|
|||
|
* Released under the MIT License.
|
|||
|
*/
|
|||
|
/*!
|
|||
|
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|||
|
*
|
|||
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
|||
|
* Released under the MIT License.
|
|||
|
*/
|