diffray 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/diffray.cjs +173 -178
- package/package.json +4 -2
package/dist/diffray.cjs
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
2
|
+
"use strict";var ay=Object.create;var aa=Object.defineProperty;var uy=Object.getOwnPropertyDescriptor;var ly=Object.getOwnPropertyNames;var cy=Object.getPrototypeOf,fy=Object.prototype.hasOwnProperty;var q=(t,e)=>()=>(t&&(e=t(t=0)),e);var S=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),wn=(t,e)=>{for(var s in e)aa(t,s,{get:e[s],enumerable:!0})},dy=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ly(e))!fy.call(t,i)&&i!==s&&aa(t,i,{get:()=>e[i],enumerable:!(n=uy(e,i))||n.enumerable});return t};var nt=(t,e,s)=>(s=t!=null?ay(cy(t)):{},dy(e||!t||!t.__esModule?aa(s,"default",{value:t,enumerable:!0}):s,t));var Sf={};wn(Sf,{kCancel:()=>vf,prompt:()=>xf});function _y(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function By(){if(rf)return ga;rf=1;let t="\x1B",e=`${t}[`,s="\x07",n={to(o,a){return a?`${e}${a+1};${o+1}H`:`${e}${o+1}G`},move(o,a){let u="";return o<0?u+=`${e}${-o}D`:o>0&&(u+=`${e}${o}C`),a<0?u+=`${e}${-a}A`:a>0&&(u+=`${e}${a}B`),u},up:(o=1)=>`${e}${o}A`,down:(o=1)=>`${e}${o}B`,forward:(o=1)=>`${e}${o}C`,backward:(o=1)=>`${e}${o}D`,nextLine:(o=1)=>`${e}E`.repeat(o),prevLine:(o=1)=>`${e}F`.repeat(o),left:`${e}G`,hide:`${e}?25l`,show:`${e}?25h`,save:`${t}7`,restore:`${t}8`},i={up:(o=1)=>`${e}S`.repeat(o),down:(o=1)=>`${e}T`.repeat(o)},r={screen:`${e}2J`,up:(o=1)=>`${e}1J`.repeat(o),down:(o=1)=>`${e}J`.repeat(o),line:`${e}2K`,lineEnd:`${e}K`,lineStart:`${e}1K`,lines(o){let a="";for(let u=0;u<o;u++)a+=this.line+(u<o-1?n.up():"");return o&&(a+=n.left),a}};return ga={cursor:n,scroll:i,erase:r,beep:s},ga}function Ty(){if(of)return Vi.exports;of=1;let t=process||{},e=t.argv||[],s=t.env||{},n=!(s.NO_COLOR||e.includes("--no-color"))&&(!!s.FORCE_COLOR||e.includes("--color")||t.platform==="win32"||(t.stdout||{}).isTTY&&s.TERM!=="dumb"||!!s.CI),i=(a,u,l=a)=>c=>{let f=""+c,d=f.indexOf(u,a.length);return~d?a+r(f,u,l,d)+u:a+f+u},r=(a,u,l,c)=>{let f="",d=0;do f+=a.substring(d,c)+l,d=c+u.length,c=a.indexOf(u,d);while(~c);return f+a.substring(d)},o=(a=n)=>{let u=a?i:()=>String;return{isColorSupported:a,reset:u("\x1B[0m","\x1B[0m"),bold:u("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:u("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:u("\x1B[3m","\x1B[23m"),underline:u("\x1B[4m","\x1B[24m"),inverse:u("\x1B[7m","\x1B[27m"),hidden:u("\x1B[8m","\x1B[28m"),strikethrough:u("\x1B[9m","\x1B[29m"),black:u("\x1B[30m","\x1B[39m"),red:u("\x1B[31m","\x1B[39m"),green:u("\x1B[32m","\x1B[39m"),yellow:u("\x1B[33m","\x1B[39m"),blue:u("\x1B[34m","\x1B[39m"),magenta:u("\x1B[35m","\x1B[39m"),cyan:u("\x1B[36m","\x1B[39m"),white:u("\x1B[37m","\x1B[39m"),gray:u("\x1B[90m","\x1B[39m"),bgBlack:u("\x1B[40m","\x1B[49m"),bgRed:u("\x1B[41m","\x1B[49m"),bgGreen:u("\x1B[42m","\x1B[49m"),bgYellow:u("\x1B[43m","\x1B[49m"),bgBlue:u("\x1B[44m","\x1B[49m"),bgMagenta:u("\x1B[45m","\x1B[49m"),bgCyan:u("\x1B[46m","\x1B[49m"),bgWhite:u("\x1B[47m","\x1B[49m"),blackBright:u("\x1B[90m","\x1B[39m"),redBright:u("\x1B[91m","\x1B[39m"),greenBright:u("\x1B[92m","\x1B[39m"),yellowBright:u("\x1B[93m","\x1B[39m"),blueBright:u("\x1B[94m","\x1B[39m"),magentaBright:u("\x1B[95m","\x1B[39m"),cyanBright:u("\x1B[96m","\x1B[39m"),whiteBright:u("\x1B[97m","\x1B[39m"),bgBlackBright:u("\x1B[100m","\x1B[49m"),bgRedBright:u("\x1B[101m","\x1B[49m"),bgGreenBright:u("\x1B[102m","\x1B[49m"),bgYellowBright:u("\x1B[103m","\x1B[49m"),bgBlueBright:u("\x1B[104m","\x1B[49m"),bgMagentaBright:u("\x1B[105m","\x1B[49m"),bgCyanBright:u("\x1B[106m","\x1B[49m"),bgWhiteBright:u("\x1B[107m","\x1B[49m")}};return Vi.exports=o(),Vi.exports.createColors=o,Vi.exports}function Ry({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function yf(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Ny,"")}function Ff(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function En(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=yf(t),t.length===0))return 0;t=t.replace(My()," ");let s=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let r=i.codePointAt(0);if(!(r<=31||r>=127&&r<=159||r>=768&&r<=879))switch(Oy.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=s;break;default:n+=1}}return n}function Uy(){let t=new Map;for(let[e,s]of Object.entries(Q)){for(let[n,i]of Object.entries(s))Q[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},s[n]=Q[n],t.set(i[0],i[1]);Object.defineProperty(Q,e,{value:s,enumerable:!1})}return Object.defineProperty(Q,"codes",{value:t,enumerable:!1}),Q.color.close="\x1B[39m",Q.bgColor.close="\x1B[49m",Q.color.ansi=af(),Q.color.ansi256=uf(),Q.color.ansi16m=lf(),Q.bgColor.ansi=af(ya),Q.bgColor.ansi256=uf(ya),Q.bgColor.ansi16m=lf(ya),Object.defineProperties(Q,{rgbToAnsi256:{value:(e,s,n)=>e===s&&s===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(s/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!s)return[0,0,0];let[n]=s;n.length===3&&(n=[...n].map(r=>r+r).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Q.rgbToAnsi256(...Q.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let s,n,i;if(e>=232)s=((e-232)*10+8)/255,n=s,i=s;else{e-=16;let a=e%36;s=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let r=Math.max(s,n,i)*2;if(r===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(s));return r===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,s,n)=>Q.ansi256ToAnsi(Q.rgbToAnsi256(e,s,n)),enumerable:!1},hexToAnsi:{value:e=>Q.ansi256ToAnsi(Q.hexToAnsi256(e)),enumerable:!1}}),Q}function df(t,e,s){return String(t).normalize().replace(/\r\n/g,`
|
|
3
3
|
`).split(`
|
|
4
|
-
`).map(n=>
|
|
5
|
-
`)}function
|
|
4
|
+
`).map(n=>Yy(n,e,s)).join(`
|
|
5
|
+
`)}function bf(t,e){if(typeof t=="string")return Gi.aliases.get(t)===e;for(let s of t)if(s!==void 0&&bf(s,e))return!0;return!1}function Jy(t,e){if(t===e)return;let s=t.split(`
|
|
6
6
|
`),n=e.split(`
|
|
7
|
-
`),i=[];for(let r=0;r<Math.max(s.length,n.length);r++)s[r]!==n[r]&&i.push(r);return i}function zi(t,e){let s=t;s.isTTY&&s.setRawMode(e)}function ty(){return he.default.platform!=="win32"?he.default.env.TERM!=="linux":!!he.default.env.CI||!!he.default.env.WT_SESSION||!!he.default.env.TERMINUS_SUBLIME||he.default.env.ConEmuTask==="{cmd::Cmder}"||he.default.env.TERM_PROGRAM==="Terminus-Sublime"||he.default.env.TERM_PROGRAM==="vscode"||he.default.env.TERM==="xterm-256color"||he.default.env.TERM==="alacritty"||he.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}async function of(t,e={}){let s=n=>{if(typeof n!="symbol"||n.toString()!=="Symbol(clack:cancel)")return n;switch(e.cancel){case"reject":{let i=new Error("Prompt cancelled.");throw i.name="ConsolaPromptCancelledError",Error.captureStackTrace&&Error.captureStackTrace(i,of),i}case"undefined":return;case"null":return null;case"symbol":return rf;default:case"default":return e.default??e.initial}};if(!e.type||e.type==="text")return await ly({message:t,defaultValue:e.default,placeholder:e.placeholder,initialValue:e.initial}).then(s);if(e.type==="confirm")return await cy({message:t,initialValue:e.initial}).then(s);if(e.type==="select")return await fy({message:t,options:e.options.map(n=>typeof n=="string"?{value:n,label:n}:n),initialValue:e.initial}).then(s);if(e.type==="multiselect")return await dy({message:t,options:e.options.map(n=>typeof n=="string"?{value:n,label:n}:n),required:e.required,initialValues:e.initial}).then(s);throw new Error(`Unknown prompt type: ${e.type}`)}var wS,he,ma,Zc,da,Mc,Ue,Gi,jc,$0,x,T0,ef,I0,R0,N0,O0,ha,qc,Uc,Wc,Q,P0,L0,j0,Yi,q0,Ea,tf,U0,sf,ba,Vc,Gc,W0,pa,V0,G0,z0,Ki,Kc,Y0,J0,Ae,Is,Da,H0,Z0,Yc,Q0,X0,ey,Jc,ga,ya,sy,We,ny,iy,ry,oy,Z,Rs,Fa,Ca,ay,Hc,uy,Ji,wa,ly,cy,fy,dy,rf,uf=L(()=>{wS=require("node:util"),he=bt(require("node:process"),1),ma=bt(require("node:readline"),1),Zc=require("node:tty");Ue=k0(),Gi={exports:{}};$0=_0(),x=A0($0);T0=B0();ef={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),r=n.length==2?n.charCodeAt(1):0,o=i;return 55296<=i&&i<=56319&&56320<=r&&r<=57343&&(i&=1023,r&=1023,o=i<<10|r,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function s(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=s(n),r=0,o=0;o<i.length;o++)r=r+this.characterLength(i[o]);return r},e.slice=function(n,i,r){textLen=e.length(n),i=i||0,r=r||1,i<0&&(i=textLen+i),r<0&&(r=textLen+r);for(var o="",a=0,u=s(n),l=0;l<u.length;l++){var c=u[l],f=e.length(c);if(a>=i-(f==2?1:0))if(a+f<=r)o+=c;else break;a+=f}return o}})(ef);I0=ef.exports,R0=Xc(I0),N0=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},O0=Xc(N0);ha=10,qc=(t=0)=>e=>`\x1B[${e+t}m`,Uc=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Wc=(t=0)=>(e,s,n)=>`\x1B[${38+t};2;${e};${s};${n}m`,Q={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Q.modifier);P0=Object.keys(Q.color),L0=Object.keys(Q.bgColor);[...P0,...L0];j0=M0(),Yi=new Set(["\x1B","\x9B"]),q0=39,Ea="\x07",tf="[",U0="]",sf="m",ba=`${U0}8;;`,Vc=t=>`${Yi.values().next().value}${tf}${t}${sf}`,Gc=t=>`${Yi.values().next().value}${ba}${t}${Ea}`,W0=t=>t.split(" ").map(e=>Cn(e)),pa=(t,e,s)=>{let n=[...e],i=!1,r=!1,o=Cn(Qc(t[t.length-1]));for(let[a,u]of n.entries()){let l=Cn(u);if(o+l<=s?t[t.length-1]+=u:(t.push(u),o=0),Yi.has(u)&&(i=!0,r=n.slice(a+1).join("").startsWith(ba)),i){r?u===Ea&&(i=!1,r=!1):u===sf&&(i=!1);continue}o+=l,o===s&&a<n.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},V0=t=>{let e=t.split(" "),s=e.length;for(;s>0&&!(Cn(e[s-1])>0);)s--;return s===e.length?t:e.slice(0,s).join(" ")+e.slice(s).join("")},G0=(t,e,s={})=>{if(s.trim!==!1&&t.trim()==="")return"";let n="",i,r,o=W0(t),a=[""];for(let[l,c]of t.split(" ").entries()){s.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=Cn(a[a.length-1]);if(l!==0&&(f>=e&&(s.wordWrap===!1||s.trim===!1)&&(a.push(""),f=0),(f>0||s.trim===!1)&&(a[a.length-1]+=" ",f++)),s.hard&&o[l]>e){let d=e-f,p=1+Math.floor((o[l]-d-1)/e);Math.floor((o[l]-1)/e)<p&&a.push(""),pa(a,c,e);continue}if(f+o[l]>e&&f>0&&o[l]>0){if(s.wordWrap===!1&&f<e){pa(a,c,e);continue}a.push("")}if(f+o[l]>e&&s.wordWrap===!1){pa(a,c,e);continue}a[a.length-1]+=c}s.trim!==!1&&(a=a.map(l=>V0(l)));let u=[...a.join(`
|
|
8
|
-
`)];for(let[l,c]of u.entries()){if(n+=c,
|
|
9
|
-
`?(r&&(n+=
|
|
10
|
-
`&&(i&&f&&(n+=
|
|
11
|
-
`),zi(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=
|
|
12
|
-
`).length-1;this.output.write(
|
|
13
|
-
`);this.output.write(i[n]),this._prevFrame=e,this.output.write(
|
|
7
|
+
`),i=[];for(let r=0;r<Math.max(s.length,n.length);r++)s[r]!==n[r]&&i.push(r);return i}function zi(t,e){let s=t;s.isTTY&&s.setRawMode(e)}function iF(){return me.default.platform!=="win32"?me.default.env.TERM!=="linux":!!me.default.env.CI||!!me.default.env.WT_SESSION||!!me.default.env.TERMINUS_SUBLIME||me.default.env.ConEmuTask==="{cmd::Cmder}"||me.default.env.TERM_PROGRAM==="Terminus-Sublime"||me.default.env.TERM_PROGRAM==="vscode"||me.default.env.TERM==="xterm-256color"||me.default.env.TERM==="alacritty"||me.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}async function xf(t,e={}){let s=n=>{if(typeof n!="symbol"||n.toString()!=="Symbol(clack:cancel)")return n;switch(e.cancel){case"reject":{let i=new Error("Prompt cancelled.");throw i.name="ConsolaPromptCancelledError",Error.captureStackTrace&&Error.captureStackTrace(i,xf),i}case"undefined":return;case"null":return null;case"symbol":return vf;default:case"default":return e.default??e.initial}};if(!e.type||e.type==="text")return await dF({message:t,defaultValue:e.default,placeholder:e.placeholder,initialValue:e.initial}).then(s);if(e.type==="confirm")return await hF({message:t,initialValue:e.initial}).then(s);if(e.type==="select")return await pF({message:t,options:e.options.map(n=>typeof n=="string"?{value:n,label:n}:n),initialValue:e.initial}).then(s);if(e.type==="multiselect")return await mF({message:t,options:e.options.map(n=>typeof n=="string"?{value:n,label:n}:n),required:e.required,initialValues:e.initial}).then(s);throw new Error(`Unknown prompt type: ${e.type}`)}var GA,me,wa,gf,ga,rf,Ye,Vi,of,Iy,x,Ny,wf,Py,Oy,Ly,My,ya,af,uf,lf,Q,jy,qy,Wy,Ki,Vy,Aa,Cf,zy,Ef,ka,cf,ff,Gy,Fa,Ky,Yy,Hy,Gi,hf,Zy,Qy,Be,Is,Ca,Xy,eF,pf,tF,sF,nF,mf,Ea,ba,rF,He,oF,aF,uF,lF,Z,Rs,va,xa,cF,Df,fF,Yi,Sa,dF,hF,pF,mF,vf,Af=q(()=>{GA=require("node:util"),me=nt(require("node:process"),1),wa=nt(require("node:readline"),1),gf=require("node:tty");Ye=By(),Vi={exports:{}};Iy=Ty(),x=_y(Iy);Ny=Ry();wf={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),r=n.length==2?n.charCodeAt(1):0,o=i;return 55296<=i&&i<=56319&&56320<=r&&r<=57343&&(i&=1023,r&=1023,o=i<<10|r,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function s(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=s(n),r=0,o=0;o<i.length;o++)r=r+this.characterLength(i[o]);return r},e.slice=function(n,i,r){textLen=e.length(n),i=i||0,r=r||1,i<0&&(i=textLen+i),r<0&&(r=textLen+r);for(var o="",a=0,u=s(n),l=0;l<u.length;l++){var c=u[l],f=e.length(c);if(a>=i-(f==2?1:0))if(a+f<=r)o+=c;else break;a+=f}return o}})(wf);Py=wf.exports,Oy=Ff(Py),Ly=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},My=Ff(Ly);ya=10,af=(t=0)=>e=>`\x1B[${e+t}m`,uf=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,lf=(t=0)=>(e,s,n)=>`\x1B[${38+t};2;${e};${s};${n}m`,Q={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Q.modifier);jy=Object.keys(Q.color),qy=Object.keys(Q.bgColor);[...jy,...qy];Wy=Uy(),Ki=new Set(["\x1B","\x9B"]),Vy=39,Aa="\x07",Cf="[",zy="]",Ef="m",ka=`${zy}8;;`,cf=t=>`${Ki.values().next().value}${Cf}${t}${Ef}`,ff=t=>`${Ki.values().next().value}${ka}${t}${Aa}`,Gy=t=>t.split(" ").map(e=>En(e)),Fa=(t,e,s)=>{let n=[...e],i=!1,r=!1,o=En(yf(t[t.length-1]));for(let[a,u]of n.entries()){let l=En(u);if(o+l<=s?t[t.length-1]+=u:(t.push(u),o=0),Ki.has(u)&&(i=!0,r=n.slice(a+1).join("").startsWith(ka)),i){r?u===Aa&&(i=!1,r=!1):u===Ef&&(i=!1);continue}o+=l,o===s&&a<n.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},Ky=t=>{let e=t.split(" "),s=e.length;for(;s>0&&!(En(e[s-1])>0);)s--;return s===e.length?t:e.slice(0,s).join(" ")+e.slice(s).join("")},Yy=(t,e,s={})=>{if(s.trim!==!1&&t.trim()==="")return"";let n="",i,r,o=Gy(t),a=[""];for(let[l,c]of t.split(" ").entries()){s.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=En(a[a.length-1]);if(l!==0&&(f>=e&&(s.wordWrap===!1||s.trim===!1)&&(a.push(""),f=0),(f>0||s.trim===!1)&&(a[a.length-1]+=" ",f++)),s.hard&&o[l]>e){let d=e-f,p=1+Math.floor((o[l]-d-1)/e);Math.floor((o[l]-1)/e)<p&&a.push(""),Fa(a,c,e);continue}if(f+o[l]>e&&f>0&&o[l]>0){if(s.wordWrap===!1&&f<e){Fa(a,c,e);continue}a.push("")}if(f+o[l]>e&&s.wordWrap===!1){Fa(a,c,e);continue}a[a.length-1]+=c}s.trim!==!1&&(a=a.map(l=>Ky(l)));let u=[...a.join(`
|
|
8
|
+
`)];for(let[l,c]of u.entries()){if(n+=c,Ki.has(c)){let{groups:d}=new RegExp(`(?:\\${Cf}(?<code>\\d+)m|\\${ka}(?<uri>.*)${Aa})`).exec(u.slice(l).join(""))||{groups:{}};if(d.code!==void 0){let p=Number.parseFloat(d.code);i=p===Vy?void 0:p}else d.uri!==void 0&&(r=d.uri.length===0?void 0:d.uri)}let f=Wy.codes.get(Number(i));u[l+1]===`
|
|
9
|
+
`?(r&&(n+=ff("")),i&&f&&(n+=cf(f))):c===`
|
|
10
|
+
`&&(i&&f&&(n+=cf(i)),r&&(n+=ff(r)))}return n};Hy=["up","down","left","right","space","enter","cancel"],Gi={actions:new Set(Hy),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};globalThis.process.platform.startsWith("win");hf=Symbol("clack:cancel");Zy=Object.defineProperty,Qy=(t,e,s)=>e in t?Zy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Be=(t,e,s)=>(Qy(t,typeof e!="symbol"?e+"":e,s),s),Is=class{constructor(e,s=!0){Be(this,"input"),Be(this,"output"),Be(this,"_abortSignal"),Be(this,"rl"),Be(this,"opts"),Be(this,"_render"),Be(this,"_track",!1),Be(this,"_prevFrame",""),Be(this,"_subscribers",new Map),Be(this,"_cursor",0),Be(this,"state","initial"),Be(this,"error",""),Be(this,"value");let{input:n=me.stdin,output:i=me.stdout,render:r,signal:o,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=r.bind(this),this._track=s,this._abortSignal=o,this.input=n,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(e,s){let n=this._subscribers.get(e)??[];n.push(s),this._subscribers.set(e,n)}on(e,s){this.setSubscriber(e,{cb:s})}once(e,s){this.setSubscriber(e,{cb:s,once:!0})}emit(e,...s){let n=this._subscribers.get(e)??[],i=[];for(let r of n)r.cb(...s),r.once&&i.push(()=>n.splice(n.indexOf(r),1));for(let r of i)r()}prompt(){return new Promise((e,s)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(hf);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new gf.WriteStream(0);n._write=(i,r,o)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),o()},this.input.pipe(n),this.rl=wa.default.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50}),wa.default.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),zi(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Ye.cursor.show),this.output.off("resize",this.render),zi(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(Ye.cursor.show),this.output.off("resize",this.render),zi(this.input,!1),e(hf)})})}onKeypress(e,s){if(this.state==="error"&&(this.state="active"),s?.name&&(!this._track&&Gi.aliases.has(s.name)&&this.emit("cursor",Gi.aliases.get(s.name)),Gi.actions.has(s.name)&&this.emit("cursor",s.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),s?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}bf([e,s?.name,s?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
11
|
+
`),zi(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=df(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
12
|
+
`).length-1;this.output.write(Ye.cursor.move(-999,e*-1))}render(){let e=df(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(Ye.cursor.hide);else{let s=Jy(this._prevFrame,e);if(this.restoreCursor(),s&&s?.length===1){let n=s[0];this.output.write(Ye.cursor.move(0,n)),this.output.write(Ye.erase.lines(1));let i=e.split(`
|
|
13
|
+
`);this.output.write(i[n]),this._prevFrame=e,this.output.write(Ye.cursor.move(0,i.length-n-1));return}if(s&&s?.length>1){let n=s[0];this.output.write(Ye.cursor.move(0,n)),this.output.write(Ye.erase.down());let i=e.split(`
|
|
14
14
|
`).slice(n);this.output.write(i.join(`
|
|
15
|
-
`)),this._prevFrame=e;return}this.output.write(
|
|
16
|
-
${
|
|
15
|
+
`)),this._prevFrame=e;return}this.output.write(Ye.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},Ca=class extends Is{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",s=>{this.output.write(Ye.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},Xy=Object.defineProperty,eF=(t,e,s)=>e in t?Xy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,pf=(t,e,s)=>(eF(t,typeof e!="symbol"?e+"":e,s),s),tF=class extends Is{constructor(t){super(t,!1),pf(this,"options"),pf(this,"cursor",0),this.options=t.options,this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===t.cursorAt),0),this.on("key",e=>{e==="a"&&this.toggleAll()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let t=this.value.length===this.options.length;this.value=t?[]:this.options.map(e=>e.value)}toggleValue(){let t=this.value.includes(this._value);this.value=t?this.value.filter(e=>e!==this._value):[...this.value,this._value]}},sF=Object.defineProperty,nF=(t,e,s)=>e in t?sF(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,mf=(t,e,s)=>(nF(t,typeof e!="symbol"?e+"":e,s),s),Ea=class extends Is{constructor(e){super(e,!1),mf(this,"options"),mf(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:s})=>s===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",s=>{switch(s){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},ba=class extends Is{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[s,...n]=this.value.slice(this.cursor);return`${e}${x.inverse(s)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};rF=iF(),He=(t,e)=>rF?t:e,oF=He("\u276F",">"),aF=He("\u25A0","x"),uF=He("\u25B2","x"),lF=He("\u2714","\u221A"),Z=He(""),Rs=He(""),va=He("\u25CF",">"),xa=He("\u25CB"," "),cF=He("\u25FB","[\u2022]"),Df=He("\u25FC","[+]"),fF=He("\u25FB","[ ]"),Yi=t=>{switch(t){case"initial":case"active":return x.cyan(oF);case"cancel":return x.red(aF);case"error":return x.yellow(uF);case"submit":return x.green(lF)}},Sa=t=>{let{cursor:e,options:s,style:n}=t,i=t.maxItems??Number.POSITIVE_INFINITY,r=Math.max(process.stdout.rows-4,0),o=Math.min(r,Math.max(i,5)),a=0;e>=a+o-3?a=Math.max(Math.min(e-o+3,s.length-o),0):e<a+2&&(a=Math.max(e-2,0));let u=o<s.length&&a>0,l=o<s.length&&a+o<s.length;return s.slice(a,a+o).map((c,f,d)=>{let p=f===0&&u,D=f===d.length-1&&l;return p||D?x.dim("..."):n(c,f+a===e)})},dF=t=>new ba({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${x.gray(Z)}
|
|
16
|
+
${Yi(this.state)} ${t.message}
|
|
17
17
|
`,s=t.placeholder?x.inverse(t.placeholder[0])+x.dim(t.placeholder.slice(1)):x.inverse(x.hidden("_")),n=this.value?this.valueWithCursor:s;switch(this.state){case"error":return`${e.trim()}
|
|
18
18
|
${x.yellow(Z)} ${n}
|
|
19
19
|
${x.yellow(Rs)} ${x.yellow(this.error)}
|
|
20
20
|
`;case"submit":return`${e}${x.gray(Z)} ${x.dim(this.value||t.placeholder)}`;case"cancel":return`${e}${x.gray(Z)} ${x.strikethrough(x.dim(this.value??""))}${this.value?.trim()?`
|
|
21
21
|
${x.gray(Z)}`:""}`;default:return`${e}${x.cyan(Z)} ${n}
|
|
22
22
|
${x.cyan(Rs)}
|
|
23
|
-
`}}}).prompt(),
|
|
24
|
-
${
|
|
23
|
+
`}}}).prompt(),hF=t=>{let e=t.active??"Yes",s=t.inactive??"No";return new Ca({active:e,inactive:s,initialValue:t.initialValue??!0,render(){let n=`${x.gray(Z)}
|
|
24
|
+
${Yi(this.state)} ${t.message}
|
|
25
25
|
`,i=this.value?e:s;switch(this.state){case"submit":return`${n}${x.gray(Z)} ${x.dim(i)}`;case"cancel":return`${n}${x.gray(Z)} ${x.strikethrough(x.dim(i))}
|
|
26
|
-
${x.gray(Z)}`;default:return`${n}${x.cyan(Z)} ${this.value?`${x.green(
|
|
26
|
+
${x.gray(Z)}`;default:return`${n}${x.cyan(Z)} ${this.value?`${x.green(va)} ${e}`:`${x.dim(xa)} ${x.dim(e)}`} ${x.dim("/")} ${this.value?`${x.dim(xa)} ${x.dim(s)}`:`${x.green(va)} ${s}`}
|
|
27
27
|
${x.cyan(Rs)}
|
|
28
|
-
`}}}).prompt()},
|
|
29
|
-
${
|
|
28
|
+
`}}}).prompt()},pF=t=>{let e=(s,n)=>{let i=s.label??String(s.value);switch(n){case"selected":return`${x.dim(i)}`;case"active":return`${x.green(va)} ${i} ${s.hint?x.dim(`(${s.hint})`):""}`;case"cancelled":return`${x.strikethrough(x.dim(i))}`;default:return`${x.dim(xa)} ${x.dim(i)}`}};return new Ea({options:t.options,initialValue:t.initialValue,render(){let s=`${x.gray(Z)}
|
|
29
|
+
${Yi(this.state)} ${t.message}
|
|
30
30
|
`;switch(this.state){case"submit":return`${s}${x.gray(Z)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${s}${x.gray(Z)} ${e(this.options[this.cursor],"cancelled")}
|
|
31
|
-
${x.gray(Z)}`;default:return`${s}${x.cyan(Z)} ${
|
|
31
|
+
${x.gray(Z)}`;default:return`${s}${x.cyan(Z)} ${Sa({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(n,i)=>e(n,i?"active":"inactive")}).join(`
|
|
32
32
|
${x.cyan(Z)} `)}
|
|
33
33
|
${x.cyan(Rs)}
|
|
34
|
-
`}}}).prompt()},
|
|
34
|
+
`}}}).prompt()},mF=t=>{let e=(s,n)=>{let i=s.label??String(s.value);return n==="active"?`${x.cyan(cF)} ${i} ${s.hint?x.dim(`(${s.hint})`):""}`:n==="selected"?`${x.green(Df)} ${x.dim(i)}`:n==="cancelled"?`${x.strikethrough(x.dim(i))}`:n==="active-selected"?`${x.green(Df)} ${i} ${s.hint?x.dim(`(${s.hint})`):""}`:n==="submitted"?`${x.dim(i)}`:`${x.dim(fF)} ${x.dim(i)}`};return new tF({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(s){if(this.required&&s.length===0)return`Please select at least one option.
|
|
35
35
|
${x.reset(x.dim(`Press ${x.gray(x.bgWhite(x.inverse(" space ")))} to select, ${x.gray(x.bgWhite(x.inverse(" enter ")))} to submit`))}`},render(){let s=`${x.gray(Z)}
|
|
36
|
-
${
|
|
36
|
+
${Yi(this.state)} ${t.message}
|
|
37
37
|
`,n=(i,r)=>{let o=this.value.includes(i.value);return r&&o?e(i,"active-selected"):o?e(i,"selected"):e(i,r?"active":"inactive")};switch(this.state){case"submit":return`${s}${x.gray(Z)} ${this.options.filter(({value:i})=>this.value.includes(i)).map(i=>e(i,"submitted")).join(x.dim(", "))||x.dim("none")}`;case"cancel":{let i=this.options.filter(({value:r})=>this.value.includes(r)).map(r=>e(r,"cancelled")).join(x.dim(", "));return`${s}${x.gray(Z)} ${i.trim()?`${i}
|
|
38
38
|
${x.gray(Z)}`:""}`}case"error":{let i=this.error.split(`
|
|
39
39
|
`).map((r,o)=>o===0?`${x.yellow(Rs)} ${x.yellow(r)}`:` ${r}`).join(`
|
|
40
|
-
`);return`${s+x.yellow(Z)} ${
|
|
40
|
+
`);return`${s+x.yellow(Z)} ${Sa({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
|
|
41
41
|
${x.yellow(Z)} `)}
|
|
42
42
|
${i}
|
|
43
|
-
`}default:return`${s}${x.cyan(Z)} ${
|
|
43
|
+
`}default:return`${s}${x.cyan(Z)} ${Sa({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
|
|
44
44
|
${x.cyan(Z)} `)}
|
|
45
45
|
${x.cyan(Rs)}
|
|
46
|
-
`}}}).prompt()};`${x.gray(Z)}`;
|
|
47
|
-
${
|
|
48
|
-
${
|
|
46
|
+
`}}}).prompt()};`${x.gray(Z)}`;vf=Symbol.for("cancel")});async function Dt(t,e){let s=Ma.get(t);if(s!==void 0)return s.value;let n=await e();return Ma.set(t,{value:n,timestamp:Date.now()}),n}function Os(t){Ma.delete(t)}var Ma,Ae,xn=q(()=>{"use strict";Ma=new Map;Ae={CONFIG:"config",INSTRUCTIONS:"instructions",OUTPUT_FORMAT:"prompt:output-format",VALIDATION_PROMPT:"prompt:validation",GIT_STATUS:"git:status"}});function Mf(){process.stdout.write("\x1B[?25h")}function Sn(t){if(!t)return"-";if(t.startsWith("embedded:"))return t;let e=(0,Lf.homedir)(),s=process.cwd();return t.startsWith(e)?"~"+t.slice(e.length):t.startsWith(s)?"."+t.slice(s.length):t}var Lf,I,Xi,h,er,ww,Ls,H=q(()=>{"use strict";Lf=require("node:os"),I={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",gray:"\x1B[90m"},Xi=new Set;process.on("SIGINT",()=>{for(let t of Xi)t.stop();Mf(),console.log(`
|
|
47
|
+
${I.yellow}!${I.reset} Interrupted - shutting down gracefully`),process.exit(130)});process.on("SIGTERM",()=>{for(let t of Xi)t.stop();Mf(),console.log(`
|
|
48
|
+
${I.yellow}!${I.reset} Terminated - shutting down gracefully`),process.exit(143)});h={success:t=>{console.log(`${I.green}\u2713${I.reset} ${t}`)},error:(t,e)=>{let s=e?`${t} ${e}`:t;console.error(`${I.red}\u2717${I.reset} ${s}`)},warn:(t,e)=>{let s=e?`${t} ${e}`:t;console.warn(`${I.yellow}!${I.reset} ${s}`)},info:t=>{console.log(`${I.blue}\u25CB${I.reset} ${t}`)},debug:t=>{process.env.DEBUG&&console.log(`${I.gray}\xB7${I.reset} ${t}`)},plain:t=>{console.log(t)},load:t=>console.log(`${I.cyan}\u25B8${I.reset} ${t}`),match:t=>console.log(`${I.magenta}\u25C6${I.reset} ${t}`),execute:t=>console.log(`${I.blue}\u203A${I.reset} ${t}`),agent:t=>console.log(`${I.cyan}\u25C9${I.reset} ${t}`),done:t=>console.log(`${I.green}\u2713${I.reset} ${t}`),analyze:t=>console.log(`${I.blue}\u25CB${I.reset} ${t}`),run:t=>console.log(`${I.green}\u25B6${I.reset} ${t}`),stats:t=>console.log(` ${t}`),rocket:t=>console.log(`${I.magenta}\u25B2${I.reset} ${t}`),robot:t=>console.log(`${I.cyan}\u25C9${I.reset} ${t}`),chart:t=>console.log(`${I.blue}\u25A0${I.reset} ${t}`),file:t=>console.log(`${I.gray}\u25C7${I.reset} ${t}`),sync:t=>console.log(`${I.cyan}\u21BB${I.reset} ${t}`),lightning:t=>console.log(`${I.yellow}\u26A1${I.reset} ${t}`),sparkles:t=>console.log(`${I.magenta}\u2726${I.reset} ${t}`),logo:()=>{console.log(`
|
|
49
49
|
\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557
|
|
50
50
|
\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u255A\u2588\u2588\u2557 \u2588\u2588\u2554\u255D
|
|
51
|
-
\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2554\u255D ${
|
|
51
|
+
\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2554\u255D ${I.bold}Multi-agent code review${I.reset}
|
|
52
52
|
\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551 \u255A\u2588\u2588\u2554\u255D
|
|
53
53
|
\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551
|
|
54
54
|
\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D
|
|
55
|
-
`)},separator:(t="=",e=80)=>{console.log(t.repeat(e))},newline:()=>console.log()};
|
|
56
|
-
`);this.linesWritten=e.length}formatTaskLine(e,s,n){let i=`[${s}/${n}]`.padEnd(7),r=18,o=e.label.length>r?e.label.slice(0,r-1)+"\u2026":e.label.padEnd(r),a,u;switch(e.status){case"pending":a=$.gray,u="\u25CB";break;case"running":a=$.cyan,u=this.frames[this.frameIndex]??"\u280B";break;case"done":a=$.green,u="\u2713";break;case"error":a=$.red,u="\u2717";break}let l=this.calculateProgress(e),c=this.formatProgressBar(l),f=`${a}${c}${$.reset} ${u}`,d="";if(e.status==="running"){let D=this.calculateETA(e);D!==null&&(d=`~${Math.ceil(D/1e3)}s`)}else e.duration!==void 0&&(d=`${(e.duration/1e3).toFixed(1)}s`);let p=e.detail?`${$.dim}| ${e.detail}${$.reset}`:"";return` ${$.dim}${i}${$.reset} ${o} ${f} ${d.padEnd(6)} ${p}`}stop(){this.isActive&&(this.isActive=!1,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.exitHandler&&(process.removeListener("exit",this.exitHandler),this.exitHandler=null),this.render(),process.stdout.write("\x1B[?25h"))}}});var U,La,k,et,An=L(()=>{(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function s(i){throw new Error}t.assertNever=s,t.arrayToEnum=i=>{let r={};for(let o of i)r[o]=o;return r},t.getValidEnumValues=i=>{let r=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of r)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(r){return i[r]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let r=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&r.push(o);return r},t.find=(i,r)=>{for(let o of i)if(r(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,r=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(r)}t.joinValues=n,t.jsonStringifyReplacer=(i,r)=>typeof r=="bigint"?r.toString():r})(U||(U={}));(function(t){t.mergeShapes=(e,s)=>({...e,...s})})(La||(La={}));k=U.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),et=t=>{switch(typeof t){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(t)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(t)?k.array:t===null?k.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?k.promise:typeof Map<"u"&&t instanceof Map?k.map:typeof Set<"u"&&t instanceof Set?k.set:typeof Date<"u"&&t instanceof Date?k.date:k.object;default:return k.unknown}}});var v,xF,pe,sr=L(()=>{An();v=U.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xF=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),pe=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}format(e){let s=e||function(r){return r.message},n={_errors:[]},i=r=>{for(let o of r.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(s(o));else{let a=n,u=0;for(;u<o.path.length;){let l=o.path[u];u===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(s(o))):a[l]=a[l]||{_errors:[]},a=a[l],u++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,U.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){let s={},n=[];for(let i of this.issues)if(i.path.length>0){let r=i.path[0];s[r]=s[r]||[],s[r].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:s}}get formErrors(){return this.flatten()}};pe.create=t=>new pe(t)});var SF,dt,Ma=L(()=>{sr();An();SF=(t,e)=>{let s;switch(t.code){case v.invalid_type:t.received===k.undefined?s="Required":s=`Expected ${t.expected}, received ${t.received}`;break;case v.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,U.jsonStringifyReplacer)}`;break;case v.unrecognized_keys:s=`Unrecognized key(s) in object: ${U.joinValues(t.keys,", ")}`;break;case v.invalid_union:s="Invalid input";break;case v.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${U.joinValues(t.options)}`;break;case v.invalid_enum_value:s=`Invalid enum value. Expected ${U.joinValues(t.options)}, received '${t.received}'`;break;case v.invalid_arguments:s="Invalid function arguments";break;case v.invalid_return_type:s="Invalid function return type";break;case v.invalid_date:s="Invalid date";break;case v.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:U.assertNever(t.validation):t.validation!=="regex"?s=`Invalid ${t.validation}`:s="Invalid";break;case v.too_small:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:s="Invalid input";break;case v.too_big:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?s=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:s="Invalid input";break;case v.custom:s="Invalid input";break;case v.invalid_intersection_types:s="Intersection results could not be merged";break;case v.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case v.not_finite:s="Number must be finite";break;default:s=e.defaultError,U.assertNever(t)}return{message:s}},dt=SF});function AF(t){Pf=t}function Ms(){return Pf}var Pf,nr=L(()=>{Ma();Pf=dt});function S(t,e){let s=Ms(),n=kn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,s,s===dt?void 0:dt].filter(i=>!!i)});t.common.issues.push(n)}var kn,kF,ce,N,ts,me,ir,rr,At,js,ja=L(()=>{nr();Ma();kn=t=>{let{data:e,path:s,errorMaps:n,issueData:i}=t,r=[...s,...i.path||[]],o={...i,path:r};if(i.message!==void 0)return{...i,path:r,message:i.message};let a="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)a=l(o,{data:e,defaultError:a}).message;return{...i,path:r,message:a}},kF=[];ce=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){let n=[];for(let i of s){if(i.status==="aborted")return N;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,s){let n=[];for(let i of s){let r=await i.key,o=await i.value;n.push({key:r,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,s){let n={};for(let i of s){let{key:r,value:o}=i;if(r.status==="aborted"||o.status==="aborted")return N;r.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[r.value]=o.value)}return{status:e.value,value:n}}},N=Object.freeze({status:"aborted"}),ts=t=>({status:"dirty",value:t}),me=t=>({status:"valid",value:t}),ir=t=>t.status==="aborted",rr=t=>t.status==="dirty",At=t=>t.status==="valid",js=t=>typeof Promise<"u"&&t instanceof Promise});var Lf=L(()=>{});var B,Mf=L(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(B||(B={}))});function P(t){if(!t)return{};let{errorMap:e,invalid_type_error:s,required_error:n,description:i}=t;if(e&&(s||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>{let{message:u}=t;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:u??s??a.defaultError}},description:i}}function Wf(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let s=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`}function GF(t){return new RegExp(`^${Wf(t)}$`)}function Vf(t){let e=`${Uf}T${Wf(t)}`,s=[];return s.push(t.local?"Z?":"Z"),t.offset&&s.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${s.join("|")})`,new RegExp(`^${e}$`)}function zF(t,e){return!!((e==="v4"||!e)&&LF.test(t)||(e==="v6"||!e)&&jF.test(t))}function KF(t,e){if(!RF.test(t))return!1;try{let[s]=t.split(".");if(!s)return!1;let n=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function YF(t,e){return!!((e==="v4"||!e)&&MF.test(t)||(e==="v6"||!e)&&qF.test(t))}function JF(t,e){let s=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=s>n?s:n,r=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return r%o/10**i}function qs(t){if(t instanceof be){let e={};for(let s in t.shape){let n=t.shape[s];e[s]=Be.create(qs(n))}return new be({...t._def,shape:()=>e})}else return t instanceof mt?new mt({...t._def,type:qs(t.element)}):t instanceof Be?Be.create(qs(t.unwrap())):t instanceof st?st.create(qs(t.unwrap())):t instanceof tt?tt.create(t.items.map(e=>qs(e))):t}function Ua(t,e){let s=et(t),n=et(e);if(t===e)return{valid:!0,data:t};if(s===k.object&&n===k.object){let i=U.objectKeys(e),r=U.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(let a of r){let u=Ua(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(s===k.array&&n===k.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let r=0;r<t.length;r++){let o=t[r],a=e[r],u=Ua(o,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return s===k.date&&n===k.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function Gf(t,e){return new ds({values:t,typeName:O.ZodEnum,...P(e)})}function qf(t,e){let s=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof s=="string"?{message:s}:s}function zf(t,e={},s){return t?_t.create().superRefine((n,i)=>{let r=t(n);if(r instanceof Promise)return r.then(o=>{if(!o){let a=qf(e,n),u=a.fatal??s??!0;i.addIssue({code:"custom",...a,fatal:u})}});if(!r){let o=qf(e,n),a=o.fatal??s??!0;i.addIssue({code:"custom",...o,fatal:a})}}):_t.create()}var Te,jf,j,_F,$F,BF,TF,IF,RF,NF,OF,PF,qa,LF,MF,jF,qF,UF,WF,Uf,VF,kt,ss,ns,is,rs,Us,os,as,_t,pt,Ge,Ws,mt,be,us,ht,or,ls,tt,ar,Vs,Gs,ur,cs,fs,ds,hs,$t,Ie,Be,st,ps,ms,zs,HF,_n,$n,Ds,ZF,O,QF,Kf,Yf,XF,eC,Jf,tC,sC,nC,iC,rC,oC,aC,uC,lC,cC,fC,dC,hC,pC,mC,DC,gC,yC,FC,CC,wC,EC,bC,vC,xC,SC,AC,kC,_C,$C,BC,TC,IC,RC,Hf=L(()=>{sr();nr();Mf();ja();An();Te=class{constructor(e,s,n,i){this._cachedPath=[],this.parent=e,this.data=s,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},jf=(t,e)=>{if(At(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let s=new pe(t.common.issues);return this._error=s,this._error}}};j=class{get description(){return this._def.description}_getType(e){return et(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:et(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ce,ctx:{common:e.parent.common,data:e.data,parsedType:et(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let s=this._parse(e);if(js(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){let s=this._parse(e);return Promise.resolve(s)}parse(e,s){let n=this.safeParse(e,s);if(n.success)return n.data;throw n.error}safeParse(e,s){let n={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:et(e)},i=this._parseSync({data:e,path:n.path,parent:n});return jf(n,i)}"~validate"(e){let s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:et(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:s});return At(n)?{value:n.value}:{issues:s.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(n=>At(n)?{value:n.value}:{issues:s.common.issues})}async parseAsync(e,s){let n=await this.safeParseAsync(e,s);if(n.success)return n.data;throw n.error}async safeParseAsync(e,s){let n={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:et(e)},i=this._parse({data:e,path:n.path,parent:n}),r=await(js(i)?i:Promise.resolve(i));return jf(n,r)}refine(e,s){let n=i=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(i):s;return this._refinement((i,r)=>{let o=e(i),a=()=>r.addIssue({code:v.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,s){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof s=="function"?s(n,i):s),!1))}_refinement(e){return new Ie({schema:this,typeName:O.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return Be.create(this,this._def)}nullable(){return st.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mt.create(this)}promise(){return $t.create(this,this._def)}or(e){return us.create([this,e],this._def)}and(e){return ls.create(this,e,this._def)}transform(e){return new Ie({...P(this._def),schema:this,typeName:O.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let s=typeof e=="function"?e:()=>e;return new ps({...P(this._def),innerType:this,defaultValue:s,typeName:O.ZodDefault})}brand(){return new _n({typeName:O.ZodBranded,type:this,...P(this._def)})}catch(e){let s=typeof e=="function"?e:()=>e;return new ms({...P(this._def),innerType:this,catchValue:s,typeName:O.ZodCatch})}describe(e){let s=this.constructor;return new s({...this._def,description:e})}pipe(e){return $n.create(this,e)}readonly(){return Ds.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},_F=/^c[^\s-]{8,}$/i,$F=/^[0-9a-z]+$/,BF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,TF=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,IF=/^[a-z0-9_-]{21}$/i,RF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,NF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,OF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",LF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,MF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,jF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,qF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,UF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,WF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Uf="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",VF=new RegExp(`^${Uf}$`);kt=class t extends j{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){let r=this._getOrReturnCtx(e);return S(r,{code:v.invalid_type,expected:k.string,received:r.parsedType}),N}let n=new ce,i;for(let r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(i=this._getOrReturnCtx(e,i),S(i,{code:v.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="max")e.data.length>r.value&&(i=this._getOrReturnCtx(e,i),S(i,{code:v.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="length"){let o=e.data.length>r.value,a=e.data.length<r.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?S(i,{code:v.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):a&&S(i,{code:v.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),n.dirty())}else if(r.kind==="email")OF.test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"email",code:v.invalid_string,message:r.message}),n.dirty());else if(r.kind==="emoji")qa||(qa=new RegExp(PF,"u")),qa.test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"emoji",code:v.invalid_string,message:r.message}),n.dirty());else if(r.kind==="uuid")TF.test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"uuid",code:v.invalid_string,message:r.message}),n.dirty());else if(r.kind==="nanoid")IF.test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"nanoid",code:v.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid")_F.test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"cuid",code:v.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid2")$F.test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"cuid2",code:v.invalid_string,message:r.message}),n.dirty());else if(r.kind==="ulid")BF.test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"ulid",code:v.invalid_string,message:r.message}),n.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),S(i,{validation:"url",code:v.invalid_string,message:r.message}),n.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"regex",code:v.invalid_string,message:r.message}),n.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(i=this._getOrReturnCtx(e,i),S(i,{code:v.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(i=this._getOrReturnCtx(e,i),S(i,{code:v.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(i=this._getOrReturnCtx(e,i),S(i,{code:v.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty()):r.kind==="datetime"?Vf(r).test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{code:v.invalid_string,validation:"datetime",message:r.message}),n.dirty()):r.kind==="date"?VF.test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{code:v.invalid_string,validation:"date",message:r.message}),n.dirty()):r.kind==="time"?GF(r).test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{code:v.invalid_string,validation:"time",message:r.message}),n.dirty()):r.kind==="duration"?NF.test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"duration",code:v.invalid_string,message:r.message}),n.dirty()):r.kind==="ip"?zF(e.data,r.version)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"ip",code:v.invalid_string,message:r.message}),n.dirty()):r.kind==="jwt"?KF(e.data,r.alg)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"jwt",code:v.invalid_string,message:r.message}),n.dirty()):r.kind==="cidr"?YF(e.data,r.version)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"cidr",code:v.invalid_string,message:r.message}),n.dirty()):r.kind==="base64"?UF.test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"base64",code:v.invalid_string,message:r.message}),n.dirty()):r.kind==="base64url"?WF.test(e.data)||(i=this._getOrReturnCtx(e,i),S(i,{validation:"base64url",code:v.invalid_string,message:r.message}),n.dirty()):U.assertNever(r);return{status:n.value,value:e.data}}_regex(e,s,n){return this.refinement(i=>e.test(i),{validation:s,code:v.invalid_string,...B.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...B.errToObj(e)})}url(e){return this._addCheck({kind:"url",...B.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...B.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...B.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...B.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...B.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...B.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...B.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...B.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...B.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...B.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...B.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...B.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...B.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...B.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...B.errToObj(e)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...B.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s?.position,...B.errToObj(s?.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...B.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...B.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...B.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...B.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...B.errToObj(s)})}nonempty(e){return this.min(1,B.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}};kt.create=t=>new kt({checks:[],typeName:O.ZodString,coerce:t?.coerce??!1,...P(t)});ss=class t extends j{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==k.number){let r=this._getOrReturnCtx(e);return S(r,{code:v.invalid_type,expected:k.number,received:r.parsedType}),N}let n,i=new ce;for(let r of this._def.checks)r.kind==="int"?U.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),S(n,{code:v.invalid_type,expected:"integer",received:"float",message:r.message}),i.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),S(n,{code:v.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),S(n,{code:v.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="multipleOf"?JF(e.data,r.value)!==0&&(n=this._getOrReturnCtx(e,n),S(n,{code:v.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),S(n,{code:v.not_finite,message:r.message}),i.dirty()):U.assertNever(r);return{status:i.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,B.toString(s))}gt(e,s){return this.setLimit("min",e,!1,B.toString(s))}lte(e,s){return this.setLimit("max",e,!0,B.toString(s))}lt(e,s){return this.setLimit("max",e,!1,B.toString(s))}setLimit(e,s,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:n,message:B.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:B.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:B.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:B.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:B.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:B.toString(e)})}get minValue(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&U.isInteger(e.value))}get isFinite(){let e=null,s=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(s===null||n.value>s)&&(s=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(s)&&Number.isFinite(e)}};ss.create=t=>new ss({checks:[],typeName:O.ZodNumber,coerce:t?.coerce||!1,...P(t)});ns=class t extends j{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==k.bigint)return this._getInvalidInput(e);let n,i=new ce;for(let r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),S(n,{code:v.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),S(n,{code:v.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),S(n,{code:v.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):U.assertNever(r);return{status:i.value,value:e.data}}_getInvalidInput(e){let s=this._getOrReturnCtx(e);return S(s,{code:v.invalid_type,expected:k.bigint,received:s.parsedType}),N}gte(e,s){return this.setLimit("min",e,!0,B.toString(s))}gt(e,s){return this.setLimit("min",e,!1,B.toString(s))}lte(e,s){return this.setLimit("max",e,!0,B.toString(s))}lt(e,s){return this.setLimit("max",e,!1,B.toString(s))}setLimit(e,s,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:n,message:B.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:B.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(s)})}get minValue(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}};ns.create=t=>new ns({checks:[],typeName:O.ZodBigInt,coerce:t?.coerce??!1,...P(t)});is=class extends j{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){let n=this._getOrReturnCtx(e);return S(n,{code:v.invalid_type,expected:k.boolean,received:n.parsedType}),N}return me(e.data)}};is.create=t=>new is({typeName:O.ZodBoolean,coerce:t?.coerce||!1,...P(t)});rs=class t extends j{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){let r=this._getOrReturnCtx(e);return S(r,{code:v.invalid_type,expected:k.date,received:r.parsedType}),N}if(Number.isNaN(e.data.getTime())){let r=this._getOrReturnCtx(e);return S(r,{code:v.invalid_date}),N}let n=new ce,i;for(let r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(i=this._getOrReturnCtx(e,i),S(i,{code:v.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(i=this._getOrReturnCtx(e,i),S(i,{code:v.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):U.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:B.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:B.toString(s)})}get minDate(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}};rs.create=t=>new rs({checks:[],coerce:t?.coerce||!1,typeName:O.ZodDate,...P(t)});Us=class extends j{_parse(e){if(this._getType(e)!==k.symbol){let n=this._getOrReturnCtx(e);return S(n,{code:v.invalid_type,expected:k.symbol,received:n.parsedType}),N}return me(e.data)}};Us.create=t=>new Us({typeName:O.ZodSymbol,...P(t)});os=class extends j{_parse(e){if(this._getType(e)!==k.undefined){let n=this._getOrReturnCtx(e);return S(n,{code:v.invalid_type,expected:k.undefined,received:n.parsedType}),N}return me(e.data)}};os.create=t=>new os({typeName:O.ZodUndefined,...P(t)});as=class extends j{_parse(e){if(this._getType(e)!==k.null){let n=this._getOrReturnCtx(e);return S(n,{code:v.invalid_type,expected:k.null,received:n.parsedType}),N}return me(e.data)}};as.create=t=>new as({typeName:O.ZodNull,...P(t)});_t=class extends j{constructor(){super(...arguments),this._any=!0}_parse(e){return me(e.data)}};_t.create=t=>new _t({typeName:O.ZodAny,...P(t)});pt=class extends j{constructor(){super(...arguments),this._unknown=!0}_parse(e){return me(e.data)}};pt.create=t=>new pt({typeName:O.ZodUnknown,...P(t)});Ge=class extends j{_parse(e){let s=this._getOrReturnCtx(e);return S(s,{code:v.invalid_type,expected:k.never,received:s.parsedType}),N}};Ge.create=t=>new Ge({typeName:O.ZodNever,...P(t)});Ws=class extends j{_parse(e){if(this._getType(e)!==k.undefined){let n=this._getOrReturnCtx(e);return S(n,{code:v.invalid_type,expected:k.void,received:n.parsedType}),N}return me(e.data)}};Ws.create=t=>new Ws({typeName:O.ZodVoid,...P(t)});mt=class t extends j{_parse(e){let{ctx:s,status:n}=this._processInputParams(e),i=this._def;if(s.parsedType!==k.array)return S(s,{code:v.invalid_type,expected:k.array,received:s.parsedType}),N;if(i.exactLength!==null){let o=s.data.length>i.exactLength.value,a=s.data.length<i.exactLength.value;(o||a)&&(S(s,{code:o?v.too_big:v.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&s.data.length<i.minLength.value&&(S(s,{code:v.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&s.data.length>i.maxLength.value&&(S(s,{code:v.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),s.common.async)return Promise.all([...s.data].map((o,a)=>i.type._parseAsync(new Te(s,o,s.path,a)))).then(o=>ce.mergeArray(n,o));let r=[...s.data].map((o,a)=>i.type._parseSync(new Te(s,o,s.path,a)));return ce.mergeArray(n,r)}get element(){return this._def.type}min(e,s){return new t({...this._def,minLength:{value:e,message:B.toString(s)}})}max(e,s){return new t({...this._def,maxLength:{value:e,message:B.toString(s)}})}length(e,s){return new t({...this._def,exactLength:{value:e,message:B.toString(s)}})}nonempty(e){return this.min(1,e)}};mt.create=(t,e)=>new mt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:O.ZodArray,...P(e)});be=class t extends j{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),s=U.objectKeys(e);return this._cached={shape:e,keys:s},this._cached}_parse(e){if(this._getType(e)!==k.object){let l=this._getOrReturnCtx(e);return S(l,{code:v.invalid_type,expected:k.object,received:l.parsedType}),N}let{status:n,ctx:i}=this._processInputParams(e),{shape:r,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Ge&&this._def.unknownKeys==="strip"))for(let l in i.data)o.includes(l)||a.push(l);let u=[];for(let l of o){let c=r[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Te(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Ge){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of a)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")a.length>0&&(S(i,{code:v.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of a){let f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Te(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let f=await c.key,d=await c.value;l.push({key:f,value:d,alwaysSet:c.alwaysSet})}return l}).then(l=>ce.mergeObjectSync(n,l)):ce.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return B.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,n)=>{let i=this._def.errorMap?.(s,n).message??n.defaultError;return s.code==="unrecognized_keys"?{message:B.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:O.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let s={};for(let n of U.objectKeys(e))e[n]&&this.shape[n]&&(s[n]=this.shape[n]);return new t({...this._def,shape:()=>s})}omit(e){let s={};for(let n of U.objectKeys(this.shape))e[n]||(s[n]=this.shape[n]);return new t({...this._def,shape:()=>s})}deepPartial(){return qs(this)}partial(e){let s={};for(let n of U.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?s[n]=i:s[n]=i.optional()}return new t({...this._def,shape:()=>s})}required(e){let s={};for(let n of U.objectKeys(this.shape))if(e&&!e[n])s[n]=this.shape[n];else{let r=this.shape[n];for(;r instanceof Be;)r=r._def.innerType;s[n]=r}return new t({...this._def,shape:()=>s})}keyof(){return Gf(U.objectKeys(this.shape))}};be.create=(t,e)=>new be({shape:()=>t,unknownKeys:"strip",catchall:Ge.create(),typeName:O.ZodObject,...P(e)});be.strictCreate=(t,e)=>new be({shape:()=>t,unknownKeys:"strict",catchall:Ge.create(),typeName:O.ZodObject,...P(e)});be.lazycreate=(t,e)=>new be({shape:t,unknownKeys:"strip",catchall:Ge.create(),typeName:O.ZodObject,...P(e)});us=class extends j{_parse(e){let{ctx:s}=this._processInputParams(e),n=this._def.options;function i(r){for(let a of r)if(a.result.status==="valid")return a.result;for(let a of r)if(a.result.status==="dirty")return s.common.issues.push(...a.ctx.common.issues),a.result;let o=r.map(a=>new pe(a.ctx.common.issues));return S(s,{code:v.invalid_union,unionErrors:o}),N}if(s.common.async)return Promise.all(n.map(async r=>{let o={...s,common:{...s.common,issues:[]},parent:null};return{result:await r._parseAsync({data:s.data,path:s.path,parent:o}),ctx:o}})).then(i);{let r,o=[];for(let u of n){let l={...s,common:{...s.common,issues:[]},parent:null},c=u._parseSync({data:s.data,path:s.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!r&&(r={result:c,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(r)return s.common.issues.push(...r.ctx.common.issues),r.result;let a=o.map(u=>new pe(u));return S(s,{code:v.invalid_union,unionErrors:a}),N}}get options(){return this._def.options}};us.create=(t,e)=>new us({options:t,typeName:O.ZodUnion,...P(e)});ht=t=>t instanceof cs?ht(t.schema):t instanceof Ie?ht(t.innerType()):t instanceof fs?[t.value]:t instanceof ds?t.options:t instanceof hs?U.objectValues(t.enum):t instanceof ps?ht(t._def.innerType):t instanceof os?[void 0]:t instanceof as?[null]:t instanceof Be?[void 0,...ht(t.unwrap())]:t instanceof st?[null,...ht(t.unwrap())]:t instanceof _n||t instanceof Ds?ht(t.unwrap()):t instanceof ms?ht(t._def.innerType):[],or=class t extends j{_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==k.object)return S(s,{code:v.invalid_type,expected:k.object,received:s.parsedType}),N;let n=this.discriminator,i=s.data[n],r=this.optionsMap.get(i);return r?s.common.async?r._parseAsync({data:s.data,path:s.path,parent:s}):r._parseSync({data:s.data,path:s.path,parent:s}):(S(s,{code:v.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),N)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,s,n){let i=new Map;for(let r of s){let o=ht(r.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,r)}}return new t({typeName:O.ZodDiscriminatedUnion,discriminator:e,options:s,optionsMap:i,...P(n)})}};ls=class extends j{_parse(e){let{status:s,ctx:n}=this._processInputParams(e),i=(r,o)=>{if(ir(r)||ir(o))return N;let a=Ua(r.value,o.value);return a.valid?((rr(r)||rr(o))&&s.dirty(),{status:s.value,value:a.data}):(S(n,{code:v.invalid_intersection_types}),N)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,o])=>i(r,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ls.create=(t,e,s)=>new ls({left:t,right:e,typeName:O.ZodIntersection,...P(s)});tt=class t extends j{_parse(e){let{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.array)return S(n,{code:v.invalid_type,expected:k.array,received:n.parsedType}),N;if(n.data.length<this._def.items.length)return S(n,{code:v.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N;!this._def.rest&&n.data.length>this._def.items.length&&(S(n,{code:v.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let r=[...n.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new Te(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(r).then(o=>ce.mergeArray(s,o)):ce.mergeArray(s,r)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};tt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tt({items:t,typeName:O.ZodTuple,rest:null,...P(e)})};ar=class t extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.object)return S(n,{code:v.invalid_type,expected:k.object,received:n.parsedType}),N;let i=[],r=this._def.keyType,o=this._def.valueType;for(let a in n.data)i.push({key:r._parse(new Te(n,a,n.path,a)),value:o._parse(new Te(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?ce.mergeObjectAsync(s,i):ce.mergeObjectSync(s,i)}get element(){return this._def.valueType}static create(e,s,n){return s instanceof j?new t({keyType:e,valueType:s,typeName:O.ZodRecord,...P(n)}):new t({keyType:kt.create(),valueType:e,typeName:O.ZodRecord,...P(s)})}},Vs=class extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.map)return S(n,{code:v.invalid_type,expected:k.map,received:n.parsedType}),N;let i=this._def.keyType,r=this._def.valueType,o=[...n.data.entries()].map(([a,u],l)=>({key:i._parse(new Te(n,a,n.path,[l,"key"])),value:r._parse(new Te(n,u,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return N;(l.status==="dirty"||c.status==="dirty")&&s.dirty(),a.set(l.value,c.value)}return{status:s.value,value:a}})}else{let a=new Map;for(let u of o){let l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return N;(l.status==="dirty"||c.status==="dirty")&&s.dirty(),a.set(l.value,c.value)}return{status:s.value,value:a}}}};Vs.create=(t,e,s)=>new Vs({valueType:e,keyType:t,typeName:O.ZodMap,...P(s)});Gs=class t extends j{_parse(e){let{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.set)return S(n,{code:v.invalid_type,expected:k.set,received:n.parsedType}),N;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(S(n,{code:v.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),s.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(S(n,{code:v.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),s.dirty());let r=this._def.valueType;function o(u){let l=new Set;for(let c of u){if(c.status==="aborted")return N;c.status==="dirty"&&s.dirty(),l.add(c.value)}return{status:s.value,value:l}}let a=[...n.data.values()].map((u,l)=>r._parse(new Te(n,u,n.path,l)));return n.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,s){return new t({...this._def,minSize:{value:e,message:B.toString(s)}})}max(e,s){return new t({...this._def,maxSize:{value:e,message:B.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}};Gs.create=(t,e)=>new Gs({valueType:t,minSize:null,maxSize:null,typeName:O.ZodSet,...P(e)});ur=class t extends j{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==k.function)return S(s,{code:v.invalid_type,expected:k.function,received:s.parsedType}),N;function n(a,u){return kn({data:a,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Ms(),dt].filter(l=>!!l),issueData:{code:v.invalid_arguments,argumentsError:u}})}function i(a,u){return kn({data:a,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Ms(),dt].filter(l=>!!l),issueData:{code:v.invalid_return_type,returnTypeError:u}})}let r={errorMap:s.common.contextualErrorMap},o=s.data;if(this._def.returns instanceof $t){let a=this;return me(async function(...u){let l=new pe([]),c=await a._def.args.parseAsync(u,r).catch(p=>{throw l.addIssue(n(u,p)),l}),f=await Reflect.apply(o,this,c);return await a._def.returns._def.type.parseAsync(f,r).catch(p=>{throw l.addIssue(i(f,p)),l})})}else{let a=this;return me(function(...u){let l=a._def.args.safeParse(u,r);if(!l.success)throw new pe([n(u,l.error)]);let c=Reflect.apply(o,this,l.data),f=a._def.returns.safeParse(c,r);if(!f.success)throw new pe([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:tt.create(e).rest(pt.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,s,n){return new t({args:e||tt.create([]).rest(pt.create()),returns:s||pt.create(),typeName:O.ZodFunction,...P(n)})}},cs=class extends j{get schema(){return this._def.getter()}_parse(e){let{ctx:s}=this._processInputParams(e);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}};cs.create=(t,e)=>new cs({getter:t,typeName:O.ZodLazy,...P(e)});fs=class extends j{_parse(e){if(e.data!==this._def.value){let s=this._getOrReturnCtx(e);return S(s,{received:s.data,code:v.invalid_literal,expected:this._def.value}),N}return{status:"valid",value:e.data}}get value(){return this._def.value}};fs.create=(t,e)=>new fs({value:t,typeName:O.ZodLiteral,...P(e)});ds=class t extends j{_parse(e){if(typeof e.data!="string"){let s=this._getOrReturnCtx(e),n=this._def.values;return S(s,{expected:U.joinValues(n),received:s.parsedType,code:v.invalid_type}),N}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let s=this._getOrReturnCtx(e),n=this._def.values;return S(s,{received:s.data,code:v.invalid_enum_value,options:n}),N}return me(e.data)}get options(){return this._def.values}get enum(){let e={};for(let s of this._def.values)e[s]=s;return e}get Values(){let e={};for(let s of this._def.values)e[s]=s;return e}get Enum(){let e={};for(let s of this._def.values)e[s]=s;return e}extract(e,s=this._def){return t.create(e,{...this._def,...s})}exclude(e,s=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...s})}};ds.create=Gf;hs=class extends j{_parse(e){let s=U.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==k.string&&n.parsedType!==k.number){let i=U.objectValues(s);return S(n,{expected:U.joinValues(i),received:n.parsedType,code:v.invalid_type}),N}if(this._cache||(this._cache=new Set(U.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=U.objectValues(s);return S(n,{received:n.data,code:v.invalid_enum_value,options:i}),N}return me(e.data)}get enum(){return this._def.values}};hs.create=(t,e)=>new hs({values:t,typeName:O.ZodNativeEnum,...P(e)});$t=class extends j{unwrap(){return this._def.type}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==k.promise&&s.common.async===!1)return S(s,{code:v.invalid_type,expected:k.promise,received:s.parsedType}),N;let n=s.parsedType===k.promise?s.data:Promise.resolve(s.data);return me(n.then(i=>this._def.type.parseAsync(i,{path:s.path,errorMap:s.common.contextualErrorMap})))}};$t.create=(t,e)=>new $t({type:t,typeName:O.ZodPromise,...P(e)});Ie=class extends j{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===O.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:s,ctx:n}=this._processInputParams(e),i=this._def.effect||null,r={addIssue:o=>{S(n,o),o.fatal?s.abort():s.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),i.type==="preprocess"){let o=i.transform(n.data,r);if(n.common.async)return Promise.resolve(o).then(async a=>{if(s.value==="aborted")return N;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?N:u.status==="dirty"?ts(u.value):s.value==="dirty"?ts(u.value):u});{if(s.value==="aborted")return N;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?N:a.status==="dirty"?ts(a.value):s.value==="dirty"?ts(a.value):a}}if(i.type==="refinement"){let o=a=>{let u=i.refinement(a,r);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?N:(a.status==="dirty"&&s.dirty(),o(a.value),{status:s.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?N:(a.status==="dirty"&&s.dirty(),o(a.value).then(()=>({status:s.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!At(o))return N;let a=i.transform(o.value,r);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>At(o)?Promise.resolve(i.transform(o.value,r)).then(a=>({status:s.value,value:a})):N);U.assertNever(i)}};Ie.create=(t,e,s)=>new Ie({schema:t,typeName:O.ZodEffects,effect:e,...P(s)});Ie.createWithPreprocess=(t,e,s)=>new Ie({schema:e,effect:{type:"preprocess",transform:t},typeName:O.ZodEffects,...P(s)});Be=class extends j{_parse(e){return this._getType(e)===k.undefined?me(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Be.create=(t,e)=>new Be({innerType:t,typeName:O.ZodOptional,...P(e)});st=class extends j{_parse(e){return this._getType(e)===k.null?me(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};st.create=(t,e)=>new st({innerType:t,typeName:O.ZodNullable,...P(e)});ps=class extends j{_parse(e){let{ctx:s}=this._processInputParams(e),n=s.data;return s.parsedType===k.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};ps.create=(t,e)=>new ps({innerType:t,typeName:O.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...P(e)});ms=class extends j{_parse(e){let{ctx:s}=this._processInputParams(e),n={...s,common:{...s.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return js(i)?i.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new pe(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new pe(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ms.create=(t,e)=>new ms({innerType:t,typeName:O.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...P(e)});zs=class extends j{_parse(e){if(this._getType(e)!==k.nan){let n=this._getOrReturnCtx(e);return S(n,{code:v.invalid_type,expected:k.nan,received:n.parsedType}),N}return{status:"valid",value:e.data}}};zs.create=t=>new zs({typeName:O.ZodNaN,...P(t)});HF=Symbol("zod_brand"),_n=class extends j{_parse(e){let{ctx:s}=this._processInputParams(e),n=s.data;return this._def.type._parse({data:n,path:s.path,parent:s})}unwrap(){return this._def.type}},$n=class t extends j{_parse(e){let{status:s,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?N:r.status==="dirty"?(s.dirty(),ts(r.value)):this._def.out._parseAsync({data:r.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?N:i.status==="dirty"?(s.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,s){return new t({in:e,out:s,typeName:O.ZodPipeline})}},Ds=class extends j{_parse(e){let s=this._def.innerType._parse(e),n=i=>(At(i)&&(i.value=Object.freeze(i.value)),i);return js(s)?s.then(i=>n(i)):n(s)}unwrap(){return this._def.innerType}};Ds.create=(t,e)=>new Ds({innerType:t,typeName:O.ZodReadonly,...P(e)});ZF={object:be.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(O||(O={}));QF=(t,e={message:`Input not instance of ${t.name}`})=>zf(s=>s instanceof t,e),Kf=kt.create,Yf=ss.create,XF=zs.create,eC=ns.create,Jf=is.create,tC=rs.create,sC=Us.create,nC=os.create,iC=as.create,rC=_t.create,oC=pt.create,aC=Ge.create,uC=Ws.create,lC=mt.create,cC=be.create,fC=be.strictCreate,dC=us.create,hC=or.create,pC=ls.create,mC=tt.create,DC=ar.create,gC=Vs.create,yC=Gs.create,FC=ur.create,CC=cs.create,wC=fs.create,EC=ds.create,bC=hs.create,vC=$t.create,xC=Ie.create,SC=Be.create,AC=st.create,kC=Ie.createWithPreprocess,_C=$n.create,$C=()=>Kf().optional(),BC=()=>Yf().optional(),TC=()=>Jf().optional(),IC={string:(t=>kt.create({...t,coerce:!0})),number:(t=>ss.create({...t,coerce:!0})),boolean:(t=>is.create({...t,coerce:!0})),bigint:(t=>ns.create({...t,coerce:!0})),date:(t=>rs.create({...t,coerce:!0}))},RC=N});var I={};yn(I,{BRAND:()=>HF,DIRTY:()=>ts,EMPTY_PATH:()=>kF,INVALID:()=>N,NEVER:()=>RC,OK:()=>me,ParseStatus:()=>ce,Schema:()=>j,ZodAny:()=>_t,ZodArray:()=>mt,ZodBigInt:()=>ns,ZodBoolean:()=>is,ZodBranded:()=>_n,ZodCatch:()=>ms,ZodDate:()=>rs,ZodDefault:()=>ps,ZodDiscriminatedUnion:()=>or,ZodEffects:()=>Ie,ZodEnum:()=>ds,ZodError:()=>pe,ZodFirstPartyTypeKind:()=>O,ZodFunction:()=>ur,ZodIntersection:()=>ls,ZodIssueCode:()=>v,ZodLazy:()=>cs,ZodLiteral:()=>fs,ZodMap:()=>Vs,ZodNaN:()=>zs,ZodNativeEnum:()=>hs,ZodNever:()=>Ge,ZodNull:()=>as,ZodNullable:()=>st,ZodNumber:()=>ss,ZodObject:()=>be,ZodOptional:()=>Be,ZodParsedType:()=>k,ZodPipeline:()=>$n,ZodPromise:()=>$t,ZodReadonly:()=>Ds,ZodRecord:()=>ar,ZodSchema:()=>j,ZodSet:()=>Gs,ZodString:()=>kt,ZodSymbol:()=>Us,ZodTransformer:()=>Ie,ZodTuple:()=>tt,ZodType:()=>j,ZodUndefined:()=>os,ZodUnion:()=>us,ZodUnknown:()=>pt,ZodVoid:()=>Ws,addIssueToContext:()=>S,any:()=>rC,array:()=>lC,bigint:()=>eC,boolean:()=>Jf,coerce:()=>IC,custom:()=>zf,date:()=>tC,datetimeRegex:()=>Vf,defaultErrorMap:()=>dt,discriminatedUnion:()=>hC,effect:()=>xC,enum:()=>EC,function:()=>FC,getErrorMap:()=>Ms,getParsedType:()=>et,instanceof:()=>QF,intersection:()=>pC,isAborted:()=>ir,isAsync:()=>js,isDirty:()=>rr,isValid:()=>At,late:()=>ZF,lazy:()=>CC,literal:()=>wC,makeIssue:()=>kn,map:()=>gC,nan:()=>XF,nativeEnum:()=>bC,never:()=>aC,null:()=>iC,nullable:()=>AC,number:()=>Yf,object:()=>cC,objectUtil:()=>La,oboolean:()=>TC,onumber:()=>BC,optional:()=>SC,ostring:()=>$C,pipeline:()=>_C,preprocess:()=>kC,promise:()=>vC,quotelessJson:()=>xF,record:()=>DC,set:()=>yC,setErrorMap:()=>AF,strictObject:()=>fC,string:()=>Kf,symbol:()=>sC,transformer:()=>xC,tuple:()=>mC,undefined:()=>nC,union:()=>dC,unknown:()=>oC,util:()=>U,void:()=>uC});var Wa=L(()=>{nr();ja();Lf();An();Hf();sr()});var Ks=L(()=>{Wa();Wa()});function Ga(){return Va.parse({})}async function Tn(t){try{return await(0,ke.access)(t),!0}catch(e){if(e instanceof Error&&"code"in e&&e.code==="ENOENT")return!1;throw e}}async function Xf(t){if(!await Tn(t))return null;let s=await(0,ke.readFile)(t,"utf-8");try{return JSON.parse(s)}catch(n){let i=n instanceof SyntaxError?n.message:String(n);throw new Error(`Invalid JSON in config file ${t}: ${i}`)}}function ed(t,e){return{...t,...e.extends!==void 0&&{extends:e.extends},...e.excludePatterns!==void 0&&{excludePatterns:e.excludePatterns},...e.concurrency!==void 0&&{concurrency:e.concurrency},...e.executor!==void 0&&{executor:e.executor},executors:e.executors?LC(t.executors,e.executors):t.executors,agents:e.agents?td(t.agents,e.agents):t.agents,rules:e.rules?td(t.rules,e.rules):t.rules,output:e.output?{...t.output,...e.output}:t.output}}async function ye(t){let e=t?`${Ee.CONFIG}:${t}`:Ee.CONFIG;return ft(e,async()=>{let s=Ga(),n=await Xf(Bn);if(n&&(s=Va.parse(ed(s,n))),t){let i=(0,Bt.join)(t,cr),r=await Xf(i);r&&(s=Va.parse(ed(s,r)))}return s})}async function nd(t){try{await(0,ke.mkdir)(lr,{recursive:!0}),await(0,ke.writeFile)(Bn,JSON.stringify(t,null,2)),Ps(Ee.CONFIG)}catch(e){throw new Error(`Failed to save global config: ${e}`)}}async function id(t){let e=(0,Bt.join)(t,cr);return await Tn(e)||(await(0,ke.writeFile)(e,JSON.stringify({agents:{},rules:{}},null,2)),Ps(Ee.CONFIG)),e}function LC(t,e){let s={...t};for(let[n,i]of Object.entries(e))s[n]={...s[n],...i,review:i.review?{...s[n]?.review,...i.review}:s[n]?.review,validation:i.validation?{...s[n]?.validation,...i.validation}:s[n]?.validation};return s}function td(t,e){let s={...t};for(let[n,i]of Object.entries(e))s[n]={...s[n],...i};return s}function za(){return Bn}function In(t){return(0,Bt.join)(t,cr)}async function Ka(){return Tn(Bn)}async function fr(t){return Tn(In(t))}async function dr(){return ft(Ee.INSTRUCTIONS,async()=>{try{return await Tn(Qf)?await(0,ke.readFile)(Qf,"utf-8"):""}catch{return""}})}async function rd(t,e,s){let n=e?Bn:(0,Bt.join)(s||process.cwd(),cr),i={};try{let o=await(0,ke.readFile)(n,"utf-8");i=JSON.parse(o)}catch{}Array.isArray(i.extends)||(i.extends=[]);let r=i.extends;r.includes(t)||r.push(t),e&&await(0,ke.mkdir)(lr,{recursive:!0}),await(0,ke.writeFile)(n,JSON.stringify(i,null,2)),Ps(Ee.CONFIG)}var Bt,sd,ke,Zf,NC,OC,PC,Va,lr,Bn,Qf,cr,ze=L(()=>{"use strict";Ks();Bt=require("path"),sd=require("os"),ke=require("node:fs/promises");bn();Zf=I.object({model:I.string().optional(),timeout:I.number().positive().optional(),concurrency:I.number().min(1).max(10).optional(),batchSize:I.number().min(1).max(50).optional()}),NC=I.object({review:Zf.optional(),validation:Zf.optional()}),OC=I.object({enabled:I.boolean().optional(),model:I.string().optional(),timeout:I.number().positive().optional()}),PC=I.object({enabled:I.boolean().optional(),agent:I.string().optional()}),Va=I.object({extends:I.array(I.string()).default([]),excludePatterns:I.array(I.string()).default(["*.min.js","*.min.css","*.map","*.d.ts","dist/**","build/**","out/**",".next/**","coverage/**","node_modules/**","vendor/**","*.generated.*","*.bundle.js"]),concurrency:I.number().min(1).max(10).default(6),executor:I.string().default("claude-cli"),executors:I.record(I.string(),NC).default({}),agents:I.record(I.string(),OC).default({}),rules:I.record(I.string(),PC).default({}),output:I.object({colorize:I.boolean().default(!0),verbose:I.boolean().default(!1),format:I.enum(["terminal","markdown","json"]).default("terminal")}).default({})}),lr=(0,Bt.join)((0,sd.homedir)(),".diffray"),Bn=(0,Bt.join)(lr,"config.json"),Qf=(0,Bt.join)(lr,"instructions.md"),cr=".diffray.json"});var Ya,od,MC,ad=L(()=>{Ya=(t,e,s)=>{let n=t instanceof RegExp?od(t,s):t,i=e instanceof RegExp?od(e,s):e,r=n!==null&&i!=null&&MC(n,i,s);return r&&{start:r[0],end:r[1],pre:s.slice(0,r[0]),body:s.slice(r[0]+n.length,r[1]),post:s.slice(r[1]+i.length)}},od=(t,e)=>{let s=e.match(t);return s?s[0]:null},MC=(t,e,s)=>{let n,i,r,o,a,u=s.indexOf(t),l=s.indexOf(e,u+1),c=u;if(u>=0&&l>0){if(t===e)return[u,l];for(n=[],r=s.length;c>=0&&!a;){if(c===u)n.push(c),u=s.indexOf(t,c+1);else if(n.length===1){let f=n.pop();f!==void 0&&(a=[f,l])}else i=n.pop(),i!==void 0&&i<r&&(r=i,o=l),l=s.indexOf(e,c+1);c=u<l&&u>=0?u:l}n.length&&o!==void 0&&(a=[r,o])}return a}});function Ja(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function HC(t){return t.replace(GC,ud).replace(zC,ld).replace(KC,Ha).replace(YC,cd).replace(JC,fd)}function ZC(t){return t.replace(jC,"\\").replace(qC,"{").replace(UC,"}").replace(WC,",").replace(VC,".")}function dd(t){if(!t)return[""];let e=[],s=Ya("{","}",t);if(!s)return t.split(",");let{pre:n,body:i,post:r}=s,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=dd(r);return r.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function hd(t){return t?(t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),Rn(HC(t),!0).map(ZC)):[]}function QC(t){return"{"+t+"}"}function XC(t){return/^-?0\d/.test(t)}function ew(t,e){return t<=e}function tw(t,e){return t>=e}function Rn(t,e){let s=[],n=Ya("{","}",t);if(!n)return[t];let i=n.pre,r=n.post.length?Rn(n.post,!1):[""];if(/\$$/.test(n.pre))for(let o=0;o<r.length;o++){let a=i+"{"+n.body+"}"+r[o];s.push(a)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),u=o||a,l=n.body.indexOf(",")>=0;if(!u&&!l)return n.post.match(/,(?!,).*\}/)?(t=n.pre+"{"+n.body+Ha+n.post,Rn(t)):[t];let c;if(u)c=n.body.split(/\.\./);else if(c=dd(n.body),c.length===1&&c[0]!==void 0&&(c=Rn(c[0],!1).map(QC),c.length===1))return r.map(d=>n.pre+c[0]+d);let f;if(u&&c[0]!==void 0&&c[1]!==void 0){let d=Ja(c[0]),p=Ja(c[1]),D=Math.max(c[0].length,c[1].length),m=c.length===3&&c[2]!==void 0?Math.abs(Ja(c[2])):1,g=ew;p<d&&(m*=-1,g=tw);let y=c.some(XC);f=[];for(let C=d;g(C,p);C+=m){let w;if(a)w=String.fromCharCode(C),w==="\\"&&(w="");else if(w=String(C),y){let b=D-w.length;if(b>0){let _=new Array(b+1).join("0");C<0?w="-"+_+w.slice(1):w=_+w}}f.push(w)}}else{f=[];for(let d=0;d<c.length;d++)f.push.apply(f,Rn(c[d],!1))}for(let d=0;d<f.length;d++)for(let p=0;p<r.length;p++){let D=i+f[d]+r[p];(!e||u||D)&&s.push(D)}}return s}var ud,ld,Ha,cd,fd,jC,qC,UC,WC,VC,GC,zC,KC,YC,JC,pd=L(()=>{ad();ud="\0SLASH"+Math.random()+"\0",ld="\0OPEN"+Math.random()+"\0",Ha="\0CLOSE"+Math.random()+"\0",cd="\0COMMA"+Math.random()+"\0",fd="\0PERIOD"+Math.random()+"\0",jC=new RegExp(ud,"g"),qC=new RegExp(ld,"g"),UC=new RegExp(Ha,"g"),WC=new RegExp(cd,"g"),VC=new RegExp(fd,"g"),GC=/\\\\/g,zC=/\\{/g,KC=/\\}/g,YC=/\\,/g,JC=/\\./g});var Nn,md=L(()=>{Nn=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")}});var sw,On,nw,Dd,gd,yd=L(()=>{sw={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},On=t=>t.replace(/[[\]\\-]/g,"\\$&"),nw=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Dd=t=>t.join(""),gd=(t,e)=>{let s=e;if(t.charAt(s)!=="[")throw new Error("not in a brace expression");let n=[],i=[],r=s+1,o=!1,a=!1,u=!1,l=!1,c=s,f="";e:for(;r<t.length;){let m=t.charAt(r);if((m==="!"||m==="^")&&r===s+1){l=!0,r++;continue}if(m==="]"&&o&&!u){c=r+1;break}if(o=!0,m==="\\"&&!u){u=!0,r++;continue}if(m==="["&&!u){for(let[g,[F,y,C]]of Object.entries(sw))if(t.startsWith(g,r)){if(f)return["$.",!1,t.length-s,!0];r+=g.length,C?i.push(F):n.push(F),a=a||y;continue e}}if(u=!1,f){m>f?n.push(On(f)+"-"+On(m)):m===f&&n.push(On(m)),f="",r++;continue}if(t.startsWith("-]",r+1)){n.push(On(m+"-")),r+=2;continue}if(t.startsWith("-",r+1)){f=m,r+=2;continue}n.push(On(m)),r++}if(c<r)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,t.length-s,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let m=n[0].length===2?n[0].slice(-1):n[0];return[nw(m),!1,c-s,!1]}let d="["+(l?"^":"")+Dd(n)+"]",p="["+(l?"":"^")+Dd(i)+"]";return[n.length&&i.length?"("+d+"|"+p+")":n.length?d:p,a,c-s,!0]}});var Re,hr=L(()=>{Re=(t,{windowsPathsNoEscape:e=!1,magicalBraces:s=!0}={})=>s?e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?t.replace(/\[([^\/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")});var iw,Fd,rw,pr,ow,aw,uw,lw,Za,Cd,wd,Ys,Qa=L(()=>{yd();hr();iw=new Set(["!","?","+","*","@"]),Fd=t=>iw.has(t),rw="(?!(?:^|/)\\.\\.?(?:$|/))",pr="(?!\\.)",ow=new Set(["[","."]),aw=new Set(["..","."]),uw=new Set("().*{}+?[]^$\\!"),lw=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Za="[^/]",Cd=Za+"*?",wd=Za+"+?",Ys=class t{type;#e;#s;#r=!1;#i=[];#o;#C;#g;#c=!1;#a;#d;#f=!1;constructor(e,s,n={}){this.type=e,e&&(this.#s=!0),this.#o=s,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?n:this.#e.#a,this.#g=this.#e===this?[]:this.#e.#g,e==="!"&&!this.#e.#c&&this.#g.push(this),this.#C=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#s!==void 0)return this.#s;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#s=!0;return this.#s}toString(){return this.#d!==void 0?this.#d:this.type?this.#d=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#d=this.#i.map(e=>String(e)).join("")}#u(){if(this!==this.#e)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let e;for(;e=this.#g.pop();){if(e.type!=="!")continue;let s=e,n=s.#o;for(;n;){for(let i=s.#C+1;!n.type&&i<n.#i.length;i++)for(let r of e.#i){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(n.#i[i])}s=n,n=s.#o}}return this}push(...e){for(let s of e)if(s!==""){if(typeof s!="string"&&!(s instanceof t&&s.#o===this))throw new Error("invalid part: "+s);this.#i.push(s)}}toJSON(){let e=this.type===null?this.#i.slice().map(s=>typeof s=="string"?s:s.toJSON()):[this.type,...this.#i.map(s=>s.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#c&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#C===0)return!0;let e=this.#o;for(let s=0;s<this.#C;s++){let n=e.#i[s];if(!(n instanceof t&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#C===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let s=new t(this.type,e);for(let n of this.#i)s.copyIn(n);return s}static#n(e,s,n,i){let r=!1,o=!1,a=-1,u=!1;if(s.type===null){let p=n,D="";for(;p<e.length;){let m=e.charAt(p++);if(r||m==="\\"){r=!r,D+=m;continue}if(o){p===a+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(p===a+2&&u)&&(o=!1),D+=m;continue}else if(m==="["){o=!0,a=p,u=!1,D+=m;continue}if(!i.noext&&Fd(m)&&e.charAt(p)==="("){s.push(D),D="";let g=new t(m,s);p=t.#n(e,g,p,i),s.push(g);continue}D+=m}return s.push(D),p}let l=n+1,c=new t(null,s),f=[],d="";for(;l<e.length;){let p=e.charAt(l++);if(r||p==="\\"){r=!r,d+=p;continue}if(o){l===a+1?(p==="^"||p==="!")&&(u=!0):p==="]"&&!(l===a+2&&u)&&(o=!1),d+=p;continue}else if(p==="["){o=!0,a=l,u=!1,d+=p;continue}if(Fd(p)&&e.charAt(l)==="("){c.push(d),d="";let D=new t(p,c);c.push(D),l=t.#n(e,D,l,i);continue}if(p==="|"){c.push(d),d="",f.push(c),c=new t(null,s);continue}if(p===")")return d===""&&s.#i.length===0&&(s.#f=!0),c.push(d),d="",s.push(...f,c),l;d+=p}return s.type=null,s.#s=void 0,s.#i=[e.substring(n-1)],l}static fromGlob(e,s={}){let n=new t(null,void 0,s);return t.#n(e,n,0,s),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[s,n,i,r]=this.toRegExpSource();if(!(i||this.#s||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#a.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${s}$`,a),{_src:s,_glob:e})}get options(){return this.#a}toRegExpSource(e){let s=e??!!this.#a.dot;if(this.#e===this&&this.#u(),!this.type){let u=this.isStart()&&this.isEnd()&&!this.#i.some(p=>typeof p!="string"),l=this.#i.map(p=>{let[D,m,g,F]=typeof p=="string"?t.#w(p,this.#s,u):p.toRegExpSource(e);return this.#s=this.#s||g,this.#r=this.#r||F,D}).join(""),c="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&aw.has(this.#i[0]))){let D=ow,m=s&&D.has(l.charAt(0))||l.startsWith("\\.")&&D.has(l.charAt(2))||l.startsWith("\\.\\.")&&D.has(l.charAt(4)),g=!s&&!e&&D.has(l.charAt(0));c=m?rw:g?pr:""}let f="";return this.isEnd()&&this.#e.#c&&this.#o?.type==="!"&&(f="(?:$|\\/)"),[c+l+f,Re(l),this.#s=!!this.#s,this.#r]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#h(s);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let u=this.toString();return this.#i=[u],this.type=null,this.#s=void 0,[u,Re(this.toString()),!1,!1]}let o=!n||e||s||!pr?"":this.#h(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";if(this.type==="!"&&this.#f)a=(this.isStart()&&!s?pr:"")+wd;else{let u=this.type==="!"?"))"+(this.isStart()&&!s&&!e?pr:"")+Cd+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+r+u}return[a,Re(r),this.#s=!!this.#s,this.#r]}#h(e){return this.#i.map(s=>{if(typeof s=="string")throw new Error("string type in extglob ast??");let[n,i,r,o]=s.toRegExpSource(e);return this.#r=this.#r||o,n}).filter(s=>!(this.isStart()&&this.isEnd())||!!s).join("|")}static#w(e,s,n=!1){let i=!1,r="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(i){i=!1,r+=(uw.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?r+="\\\\":i=!0;continue}if(u==="["){let[l,c,f,d]=gd(e,a);if(f){r+=l,o=o||c,a+=f-1,s=s||d;continue}}if(u==="*"){r+=n&&e==="*"?wd:Cd,s=!0;continue}if(u==="?"){r+=Za,s=!0;continue}r+=lw(u)}return[r,Re(e),!!s,o]}}});var gs,Xa=L(()=>{gs=(t,{windowsPathsNoEscape:e=!1,magicalBraces:s=!1}={})=>s?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&")});var Fe,cw,fw,dw,hw,pw,mw,Dw,gw,yw,Fw,Cw,ww,Ew,bw,vw,xw,Sw,Aw,vd,xd,Sd,Ed,kw,fe,_w,$w,Bw,Tw,Iw,Ne,Rw,Ad,Nw,Ow,bd,Pw,_e,Tt=L(()=>{pd();md();Qa();Xa();hr();Qa();Xa();hr();Fe=(t,e,s={})=>(Nn(e),!s.nocomment&&e.charAt(0)==="#"?!1:new _e(e,s).match(t)),cw=/^\*+([^+@!?\*\[\(]*)$/,fw=t=>e=>!e.startsWith(".")&&e.endsWith(t),dw=t=>e=>e.endsWith(t),hw=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),pw=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),mw=/^\*+\.\*+$/,Dw=t=>!t.startsWith(".")&&t.includes("."),gw=t=>t!=="."&&t!==".."&&t.includes("."),yw=/^\.\*+$/,Fw=t=>t!=="."&&t!==".."&&t.startsWith("."),Cw=/^\*+$/,ww=t=>t.length!==0&&!t.startsWith("."),Ew=t=>t.length!==0&&t!=="."&&t!=="..",bw=/^\?+([^+@!?\*\[\(]*)?$/,vw=([t,e=""])=>{let s=vd([t]);return e?(e=e.toLowerCase(),n=>s(n)&&n.toLowerCase().endsWith(e)):s},xw=([t,e=""])=>{let s=xd([t]);return e?(e=e.toLowerCase(),n=>s(n)&&n.toLowerCase().endsWith(e)):s},Sw=([t,e=""])=>{let s=xd([t]);return e?n=>s(n)&&n.endsWith(e):s},Aw=([t,e=""])=>{let s=vd([t]);return e?n=>s(n)&&n.endsWith(e):s},vd=([t])=>{let e=t.length;return s=>s.length===e&&!s.startsWith(".")},xd=([t])=>{let e=t.length;return s=>s.length===e&&s!=="."&&s!==".."},Sd=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ed={win32:{sep:"\\"},posix:{sep:"/"}},kw=Sd==="win32"?Ed.win32.sep:Ed.posix.sep;Fe.sep=kw;fe=Symbol("globstar **");Fe.GLOBSTAR=fe;_w="[^/]",$w=_w+"*?",Bw="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Tw="(?:(?!(?:\\/|^)\\.).)*?",Iw=(t,e={})=>s=>Fe(s,t,e);Fe.filter=Iw;Ne=(t,e={})=>Object.assign({},t,e),Rw=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Fe;let e=Fe;return Object.assign((n,i,r={})=>e(n,i,Ne(t,r)),{Minimatch:class extends e.Minimatch{constructor(i,r={}){super(i,Ne(t,r))}static defaults(i){return e.defaults(Ne(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,r,o={}){super(i,r,Ne(t,o))}static fromGlob(i,r={}){return e.AST.fromGlob(i,Ne(t,r))}},unescape:(n,i={})=>e.unescape(n,Ne(t,i)),escape:(n,i={})=>e.escape(n,Ne(t,i)),filter:(n,i={})=>e.filter(n,Ne(t,i)),defaults:n=>e.defaults(Ne(t,n)),makeRe:(n,i={})=>e.makeRe(n,Ne(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,Ne(t,i)),match:(n,i,r={})=>e.match(n,i,Ne(t,r)),sep:e.sep,GLOBSTAR:fe})};Fe.defaults=Rw;Ad=(t,e={})=>(Nn(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:hd(t));Fe.braceExpand=Ad;Nw=(t,e={})=>new _e(t,e).makeRe();Fe.makeRe=Nw;Ow=(t,e,s={})=>{let n=new _e(e,s);return t=t.filter(i=>n.match(i)),n.options.nonull&&!t.length&&t.push(e),t};Fe.match=Ow;bd=/[?*]|[+@!]\(.*?\)|\[|\]/,Pw=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),_e=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,s={}){Nn(e),s=s||{},this.options=s,this.pattern=e,this.platform=s.platform||Sd,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!s.windowsPathsNoEscape||s.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!s.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!s.nonegate,this.comment=!1,this.empty=!1,this.partial=!!s.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=s.windowsNoMagicRoot!==void 0?s.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let s of e)if(typeof s!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,s=this.options;if(!s.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],s.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=r[0]===""&&r[1]===""&&(r[2]==="?"||!bd.test(r[2]))&&!bd.test(r[3]),l=/^[a-z]:/i.test(r[0]);if(u)return[...r.slice(0,4),...r.slice(4).map(c=>this.parse(c))];if(l)return[r[0],...r.slice(1).map(c=>this.parse(c))]}return r.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");let{optimizationLevel:s=1}=this.options;return s>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):s>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(s=>{let n=-1;for(;(n=s.indexOf("**",n+1))!==-1;){let i=n;for(;s[i+1]==="**";)i++;i!==n&&s.splice(n,i-n)}return s})}levelOneOptimize(e){return e.map(s=>(s=s.reduce((n,i)=>{let r=n[n.length-1];return i==="**"&&r==="**"?n:i===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(n.pop(),n):(n.push(i),n)},[]),s.length===0?[""]:s))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let s=!1;do{if(s=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let r=e[i];i===1&&r===""&&e[0]===""||(r==="."||r==="")&&(s=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(s=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(s=!0,e.splice(n-1,2),n-=2)}}while(s);return e.length===0?[""]:e}firstPhasePreProcess(e){let s=!1;do{s=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],u=n[i+2],l=n[i+3];if(a!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;s=!0,n.splice(i,1);let c=n.slice(0);c[i]="**",e.push(c),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(s=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(s=!0,n.pop())}let r=0;for(;(r=n.indexOf("..",r+1))!==-1;){let o=n[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){s=!0;let u=r===1&&n[r+1]==="**"?["."]:[];n.splice(r-1,2,...u),n.length===0&&n.push(""),r-=2}}}}while(s);return e}secondPhasePreProcess(e){for(let s=0;s<e.length-1;s++)for(let n=s+1;n<e.length;n++){let i=this.partsMatch(e[s],e[n],!this.preserveMultipleSlashes);if(i){e[s]=[],e[n]=i;break}}return e.filter(s=>s.length)}partsMatch(e,s,n=!1){let i=0,r=0,o=[],a="";for(;i<e.length&&r<s.length;)if(e[i]===s[r])o.push(a==="b"?s[r]:e[i]),i++,r++;else if(n&&e[i]==="**"&&s[r]===e[i+1])o.push(e[i]),i++;else if(n&&s[r]==="**"&&e[i]===s[r+1])o.push(s[r]),r++;else if(e[i]==="*"&&s[r]&&(this.options.dot||!s[r].startsWith("."))&&s[r]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,r++}else if(s[r]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(s[r]),i++,r++}else return!1;return e.length===s.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,s=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)s=!s,n++;n&&(this.pattern=e.slice(n)),this.negate=s}matchOne(e,s,n=!1){let i=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),g=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),F=typeof s[0]=="string"&&/^[a-z]:$/i.test(s[0]),y=!F&&s[0]===""&&s[1]===""&&s[2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3]),C=g?3:m?0:void 0,w=y?3:F?0:void 0;if(typeof C=="number"&&typeof w=="number"){let[b,_]=[e[C],s[w]];b.toLowerCase()===_.toLowerCase()&&(s[w]=b,w>C?s=s.slice(w):C>w&&(e=e.slice(C)))}}let{optimizationLevel:r=1}=this.options;r>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:s}),this.debug("matchOne",e.length,s.length);for(var o=0,a=0,u=e.length,l=s.length;o<u&&a<l;o++,a++){this.debug("matchOne loop");var c=s[a],f=e[o];if(this.debug(s,c,f),c===!1)return!1;if(c===fe){this.debug("GLOBSTAR",[s,c,f]);var d=o,p=a+1;if(p===l){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;d<u;){var D=e[d];if(this.debug(`
|
|
55
|
+
`)},separator:(t="=",e=80)=>{console.log(t.repeat(e))},newline:()=>console.log()};er=class{frames=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];intervalId=null;frameIndex=0;message;isSpinning=!1;constructor(e){this.message=e}start(){this.isSpinning||(this.isSpinning=!0,Xi.add(this),this.frameIndex=0,process.stdout.write("\x1B[?25l"),this.intervalId=setInterval(()=>{let e=this.frames[this.frameIndex];process.stdout.write(`\r${I.cyan}${e}${I.reset} ${this.message}`),this.frameIndex=(this.frameIndex+1)%this.frames.length},80))}update(e){this.message=e}succeed(e){this.stop();let s=e||this.message;console.log(`${I.green}\u2713${I.reset} ${s}`)}fail(e){this.stop();let s=e||this.message;console.log(`${I.red}\u2717${I.reset} ${s}`)}warn(e){this.stop();let s=e||this.message;console.log(`${I.yellow}!${I.reset} ${s}`)}stop(){this.isSpinning&&(Xi.delete(this),this.isSpinning=!1,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),process.stdout.write("\r\x1B[K"),process.stdout.write("\x1B[?25h"))}},ww=10,Ls=class{tasks=new Map;taskOrder=[];intervalId=null;frames=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];frameIndex=0;linesWritten=0;isActive=!1;isDirty=!0;exitHandler=null;addTask(e,s,n,i,r,o){let a={id:e,label:s,status:"pending",detail:o,totalBatches:n,completedBatches:0,fileCount:i,ruleCount:r};this.tasks.set(e,a),this.taskOrder.push(e)}start(){this.isActive||(this.isActive=!0,process.stdout.write("\x1B[?25l"),this.exitHandler=()=>{process.stdout.write("\x1B[?25h")},process.on("exit",this.exitHandler),this.render(),this.intervalId=setInterval(()=>{this.frameIndex=(this.frameIndex+1)%this.frames.length;let e=[...this.tasks.values()].some(s=>s.status==="running");(this.isDirty||e)&&(this.render(),this.isDirty=!1)},80))}startTask(e){let s=this.tasks.get(e);s&&s.status!=="running"&&(s.startTime=Date.now(),s.status="running",this.isDirty=!0)}completeBatch(e){let s=this.tasks.get(e);s&&(s.completedBatches++,this.isDirty=!0,s.completedBatches>=s.totalBatches&&(s.status="done",s.startTime&&(s.duration=Date.now()-s.startTime)))}failTask(e){let s=this.tasks.get(e);s&&(s.status="error",this.isDirty=!0,s.startTime&&(s.duration=Date.now()-s.startTime))}getEstimatedTotal(e){return e.fileCount*e.ruleCount*ww*1e3}calculateProgress(e){if(e.status==="done")return 1;if(e.status==="error")return e.completedBatches/Math.max(1,e.totalBatches);if(e.status!=="running"||!e.startTime)return 0;let s=Date.now()-e.startTime,n=this.getEstimatedTotal(e),i=s/n,r=e.completedBatches/Math.max(1,e.totalBatches);return Math.min(.95,Math.max(i,r))}calculateETA(e){if(e.status!=="running"||!e.startTime)return null;let s=Date.now()-e.startTime,n=this.getEstimatedTotal(e),i=Math.max(0,n-s);return i>1e3?i:null}formatProgressBar(e,s=40){let n=Math.round(e*s),i=s-n;return"\u2588".repeat(n)+"\u2591".repeat(i)}render(){this.linesWritten>0&&process.stdout.write(`\x1B[${this.linesWritten}A`);let e=[],s=this.taskOrder.length;for(let n=0;n<this.taskOrder.length;n++){let i=this.taskOrder[n],r=this.tasks.get(i);if(!r)continue;let o=this.formatTaskLine(r,n+1,s);e.push(...o)}for(let n of e)process.stdout.write(`\x1B[K${n}
|
|
56
|
+
`);this.linesWritten=e.length}formatTaskLine(e,s,n){let i=`[${s}/${n}]`.padEnd(7),r,o;switch(e.status){case"pending":r=I.gray,o="\u25CB";break;case"running":r=I.cyan,o=this.frames[this.frameIndex]??"\u280B";break;case"done":r=I.green,o="\u2713";break;case"error":r=I.red,o="\u2717";break}let a=this.calculateProgress(e),u=this.formatProgressBar(a),l=`${r}${u}${I.reset} ${o}`,c="";if(e.status==="running"){let D=this.calculateETA(e);D!==null&&(c=`~${Math.ceil(D/1e3)}s`)}else e.duration!==void 0&&(c=`${(e.duration/1e3).toFixed(1)}s`);let f=e.detail&&e.status!=="pending"?` ${I.dim}| ${e.detail}${I.reset}`:"",d=` ${I.dim}${i}${I.reset} ${e.label}${f}`,p=` ${l} ${c.padEnd(6)}`;return[d,p]}stop(){this.isActive&&(this.isActive=!1,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.exitHandler&&(process.removeListener("exit",this.exitHandler),this.exitHandler=null),this.render(),process.stdout.write("\x1B[?25h"))}}});var z,Va,_,rt,kn=q(()=>{(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function s(i){throw new Error}t.assertNever=s,t.arrayToEnum=i=>{let r={};for(let o of i)r[o]=o;return r},t.getValidEnumValues=i=>{let r=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of r)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(r){return i[r]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let r=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&r.push(o);return r},t.find=(i,r)=>{for(let o of i)if(r(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,r=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(r)}t.joinValues=n,t.jsonStringifyReplacer=(i,r)=>typeof r=="bigint"?r.toString():r})(z||(z={}));(function(t){t.mergeShapes=(e,s)=>({...e,...s})})(Va||(Va={}));_=z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rt=t=>{switch(typeof t){case"undefined":return _.undefined;case"string":return _.string;case"number":return Number.isNaN(t)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(t)?_.array:t===null?_.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?_.promise:typeof Map<"u"&&t instanceof Map?_.map:typeof Set<"u"&&t instanceof Set?_.set:typeof Date<"u"&&t instanceof Date?_.date:_.object;default:return _.unknown}}});var b,kw,De,tr=q(()=>{kn();b=z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),kw=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),De=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}format(e){let s=e||function(r){return r.message},n={_errors:[]},i=r=>{for(let o of r.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(s(o));else{let a=n,u=0;for(;u<o.path.length;){let l=o.path[u];u===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(s(o))):a[l]=a[l]||{_errors:[]},a=a[l],u++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){let s={},n=[];for(let i of this.issues)if(i.path.length>0){let r=i.path[0];s[r]=s[r]||[],s[r].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:s}}get formErrors(){return this.flatten()}};De.create=t=>new De(t)});var $w,gt,za=q(()=>{tr();kn();$w=(t,e)=>{let s;switch(t.code){case b.invalid_type:t.received===_.undefined?s="Required":s=`Expected ${t.expected}, received ${t.received}`;break;case b.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,z.jsonStringifyReplacer)}`;break;case b.unrecognized_keys:s=`Unrecognized key(s) in object: ${z.joinValues(t.keys,", ")}`;break;case b.invalid_union:s="Invalid input";break;case b.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${z.joinValues(t.options)}`;break;case b.invalid_enum_value:s=`Invalid enum value. Expected ${z.joinValues(t.options)}, received '${t.received}'`;break;case b.invalid_arguments:s="Invalid function arguments";break;case b.invalid_return_type:s="Invalid function return type";break;case b.invalid_date:s="Invalid date";break;case b.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:z.assertNever(t.validation):t.validation!=="regex"?s=`Invalid ${t.validation}`:s="Invalid";break;case b.too_small:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:s="Invalid input";break;case b.too_big:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?s=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:s="Invalid input";break;case b.custom:s="Invalid input";break;case b.invalid_intersection_types:s="Intersection results could not be merged";break;case b.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case b.not_finite:s="Number must be finite";break;default:s=e.defaultError,z.assertNever(t)}return{message:s}},gt=$w});function _w(t){sd=t}function Ms(){return sd}var sd,sr=q(()=>{za();sd=gt});function k(t,e){let s=Ms(),n=$n({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,s,s===gt?void 0:gt].filter(i=>!!i)});t.common.issues.push(n)}var $n,Bw,fe,N,ss,ge,nr,ir,Bt,js,Ga=q(()=>{sr();za();$n=t=>{let{data:e,path:s,errorMaps:n,issueData:i}=t,r=[...s,...i.path||[]],o={...i,path:r};if(i.message!==void 0)return{...i,path:r,message:i.message};let a="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)a=l(o,{data:e,defaultError:a}).message;return{...i,path:r,message:a}},Bw=[];fe=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){let n=[];for(let i of s){if(i.status==="aborted")return N;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,s){let n=[];for(let i of s){let r=await i.key,o=await i.value;n.push({key:r,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,s){let n={};for(let i of s){let{key:r,value:o}=i;if(r.status==="aborted"||o.status==="aborted")return N;r.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[r.value]=o.value)}return{status:e.value,value:n}}},N=Object.freeze({status:"aborted"}),ss=t=>({status:"dirty",value:t}),ge=t=>({status:"valid",value:t}),nr=t=>t.status==="aborted",ir=t=>t.status==="dirty",Bt=t=>t.status==="valid",js=t=>typeof Promise<"u"&&t instanceof Promise});var nd=q(()=>{});var R,id=q(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(R||(R={}))});function j(t){if(!t)return{};let{errorMap:e,invalid_type_error:s,required_error:n,description:i}=t;if(e&&(s||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>{let{message:u}=t;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:u??s??a.defaultError}},description:i}}function ud(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let s=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`}function Yw(t){return new RegExp(`^${ud(t)}$`)}function ld(t){let e=`${ad}T${ud(t)}`,s=[];return s.push(t.local?"Z?":"Z"),t.offset&&s.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${s.join("|")})`,new RegExp(`^${e}$`)}function Hw(t,e){return!!((e==="v4"||!e)&&qw.test(t)||(e==="v6"||!e)&&Ww.test(t))}function Jw(t,e){if(!Ow.test(t))return!1;try{let[s]=t.split(".");if(!s)return!1;let n=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Zw(t,e){return!!((e==="v4"||!e)&&Uw.test(t)||(e==="v6"||!e)&&Vw.test(t))}function Qw(t,e){let s=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=s>n?s:n,r=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return r%o/10**i}function qs(t){if(t instanceof ke){let e={};for(let s in t.shape){let n=t.shape[s];e[s]=Ne.create(qs(n))}return new ke({...t._def,shape:()=>e})}else return t instanceof wt?new wt({...t._def,type:qs(t.element)}):t instanceof Ne?Ne.create(qs(t.unwrap())):t instanceof at?at.create(qs(t.unwrap())):t instanceof ot?ot.create(t.items.map(e=>qs(e))):t}function Ya(t,e){let s=rt(t),n=rt(e);if(t===e)return{valid:!0,data:t};if(s===_.object&&n===_.object){let i=z.objectKeys(e),r=z.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(let a of r){let u=Ya(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(s===_.array&&n===_.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let r=0;r<t.length;r++){let o=t[r],a=e[r],u=Ya(o,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return s===_.date&&n===_.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function cd(t,e){return new hs({values:t,typeName:O.ZodEnum,...j(e)})}function od(t,e){let s=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof s=="string"?{message:s}:s}function fd(t,e={},s){return t?It.create().superRefine((n,i)=>{let r=t(n);if(r instanceof Promise)return r.then(o=>{if(!o){let a=od(e,n),u=a.fatal??s??!0;i.addIssue({code:"custom",...a,fatal:u})}});if(!r){let o=od(e,n),a=o.fatal??s??!0;i.addIssue({code:"custom",...o,fatal:a})}}):It.create()}var Pe,rd,W,Tw,Iw,Rw,Nw,Pw,Ow,Lw,Mw,jw,Ka,qw,Uw,Ww,Vw,zw,Gw,ad,Kw,Tt,ns,is,rs,os,Us,as,us,It,Ft,Ze,Ws,wt,ke,ls,yt,rr,cs,ot,or,Vs,zs,ar,fs,ds,hs,ps,Rt,Oe,Ne,at,ms,Ds,Gs,Xw,_n,Bn,gs,eC,O,tC,dd,hd,sC,nC,pd,iC,rC,oC,aC,uC,lC,cC,fC,dC,hC,pC,mC,DC,gC,yC,FC,wC,CC,EC,bC,vC,xC,SC,AC,kC,$C,_C,BC,TC,IC,RC,NC,PC,OC,md=q(()=>{tr();sr();id();Ga();kn();Pe=class{constructor(e,s,n,i){this._cachedPath=[],this.parent=e,this.data=s,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},rd=(t,e)=>{if(Bt(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let s=new De(t.common.issues);return this._error=s,this._error}}};W=class{get description(){return this._def.description}_getType(e){return rt(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:rt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new fe,ctx:{common:e.parent.common,data:e.data,parsedType:rt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let s=this._parse(e);if(js(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){let s=this._parse(e);return Promise.resolve(s)}parse(e,s){let n=this.safeParse(e,s);if(n.success)return n.data;throw n.error}safeParse(e,s){let n={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rt(e)},i=this._parseSync({data:e,path:n.path,parent:n});return rd(n,i)}"~validate"(e){let s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rt(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:s});return Bt(n)?{value:n.value}:{issues:s.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(n=>Bt(n)?{value:n.value}:{issues:s.common.issues})}async parseAsync(e,s){let n=await this.safeParseAsync(e,s);if(n.success)return n.data;throw n.error}async safeParseAsync(e,s){let n={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rt(e)},i=this._parse({data:e,path:n.path,parent:n}),r=await(js(i)?i:Promise.resolve(i));return rd(n,r)}refine(e,s){let n=i=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(i):s;return this._refinement((i,r)=>{let o=e(i),a=()=>r.addIssue({code:b.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,s){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof s=="function"?s(n,i):s),!1))}_refinement(e){return new Oe({schema:this,typeName:O.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return Ne.create(this,this._def)}nullable(){return at.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wt.create(this)}promise(){return Rt.create(this,this._def)}or(e){return ls.create([this,e],this._def)}and(e){return cs.create(this,e,this._def)}transform(e){return new Oe({...j(this._def),schema:this,typeName:O.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let s=typeof e=="function"?e:()=>e;return new ms({...j(this._def),innerType:this,defaultValue:s,typeName:O.ZodDefault})}brand(){return new _n({typeName:O.ZodBranded,type:this,...j(this._def)})}catch(e){let s=typeof e=="function"?e:()=>e;return new Ds({...j(this._def),innerType:this,catchValue:s,typeName:O.ZodCatch})}describe(e){let s=this.constructor;return new s({...this._def,description:e})}pipe(e){return Bn.create(this,e)}readonly(){return gs.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Tw=/^c[^\s-]{8,}$/i,Iw=/^[0-9a-z]+$/,Rw=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Nw=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Pw=/^[a-z0-9_-]{21}$/i,Ow=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Lw=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Mw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",qw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Uw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ww=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Vw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,zw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Gw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ad="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Kw=new RegExp(`^${ad}$`);Tt=class t extends W{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:_.string,received:r.parsedType}),N}let n=new fe,i;for(let r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(i=this._getOrReturnCtx(e,i),k(i,{code:b.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="max")e.data.length>r.value&&(i=this._getOrReturnCtx(e,i),k(i,{code:b.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="length"){let o=e.data.length>r.value,a=e.data.length<r.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?k(i,{code:b.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):a&&k(i,{code:b.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),n.dirty())}else if(r.kind==="email")Mw.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"email",code:b.invalid_string,message:r.message}),n.dirty());else if(r.kind==="emoji")Ka||(Ka=new RegExp(jw,"u")),Ka.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"emoji",code:b.invalid_string,message:r.message}),n.dirty());else if(r.kind==="uuid")Nw.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"uuid",code:b.invalid_string,message:r.message}),n.dirty());else if(r.kind==="nanoid")Pw.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"nanoid",code:b.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid")Tw.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"cuid",code:b.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid2")Iw.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"cuid2",code:b.invalid_string,message:r.message}),n.dirty());else if(r.kind==="ulid")Rw.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"ulid",code:b.invalid_string,message:r.message}),n.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),k(i,{validation:"url",code:b.invalid_string,message:r.message}),n.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"regex",code:b.invalid_string,message:r.message}),n.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(i=this._getOrReturnCtx(e,i),k(i,{code:b.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(i=this._getOrReturnCtx(e,i),k(i,{code:b.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(i=this._getOrReturnCtx(e,i),k(i,{code:b.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty()):r.kind==="datetime"?ld(r).test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{code:b.invalid_string,validation:"datetime",message:r.message}),n.dirty()):r.kind==="date"?Kw.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{code:b.invalid_string,validation:"date",message:r.message}),n.dirty()):r.kind==="time"?Yw(r).test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{code:b.invalid_string,validation:"time",message:r.message}),n.dirty()):r.kind==="duration"?Lw.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"duration",code:b.invalid_string,message:r.message}),n.dirty()):r.kind==="ip"?Hw(e.data,r.version)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"ip",code:b.invalid_string,message:r.message}),n.dirty()):r.kind==="jwt"?Jw(e.data,r.alg)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"jwt",code:b.invalid_string,message:r.message}),n.dirty()):r.kind==="cidr"?Zw(e.data,r.version)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"cidr",code:b.invalid_string,message:r.message}),n.dirty()):r.kind==="base64"?zw.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"base64",code:b.invalid_string,message:r.message}),n.dirty()):r.kind==="base64url"?Gw.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"base64url",code:b.invalid_string,message:r.message}),n.dirty()):z.assertNever(r);return{status:n.value,value:e.data}}_regex(e,s,n){return this.refinement(i=>e.test(i),{validation:s,code:b.invalid_string,...R.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...R.errToObj(e)})}url(e){return this._addCheck({kind:"url",...R.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...R.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...R.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...R.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...R.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...R.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...R.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...R.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...R.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...R.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...R.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...R.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...R.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...R.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...R.errToObj(e)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...R.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s?.position,...R.errToObj(s?.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...R.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...R.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...R.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...R.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...R.errToObj(s)})}nonempty(e){return this.min(1,R.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}};Tt.create=t=>new Tt({checks:[],typeName:O.ZodString,coerce:t?.coerce??!1,...j(t)});ns=class t extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==_.number){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:_.number,received:r.parsedType}),N}let n,i=new fe;for(let r of this._def.checks)r.kind==="int"?z.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{code:b.invalid_type,expected:"integer",received:"float",message:r.message}),i.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:b.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:b.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="multipleOf"?Qw(e.data,r.value)!==0&&(n=this._getOrReturnCtx(e,n),k(n,{code:b.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{code:b.not_finite,message:r.message}),i.dirty()):z.assertNever(r);return{status:i.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,R.toString(s))}gt(e,s){return this.setLimit("min",e,!1,R.toString(s))}lte(e,s){return this.setLimit("max",e,!0,R.toString(s))}lt(e,s){return this.setLimit("max",e,!1,R.toString(s))}setLimit(e,s,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:n,message:R.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:R.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:R.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:R.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.toString(e)})}get minValue(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&z.isInteger(e.value))}get isFinite(){let e=null,s=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(s===null||n.value>s)&&(s=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(s)&&Number.isFinite(e)}};ns.create=t=>new ns({checks:[],typeName:O.ZodNumber,coerce:t?.coerce||!1,...j(t)});is=class t extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==_.bigint)return this._getInvalidInput(e);let n,i=new fe;for(let r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:b.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:b.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),k(n,{code:b.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):z.assertNever(r);return{status:i.value,value:e.data}}_getInvalidInput(e){let s=this._getOrReturnCtx(e);return k(s,{code:b.invalid_type,expected:_.bigint,received:s.parsedType}),N}gte(e,s){return this.setLimit("min",e,!0,R.toString(s))}gt(e,s){return this.setLimit("min",e,!1,R.toString(s))}lte(e,s){return this.setLimit("max",e,!0,R.toString(s))}lt(e,s){return this.setLimit("max",e,!1,R.toString(s))}setLimit(e,s,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:n,message:R.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:R.toString(s)})}get minValue(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}};is.create=t=>new is({checks:[],typeName:O.ZodBigInt,coerce:t?.coerce??!1,...j(t)});rs=class extends W{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.boolean){let n=this._getOrReturnCtx(e);return k(n,{code:b.invalid_type,expected:_.boolean,received:n.parsedType}),N}return ge(e.data)}};rs.create=t=>new rs({typeName:O.ZodBoolean,coerce:t?.coerce||!1,...j(t)});os=class t extends W{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:_.date,received:r.parsedType}),N}if(Number.isNaN(e.data.getTime())){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_date}),N}let n=new fe,i;for(let r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(i=this._getOrReturnCtx(e,i),k(i,{code:b.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(i=this._getOrReturnCtx(e,i),k(i,{code:b.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):z.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:R.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:R.toString(s)})}get minDate(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}};os.create=t=>new os({checks:[],coerce:t?.coerce||!1,typeName:O.ZodDate,...j(t)});Us=class extends W{_parse(e){if(this._getType(e)!==_.symbol){let n=this._getOrReturnCtx(e);return k(n,{code:b.invalid_type,expected:_.symbol,received:n.parsedType}),N}return ge(e.data)}};Us.create=t=>new Us({typeName:O.ZodSymbol,...j(t)});as=class extends W{_parse(e){if(this._getType(e)!==_.undefined){let n=this._getOrReturnCtx(e);return k(n,{code:b.invalid_type,expected:_.undefined,received:n.parsedType}),N}return ge(e.data)}};as.create=t=>new as({typeName:O.ZodUndefined,...j(t)});us=class extends W{_parse(e){if(this._getType(e)!==_.null){let n=this._getOrReturnCtx(e);return k(n,{code:b.invalid_type,expected:_.null,received:n.parsedType}),N}return ge(e.data)}};us.create=t=>new us({typeName:O.ZodNull,...j(t)});It=class extends W{constructor(){super(...arguments),this._any=!0}_parse(e){return ge(e.data)}};It.create=t=>new It({typeName:O.ZodAny,...j(t)});Ft=class extends W{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ge(e.data)}};Ft.create=t=>new Ft({typeName:O.ZodUnknown,...j(t)});Ze=class extends W{_parse(e){let s=this._getOrReturnCtx(e);return k(s,{code:b.invalid_type,expected:_.never,received:s.parsedType}),N}};Ze.create=t=>new Ze({typeName:O.ZodNever,...j(t)});Ws=class extends W{_parse(e){if(this._getType(e)!==_.undefined){let n=this._getOrReturnCtx(e);return k(n,{code:b.invalid_type,expected:_.void,received:n.parsedType}),N}return ge(e.data)}};Ws.create=t=>new Ws({typeName:O.ZodVoid,...j(t)});wt=class t extends W{_parse(e){let{ctx:s,status:n}=this._processInputParams(e),i=this._def;if(s.parsedType!==_.array)return k(s,{code:b.invalid_type,expected:_.array,received:s.parsedType}),N;if(i.exactLength!==null){let o=s.data.length>i.exactLength.value,a=s.data.length<i.exactLength.value;(o||a)&&(k(s,{code:o?b.too_big:b.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&s.data.length<i.minLength.value&&(k(s,{code:b.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&s.data.length>i.maxLength.value&&(k(s,{code:b.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),s.common.async)return Promise.all([...s.data].map((o,a)=>i.type._parseAsync(new Pe(s,o,s.path,a)))).then(o=>fe.mergeArray(n,o));let r=[...s.data].map((o,a)=>i.type._parseSync(new Pe(s,o,s.path,a)));return fe.mergeArray(n,r)}get element(){return this._def.type}min(e,s){return new t({...this._def,minLength:{value:e,message:R.toString(s)}})}max(e,s){return new t({...this._def,maxLength:{value:e,message:R.toString(s)}})}length(e,s){return new t({...this._def,exactLength:{value:e,message:R.toString(s)}})}nonempty(e){return this.min(1,e)}};wt.create=(t,e)=>new wt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:O.ZodArray,...j(e)});ke=class t extends W{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),s=z.objectKeys(e);return this._cached={shape:e,keys:s},this._cached}_parse(e){if(this._getType(e)!==_.object){let l=this._getOrReturnCtx(e);return k(l,{code:b.invalid_type,expected:_.object,received:l.parsedType}),N}let{status:n,ctx:i}=this._processInputParams(e),{shape:r,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Ze&&this._def.unknownKeys==="strip"))for(let l in i.data)o.includes(l)||a.push(l);let u=[];for(let l of o){let c=r[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Pe(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Ze){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of a)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")a.length>0&&(k(i,{code:b.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of a){let f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Pe(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let f=await c.key,d=await c.value;l.push({key:f,value:d,alwaysSet:c.alwaysSet})}return l}).then(l=>fe.mergeObjectSync(n,l)):fe.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return R.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,n)=>{let i=this._def.errorMap?.(s,n).message??n.defaultError;return s.code==="unrecognized_keys"?{message:R.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:O.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let s={};for(let n of z.objectKeys(e))e[n]&&this.shape[n]&&(s[n]=this.shape[n]);return new t({...this._def,shape:()=>s})}omit(e){let s={};for(let n of z.objectKeys(this.shape))e[n]||(s[n]=this.shape[n]);return new t({...this._def,shape:()=>s})}deepPartial(){return qs(this)}partial(e){let s={};for(let n of z.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?s[n]=i:s[n]=i.optional()}return new t({...this._def,shape:()=>s})}required(e){let s={};for(let n of z.objectKeys(this.shape))if(e&&!e[n])s[n]=this.shape[n];else{let r=this.shape[n];for(;r instanceof Ne;)r=r._def.innerType;s[n]=r}return new t({...this._def,shape:()=>s})}keyof(){return cd(z.objectKeys(this.shape))}};ke.create=(t,e)=>new ke({shape:()=>t,unknownKeys:"strip",catchall:Ze.create(),typeName:O.ZodObject,...j(e)});ke.strictCreate=(t,e)=>new ke({shape:()=>t,unknownKeys:"strict",catchall:Ze.create(),typeName:O.ZodObject,...j(e)});ke.lazycreate=(t,e)=>new ke({shape:t,unknownKeys:"strip",catchall:Ze.create(),typeName:O.ZodObject,...j(e)});ls=class extends W{_parse(e){let{ctx:s}=this._processInputParams(e),n=this._def.options;function i(r){for(let a of r)if(a.result.status==="valid")return a.result;for(let a of r)if(a.result.status==="dirty")return s.common.issues.push(...a.ctx.common.issues),a.result;let o=r.map(a=>new De(a.ctx.common.issues));return k(s,{code:b.invalid_union,unionErrors:o}),N}if(s.common.async)return Promise.all(n.map(async r=>{let o={...s,common:{...s.common,issues:[]},parent:null};return{result:await r._parseAsync({data:s.data,path:s.path,parent:o}),ctx:o}})).then(i);{let r,o=[];for(let u of n){let l={...s,common:{...s.common,issues:[]},parent:null},c=u._parseSync({data:s.data,path:s.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!r&&(r={result:c,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(r)return s.common.issues.push(...r.ctx.common.issues),r.result;let a=o.map(u=>new De(u));return k(s,{code:b.invalid_union,unionErrors:a}),N}}get options(){return this._def.options}};ls.create=(t,e)=>new ls({options:t,typeName:O.ZodUnion,...j(e)});yt=t=>t instanceof fs?yt(t.schema):t instanceof Oe?yt(t.innerType()):t instanceof ds?[t.value]:t instanceof hs?t.options:t instanceof ps?z.objectValues(t.enum):t instanceof ms?yt(t._def.innerType):t instanceof as?[void 0]:t instanceof us?[null]:t instanceof Ne?[void 0,...yt(t.unwrap())]:t instanceof at?[null,...yt(t.unwrap())]:t instanceof _n||t instanceof gs?yt(t.unwrap()):t instanceof Ds?yt(t._def.innerType):[],rr=class t extends W{_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==_.object)return k(s,{code:b.invalid_type,expected:_.object,received:s.parsedType}),N;let n=this.discriminator,i=s.data[n],r=this.optionsMap.get(i);return r?s.common.async?r._parseAsync({data:s.data,path:s.path,parent:s}):r._parseSync({data:s.data,path:s.path,parent:s}):(k(s,{code:b.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),N)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,s,n){let i=new Map;for(let r of s){let o=yt(r.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,r)}}return new t({typeName:O.ZodDiscriminatedUnion,discriminator:e,options:s,optionsMap:i,...j(n)})}};cs=class extends W{_parse(e){let{status:s,ctx:n}=this._processInputParams(e),i=(r,o)=>{if(nr(r)||nr(o))return N;let a=Ya(r.value,o.value);return a.valid?((ir(r)||ir(o))&&s.dirty(),{status:s.value,value:a.data}):(k(n,{code:b.invalid_intersection_types}),N)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,o])=>i(r,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};cs.create=(t,e,s)=>new cs({left:t,right:e,typeName:O.ZodIntersection,...j(s)});ot=class t extends W{_parse(e){let{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.array)return k(n,{code:b.invalid_type,expected:_.array,received:n.parsedType}),N;if(n.data.length<this._def.items.length)return k(n,{code:b.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N;!this._def.rest&&n.data.length>this._def.items.length&&(k(n,{code:b.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let r=[...n.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new Pe(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(r).then(o=>fe.mergeArray(s,o)):fe.mergeArray(s,r)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};ot.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ot({items:t,typeName:O.ZodTuple,rest:null,...j(e)})};or=class t extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.object)return k(n,{code:b.invalid_type,expected:_.object,received:n.parsedType}),N;let i=[],r=this._def.keyType,o=this._def.valueType;for(let a in n.data)i.push({key:r._parse(new Pe(n,a,n.path,a)),value:o._parse(new Pe(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?fe.mergeObjectAsync(s,i):fe.mergeObjectSync(s,i)}get element(){return this._def.valueType}static create(e,s,n){return s instanceof W?new t({keyType:e,valueType:s,typeName:O.ZodRecord,...j(n)}):new t({keyType:Tt.create(),valueType:e,typeName:O.ZodRecord,...j(s)})}},Vs=class extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.map)return k(n,{code:b.invalid_type,expected:_.map,received:n.parsedType}),N;let i=this._def.keyType,r=this._def.valueType,o=[...n.data.entries()].map(([a,u],l)=>({key:i._parse(new Pe(n,a,n.path,[l,"key"])),value:r._parse(new Pe(n,u,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return N;(l.status==="dirty"||c.status==="dirty")&&s.dirty(),a.set(l.value,c.value)}return{status:s.value,value:a}})}else{let a=new Map;for(let u of o){let l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return N;(l.status==="dirty"||c.status==="dirty")&&s.dirty(),a.set(l.value,c.value)}return{status:s.value,value:a}}}};Vs.create=(t,e,s)=>new Vs({valueType:e,keyType:t,typeName:O.ZodMap,...j(s)});zs=class t extends W{_parse(e){let{status:s,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.set)return k(n,{code:b.invalid_type,expected:_.set,received:n.parsedType}),N;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(k(n,{code:b.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),s.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(k(n,{code:b.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),s.dirty());let r=this._def.valueType;function o(u){let l=new Set;for(let c of u){if(c.status==="aborted")return N;c.status==="dirty"&&s.dirty(),l.add(c.value)}return{status:s.value,value:l}}let a=[...n.data.values()].map((u,l)=>r._parse(new Pe(n,u,n.path,l)));return n.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,s){return new t({...this._def,minSize:{value:e,message:R.toString(s)}})}max(e,s){return new t({...this._def,maxSize:{value:e,message:R.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}};zs.create=(t,e)=>new zs({valueType:t,minSize:null,maxSize:null,typeName:O.ZodSet,...j(e)});ar=class t extends W{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==_.function)return k(s,{code:b.invalid_type,expected:_.function,received:s.parsedType}),N;function n(a,u){return $n({data:a,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Ms(),gt].filter(l=>!!l),issueData:{code:b.invalid_arguments,argumentsError:u}})}function i(a,u){return $n({data:a,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Ms(),gt].filter(l=>!!l),issueData:{code:b.invalid_return_type,returnTypeError:u}})}let r={errorMap:s.common.contextualErrorMap},o=s.data;if(this._def.returns instanceof Rt){let a=this;return ge(async function(...u){let l=new De([]),c=await a._def.args.parseAsync(u,r).catch(p=>{throw l.addIssue(n(u,p)),l}),f=await Reflect.apply(o,this,c);return await a._def.returns._def.type.parseAsync(f,r).catch(p=>{throw l.addIssue(i(f,p)),l})})}else{let a=this;return ge(function(...u){let l=a._def.args.safeParse(u,r);if(!l.success)throw new De([n(u,l.error)]);let c=Reflect.apply(o,this,l.data),f=a._def.returns.safeParse(c,r);if(!f.success)throw new De([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:ot.create(e).rest(Ft.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,s,n){return new t({args:e||ot.create([]).rest(Ft.create()),returns:s||Ft.create(),typeName:O.ZodFunction,...j(n)})}},fs=class extends W{get schema(){return this._def.getter()}_parse(e){let{ctx:s}=this._processInputParams(e);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}};fs.create=(t,e)=>new fs({getter:t,typeName:O.ZodLazy,...j(e)});ds=class extends W{_parse(e){if(e.data!==this._def.value){let s=this._getOrReturnCtx(e);return k(s,{received:s.data,code:b.invalid_literal,expected:this._def.value}),N}return{status:"valid",value:e.data}}get value(){return this._def.value}};ds.create=(t,e)=>new ds({value:t,typeName:O.ZodLiteral,...j(e)});hs=class t extends W{_parse(e){if(typeof e.data!="string"){let s=this._getOrReturnCtx(e),n=this._def.values;return k(s,{expected:z.joinValues(n),received:s.parsedType,code:b.invalid_type}),N}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let s=this._getOrReturnCtx(e),n=this._def.values;return k(s,{received:s.data,code:b.invalid_enum_value,options:n}),N}return ge(e.data)}get options(){return this._def.values}get enum(){let e={};for(let s of this._def.values)e[s]=s;return e}get Values(){let e={};for(let s of this._def.values)e[s]=s;return e}get Enum(){let e={};for(let s of this._def.values)e[s]=s;return e}extract(e,s=this._def){return t.create(e,{...this._def,...s})}exclude(e,s=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...s})}};hs.create=cd;ps=class extends W{_parse(e){let s=z.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==_.string&&n.parsedType!==_.number){let i=z.objectValues(s);return k(n,{expected:z.joinValues(i),received:n.parsedType,code:b.invalid_type}),N}if(this._cache||(this._cache=new Set(z.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=z.objectValues(s);return k(n,{received:n.data,code:b.invalid_enum_value,options:i}),N}return ge(e.data)}get enum(){return this._def.values}};ps.create=(t,e)=>new ps({values:t,typeName:O.ZodNativeEnum,...j(e)});Rt=class extends W{unwrap(){return this._def.type}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==_.promise&&s.common.async===!1)return k(s,{code:b.invalid_type,expected:_.promise,received:s.parsedType}),N;let n=s.parsedType===_.promise?s.data:Promise.resolve(s.data);return ge(n.then(i=>this._def.type.parseAsync(i,{path:s.path,errorMap:s.common.contextualErrorMap})))}};Rt.create=(t,e)=>new Rt({type:t,typeName:O.ZodPromise,...j(e)});Oe=class extends W{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===O.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:s,ctx:n}=this._processInputParams(e),i=this._def.effect||null,r={addIssue:o=>{k(n,o),o.fatal?s.abort():s.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),i.type==="preprocess"){let o=i.transform(n.data,r);if(n.common.async)return Promise.resolve(o).then(async a=>{if(s.value==="aborted")return N;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?N:u.status==="dirty"?ss(u.value):s.value==="dirty"?ss(u.value):u});{if(s.value==="aborted")return N;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?N:a.status==="dirty"?ss(a.value):s.value==="dirty"?ss(a.value):a}}if(i.type==="refinement"){let o=a=>{let u=i.refinement(a,r);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?N:(a.status==="dirty"&&s.dirty(),o(a.value),{status:s.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?N:(a.status==="dirty"&&s.dirty(),o(a.value).then(()=>({status:s.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Bt(o))return N;let a=i.transform(o.value,r);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Bt(o)?Promise.resolve(i.transform(o.value,r)).then(a=>({status:s.value,value:a})):N);z.assertNever(i)}};Oe.create=(t,e,s)=>new Oe({schema:t,typeName:O.ZodEffects,effect:e,...j(s)});Oe.createWithPreprocess=(t,e,s)=>new Oe({schema:e,effect:{type:"preprocess",transform:t},typeName:O.ZodEffects,...j(s)});Ne=class extends W{_parse(e){return this._getType(e)===_.undefined?ge(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ne.create=(t,e)=>new Ne({innerType:t,typeName:O.ZodOptional,...j(e)});at=class extends W{_parse(e){return this._getType(e)===_.null?ge(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};at.create=(t,e)=>new at({innerType:t,typeName:O.ZodNullable,...j(e)});ms=class extends W{_parse(e){let{ctx:s}=this._processInputParams(e),n=s.data;return s.parsedType===_.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};ms.create=(t,e)=>new ms({innerType:t,typeName:O.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...j(e)});Ds=class extends W{_parse(e){let{ctx:s}=this._processInputParams(e),n={...s,common:{...s.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return js(i)?i.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new De(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new De(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ds.create=(t,e)=>new Ds({innerType:t,typeName:O.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...j(e)});Gs=class extends W{_parse(e){if(this._getType(e)!==_.nan){let n=this._getOrReturnCtx(e);return k(n,{code:b.invalid_type,expected:_.nan,received:n.parsedType}),N}return{status:"valid",value:e.data}}};Gs.create=t=>new Gs({typeName:O.ZodNaN,...j(t)});Xw=Symbol("zod_brand"),_n=class extends W{_parse(e){let{ctx:s}=this._processInputParams(e),n=s.data;return this._def.type._parse({data:n,path:s.path,parent:s})}unwrap(){return this._def.type}},Bn=class t extends W{_parse(e){let{status:s,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?N:r.status==="dirty"?(s.dirty(),ss(r.value)):this._def.out._parseAsync({data:r.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?N:i.status==="dirty"?(s.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,s){return new t({in:e,out:s,typeName:O.ZodPipeline})}},gs=class extends W{_parse(e){let s=this._def.innerType._parse(e),n=i=>(Bt(i)&&(i.value=Object.freeze(i.value)),i);return js(s)?s.then(i=>n(i)):n(s)}unwrap(){return this._def.innerType}};gs.create=(t,e)=>new gs({innerType:t,typeName:O.ZodReadonly,...j(e)});eC={object:ke.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(O||(O={}));tC=(t,e={message:`Input not instance of ${t.name}`})=>fd(s=>s instanceof t,e),dd=Tt.create,hd=ns.create,sC=Gs.create,nC=is.create,pd=rs.create,iC=os.create,rC=Us.create,oC=as.create,aC=us.create,uC=It.create,lC=Ft.create,cC=Ze.create,fC=Ws.create,dC=wt.create,hC=ke.create,pC=ke.strictCreate,mC=ls.create,DC=rr.create,gC=cs.create,yC=ot.create,FC=or.create,wC=Vs.create,CC=zs.create,EC=ar.create,bC=fs.create,vC=ds.create,xC=hs.create,SC=ps.create,AC=Rt.create,kC=Oe.create,$C=Ne.create,_C=at.create,BC=Oe.createWithPreprocess,TC=Bn.create,IC=()=>dd().optional(),RC=()=>hd().optional(),NC=()=>pd().optional(),PC={string:(t=>Tt.create({...t,coerce:!0})),number:(t=>ns.create({...t,coerce:!0})),boolean:(t=>rs.create({...t,coerce:!0})),bigint:(t=>is.create({...t,coerce:!0})),date:(t=>os.create({...t,coerce:!0}))},OC=N});var T={};wn(T,{BRAND:()=>Xw,DIRTY:()=>ss,EMPTY_PATH:()=>Bw,INVALID:()=>N,NEVER:()=>OC,OK:()=>ge,ParseStatus:()=>fe,Schema:()=>W,ZodAny:()=>It,ZodArray:()=>wt,ZodBigInt:()=>is,ZodBoolean:()=>rs,ZodBranded:()=>_n,ZodCatch:()=>Ds,ZodDate:()=>os,ZodDefault:()=>ms,ZodDiscriminatedUnion:()=>rr,ZodEffects:()=>Oe,ZodEnum:()=>hs,ZodError:()=>De,ZodFirstPartyTypeKind:()=>O,ZodFunction:()=>ar,ZodIntersection:()=>cs,ZodIssueCode:()=>b,ZodLazy:()=>fs,ZodLiteral:()=>ds,ZodMap:()=>Vs,ZodNaN:()=>Gs,ZodNativeEnum:()=>ps,ZodNever:()=>Ze,ZodNull:()=>us,ZodNullable:()=>at,ZodNumber:()=>ns,ZodObject:()=>ke,ZodOptional:()=>Ne,ZodParsedType:()=>_,ZodPipeline:()=>Bn,ZodPromise:()=>Rt,ZodReadonly:()=>gs,ZodRecord:()=>or,ZodSchema:()=>W,ZodSet:()=>zs,ZodString:()=>Tt,ZodSymbol:()=>Us,ZodTransformer:()=>Oe,ZodTuple:()=>ot,ZodType:()=>W,ZodUndefined:()=>as,ZodUnion:()=>ls,ZodUnknown:()=>Ft,ZodVoid:()=>Ws,addIssueToContext:()=>k,any:()=>uC,array:()=>dC,bigint:()=>nC,boolean:()=>pd,coerce:()=>PC,custom:()=>fd,date:()=>iC,datetimeRegex:()=>ld,defaultErrorMap:()=>gt,discriminatedUnion:()=>DC,effect:()=>kC,enum:()=>xC,function:()=>EC,getErrorMap:()=>Ms,getParsedType:()=>rt,instanceof:()=>tC,intersection:()=>gC,isAborted:()=>nr,isAsync:()=>js,isDirty:()=>ir,isValid:()=>Bt,late:()=>eC,lazy:()=>bC,literal:()=>vC,makeIssue:()=>$n,map:()=>wC,nan:()=>sC,nativeEnum:()=>SC,never:()=>cC,null:()=>aC,nullable:()=>_C,number:()=>hd,object:()=>hC,objectUtil:()=>Va,oboolean:()=>NC,onumber:()=>RC,optional:()=>$C,ostring:()=>IC,pipeline:()=>TC,preprocess:()=>BC,promise:()=>AC,quotelessJson:()=>kw,record:()=>FC,set:()=>CC,setErrorMap:()=>_w,strictObject:()=>pC,string:()=>dd,symbol:()=>rC,transformer:()=>kC,tuple:()=>yC,undefined:()=>oC,union:()=>mC,unknown:()=>lC,util:()=>z,void:()=>fC});var Ha=q(()=>{sr();Ga();nd();kn();md();tr()});var Ks=q(()=>{Ha();Ha()});function Qa(){return Za.parse({})}async function Tn(t){try{return await(0,Te.access)(t),!0}catch(e){if(e instanceof Error&&"code"in e&&e.code==="ENOENT")return!1;throw e}}async function yd(t){if(!await Tn(t))return null;let s=await(0,Te.readFile)(t,"utf-8");try{return JSON.parse(s)}catch(n){let i=n instanceof SyntaxError?n.message:String(n);throw new Error(`Invalid JSON in config file ${t}: ${i}`,{cause:n})}}function Fd(t,e){return{...t,...e.extends!==void 0&&{extends:e.extends},...e.excludePatterns!==void 0&&{excludePatterns:e.excludePatterns},...e.concurrency!==void 0&&{concurrency:e.concurrency},...e.executor!==void 0&&{executor:e.executor},executors:e.executors?UC(t.executors,e.executors):t.executors,agents:e.agents?wd(t.agents,e.agents):t.agents,rules:e.rules?wd(t.rules,e.rules):t.rules,workflows:e.workflows??t.workflows,output:e.output?{...t.output,...e.output}:t.output}}async function Ee(t){let e=t?`${Ae.CONFIG}:${t}`:Ae.CONFIG;return Dt(e,async()=>{let s=Qa(),n=await yd(Ys);if(n&&(s=Za.parse(Fd(s,n))),t){let i=(0,Nt.join)(t,lr),r=await yd(i);r&&(s=Za.parse(Fd(s,r)))}return s})}async function Ed(t){try{await(0,Te.mkdir)(ur,{recursive:!0}),await(0,Te.writeFile)(Ys,JSON.stringify(t,null,2)),Os(Ae.CONFIG)}catch(e){throw new Error(`Failed to save global config to ${Ys}: ${e}`,{cause:e})}}async function bd(t){let e=(0,Nt.join)(t,lr);return await Tn(e)||(await(0,Te.writeFile)(e,JSON.stringify({agents:{},rules:{}},null,2)),Os(Ae.CONFIG)),e}function UC(t,e){let s={...t};for(let[n,i]of Object.entries(e))s[n]={...s[n],...i,review:i.review?{...s[n]?.review,...i.review}:s[n]?.review,validation:i.validation?{...s[n]?.validation,...i.validation}:s[n]?.validation};return s}function wd(t,e){let s={...t};for(let[n,i]of Object.entries(e))s[n]={...s[n],...i};return s}function Xa(){return Ys}function In(t){return(0,Nt.join)(t,lr)}async function eu(){return Tn(Ys)}async function cr(t){return Tn(In(t))}async function fr(){return Dt(Ae.INSTRUCTIONS,async()=>{try{return await Tn(Ja)?await(0,Te.readFile)(Ja,"utf-8"):""}catch(t){return console.debug(`Failed to load instructions from ${Ja}: ${t instanceof Error?t.message:String(t)}`),""}})}async function vd(t,e,s){let n=e?Ys:(0,Nt.join)(s||process.cwd(),lr),i={};try{let o=await(0,Te.readFile)(n,"utf-8");i=JSON.parse(o)}catch(o){o instanceof Error&&"code"in o&&o.code==="ENOENT"||console.debug(`Failed to load config from ${n}: ${o instanceof Error?o.message:String(o)}`)}let r=Array.isArray(i.extends)?i.extends.filter(o=>typeof o=="string"):[];r.includes(t)||r.push(t),i.extends=r,e&&await(0,Te.mkdir)(ur,{recursive:!0}),await(0,Te.writeFile)(n,JSON.stringify(i,null,2)),Os(Ae.CONFIG)}var Nt,Cd,Te,Dd,LC,gd,MC,jC,qC,Za,ur,Ys,Ja,lr,Qe=q(()=>{"use strict";Ks();Nt=require("path"),Cd=require("os"),Te=require("node:fs/promises");xn();Dd=T.object({executor:T.string().optional(),model:T.string().optional()}),LC=T.object({review:T.array(Dd).optional(),validation:T.array(Dd).optional()}),gd=T.object({model:T.string().optional(),timeout:T.number().positive().optional(),concurrency:T.number().min(1).max(10).optional(),batchSize:T.number().min(1).max(50).optional()}),MC=T.object({review:gd.optional(),validation:gd.optional()}),jC=T.object({enabled:T.boolean().optional(),model:T.string().optional(),timeout:T.number().positive().optional()}),qC=T.object({enabled:T.boolean().optional(),agent:T.string().optional()}),Za=T.object({extends:T.array(T.string()).default([]),excludePatterns:T.array(T.string()).default(["*.min.js","*.min.css","*.map","*.d.ts","dist/**","build/**","out/**",".next/**","coverage/**","node_modules/**","vendor/**","*.generated.*","*.bundle.js"]),concurrency:T.number().min(1).max(10).default(6),executor:T.string().default("claude-cli"),executors:T.record(T.string(),MC).default({}),agents:T.record(T.string(),jC).default({}),rules:T.record(T.string(),qC).default({}),workflows:LC.optional(),output:T.object({colorize:T.boolean().default(!0),verbose:T.boolean().default(!1),format:T.enum(["terminal","markdown","json"]).default("terminal")}).default({})}),ur=(0,Nt.join)((0,Cd.homedir)(),".diffray"),Ys=(0,Nt.join)(ur,"config.json"),Ja=(0,Nt.join)(ur,"instructions.md"),lr=".diffray.json"});var tu,xd,WC,Sd=q(()=>{tu=(t,e,s)=>{let n=t instanceof RegExp?xd(t,s):t,i=e instanceof RegExp?xd(e,s):e,r=n!==null&&i!=null&&WC(n,i,s);return r&&{start:r[0],end:r[1],pre:s.slice(0,r[0]),body:s.slice(r[0]+n.length,r[1]),post:s.slice(r[1]+i.length)}},xd=(t,e)=>{let s=e.match(t);return s?s[0]:null},WC=(t,e,s)=>{let n,i,r,o,a,u=s.indexOf(t),l=s.indexOf(e,u+1),c=u;if(u>=0&&l>0){if(t===e)return[u,l];for(n=[],r=s.length;c>=0&&!a;){if(c===u)n.push(c),u=s.indexOf(t,c+1);else if(n.length===1){let f=n.pop();f!==void 0&&(a=[f,l])}else i=n.pop(),i!==void 0&&i<r&&(r=i,o=l),l=s.indexOf(e,c+1);c=u<l&&u>=0?u:l}n.length&&o!==void 0&&(a=[r,o])}return a}});function su(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function eE(t){return t.replace(HC,Ad).replace(JC,kd).replace(ZC,nu).replace(QC,$d).replace(XC,_d)}function tE(t){return t.replace(VC,"\\").replace(zC,"{").replace(GC,"}").replace(KC,",").replace(YC,".")}function Bd(t){if(!t)return[""];let e=[],s=tu("{","}",t);if(!s)return t.split(",");let{pre:n,body:i,post:r}=s,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=Bd(r);return r.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function Td(t){return t?(t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),Rn(eE(t),!0).map(tE)):[]}function sE(t){return"{"+t+"}"}function nE(t){return/^-?0\d/.test(t)}function iE(t,e){return t<=e}function rE(t,e){return t>=e}function Rn(t,e){let s=[],n=tu("{","}",t);if(!n)return[t];let i=n.pre,r=n.post.length?Rn(n.post,!1):[""];if(/\$$/.test(n.pre))for(let o=0;o<r.length;o++){let a=i+"{"+n.body+"}"+r[o];s.push(a)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),u=o||a,l=n.body.indexOf(",")>=0;if(!u&&!l)return n.post.match(/,(?!,).*\}/)?(t=n.pre+"{"+n.body+nu+n.post,Rn(t)):[t];let c;if(u)c=n.body.split(/\.\./);else if(c=Bd(n.body),c.length===1&&c[0]!==void 0&&(c=Rn(c[0],!1).map(sE),c.length===1))return r.map(d=>n.pre+c[0]+d);let f;if(u&&c[0]!==void 0&&c[1]!==void 0){let d=su(c[0]),p=su(c[1]),D=Math.max(c[0].length,c[1].length),m=c.length===3&&c[2]!==void 0?Math.abs(su(c[2])):1,g=iE;p<d&&(m*=-1,g=rE);let y=c.some(nE);f=[];for(let C=d;g(C,p);C+=m){let w;if(a)w=String.fromCharCode(C),w==="\\"&&(w="");else if(w=String(C),y){let E=D-w.length;if(E>0){let v=new Array(E+1).join("0");C<0?w="-"+v+w.slice(1):w=v+w}}f.push(w)}}else{f=[];for(let d=0;d<c.length;d++)f.push.apply(f,Rn(c[d],!1))}for(let d=0;d<f.length;d++)for(let p=0;p<r.length;p++){let D=i+f[d]+r[p];(!e||u||D)&&s.push(D)}}return s}var Ad,kd,nu,$d,_d,VC,zC,GC,KC,YC,HC,JC,ZC,QC,XC,Id=q(()=>{Sd();Ad="\0SLASH"+Math.random()+"\0",kd="\0OPEN"+Math.random()+"\0",nu="\0CLOSE"+Math.random()+"\0",$d="\0COMMA"+Math.random()+"\0",_d="\0PERIOD"+Math.random()+"\0",VC=new RegExp(Ad,"g"),zC=new RegExp(kd,"g"),GC=new RegExp(nu,"g"),KC=new RegExp($d,"g"),YC=new RegExp(_d,"g"),HC=/\\\\/g,JC=/\\{/g,ZC=/\\}/g,QC=/\\,/g,XC=/\\./g});var Nn,Rd=q(()=>{Nn=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")}});var oE,Pn,aE,Nd,Pd,Od=q(()=>{oE={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Pn=t=>t.replace(/[[\]\\-]/g,"\\$&"),aE=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Nd=t=>t.join(""),Pd=(t,e)=>{let s=e;if(t.charAt(s)!=="[")throw new Error("not in a brace expression");let n=[],i=[],r=s+1,o=!1,a=!1,u=!1,l=!1,c=s,f="";e:for(;r<t.length;){let m=t.charAt(r);if((m==="!"||m==="^")&&r===s+1){l=!0,r++;continue}if(m==="]"&&o&&!u){c=r+1;break}if(o=!0,m==="\\"&&!u){u=!0,r++;continue}if(m==="["&&!u){for(let[g,[F,y,C]]of Object.entries(oE))if(t.startsWith(g,r)){if(f)return["$.",!1,t.length-s,!0];r+=g.length,C?i.push(F):n.push(F),a=a||y;continue e}}if(u=!1,f){m>f?n.push(Pn(f)+"-"+Pn(m)):m===f&&n.push(Pn(m)),f="",r++;continue}if(t.startsWith("-]",r+1)){n.push(Pn(m+"-")),r+=2;continue}if(t.startsWith("-",r+1)){f=m,r+=2;continue}n.push(Pn(m)),r++}if(c<r)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,t.length-s,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let m=n[0].length===2?n[0].slice(-1):n[0];return[aE(m),!1,c-s,!1]}let d="["+(l?"^":"")+Nd(n)+"]",p="["+(l?"":"^")+Nd(i)+"]";return[n.length&&i.length?"("+d+"|"+p+")":n.length?d:p,a,c-s,!0]}});var Le,dr=q(()=>{Le=(t,{windowsPathsNoEscape:e=!1,magicalBraces:s=!0}={})=>s?e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?t.replace(/\[([^\/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")});var uE,Ld,lE,hr,cE,fE,dE,hE,iu,Md,jd,Hs,ru=q(()=>{Od();dr();uE=new Set(["!","?","+","*","@"]),Ld=t=>uE.has(t),lE="(?!(?:^|/)\\.\\.?(?:$|/))",hr="(?!\\.)",cE=new Set(["[","."]),fE=new Set(["..","."]),dE=new Set("().*{}+?[]^$\\!"),hE=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),iu="[^/]",Md=iu+"*?",jd=iu+"+?",Hs=class t{type;#e;#s;#r=!1;#i=[];#o;#w;#g;#c=!1;#a;#d;#f=!1;constructor(e,s,n={}){this.type=e,e&&(this.#s=!0),this.#o=s,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?n:this.#e.#a,this.#g=this.#e===this?[]:this.#e.#g,e==="!"&&!this.#e.#c&&this.#g.push(this),this.#w=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#s!==void 0)return this.#s;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#s=!0;return this.#s}toString(){return this.#d!==void 0?this.#d:this.type?this.#d=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#d=this.#i.map(e=>String(e)).join("")}#u(){if(this!==this.#e)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let e;for(;e=this.#g.pop();){if(e.type!=="!")continue;let s=e,n=s.#o;for(;n;){for(let i=s.#w+1;!n.type&&i<n.#i.length;i++)for(let r of e.#i){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(n.#i[i])}s=n,n=s.#o}}return this}push(...e){for(let s of e)if(s!==""){if(typeof s!="string"&&!(s instanceof t&&s.#o===this))throw new Error("invalid part: "+s);this.#i.push(s)}}toJSON(){let e=this.type===null?this.#i.slice().map(s=>typeof s=="string"?s:s.toJSON()):[this.type,...this.#i.map(s=>s.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#c&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#w===0)return!0;let e=this.#o;for(let s=0;s<this.#w;s++){let n=e.#i[s];if(!(n instanceof t&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#w===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let s=new t(this.type,e);for(let n of this.#i)s.copyIn(n);return s}static#n(e,s,n,i){let r=!1,o=!1,a=-1,u=!1;if(s.type===null){let p=n,D="";for(;p<e.length;){let m=e.charAt(p++);if(r||m==="\\"){r=!r,D+=m;continue}if(o){p===a+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(p===a+2&&u)&&(o=!1),D+=m;continue}else if(m==="["){o=!0,a=p,u=!1,D+=m;continue}if(!i.noext&&Ld(m)&&e.charAt(p)==="("){s.push(D),D="";let g=new t(m,s);p=t.#n(e,g,p,i),s.push(g);continue}D+=m}return s.push(D),p}let l=n+1,c=new t(null,s),f=[],d="";for(;l<e.length;){let p=e.charAt(l++);if(r||p==="\\"){r=!r,d+=p;continue}if(o){l===a+1?(p==="^"||p==="!")&&(u=!0):p==="]"&&!(l===a+2&&u)&&(o=!1),d+=p;continue}else if(p==="["){o=!0,a=l,u=!1,d+=p;continue}if(Ld(p)&&e.charAt(l)==="("){c.push(d),d="";let D=new t(p,c);c.push(D),l=t.#n(e,D,l,i);continue}if(p==="|"){c.push(d),d="",f.push(c),c=new t(null,s);continue}if(p===")")return d===""&&s.#i.length===0&&(s.#f=!0),c.push(d),d="",s.push(...f,c),l;d+=p}return s.type=null,s.#s=void 0,s.#i=[e.substring(n-1)],l}static fromGlob(e,s={}){let n=new t(null,void 0,s);return t.#n(e,n,0,s),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[s,n,i,r]=this.toRegExpSource();if(!(i||this.#s||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#a.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${s}$`,a),{_src:s,_glob:e})}get options(){return this.#a}toRegExpSource(e){let s=e??!!this.#a.dot;if(this.#e===this&&this.#u(),!this.type){let u=this.isStart()&&this.isEnd()&&!this.#i.some(p=>typeof p!="string"),l=this.#i.map(p=>{let[D,m,g,F]=typeof p=="string"?t.#C(p,this.#s,u):p.toRegExpSource(e);return this.#s=this.#s||g,this.#r=this.#r||F,D}).join(""),c="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&fE.has(this.#i[0]))){let D=cE,m=s&&D.has(l.charAt(0))||l.startsWith("\\.")&&D.has(l.charAt(2))||l.startsWith("\\.\\.")&&D.has(l.charAt(4)),g=!s&&!e&&D.has(l.charAt(0));c=m?lE:g?hr:""}let f="";return this.isEnd()&&this.#e.#c&&this.#o?.type==="!"&&(f="(?:$|\\/)"),[c+l+f,Le(l),this.#s=!!this.#s,this.#r]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#h(s);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let u=this.toString();return this.#i=[u],this.type=null,this.#s=void 0,[u,Le(this.toString()),!1,!1]}let o=!n||e||s||!hr?"":this.#h(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";if(this.type==="!"&&this.#f)a=(this.isStart()&&!s?hr:"")+jd;else{let u=this.type==="!"?"))"+(this.isStart()&&!s&&!e?hr:"")+Md+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+r+u}return[a,Le(r),this.#s=!!this.#s,this.#r]}#h(e){return this.#i.map(s=>{if(typeof s=="string")throw new Error("string type in extglob ast??");let[n,i,r,o]=s.toRegExpSource(e);return this.#r=this.#r||o,n}).filter(s=>!(this.isStart()&&this.isEnd())||!!s).join("|")}static#C(e,s,n=!1){let i=!1,r="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(i){i=!1,r+=(dE.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?r+="\\\\":i=!0;continue}if(u==="["){let[l,c,f,d]=Pd(e,a);if(f){r+=l,o=o||c,a+=f-1,s=s||d;continue}}if(u==="*"){r+=n&&e==="*"?jd:Md,s=!0;continue}if(u==="?"){r+=iu,s=!0;continue}r+=hE(u)}return[r,Le(e),!!s,o]}}});var ys,ou=q(()=>{ys=(t,{windowsPathsNoEscape:e=!1,magicalBraces:s=!1}={})=>s?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&")});var be,pE,mE,DE,gE,yE,FE,wE,CE,EE,bE,vE,xE,SE,AE,kE,$E,_E,BE,Wd,Vd,zd,qd,TE,de,IE,RE,NE,PE,OE,Me,LE,Gd,ME,jE,Ud,qE,Ie,Pt=q(()=>{Id();Rd();ru();ou();dr();ru();ou();dr();be=(t,e,s={})=>(Nn(e),!s.nocomment&&e.charAt(0)==="#"?!1:new Ie(e,s).match(t)),pE=/^\*+([^+@!?\*\[\(]*)$/,mE=t=>e=>!e.startsWith(".")&&e.endsWith(t),DE=t=>e=>e.endsWith(t),gE=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),yE=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),FE=/^\*+\.\*+$/,wE=t=>!t.startsWith(".")&&t.includes("."),CE=t=>t!=="."&&t!==".."&&t.includes("."),EE=/^\.\*+$/,bE=t=>t!=="."&&t!==".."&&t.startsWith("."),vE=/^\*+$/,xE=t=>t.length!==0&&!t.startsWith("."),SE=t=>t.length!==0&&t!=="."&&t!=="..",AE=/^\?+([^+@!?\*\[\(]*)?$/,kE=([t,e=""])=>{let s=Wd([t]);return e?(e=e.toLowerCase(),n=>s(n)&&n.toLowerCase().endsWith(e)):s},$E=([t,e=""])=>{let s=Vd([t]);return e?(e=e.toLowerCase(),n=>s(n)&&n.toLowerCase().endsWith(e)):s},_E=([t,e=""])=>{let s=Vd([t]);return e?n=>s(n)&&n.endsWith(e):s},BE=([t,e=""])=>{let s=Wd([t]);return e?n=>s(n)&&n.endsWith(e):s},Wd=([t])=>{let e=t.length;return s=>s.length===e&&!s.startsWith(".")},Vd=([t])=>{let e=t.length;return s=>s.length===e&&s!=="."&&s!==".."},zd=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",qd={win32:{sep:"\\"},posix:{sep:"/"}},TE=zd==="win32"?qd.win32.sep:qd.posix.sep;be.sep=TE;de=Symbol("globstar **");be.GLOBSTAR=de;IE="[^/]",RE=IE+"*?",NE="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",PE="(?:(?!(?:\\/|^)\\.).)*?",OE=(t,e={})=>s=>be(s,t,e);be.filter=OE;Me=(t,e={})=>Object.assign({},t,e),LE=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return be;let e=be;return Object.assign((n,i,r={})=>e(n,i,Me(t,r)),{Minimatch:class extends e.Minimatch{constructor(i,r={}){super(i,Me(t,r))}static defaults(i){return e.defaults(Me(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,r,o={}){super(i,r,Me(t,o))}static fromGlob(i,r={}){return e.AST.fromGlob(i,Me(t,r))}},unescape:(n,i={})=>e.unescape(n,Me(t,i)),escape:(n,i={})=>e.escape(n,Me(t,i)),filter:(n,i={})=>e.filter(n,Me(t,i)),defaults:n=>e.defaults(Me(t,n)),makeRe:(n,i={})=>e.makeRe(n,Me(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,Me(t,i)),match:(n,i,r={})=>e.match(n,i,Me(t,r)),sep:e.sep,GLOBSTAR:de})};be.defaults=LE;Gd=(t,e={})=>(Nn(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Td(t));be.braceExpand=Gd;ME=(t,e={})=>new Ie(t,e).makeRe();be.makeRe=ME;jE=(t,e,s={})=>{let n=new Ie(e,s);return t=t.filter(i=>n.match(i)),n.options.nonull&&!t.length&&t.push(e),t};be.match=jE;Ud=/[?*]|[+@!]\(.*?\)|\[|\]/,qE=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ie=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,s={}){Nn(e),s=s||{},this.options=s,this.pattern=e,this.platform=s.platform||zd,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!s.windowsPathsNoEscape||s.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!s.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!s.nonegate,this.comment=!1,this.empty=!1,this.partial=!!s.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=s.windowsNoMagicRoot!==void 0?s.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let s of e)if(typeof s!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,s=this.options;if(!s.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],s.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=r[0]===""&&r[1]===""&&(r[2]==="?"||!Ud.test(r[2]))&&!Ud.test(r[3]),l=/^[a-z]:/i.test(r[0]);if(u)return[...r.slice(0,4),...r.slice(4).map(c=>this.parse(c))];if(l)return[r[0],...r.slice(1).map(c=>this.parse(c))]}return r.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");let{optimizationLevel:s=1}=this.options;return s>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):s>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(s=>{let n=-1;for(;(n=s.indexOf("**",n+1))!==-1;){let i=n;for(;s[i+1]==="**";)i++;i!==n&&s.splice(n,i-n)}return s})}levelOneOptimize(e){return e.map(s=>(s=s.reduce((n,i)=>{let r=n[n.length-1];return i==="**"&&r==="**"?n:i===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(n.pop(),n):(n.push(i),n)},[]),s.length===0?[""]:s))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let s=!1;do{if(s=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let r=e[i];i===1&&r===""&&e[0]===""||(r==="."||r==="")&&(s=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(s=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(s=!0,e.splice(n-1,2),n-=2)}}while(s);return e.length===0?[""]:e}firstPhasePreProcess(e){let s=!1;do{s=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],u=n[i+2],l=n[i+3];if(a!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;s=!0,n.splice(i,1);let c=n.slice(0);c[i]="**",e.push(c),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(s=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(s=!0,n.pop())}let r=0;for(;(r=n.indexOf("..",r+1))!==-1;){let o=n[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){s=!0;let u=r===1&&n[r+1]==="**"?["."]:[];n.splice(r-1,2,...u),n.length===0&&n.push(""),r-=2}}}}while(s);return e}secondPhasePreProcess(e){for(let s=0;s<e.length-1;s++)for(let n=s+1;n<e.length;n++){let i=this.partsMatch(e[s],e[n],!this.preserveMultipleSlashes);if(i){e[s]=[],e[n]=i;break}}return e.filter(s=>s.length)}partsMatch(e,s,n=!1){let i=0,r=0,o=[],a="";for(;i<e.length&&r<s.length;)if(e[i]===s[r])o.push(a==="b"?s[r]:e[i]),i++,r++;else if(n&&e[i]==="**"&&s[r]===e[i+1])o.push(e[i]),i++;else if(n&&s[r]==="**"&&e[i]===s[r+1])o.push(s[r]),r++;else if(e[i]==="*"&&s[r]&&(this.options.dot||!s[r].startsWith("."))&&s[r]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,r++}else if(s[r]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(s[r]),i++,r++}else return!1;return e.length===s.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,s=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)s=!s,n++;n&&(this.pattern=e.slice(n)),this.negate=s}matchOne(e,s,n=!1){let i=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),g=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),F=typeof s[0]=="string"&&/^[a-z]:$/i.test(s[0]),y=!F&&s[0]===""&&s[1]===""&&s[2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3]),C=g?3:m?0:void 0,w=y?3:F?0:void 0;if(typeof C=="number"&&typeof w=="number"){let[E,v]=[e[C],s[w]];E.toLowerCase()===v.toLowerCase()&&(s[w]=E,w>C?s=s.slice(w):C>w&&(e=e.slice(C)))}}let{optimizationLevel:r=1}=this.options;r>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:s}),this.debug("matchOne",e.length,s.length);for(var o=0,a=0,u=e.length,l=s.length;o<u&&a<l;o++,a++){this.debug("matchOne loop");var c=s[a],f=e[o];if(this.debug(s,c,f),c===!1)return!1;if(c===de){this.debug("GLOBSTAR",[s,c,f]);var d=o,p=a+1;if(p===l){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;d<u;){var D=e[d];if(this.debug(`
|
|
57
57
|
globstar while`,e,d,s,p,D),this.matchOne(e.slice(d),s.slice(p),n))return this.debug("globstar found match!",d,u,D),!0;if(D==="."||D===".."||!i.dot&&D.charAt(0)==="."){this.debug("dot detected!",e,d,s,p);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(n&&(this.debug(`
|
|
58
|
-
>>> no match, partial?`,e,d,s,p),d===u))}let m;if(typeof c=="string"?(m=f===c,this.debug("string match",c,f,m)):(m=c.test(f),this.debug("pattern match",c,f,m)),!m)return!1}if(o===u&&a===l)return!0;if(o===u)return n;if(a===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Ad(this.pattern,this.options)}parse(e){Nn(e);let s=this.options;if(e==="**")return fe;if(e==="")return"";let n,i=null;(n=e.match(Cw))?i=s.dot?Ew:ww:(n=e.match(cw))?i=(s.nocase?s.dot?pw:hw:s.dot?dw:fw)(n[1]):(n=e.match(bw))?i=(s.nocase?s.dot?xw:vw:s.dot?Sw:Aw)(n):(n=e.match(mw))?i=s.dot?gw:Dw:(n=e.match(yw))&&(i=Fw);let r=Ys.fromGlob(e,this.options).toMMPattern();return i&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:i}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let s=this.options,n=s.noglobstar?$w:s.dot?Bw:Tw,i=new Set(s.nocase?["i"]:[]),r=e.map(u=>{let l=u.map(f=>{if(f instanceof RegExp)for(let d of f.flags.split(""))i.add(d);return typeof f=="string"?Pw(f):f===fe?fe:f._src});l.forEach((f,d)=>{let p=l[d+1],D=l[d-1];f!==fe||D===fe||(D===void 0?p!==void 0&&p!==fe?l[d+1]="(?:\\/|"+n+"\\/)?"+p:l[d]=n:p===void 0?l[d-1]=D+"(?:\\/|\\/"+n+")?":p!==fe&&(l[d-1]=D+"(?:\\/|\\/"+n+"\\/)"+p,l[d+1]=fe))});let c=l.filter(f=>f!==fe);if(this.partial&&c.length>=1){let f=[];for(let d=1;d<=c.length;d++)f.push(c.slice(0,d).join("/"));return"(?:"+f.join("|")+")"}return c.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];r="^"+o+r+a+"$",this.partial&&(r="^(?:\\/|"+o+r.slice(1,-1)+a+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,s=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&s)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let r=this.set;this.debug(this.pattern,"set",r);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<r.length;a++){let u=r[a],l=i;if(n.matchBase&&u.length===1&&(l=[o]),this.matchOne(l,u,s))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return Fe.defaults(e).Minimatch}};Fe.AST=Ys;Fe.Minimatch=_e;Fe.escape=gs;Fe.unescape=Re});var Lw,_d,eu,$d,mr,kd,Mw,XA,It,Bd,Js,tu,ys,Td=L(()=>{Lw=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,_d=new Set,eu=typeof process=="object"&&process?process:{},$d=(t,e,s,n)=>{typeof eu.emitWarning=="function"?eu.emitWarning(t,e,s,n):console.error(`[${s}] ${e}: ${t}`)},mr=globalThis.AbortController,kd=globalThis.AbortSignal;if(typeof mr>"u"){kd=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},mr=class{constructor(){e()}signal=new kd;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let t=eu.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,$d("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Mw=t=>!_d.has(t),XA=Symbol("type"),It=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Bd=t=>It(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Js:null:null,Js=class extends Array{constructor(e){super(e),this.fill(0)}},tu=class t{heap;length;static#e=!1;static create(e){let s=Bd(e);if(!s)return[];t.#e=!0;let n=new t(e,s);return t.#e=!1,n}constructor(e,s){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new s(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ys=class t{#e;#s;#r;#i;#o;#C;#g;#c;get perf(){return this.#c}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#d;#f;#u;#n;#h;#w;#F;#p;#k;#m;#v;#x;#D;#y;#E;#S;#t;#R;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#D,autopurgeTimers:e.#y,sizes:e.#v,keyMap:e.#f,keyList:e.#u,valList:e.#n,next:e.#h,prev:e.#w,get head(){return e.#F},get tail(){return e.#p},free:e.#k,isBackgroundFetch:s=>e.#l(s),backgroundFetch:(s,n,i,r)=>e.#U(s,n,i,r),moveToTail:s=>e.#O(s),indexes:s=>e.#$(s),rindexes:s=>e.#B(s),isStale:s=>e.#b(s)}}get max(){return this.#e}get maxSize(){return this.#s}get calculatedSize(){return this.#d}get size(){return this.#a}get fetchMethod(){return this.#C}get memoMethod(){return this.#g}get dispose(){return this.#r}get onInsert(){return this.#i}get disposeAfter(){return this.#o}constructor(e){let{max:s=0,ttl:n,ttlResolution:i=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:p,maxSize:D=0,maxEntrySize:m=0,sizeCalculation:g,fetchMethod:F,memoMethod:y,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:_,ignoreFetchAbort:T,perf:E}=e;if(E!==void 0&&typeof E?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#c=E??Lw,s!==0&&!It(s))throw new TypeError("max option must be a nonnegative integer");let R=s?Bd(s):Array;if(!R)throw new Error("invalid max value: "+s);if(this.#e=s,this.#s=D,this.maxEntrySize=m||this.#s,this.sizeCalculation=g,this.sizeCalculation){if(!this.#s&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#g=y,F!==void 0&&typeof F!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#C=F,this.#S=!!F,this.#f=new Map,this.#u=new Array(s).fill(void 0),this.#n=new Array(s).fill(void 0),this.#h=new R(s),this.#w=new R(s),this.#F=0,this.#p=0,this.#k=tu.create(s),this.#a=0,this.#d=0,typeof l=="function"&&(this.#r=l),typeof c=="function"&&(this.#i=c),typeof f=="function"?(this.#o=f,this.#m=[]):(this.#o=void 0,this.#m=void 0),this.#E=!!this.#r,this.#R=!!this.#i,this.#t=!!this.#o,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(this.#s!==0&&!It(this.#s))throw new TypeError("maxSize must be a positive integer if specified");if(!It(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=It(i)||i===0?i:1,this.ttlAutopurge=!!r,this.ttl=n||0,this.ttl){if(!It(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T()}if(this.#e===0&&this.ttl===0&&this.#s===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#s){let K="LRU_CACHE_UNBOUNDED";Mw(K)&&(_d.add(K),$d("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",K,t))}}getRemainingTTL(e){return this.#f.has(e)?1/0:0}#T(){let e=new Js(this.#e),s=new Js(this.#e);this.#D=e,this.#x=s;let n=this.ttlAutopurge?new Array(this.#e):void 0;this.#y=n,this.#L=(o,a,u=this.#c.now())=>{if(s[o]=a!==0?u:0,e[o]=a,n?.[o]&&(clearTimeout(n[o]),n[o]=void 0),a!==0&&n){let l=setTimeout(()=>{this.#b(o)&&this.#_(this.#u[o],"expire")},a+1);l.unref&&l.unref(),n[o]=l}},this.#A=o=>{s[o]=e[o]!==0?this.#c.now():0},this.#I=(o,a)=>{if(e[a]){let u=e[a],l=s[a];if(!u||!l)return;o.ttl=u,o.start=l,o.now=i||r();let c=o.now-l;o.remainingTTL=u-c}};let i=0,r=()=>{let o=this.#c.now();if(this.ttlResolution>0){i=o;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{let a=this.#f.get(o);if(a===void 0)return 0;let u=e[a],l=s[a];if(!u||!l)return 1/0;let c=(i||r())-l;return u-c},this.#b=o=>{let a=s[o],u=e[o];return!!u&&!!a&&(i||r())-a>u}}#A=()=>{};#I=()=>{};#L=()=>{};#b=()=>!1;#V(){let e=new Js(this.#e);this.#d=0,this.#v=e,this.#P=s=>{this.#d-=e[s],e[s]=0},this.#M=(s,n,i,r)=>{if(this.#l(n))return 0;if(!It(i))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(i=r(n,s),!It(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#N=(s,n,i)=>{if(e[s]=n,this.#s){let r=this.#s-e[s];for(;this.#d>r;)this.#q(!0)}this.#d+=e[s],i&&(i.entrySize=n,i.totalCalculatedSize=this.#d)}}#P=e=>{};#N=(e,s,n)=>{};#M=(e,s,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#$({allowStale:e=this.allowStale}={}){if(this.#a)for(let s=this.#p;!(!this.#j(s)||((e||!this.#b(s))&&(yield s),s===this.#F));)s=this.#w[s]}*#B({allowStale:e=this.allowStale}={}){if(this.#a)for(let s=this.#F;!(!this.#j(s)||((e||!this.#b(s))&&(yield s),s===this.#p));)s=this.#h[s]}#j(e){return e!==void 0&&this.#f.get(this.#u[e])===e}*entries(){for(let e of this.#$())this.#n[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#n[e])&&(yield[this.#u[e],this.#n[e]])}*rentries(){for(let e of this.#B())this.#n[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#n[e])&&(yield[this.#u[e],this.#n[e]])}*keys(){for(let e of this.#$()){let s=this.#u[e];s!==void 0&&!this.#l(this.#n[e])&&(yield s)}}*rkeys(){for(let e of this.#B()){let s=this.#u[e];s!==void 0&&!this.#l(this.#n[e])&&(yield s)}}*values(){for(let e of this.#$())this.#n[e]!==void 0&&!this.#l(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#B())this.#n[e]!==void 0&&!this.#l(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,s={}){for(let n of this.#$()){let i=this.#n[n],r=this.#l(i)?i.__staleWhileFetching:i;if(r!==void 0&&e(r,this.#u[n],this))return this.get(this.#u[n],s)}}forEach(e,s=this){for(let n of this.#$()){let i=this.#n[n],r=this.#l(i)?i.__staleWhileFetching:i;r!==void 0&&e.call(s,r,this.#u[n],this)}}rforEach(e,s=this){for(let n of this.#B()){let i=this.#n[n],r=this.#l(i)?i.__staleWhileFetching:i;r!==void 0&&e.call(s,r,this.#u[n],this)}}purgeStale(){let e=!1;for(let s of this.#B({allowStale:!0}))this.#b(s)&&(this.#_(this.#u[s],"expire"),e=!0);return e}info(e){let s=this.#f.get(e);if(s===void 0)return;let n=this.#n[s],i=this.#l(n)?n.__staleWhileFetching:n;if(i===void 0)return;let r={value:i};if(this.#D&&this.#x){let o=this.#D[s],a=this.#x[s];if(o&&a){let u=o-(this.#c.now()-a);r.ttl=u,r.start=Date.now()}}return this.#v&&(r.size=this.#v[s]),r}dump(){let e=[];for(let s of this.#$({allowStale:!0})){let n=this.#u[s],i=this.#n[s],r=this.#l(i)?i.__staleWhileFetching:i;if(r===void 0||n===void 0)continue;let o={value:r};if(this.#D&&this.#x){o.ttl=this.#D[s];let a=this.#c.now()-this.#x[s];o.start=Math.floor(Date.now()-a)}this.#v&&(o.size=this.#v[s]),e.unshift([n,o])}return e}load(e){this.clear();for(let[s,n]of e){if(n.start){let i=Date.now()-n.start;n.start=this.#c.now()-i}this.set(s,n.value,n)}}set(e,s,n={}){if(s===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,c=this.#M(e,s,n.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#_(e,"set"),this;let f=this.#a===0?void 0:this.#f.get(e);if(f===void 0)f=this.#a===0?this.#p:this.#k.length!==0?this.#k.pop():this.#a===this.#e?this.#q(!1):this.#a,this.#u[f]=e,this.#n[f]=s,this.#f.set(e,f),this.#h[this.#p]=f,this.#w[f]=this.#p,this.#p=f,this.#a++,this.#N(f,c,u),u&&(u.set="add"),l=!1,this.#R&&this.#i?.(s,e,"add");else{this.#O(f);let d=this.#n[f];if(s!==d){if(this.#S&&this.#l(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=d;p!==void 0&&!o&&(this.#E&&this.#r?.(p,e,"set"),this.#t&&this.#m?.push([p,e,"set"]))}else o||(this.#E&&this.#r?.(d,e,"set"),this.#t&&this.#m?.push([d,e,"set"]));if(this.#P(f),this.#N(f,c,u),this.#n[f]=s,u){u.set="replace";let p=d&&this.#l(d)?d.__staleWhileFetching:d;p!==void 0&&(u.oldValue=p)}}else u&&(u.set="update");this.#R&&this.onInsert?.(s,e,s===d?"update":"replace")}if(i!==0&&!this.#D&&this.#T(),this.#D&&(l||this.#L(f,i,r),u&&this.#I(u,f)),!o&&this.#t&&this.#m){let d=this.#m,p;for(;p=d?.shift();)this.#o?.(...p)}return this}pop(){try{for(;this.#a;){let e=this.#n[this.#F];if(this.#q(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#t&&this.#m){let e=this.#m,s;for(;s=e?.shift();)this.#o?.(...s)}}}#q(e){let s=this.#F,n=this.#u[s],i=this.#n[s];return this.#S&&this.#l(i)?i.__abortController.abort(new Error("evicted")):(this.#E||this.#t)&&(this.#E&&this.#r?.(i,n,"evict"),this.#t&&this.#m?.push([i,n,"evict"])),this.#P(s),this.#y?.[s]&&(clearTimeout(this.#y[s]),this.#y[s]=void 0),e&&(this.#u[s]=void 0,this.#n[s]=void 0,this.#k.push(s)),this.#a===1?(this.#F=this.#p=0,this.#k.length=0):this.#F=this.#h[s],this.#f.delete(n),this.#a--,s}has(e,s={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=s,r=this.#f.get(e);if(r!==void 0){let o=this.#n[r];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(r))i&&(i.has="stale",this.#I(i,r));else return n&&this.#A(r),i&&(i.has="hit",this.#I(i,r)),!0}else i&&(i.has="miss");return!1}peek(e,s={}){let{allowStale:n=this.allowStale}=s,i=this.#f.get(e);if(i===void 0||!n&&this.#b(i))return;let r=this.#n[i];return this.#l(r)?r.__staleWhileFetching:r}#U(e,s,n,i){let r=s===void 0?void 0:this.#n[s];if(this.#l(r))return r;let o=new mr,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:n,context:i},l=(m,g=!1)=>{let{aborted:F}=o.signal,y=n.ignoreFetchAbort&&m!==void 0;if(n.status&&(F&&!g?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,y&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),F&&!y&&!g)return f(o.signal.reason);let C=p,w=this.#n[s];return(w===p||y&&g&&w===void 0)&&(m===void 0?C.__staleWhileFetching!==void 0?this.#n[s]=C.__staleWhileFetching:this.#_(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,m,u.options))),m},c=m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),f(m)),f=m=>{let{aborted:g}=o.signal,F=g&&n.allowStaleOnFetchAbort,y=F||n.allowStaleOnFetchRejection,C=y||n.noDeleteOnFetchRejection,w=p;if(this.#n[s]===p&&(!C||w.__staleWhileFetching===void 0?this.#_(e,"fetch"):F||(this.#n[s]=w.__staleWhileFetching)),y)return n.status&&w.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw m},d=(m,g)=>{let F=this.#C?.(e,r,u);F&&F instanceof Promise&&F.then(y=>m(y===void 0?void 0:y),g),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=y=>l(y,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(d).then(l,c),D=Object.assign(p,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return s===void 0?(this.set(e,D,{...u.options,status:void 0}),s=this.#f.get(e)):this.#n[s]=D,D}#l(e){if(!this.#S)return!1;let s=e;return!!s&&s instanceof Promise&&s.hasOwnProperty("__staleWhileFetching")&&s.__abortController instanceof mr}async fetch(e,s={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:D=this.allowStaleOnFetchAbort,context:m,forceRefresh:g=!1,status:F,signal:y}=s;if(!this.#S)return F&&(F.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:F});let C={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:D,ignoreFetchAbort:p,status:F,signal:y},w=this.#f.get(e);if(w===void 0){F&&(F.fetch="miss");let b=this.#U(e,w,C,m);return b.__returned=b}else{let b=this.#n[w];if(this.#l(b)){let K=n&&b.__staleWhileFetching!==void 0;return F&&(F.fetch="inflight",K&&(F.returnedStale=!0)),K?b.__staleWhileFetching:b.__returned=b}let _=this.#b(w);if(!g&&!_)return F&&(F.fetch="hit"),this.#O(w),i&&this.#A(w),F&&this.#I(F,w),b;let T=this.#U(e,w,C,m),R=T.__staleWhileFetching!==void 0&&n;return F&&(F.fetch=_?"stale":"refresh",R&&_&&(F.returnedStale=!0)),R?T.__staleWhileFetching:T.__returned=T}}async forceFetch(e,s={}){let n=await this.fetch(e,s);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,s={}){let n=this.#g;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:r,...o}=s,a=this.get(e,o);if(!r&&a!==void 0)return a;let u=n(e,a,{options:o,context:i});return this.set(e,u,o),u}get(e,s={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=s,a=this.#f.get(e);if(a!==void 0){let u=this.#n[a],l=this.#l(u);return o&&this.#I(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&n&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?u.__staleWhileFetching:void 0):(r||this.#_(e,"expire"),o&&n&&(o.returnedStale=!0),n?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(this.#O(a),i&&this.#A(a),u))}else o&&(o.get="miss")}#W(e,s){this.#w[s]=e,this.#h[e]=s}#O(e){e!==this.#p&&(e===this.#F?this.#F=this.#h[e]:this.#W(this.#w[e],this.#h[e]),this.#W(this.#p,e),this.#p=e)}delete(e){return this.#_(e,"delete")}#_(e,s){let n=!1;if(this.#a!==0){let i=this.#f.get(e);if(i!==void 0)if(this.#y?.[i]&&(clearTimeout(this.#y?.[i]),this.#y[i]=void 0),n=!0,this.#a===1)this.#G(s);else{this.#P(i);let r=this.#n[i];if(this.#l(r)?r.__abortController.abort(new Error("deleted")):(this.#E||this.#t)&&(this.#E&&this.#r?.(r,e,s),this.#t&&this.#m?.push([r,e,s])),this.#f.delete(e),this.#u[i]=void 0,this.#n[i]=void 0,i===this.#p)this.#p=this.#w[i];else if(i===this.#F)this.#F=this.#h[i];else{let o=this.#w[i];this.#h[o]=this.#h[i];let a=this.#h[i];this.#w[a]=this.#w[i]}this.#a--,this.#k.push(i)}}if(this.#t&&this.#m?.length){let i=this.#m,r;for(;r=i?.shift();)this.#o?.(...r)}return n}clear(){return this.#G("delete")}#G(e){for(let s of this.#B({allowStale:!0})){let n=this.#n[s];if(this.#l(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#u[s];this.#E&&this.#r?.(n,i,e),this.#t&&this.#m?.push([n,i,e])}}if(this.#f.clear(),this.#n.fill(void 0),this.#u.fill(void 0),this.#D&&this.#x){this.#D.fill(0),this.#x.fill(0);for(let s of this.#y??[])s!==void 0&&clearTimeout(s);this.#y?.fill(void 0)}if(this.#v&&this.#v.fill(0),this.#F=0,this.#p=0,this.#k.length=0,this.#d=0,this.#a=0,this.#t&&this.#m){let s=this.#m,n;for(;n=s?.shift();)this.#o?.(...n)}}}});var Er,uu,Pd,Id,jw,qw,Uw,Dt,gt,Rt,Dr,Pn,gr,Rd,yr,Nd,Ke,Hs,re,Ln,Zs,oe,Ce,ae,su,Fr,De,ee,nu,iu,Od,ru,nt,ou,Cr,Mn,Fs,$e,jn,Ww,Vw,Gw,zw,wr,au,Kw,Yw,Nt,lu=L(()=>{Er=require("node:events"),uu=bt(require("node:stream"),1),Pd=require("node:string_decoder"),Id=typeof process=="object"&&process?process:{stdout:null,stderr:null},jw=t=>!!t&&typeof t=="object"&&(t instanceof Nt||t instanceof uu.default||qw(t)||Uw(t)),qw=t=>!!t&&typeof t=="object"&&t instanceof Er.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==uu.default.Writable.prototype.pipe,Uw=t=>!!t&&typeof t=="object"&&t instanceof Er.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",Dt=Symbol("EOF"),gt=Symbol("maybeEmitEnd"),Rt=Symbol("emittedEnd"),Dr=Symbol("emittingEnd"),Pn=Symbol("emittedError"),gr=Symbol("closed"),Rd=Symbol("read"),yr=Symbol("flush"),Nd=Symbol("flushChunk"),Ke=Symbol("encoding"),Hs=Symbol("decoder"),re=Symbol("flowing"),Ln=Symbol("paused"),Zs=Symbol("resume"),oe=Symbol("buffer"),Ce=Symbol("pipes"),ae=Symbol("bufferLength"),su=Symbol("bufferPush"),Fr=Symbol("bufferShift"),De=Symbol("objectMode"),ee=Symbol("destroyed"),nu=Symbol("error"),iu=Symbol("emitData"),Od=Symbol("emitEnd"),ru=Symbol("emitEnd2"),nt=Symbol("async"),ou=Symbol("abort"),Cr=Symbol("aborted"),Mn=Symbol("signal"),Fs=Symbol("dataListeners"),$e=Symbol("discarded"),jn=t=>Promise.resolve().then(t),Ww=t=>t(),Vw=t=>t==="end"||t==="finish"||t==="prefinish",Gw=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,zw=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),wr=class{src;dest;opts;ondrain;constructor(e,s,n){this.src=e,this.dest=s,this.opts=n,this.ondrain=()=>e[Zs](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},au=class extends wr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,s,n){super(e,s,n),this.proxyErrors=i=>s.emit("error",i),e.on("error",this.proxyErrors)}},Kw=t=>!!t.objectMode,Yw=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Nt=class extends Er.EventEmitter{[re]=!1;[Ln]=!1;[Ce]=[];[oe]=[];[De];[Ke];[nt];[Hs];[Dt]=!1;[Rt]=!1;[Dr]=!1;[gr]=!1;[Pn]=null;[ae]=0;[ee]=!1;[Mn];[Cr]=!1;[Fs]=0;[$e]=!1;writable=!0;readable=!0;constructor(...e){let s=e[0]||{};if(super(),s.objectMode&&typeof s.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Kw(s)?(this[De]=!0,this[Ke]=null):Yw(s)?(this[Ke]=s.encoding,this[De]=!1):(this[De]=!1,this[Ke]=null),this[nt]=!!s.async,this[Hs]=this[Ke]?new Pd.StringDecoder(this[Ke]):null,s&&s.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[oe]}),s&&s.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Ce]});let{signal:n}=s;n&&(this[Mn]=n,n.aborted?this[ou]():n.addEventListener("abort",()=>this[ou]()))}get bufferLength(){return this[ae]}get encoding(){return this[Ke]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[De]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[nt]}set async(e){this[nt]=this[nt]||!!e}[ou](){this[Cr]=!0,this.emit("abort",this[Mn]?.reason),this.destroy(this[Mn]?.reason)}get aborted(){return this[Cr]}set aborted(e){}write(e,s,n){if(this[Cr])return!1;if(this[Dt])throw new Error("write after end");if(this[ee])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof s=="function"&&(n=s,s="utf8"),s||(s="utf8");let i=this[nt]?jn:Ww;if(!this[De]&&!Buffer.isBuffer(e)){if(zw(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Gw(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[De]?(this[re]&&this[ae]!==0&&this[yr](!0),this[re]?this.emit("data",e):this[su](e),this[ae]!==0&&this.emit("readable"),n&&i(n),this[re]):e.length?(typeof e=="string"&&!(s===this[Ke]&&!this[Hs]?.lastNeed)&&(e=Buffer.from(e,s)),Buffer.isBuffer(e)&&this[Ke]&&(e=this[Hs].write(e)),this[re]&&this[ae]!==0&&this[yr](!0),this[re]?this.emit("data",e):this[su](e),this[ae]!==0&&this.emit("readable"),n&&i(n),this[re]):(this[ae]!==0&&this.emit("readable"),n&&i(n),this[re])}read(e){if(this[ee])return null;if(this[$e]=!1,this[ae]===0||e===0||e&&e>this[ae])return this[gt](),null;this[De]&&(e=null),this[oe].length>1&&!this[De]&&(this[oe]=[this[Ke]?this[oe].join(""):Buffer.concat(this[oe],this[ae])]);let s=this[Rd](e||null,this[oe][0]);return this[gt](),s}[Rd](e,s){if(this[De])this[Fr]();else{let n=s;e===n.length||e===null?this[Fr]():typeof n=="string"?(this[oe][0]=n.slice(e),s=n.slice(0,e),this[ae]-=e):(this[oe][0]=n.subarray(e),s=n.subarray(0,e),this[ae]-=e)}return this.emit("data",s),!this[oe].length&&!this[Dt]&&this.emit("drain"),s}end(e,s,n){return typeof e=="function"&&(n=e,e=void 0),typeof s=="function"&&(n=s,s="utf8"),e!==void 0&&this.write(e,s),n&&this.once("end",n),this[Dt]=!0,this.writable=!1,(this[re]||!this[Ln])&&this[gt](),this}[Zs](){this[ee]||(!this[Fs]&&!this[Ce].length&&(this[$e]=!0),this[Ln]=!1,this[re]=!0,this.emit("resume"),this[oe].length?this[yr]():this[Dt]?this[gt]():this.emit("drain"))}resume(){return this[Zs]()}pause(){this[re]=!1,this[Ln]=!0,this[$e]=!1}get destroyed(){return this[ee]}get flowing(){return this[re]}get paused(){return this[Ln]}[su](e){this[De]?this[ae]+=1:this[ae]+=e.length,this[oe].push(e)}[Fr](){return this[De]?this[ae]-=1:this[ae]-=this[oe][0].length,this[oe].shift()}[yr](e=!1){do;while(this[Nd](this[Fr]())&&this[oe].length);!e&&!this[oe].length&&!this[Dt]&&this.emit("drain")}[Nd](e){return this.emit("data",e),this[re]}pipe(e,s){if(this[ee])return e;this[$e]=!1;let n=this[Rt];return s=s||{},e===Id.stdout||e===Id.stderr?s.end=!1:s.end=s.end!==!1,s.proxyErrors=!!s.proxyErrors,n?s.end&&e.end():(this[Ce].push(s.proxyErrors?new au(this,e,s):new wr(this,e,s)),this[nt]?jn(()=>this[Zs]()):this[Zs]()),e}unpipe(e){let s=this[Ce].find(n=>n.dest===e);s&&(this[Ce].length===1?(this[re]&&this[Fs]===0&&(this[re]=!1),this[Ce]=[]):this[Ce].splice(this[Ce].indexOf(s),1),s.unpipe())}addListener(e,s){return this.on(e,s)}on(e,s){let n=super.on(e,s);if(e==="data")this[$e]=!1,this[Fs]++,!this[Ce].length&&!this[re]&&this[Zs]();else if(e==="readable"&&this[ae]!==0)super.emit("readable");else if(Vw(e)&&this[Rt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Pn]){let i=s;this[nt]?jn(()=>i.call(this,this[Pn])):i.call(this,this[Pn])}return n}removeListener(e,s){return this.off(e,s)}off(e,s){let n=super.off(e,s);return e==="data"&&(this[Fs]=this.listeners("data").length,this[Fs]===0&&!this[$e]&&!this[Ce].length&&(this[re]=!1)),n}removeAllListeners(e){let s=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Fs]=0,!this[$e]&&!this[Ce].length&&(this[re]=!1)),s}get emittedEnd(){return this[Rt]}[gt](){!this[Dr]&&!this[Rt]&&!this[ee]&&this[oe].length===0&&this[Dt]&&(this[Dr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[gr]&&this.emit("close"),this[Dr]=!1)}emit(e,...s){let n=s[0];if(e!=="error"&&e!=="close"&&e!==ee&&this[ee])return!1;if(e==="data")return!this[De]&&!n?!1:this[nt]?(jn(()=>this[iu](n)),!0):this[iu](n);if(e==="end")return this[Od]();if(e==="close"){if(this[gr]=!0,!this[Rt]&&!this[ee])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(e==="error"){this[Pn]=n,super.emit(nu,n);let r=!this[Mn]||this.listeners("error").length?super.emit("error",n):!1;return this[gt](),r}else if(e==="resume"){let r=super.emit("resume");return this[gt](),r}else if(e==="finish"||e==="prefinish"){let r=super.emit(e);return this.removeAllListeners(e),r}let i=super.emit(e,...s);return this[gt](),i}[iu](e){for(let n of this[Ce])n.dest.write(e)===!1&&this.pause();let s=this[$e]?!1:super.emit("data",e);return this[gt](),s}[Od](){return this[Rt]?!1:(this[Rt]=!0,this.readable=!1,this[nt]?(jn(()=>this[ru]()),!0):this[ru]())}[ru](){if(this[Hs]){let s=this[Hs].end();if(s){for(let n of this[Ce])n.dest.write(s);this[$e]||super.emit("data",s)}}for(let s of this[Ce])s.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[De]||(e.dataLength=0);let s=this.promise();return this.on("data",n=>{e.push(n),this[De]||(e.dataLength+=n.length)}),await s,e}async concat(){if(this[De])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Ke]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,s)=>{this.on(ee,()=>s(new Error("stream destroyed"))),this.on("error",n=>s(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[$e]=!1;let e=!1,s=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return s();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Dt])return s();let r,o,a=f=>{this.off("data",u),this.off("end",l),this.off(ee,c),s(),o(f)},u=f=>{this.off("error",a),this.off("end",l),this.off(ee,c),this.pause(),r({value:f,done:!!this[Dt]})},l=()=>{this.off("error",a),this.off("data",u),this.off(ee,c),s(),r({done:!0,value:void 0})},c=()=>a(new Error("stream destroyed"));return new Promise((f,d)=>{o=d,r=f,this.once(ee,c),this.once("error",a),this.once("end",l),this.once("data",u)})},throw:s,return:s,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[$e]=!1;let e=!1,s=()=>(this.pause(),this.off(nu,s),this.off(ee,s),this.off("end",s),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return s();let i=this.read();return i===null?s():{done:!1,value:i}};return this.once("end",s),this.once(nu,s),this.once(ee,s),{next:n,throw:s,return:s,[Symbol.iterator](){return this}}}destroy(e){if(this[ee])return e?this.emit("error",e):this.emit(ee),this;this[ee]=!0,this[$e]=!0,this[oe].length=0,this[ae]=0;let s=this;return typeof s.close=="function"&&!this[gr]&&s.close(),e?this.emit("error",e):this.emit(ee),this}static get isStream(){return jw}}});var Qs,Ud,rt,Jw,Ot,Hw,Un,Wd,Vd,Zw,Qw,Pe,Gd,zd,it,Kd,Yd,Cs,Jd,Oe,qn,cu,Ld,Wn,Ye,br,xr,Md,Xw,fu,jd,Vn,qd,vr,Sr,du,Hd,ge,Ar,kr,_r,Xs,en,Gn,i3,Zd,Qd=L(()=>{Td();Qs=require("node:path"),Ud=require("node:url"),rt=require("fs"),Jw=bt(require("node:fs"),1),Ot=require("node:fs/promises");lu();Hw=rt.realpathSync.native,Un={lstatSync:rt.lstatSync,readdir:rt.readdir,readdirSync:rt.readdirSync,readlinkSync:rt.readlinkSync,realpathSync:Hw,promises:{lstat:Ot.lstat,readdir:Ot.readdir,readlink:Ot.readlink,realpath:Ot.realpath}},Wd=t=>!t||t===Un||t===Jw?Un:{...Un,...t,promises:{...Un.promises,...t.promises||{}}},Vd=/^\\\\\?\\([a-z]:)\\?$/i,Zw=t=>t.replace(/\//g,"\\").replace(Vd,"$1\\"),Qw=/[\\\/]/,Pe=0,Gd=1,zd=2,it=4,Kd=6,Yd=8,Cs=10,Jd=12,Oe=15,qn=~Oe,cu=16,Ld=32,Wn=64,Ye=128,br=256,xr=512,Md=Wn|Ye|xr,Xw=1023,fu=t=>t.isFile()?Yd:t.isDirectory()?it:t.isSymbolicLink()?Cs:t.isCharacterDevice()?zd:t.isBlockDevice()?Kd:t.isSocket()?Jd:t.isFIFO()?Gd:Pe,jd=new ys({max:2**12}),Vn=t=>{let e=jd.get(t);if(e)return e;let s=t.normalize("NFKD");return jd.set(t,s),s},qd=new ys({max:2**12}),vr=t=>{let e=qd.get(t);if(e)return e;let s=Vn(t.toLowerCase());return qd.set(t,s),s},Sr=class extends ys{constructor(){super({max:256})}},du=class extends ys{constructor(e=16*1024){super({maxSize:e,sizeCalculation:s=>s.length+1})}},Hd=Symbol("PathScurry setAsCwd"),ge=class{name;root;roots;parent;nocase;isCWD=!1;#e;#s;get dev(){return this.#s}#r;get mode(){return this.#r}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#C;get gid(){return this.#C}#g;get rdev(){return this.#g}#c;get blksize(){return this.#c}#a;get ino(){return this.#a}#d;get size(){return this.#d}#f;get blocks(){return this.#f}#u;get atimeMs(){return this.#u}#n;get mtimeMs(){return this.#n}#h;get ctimeMs(){return this.#h}#w;get birthtimeMs(){return this.#w}#F;get atime(){return this.#F}#p;get mtime(){return this.#p}#k;get ctime(){return this.#k}#m;get birthtime(){return this.#m}#v;#x;#D;#y;#E;#S;#t;#R;#T;#A;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,s=Pe,n,i,r,o,a){this.name=e,this.#v=r?vr(e):Vn(e),this.#t=s&Xw,this.nocase=r,this.roots=i,this.root=n||this,this.#R=o,this.#D=a.fullpath,this.#E=a.relative,this.#S=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=Wd(a.fs)}depth(){return this.#x!==void 0?this.#x:this.parent?this.#x=this.parent.depth()+1:this.#x=0}childrenCache(){return this.#R}resolve(e){if(!e)return this;let s=this.getRootString(e),i=e.substring(s.length).split(this.splitSep);return s?this.getRoot(s).#I(i):this.#I(i)}#I(e){let s=this;for(let n of e)s=s.child(n);return s}children(){let e=this.#R.get(this);if(e)return e;let s=Object.assign([],{provisional:0});return this.#R.set(this,s),this.#t&=~cu,s}child(e,s){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?vr(e):Vn(e);for(let u of n)if(u.#v===i)return u;let r=this.parent?this.sep:"",o=this.#D?this.#D+r+e:void 0,a=this.newChild(e,Pe,{...s,parent:this,fullpath:o});return this.canReaddir()||(a.#t|=Ye),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#E!==void 0)return this.#E;let e=this.name,s=this.parent;if(!s)return this.#E=this.name;let n=s.relative();return n+(!n||!s.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#S!==void 0)return this.#S;let e=this.name,s=this.parent;if(!s)return this.#S=this.fullpathPosix();let n=s.relativePosix();return n+(!n||!s.parent?"":"/")+e}fullpath(){if(this.#D!==void 0)return this.#D;let e=this.name,s=this.parent;if(!s)return this.#D=this.name;let i=s.fullpath()+(s.parent?this.sep:"")+e;return this.#D=i}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#y=`//?/${i}`:this.#y=i}let e=this.parent,s=e.fullpathPosix(),n=s+(!s||!e.parent?"":"/")+this.name;return this.#y=n}isUnknown(){return(this.#t&Oe)===Pe}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#t&Oe)===Yd}isDirectory(){return(this.#t&Oe)===it}isCharacterDevice(){return(this.#t&Oe)===zd}isBlockDevice(){return(this.#t&Oe)===Kd}isFIFO(){return(this.#t&Oe)===Gd}isSocket(){return(this.#t&Oe)===Jd}isSymbolicLink(){return(this.#t&Cs)===Cs}lstatCached(){return this.#t&Ld?this:void 0}readlinkCached(){return this.#T}realpathCached(){return this.#A}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#T)return!0;if(!this.parent)return!1;let e=this.#t&Oe;return!(e!==Pe&&e!==Cs||this.#t&br||this.#t&Ye)}calledReaddir(){return!!(this.#t&cu)}isENOENT(){return!!(this.#t&Ye)}isNamed(e){return this.nocase?this.#v===vr(e):this.#v===Vn(e)}async readlink(){let e=this.#T;if(e)return e;if(this.canReadlink()&&this.parent)try{let s=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(s);if(n)return this.#T=n}catch(s){this.#B(s.code);return}}readlinkSync(){let e=this.#T;if(e)return e;if(this.canReadlink()&&this.parent)try{let s=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(s);if(n)return this.#T=n}catch(s){this.#B(s.code);return}}#L(e){this.#t|=cu;for(let s=e.provisional;s<e.length;s++){let n=e[s];n&&n.#b()}}#b(){this.#t&Ye||(this.#t=(this.#t|Ye)&qn,this.#V())}#V(){let e=this.children();e.provisional=0;for(let s of e)s.#b()}#P(){this.#t|=xr,this.#N()}#N(){if(this.#t&Wn)return;let e=this.#t;(e&Oe)===it&&(e&=qn),this.#t=e|Wn,this.#V()}#M(e=""){e==="ENOTDIR"||e==="EPERM"?this.#N():e==="ENOENT"?this.#b():this.children().provisional=0}#$(e=""){e==="ENOTDIR"?this.parent.#N():e==="ENOENT"&&this.#b()}#B(e=""){let s=this.#t;s|=br,e==="ENOENT"&&(s|=Ye),(e==="EINVAL"||e==="UNKNOWN")&&(s&=qn),this.#t=s,e==="ENOTDIR"&&this.parent&&this.parent.#N()}#j(e,s){return this.#U(e,s)||this.#q(e,s)}#q(e,s){let n=fu(e),i=this.newChild(e.name,n,{parent:this}),r=i.#t&Oe;return r!==it&&r!==Cs&&r!==Pe&&(i.#t|=Wn),s.unshift(i),s.provisional++,i}#U(e,s){for(let n=s.provisional;n<s.length;n++){let i=s[n];if((this.nocase?vr(e.name):Vn(e.name))===i.#v)return this.#l(e,i,n,s)}}#l(e,s,n,i){let r=s.name;return s.#t=s.#t&qn|fu(e),r!==e.name&&(s.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(s)),i.provisional++,s}async lstat(){if((this.#t&Ye)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#$(e.code)}}lstatSync(){if((this.#t&Ye)===0)try{return this.#W(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#$(e.code)}}#W(e){let{atime:s,atimeMs:n,birthtime:i,birthtimeMs:r,blksize:o,blocks:a,ctime:u,ctimeMs:l,dev:c,gid:f,ino:d,mode:p,mtime:D,mtimeMs:m,nlink:g,rdev:F,size:y,uid:C}=e;this.#F=s,this.#u=n,this.#m=i,this.#w=r,this.#c=o,this.#f=a,this.#k=u,this.#h=l,this.#s=c,this.#C=f,this.#a=d,this.#r=p,this.#p=D,this.#n=m,this.#i=g,this.#g=F,this.#d=y,this.#o=C;let w=fu(e);this.#t=this.#t&qn|w|Ld,w!==Pe&&w!==it&&w!==Cs&&(this.#t|=Wn)}#O=[];#_=!1;#G(e){this.#_=!1;let s=this.#O.slice();this.#O.length=0,s.forEach(n=>n(null,e))}readdirCB(e,s=!1){if(!this.canReaddir()){s?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let r=n.slice(0,n.provisional);s?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#O.push(e),this.#_)return;this.#_=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(r,o)=>{if(r)this.#M(r.code),n.provisional=0;else{for(let a of o)this.#j(a,n);this.#L(n)}this.#G(n.slice(0,n.provisional))})}#z;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let s=this.fullpath();if(this.#z)await this.#z;else{let n=()=>{};this.#z=new Promise(i=>n=i);try{for(let i of await this.#e.promises.readdir(s,{withFileTypes:!0}))this.#j(i,e);this.#L(e)}catch(i){this.#M(i.code),e.provisional=0}this.#z=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let s=this.fullpath();try{for(let n of this.#e.readdirSync(s,{withFileTypes:!0}))this.#j(n,e);this.#L(e)}catch(n){this.#M(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#t&Md)return!1;let e=Oe&this.#t;return e===Pe||e===it||e===Cs}shouldWalk(e,s){return(this.#t&it)===it&&!(this.#t&Md)&&!e.has(this)&&(!s||s(this))}async realpath(){if(this.#A)return this.#A;if(!((xr|br|Ye)&this.#t))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#A=this.resolve(e)}catch{this.#P()}}realpathSync(){if(this.#A)return this.#A;if(!((xr|br|Ye)&this.#t))try{let e=this.#e.realpathSync(this.fullpath());return this.#A=this.resolve(e)}catch{this.#P()}}[Hd](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let s=new Set([]),n=[],i=this;for(;i&&i.parent;)s.add(i),i.#E=n.join(this.sep),i.#S=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!s.has(i);)i.#E=void 0,i.#S=void 0,i=i.parent}},Ar=class t extends ge{sep="\\";splitSep=Qw;constructor(e,s=Pe,n,i,r,o,a){super(e,s,n,i,r,o,a)}newChild(e,s=Pe,n={}){return new t(e,s,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Qs.win32.parse(e).root}getRoot(e){if(e=Zw(e.toUpperCase()),e===this.root.name)return this.root;for(let[s,n]of Object.entries(this.roots))if(this.sameRoot(e,s))return this.roots[e]=n;return this.roots[e]=new Xs(e,this).root}sameRoot(e,s=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Vd,"$1\\"),e===s}},kr=class t extends ge{splitSep="/";sep="/";constructor(e,s=Pe,n,i,r,o,a){super(e,s,n,i,r,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,s=Pe,n={}){return new t(e,s,this.root,this.roots,this.nocase,this.childrenCache(),n)}},_r=class{root;rootPath;roots;cwd;#e;#s;#r;nocase;#i;constructor(e=process.cwd(),s,n,{nocase:i,childrenCacheSize:r=16*1024,fs:o=Un}={}){this.#i=Wd(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,Ud.fileURLToPath)(e));let a=s.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new Sr,this.#s=new Sr,this.#r=new du(r);let u=a.substring(this.rootPath.length).split(n);if(u.length===1&&!u[0]&&u.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let l=this.root,c=u.length-1,f=s.sep,d=this.rootPath,p=!1;for(let D of u){let m=c--;l=l.child(D,{relative:new Array(m).fill("..").join(f),relativePosix:new Array(m).fill("..").join("/"),fullpath:d+=(p?"":f)+D}),p=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let s="";for(let r=e.length-1;r>=0;r--){let o=e[r];if(!(!o||o===".")&&(s=s?`${o}/${s}`:o,this.isAbsolute(o)))break}let n=this.#e.get(s);if(n!==void 0)return n;let i=this.cwd.resolve(s).fullpath();return this.#e.set(s,i),i}resolvePosix(...e){let s="";for(let r=e.length-1;r>=0;r--){let o=e[r];if(!(!o||o===".")&&(s=s?`${o}/${s}`:o,this.isAbsolute(o)))break}let n=this.#s.get(s);if(n!==void 0)return n;let i=this.cwd.resolve(s).fullpathPosix();return this.#s.set(s,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,s={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ge||(s=e,e=this.cwd);let{withFileTypes:n}=s;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(r=>r.name)}else return[]}readdirSync(e=this.cwd,s={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ge||(s=e,e=this.cwd);let{withFileTypes:n=!0}=s;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:s}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ge||(s=e.withFileTypes,e=this.cwd);let n=await e.readlink();return s?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:s}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ge||(s=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return s?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:s}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ge||(s=e.withFileTypes,e=this.cwd);let n=await e.realpath();return s?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:s}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ge||(s=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return s?n:n?.fullpath()}async walk(e=this.cwd,s={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ge||(s=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:r,walkFilter:o}=s,a=[];(!r||r(e))&&a.push(n?e:e.fullpath());let u=new Set,l=(f,d)=>{u.add(f),f.readdirCB((p,D)=>{if(p)return d(p);let m=D.length;if(!m)return d();let g=()=>{--m===0&&d()};for(let F of D)(!r||r(F))&&a.push(n?F:F.fullpath()),i&&F.isSymbolicLink()?F.realpath().then(y=>y?.isUnknown()?y.lstat():y).then(y=>y?.shouldWalk(u,o)?l(y,g):g()):F.shouldWalk(u,o)?l(F,g):g()},!0)},c=e;return new Promise((f,d)=>{l(c,p=>{if(p)return d(p);f(a)})})}walkSync(e=this.cwd,s={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ge||(s=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:r,walkFilter:o}=s,a=[];(!r||r(e))&&a.push(n?e:e.fullpath());let u=new Set([e]);for(let l of u){let c=l.readdirSync();for(let f of c){(!r||r(f))&&a.push(n?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(u,o)&&u.add(d)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,s={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof ge||(s=e,e=this.cwd),this.stream(e,s)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,s={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ge||(s=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:r,walkFilter:o}=s;(!r||r(e))&&(yield n?e:e.fullpath());let a=new Set([e]);for(let u of a){let l=u.readdirSync();for(let c of l){(!r||r(c))&&(yield n?c:c.fullpath());let f=c;if(c.isSymbolicLink()){if(!(i&&(f=c.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(a,o)&&a.add(f)}}}stream(e=this.cwd,s={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ge||(s=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:r,walkFilter:o}=s,a=new Nt({objectMode:!0});(!r||r(e))&&a.write(n?e:e.fullpath());let u=new Set,l=[e],c=0,f=()=>{let d=!1;for(;!d;){let p=l.shift();if(!p){c===0&&a.end();return}c++,u.add(p);let D=(g,F,y=!1)=>{if(g)return a.emit("error",g);if(i&&!y){let C=[];for(let w of F)w.isSymbolicLink()&&C.push(w.realpath().then(b=>b?.isUnknown()?b.lstat():b));if(C.length){Promise.all(C).then(()=>D(null,F,!0));return}}for(let C of F)C&&(!r||r(C))&&(a.write(n?C:C.fullpath())||(d=!0));c--;for(let C of F){let w=C.realpathCached()||C;w.shouldWalk(u,o)&&l.push(w)}d&&!a.flowing?a.once("drain",f):m||f()},m=!0;p.readdirCB(D,!0),m=!1}};return f(),a}streamSync(e=this.cwd,s={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ge||(s=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:r,walkFilter:o}=s,a=new Nt({objectMode:!0}),u=new Set;(!r||r(e))&&a.write(n?e:e.fullpath());let l=[e],c=0,f=()=>{let d=!1;for(;!d;){let p=l.shift();if(!p){c===0&&a.end();return}c++,u.add(p);let D=p.readdirSync();for(let m of D)(!r||r(m))&&(a.write(n?m:m.fullpath())||(d=!0));c--;for(let m of D){let g=m;if(m.isSymbolicLink()){if(!(i&&(g=m.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(u,o)&&l.push(g)}}d&&!a.flowing&&a.once("drain",f)};return f(),a}chdir(e=this.cwd){let s=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[Hd](s)}},Xs=class extends _r{sep="\\";constructor(e=process.cwd(),s={}){let{nocase:n=!0}=s;super(e,Qs.win32,"\\",{...s,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Qs.win32.parse(e).root.toUpperCase()}newRoot(e){return new Ar(this.rootPath,it,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},en=class extends _r{sep="/";constructor(e=process.cwd(),s={}){let{nocase:n=!1}=s;super(e,Qs.posix,"/",{...s,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new kr(this.rootPath,it,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Gn=class extends en{constructor(e=process.cwd(),s={}){let{nocase:n=!0}=s;super(e,{...s,nocase:n})}},i3=process.platform==="win32"?Ar:kr,Zd=process.platform==="win32"?Xs:process.platform==="darwin"?Gn:en});var eE,tE,tn,hu=L(()=>{Tt();eE=t=>t.length>=1,tE=t=>t.length>=1,tn=class t{#e;#s;#r;length;#i;#o;#C;#g;#c;#a;#d=!0;constructor(e,s,n,i){if(!eE(e))throw new TypeError("empty pattern list");if(!tE(s))throw new TypeError("empty glob list");if(s.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#s=s,this.#r=n,this.#i=i,this.#r===0){if(this.isUNC()){let[r,o,a,u,...l]=this.#e,[c,f,d,p,...D]=this.#s;l[0]===""&&(l.shift(),D.shift());let m=[r,o,a,u,""].join("/"),g=[c,f,d,p,""].join("/");this.#e=[m,...l],this.#s=[g,...D],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[r,...o]=this.#e,[a,...u]=this.#s;o[0]===""&&(o.shift(),u.shift());let l=r+"/",c=a+"/";this.#e=[l,...o],this.#s=[c,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===fe}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#C=this.#C||(this.#r===0?this.isAbsolute()?this.#s[0]+this.#s.slice(1).join("/"):this.#s.join("/"):this.#s.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#s,this.#r+1,this.#i),this.#o.#a=this.#a,this.#o.#c=this.#c,this.#o.#g=this.#g,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=this.#i==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#g!==void 0?this.#g:this.#g=this.#i==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#d)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#d?!1:(this.#d=!1,!0)}}});var sE,ws,pu=L(()=>{Tt();hu();sE=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ws=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:s,nocase:n,noext:i,noglobstar:r,platform:o=sE}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:s,nocase:n,noext:i,noglobstar:r,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let s=new _e(e,this.mmopts);for(let n=0;n<s.set.length;n++){let i=s.set[n],r=s.globParts[n];if(!i||!r)throw new Error("invalid pattern object");for(;i[0]==="."&&r[0]===".";)i.shift(),r.shift();let o=new tn(i,r,0,this.platform),a=new _e(o.globString(),this.mmopts),u=r[r.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),u&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let s=e.fullpath(),n=`${s}/`,i=e.relative()||".",r=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(r))return!0;for(let o of this.absolute)if(o.match(s)||o.match(n))return!0;return!1}childrenIgnored(e){let s=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(s))return!0;return!1}}});var mu,Du,gu,zn,Xd=L(()=>{Tt();mu=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,s){return this.store.get(e.fullpath())?.has(s.globString())}storeWalked(e,s){let n=e.fullpath(),i=this.store.get(n);i?i.add(s.globString()):this.store.set(n,new Set([s.globString()]))}},Du=class{store=new Map;add(e,s,n){let i=(s?2:0)|(n?1:0),r=this.store.get(e);this.store.set(e,r===void 0?i:i&r)}entries(){return[...this.store.entries()].map(([e,s])=>[e,!!(s&2),!!(s&1)])}},gu=class{store=new Map;add(e,s){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===s.globString())||n.push(s):this.store.set(e,[s])}get(e){let s=this.store.get(e);if(!s)throw new Error("attempting to walk unknown path");return s}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},zn=class t{hasWalkedCache;matches=new Du;subwalks=new gu;patterns;follow;dot;opts;constructor(e,s){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=s?s.copy():new mu}processPatterns(e,s){this.patterns=s;let n=s.map(i=>[e,i]);for(let[i,r]of n){this.hasWalkedCache.storeWalked(i,r);let o=r.root(),a=r.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=r.rest();if(f)r=f;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,l,c=!1;for(;typeof(u=r.pattern())=="string"&&(l=r.rest());)i=i.resolve(u),r=l,c=!0;if(u=r.pattern(),l=r.rest(),c){if(this.hasWalkedCache.hasWalked(i,r))continue;this.hasWalkedCache.storeWalked(i,r)}if(typeof u=="string"){let f=u===".."||u===""||u===".";this.matches.add(i.resolve(u),a,f);continue}else if(u===fe){(!i.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(i,r);let f=l?.pattern(),d=l?.rest();if(!l||(f===""||f===".")&&!d)this.matches.add(i,a,f===""||f===".");else if(f===".."){let p=i.parent||i;d?this.hasWalkedCache.hasWalked(p,d)||this.subwalks.add(p,d):this.matches.add(p,a,!0)}}else u instanceof RegExp&&this.subwalks.add(i,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,s){let n=this.subwalks.get(e),i=this.child();for(let r of s)for(let o of n){let a=o.isAbsolute(),u=o.pattern(),l=o.rest();u===fe?i.testGlobstar(r,o,l,a):u instanceof RegExp?i.testRegExp(r,u,l,a):i.testString(r,u,l,a)}return i}testGlobstar(e,s,n,i){if((this.dot||!e.name.startsWith("."))&&(s.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,s):e.isSymbolicLink()&&(n&&s.checkFollowGlobstar()?this.subwalks.add(e,n):s.markFollowGlobstar()&&this.subwalks.add(e,s)))),n){let r=n.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(e,r,n.rest(),i);else if(r===".."){let o=e.parent||e;this.subwalks.add(o,n)}else r instanceof RegExp&&this.testRegExp(e,r,n.rest(),i)}}testRegExp(e,s,n,i){s.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,s,n,i){e.isNamed(s)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}}});var nE,$r,Kn,Yn,eh=L(()=>{lu();pu();Xd();nE=(t,e)=>typeof t=="string"?new ws([t],e):Array.isArray(t)?new ws(t,e):t,$r=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#s;#r;signal;maxDepth;includeChildMatches;constructor(e,s,n){if(this.patterns=e,this.path=s,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#s=nE(n.ignore??[],n),!this.includeChildMatches&&typeof this.#s.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#s?.ignored?.(e)}#o(e){return!!this.#s?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,s){if(s&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=await r.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(r,s)}matchCheckTest(e,s){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!s||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,s){if(s&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=r.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(r,s)}matchFinish(e,s){if(this.#i(e))return;if(!this.includeChildMatches&&this.#s?.add){let r=`${e.relativePosix()}/**`;this.#s.add(r)}let n=this.opts.absolute===void 0?s:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let r=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(r+i)}else{let r=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!r.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(r?o+r+i:"."+i)}}async match(e,s,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,s)}matchSync(e,s,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,s)}walkCB(e,s,n){this.signal?.aborted&&n(),this.walkCB2(e,s,new zn(this.opts),n)}walkCB2(e,s,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,s,n,i));return}n.processPatterns(e,s);let r=1,o=()=>{--r===0&&i()};for(let[a,u,l]of n.matches.entries())this.#i(a)||(r++,this.match(a,u,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,n,o):a.readdirCB((l,c)=>this.walkCB3(a,c,n,o),!0)}o()}walkCB3(e,s,n,i){n=n.filterEntries(e,s);let r=1,o=()=>{--r===0&&i()};for(let[a,u,l]of n.matches.entries())this.#i(a)||(r++,this.match(a,u,l).then(()=>o()));for(let[a,u]of n.subwalks.entries())r++,this.walkCB2(a,u,n.child(),o);o()}walkCBSync(e,s,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,s,new zn(this.opts),n)}walkCB2Sync(e,s,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,s,n,i));return}n.processPatterns(e,s);let r=1,o=()=>{--r===0&&i()};for(let[a,u,l]of n.matches.entries())this.#i(a)||this.matchSync(a,u,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let u=a.readdirSync();this.walkCB3Sync(a,u,n,o)}o()}walkCB3Sync(e,s,n,i){n=n.filterEntries(e,s);let r=1,o=()=>{--r===0&&i()};for(let[a,u,l]of n.matches.entries())this.#i(a)||this.matchSync(a,u,l);for(let[a,u]of n.subwalks.entries())r++,this.walkCB2Sync(a,u,n.child(),o);o()}},Kn=class extends $r{matches=new Set;constructor(e,s,n){super(e,s,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,s)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?s(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Yn=class extends $r{results;constructor(e,s,n){super(e,s,n),this.results=new Nt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}});var th,iE,Le,yu=L(()=>{Tt();th=require("node:url");Qd();hu();eh();iE=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Le=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,s){if(!s)throw new TypeError("glob options required");if(this.withFileTypes=!!s.withFileTypes,this.signal=s.signal,this.follow=!!s.follow,this.dot=!!s.dot,this.dotRelative=!!s.dotRelative,this.nodir=!!s.nodir,this.mark=!!s.mark,s.cwd?(s.cwd instanceof URL||s.cwd.startsWith("file://"))&&(s.cwd=(0,th.fileURLToPath)(s.cwd)):this.cwd="",this.cwd=s.cwd||"",this.root=s.root,this.magicalBraces=!!s.magicalBraces,this.nobrace=!!s.nobrace,this.noext=!!s.noext,this.realpath=!!s.realpath,this.absolute=s.absolute,this.includeChildMatches=s.includeChildMatches!==!1,this.noglobstar=!!s.noglobstar,this.matchBase=!!s.matchBase,this.maxDepth=typeof s.maxDepth=="number"?s.maxDepth:1/0,this.stat=!!s.stat,this.ignore=s.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!s.windowsPathsNoEscape||s.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(s.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=s.platform||iE,this.opts={...s,platform:this.platform},s.scurry){if(this.scurry=s.scurry,s.nocase!==void 0&&s.nocase!==s.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=s.platform==="win32"?Xs:s.platform==="darwin"?Gn:s.platform?en:Zd;this.scurry=new u(this.cwd,{nocase:s.nocase,fs:s.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...s,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map(u=>new _e(u,i)),[o,a]=r.reduce((u,l)=>(u[0].push(...l.set),u[1].push(...l.globParts),u),[[],[]]);this.patterns=o.map((u,l)=>{let c=a[l];if(!c)throw new Error("invalid pattern object");return new tn(u,c,0,this.platform)})}async walk(){return[...await new Kn(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Kn(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Yn(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Yn(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}});var Br,Fu=L(()=>{Tt();Br=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let s of t)if(new _e(s,e).hasMagic())return!0;return!1}});var uh={};yn(uh,{Glob:()=>Le,Ignore:()=>ws,escape:()=>gs,glob:()=>yt,globIterate:()=>Eu,globIterateSync:()=>Hn,globStream:()=>Cu,globStreamSync:()=>Jn,globSync:()=>wu,hasMagic:()=>Br,iterate:()=>oh,iterateSync:()=>rh,stream:()=>ih,streamSync:()=>nh,sync:()=>ah,unescape:()=>Re});function Jn(t,e={}){return new Le(t,e).streamSync()}function Cu(t,e={}){return new Le(t,e).stream()}function wu(t,e={}){return new Le(t,e).walkSync()}async function sh(t,e={}){return new Le(t,e).walk()}function Hn(t,e={}){return new Le(t,e).iterateSync()}function Eu(t,e={}){return new Le(t,e).iterate()}var nh,ih,rh,oh,ah,yt,Tr=L(()=>{Tt();yu();Fu();Tt();yu();Fu();pu();nh=Jn,ih=Object.assign(Cu,{sync:Jn}),rh=Hn,oh=Object.assign(Eu,{sync:Hn}),ah=Object.assign(wu,{stream:Jn,iterate:Hn}),yt=Object.assign(sh,{glob:sh,globSync:wu,sync:ah,globStream:Cu,stream:ih,globStreamSync:Jn,streamSync:nh,globIterate:Eu,iterate:oh,globIterateSync:Hn,iterateSync:rh,Glob:Le,hasMagic:Br,escape:gs,unescape:Re});yt.glob=yt});var G=A(de=>{"use strict";var bu=Symbol.for("yaml.alias"),lh=Symbol.for("yaml.document"),Ir=Symbol.for("yaml.map"),ch=Symbol.for("yaml.pair"),vu=Symbol.for("yaml.scalar"),Rr=Symbol.for("yaml.seq"),Ft=Symbol.for("yaml.node.type"),rE=t=>!!t&&typeof t=="object"&&t[Ft]===bu,oE=t=>!!t&&typeof t=="object"&&t[Ft]===lh,aE=t=>!!t&&typeof t=="object"&&t[Ft]===Ir,uE=t=>!!t&&typeof t=="object"&&t[Ft]===ch,fh=t=>!!t&&typeof t=="object"&&t[Ft]===vu,lE=t=>!!t&&typeof t=="object"&&t[Ft]===Rr;function dh(t){if(t&&typeof t=="object")switch(t[Ft]){case Ir:case Rr:return!0}return!1}function cE(t){if(t&&typeof t=="object")switch(t[Ft]){case bu:case Ir:case vu:case Rr:return!0}return!1}var fE=t=>(fh(t)||dh(t))&&!!t.anchor;de.ALIAS=bu;de.DOC=lh;de.MAP=Ir;de.NODE_TYPE=Ft;de.PAIR=ch;de.SCALAR=vu;de.SEQ=Rr;de.hasAnchor=fE;de.isAlias=rE;de.isCollection=dh;de.isDocument=oE;de.isMap=aE;de.isNode=cE;de.isPair=uE;de.isScalar=fh;de.isSeq=lE});var Zn=A(xu=>{"use strict";var ne=G(),ve=Symbol("break visit"),hh=Symbol("skip children"),ot=Symbol("remove node");function Nr(t,e){let s=ph(e);ne.isDocument(t)?sn(null,t.contents,s,Object.freeze([t]))===ot&&(t.contents=null):sn(null,t,s,Object.freeze([]))}Nr.BREAK=ve;Nr.SKIP=hh;Nr.REMOVE=ot;function sn(t,e,s,n){let i=mh(t,e,s,n);if(ne.isNode(i)||ne.isPair(i))return Dh(t,n,i),sn(t,i,s,n);if(typeof i!="symbol"){if(ne.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=sn(r,e.items[r],s,n);if(typeof o=="number")r=o-1;else{if(o===ve)return ve;o===ot&&(e.items.splice(r,1),r-=1)}}}else if(ne.isPair(e)){n=Object.freeze(n.concat(e));let r=sn("key",e.key,s,n);if(r===ve)return ve;r===ot&&(e.key=null);let o=sn("value",e.value,s,n);if(o===ve)return ve;o===ot&&(e.value=null)}}return i}async function Or(t,e){let s=ph(e);ne.isDocument(t)?await nn(null,t.contents,s,Object.freeze([t]))===ot&&(t.contents=null):await nn(null,t,s,Object.freeze([]))}Or.BREAK=ve;Or.SKIP=hh;Or.REMOVE=ot;async function nn(t,e,s,n){let i=await mh(t,e,s,n);if(ne.isNode(i)||ne.isPair(i))return Dh(t,n,i),nn(t,i,s,n);if(typeof i!="symbol"){if(ne.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await nn(r,e.items[r],s,n);if(typeof o=="number")r=o-1;else{if(o===ve)return ve;o===ot&&(e.items.splice(r,1),r-=1)}}}else if(ne.isPair(e)){n=Object.freeze(n.concat(e));let r=await nn("key",e.key,s,n);if(r===ve)return ve;r===ot&&(e.key=null);let o=await nn("value",e.value,s,n);if(o===ve)return ve;o===ot&&(e.value=null)}}return i}function ph(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function mh(t,e,s,n){if(typeof s=="function")return s(t,e,n);if(ne.isMap(e))return s.Map?.(t,e,n);if(ne.isSeq(e))return s.Seq?.(t,e,n);if(ne.isPair(e))return s.Pair?.(t,e,n);if(ne.isScalar(e))return s.Scalar?.(t,e,n);if(ne.isAlias(e))return s.Alias?.(t,e,n)}function Dh(t,e,s){let n=e[e.length-1];if(ne.isCollection(n))n.items[t]=s;else if(ne.isPair(n))t==="key"?n.key=s:n.value=s;else if(ne.isDocument(n))n.contents=s;else{let i=ne.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}xu.visit=Nr;xu.visitAsync=Or});var Su=A(yh=>{"use strict";var gh=G(),dE=Zn(),hE={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},pE=t=>t.replace(/[!,[\]{}]/g,e=>hE[e]),Qn=class t{constructor(e,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,s)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,s){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return s(6,`Unsupported YAML version ${r}`,o),!1}}default:return s(0,`Unknown directive ${i}`,!0),!1}}tagName(e,s){if(e==="!")return"!";if(e[0]!=="!")return s(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(s(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&s("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||s(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return s(String(o)),null}return n==="!"?e:(s(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[s,n]of Object.entries(this.tags))if(e.startsWith(n))return s+pE(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&gh.isNode(e.contents)){let r={};dE.visit(e.contents,(o,a)=>{gh.isNode(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&s.push(`%TAG ${r} ${o}`);return s.join(`
|
|
59
|
-
`)}};Qn.defaultYaml={explicit:!1,version:"1.2"};Qn.defaultTags={"!!":"tag:yaml.org,2002:"};
|
|
60
|
-
`)?
|
|
58
|
+
>>> no match, partial?`,e,d,s,p),d===u))}let m;if(typeof c=="string"?(m=f===c,this.debug("string match",c,f,m)):(m=c.test(f),this.debug("pattern match",c,f,m)),!m)return!1}if(o===u&&a===l)return!0;if(o===u)return n;if(a===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Gd(this.pattern,this.options)}parse(e){Nn(e);let s=this.options;if(e==="**")return de;if(e==="")return"";let n,i=null;(n=e.match(vE))?i=s.dot?SE:xE:(n=e.match(pE))?i=(s.nocase?s.dot?yE:gE:s.dot?DE:mE)(n[1]):(n=e.match(AE))?i=(s.nocase?s.dot?$E:kE:s.dot?_E:BE)(n):(n=e.match(FE))?i=s.dot?CE:wE:(n=e.match(EE))&&(i=bE);let r=Hs.fromGlob(e,this.options).toMMPattern();return i&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:i}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let s=this.options,n=s.noglobstar?RE:s.dot?NE:PE,i=new Set(s.nocase?["i"]:[]),r=e.map(u=>{let l=u.map(f=>{if(f instanceof RegExp)for(let d of f.flags.split(""))i.add(d);return typeof f=="string"?qE(f):f===de?de:f._src});l.forEach((f,d)=>{let p=l[d+1],D=l[d-1];f!==de||D===de||(D===void 0?p!==void 0&&p!==de?l[d+1]="(?:\\/|"+n+"\\/)?"+p:l[d]=n:p===void 0?l[d-1]=D+"(?:\\/|\\/"+n+")?":p!==de&&(l[d-1]=D+"(?:\\/|\\/"+n+"\\/)"+p,l[d+1]=de))});let c=l.filter(f=>f!==de);if(this.partial&&c.length>=1){let f=[];for(let d=1;d<=c.length;d++)f.push(c.slice(0,d).join("/"));return"(?:"+f.join("|")+")"}return c.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];r="^"+o+r+a+"$",this.partial&&(r="^(?:\\/|"+o+r.slice(1,-1)+a+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,s=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&s)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let r=this.set;this.debug(this.pattern,"set",r);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<r.length;a++){let u=r[a],l=i;if(n.matchBase&&u.length===1&&(l=[o]),this.matchOne(l,u,s))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return be.defaults(e).Minimatch}};be.AST=Hs;be.Minimatch=Ie;be.escape=ys;be.unescape=Le});var UE,Yd,au,Hd,pr,Kd,WE,vk,Ot,Jd,Js,uu,Fs,Zd=q(()=>{UE=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Yd=new Set,au=typeof process=="object"&&process?process:{},Hd=(t,e,s,n)=>{typeof au.emitWarning=="function"?au.emitWarning(t,e,s,n):console.error(`[${s}] ${e}: ${t}`)},pr=globalThis.AbortController,Kd=globalThis.AbortSignal;if(typeof pr>"u"){Kd=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},pr=class{constructor(){e()}signal=new Kd;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let t=au.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,Hd("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}WE=t=>!Yd.has(t),vk=Symbol("type"),Ot=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Jd=t=>Ot(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Js:null:null,Js=class extends Array{constructor(e){super(e),this.fill(0)}},uu=class t{heap;length;static#e=!1;static create(e){let s=Jd(e);if(!s)return[];t.#e=!0;let n=new t(e,s);return t.#e=!1,n}constructor(e,s){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new s(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Fs=class t{#e;#s;#r;#i;#o;#w;#g;#c;get perf(){return this.#c}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#d;#f;#u;#n;#h;#C;#F;#p;#k;#m;#v;#x;#D;#y;#E;#S;#t;#R;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#D,autopurgeTimers:e.#y,sizes:e.#v,keyMap:e.#f,keyList:e.#u,valList:e.#n,next:e.#h,prev:e.#C,get head(){return e.#F},get tail(){return e.#p},free:e.#k,isBackgroundFetch:s=>e.#l(s),backgroundFetch:(s,n,i,r)=>e.#U(s,n,i,r),moveToTail:s=>e.#P(s),indexes:s=>e.#_(s),rindexes:s=>e.#B(s),isStale:s=>e.#b(s)}}get max(){return this.#e}get maxSize(){return this.#s}get calculatedSize(){return this.#d}get size(){return this.#a}get fetchMethod(){return this.#w}get memoMethod(){return this.#g}get dispose(){return this.#r}get onInsert(){return this.#i}get disposeAfter(){return this.#o}constructor(e){let{max:s=0,ttl:n,ttlResolution:i=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:p,maxSize:D=0,maxEntrySize:m=0,sizeCalculation:g,fetchMethod:F,memoMethod:y,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:v,ignoreFetchAbort:B,perf:A}=e;if(A!==void 0&&typeof A?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#c=A??UE,s!==0&&!Ot(s))throw new TypeError("max option must be a nonnegative integer");let $=s?Jd(s):Array;if(!$)throw new Error("invalid max value: "+s);if(this.#e=s,this.#s=D,this.maxEntrySize=m||this.#s,this.sizeCalculation=g,this.sizeCalculation){if(!this.#s&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#g=y,F!==void 0&&typeof F!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#w=F,this.#S=!!F,this.#f=new Map,this.#u=new Array(s).fill(void 0),this.#n=new Array(s).fill(void 0),this.#h=new $(s),this.#C=new $(s),this.#F=0,this.#p=0,this.#k=uu.create(s),this.#a=0,this.#d=0,typeof l=="function"&&(this.#r=l),typeof c=="function"&&(this.#i=c),typeof f=="function"?(this.#o=f,this.#m=[]):(this.#o=void 0,this.#m=void 0),this.#E=!!this.#r,this.#R=!!this.#i,this.#t=!!this.#o,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#s!==0&&!Ot(this.#s))throw new TypeError("maxSize must be a positive integer if specified");if(!Ot(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ot(i)||i===0?i:1,this.ttlAutopurge=!!r,this.ttl=n||0,this.ttl){if(!Ot(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T()}if(this.#e===0&&this.ttl===0&&this.#s===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#s){let P="LRU_CACHE_UNBOUNDED";WE(P)&&(Yd.add(P),Hd("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,t))}}getRemainingTTL(e){return this.#f.has(e)?1/0:0}#T(){let e=new Js(this.#e),s=new Js(this.#e);this.#D=e,this.#x=s;let n=this.ttlAutopurge?new Array(this.#e):void 0;this.#y=n,this.#L=(o,a,u=this.#c.now())=>{if(s[o]=a!==0?u:0,e[o]=a,n?.[o]&&(clearTimeout(n[o]),n[o]=void 0),a!==0&&n){let l=setTimeout(()=>{this.#b(o)&&this.#$(this.#u[o],"expire")},a+1);l.unref&&l.unref(),n[o]=l}},this.#A=o=>{s[o]=e[o]!==0?this.#c.now():0},this.#I=(o,a)=>{if(e[a]){let u=e[a],l=s[a];if(!u||!l)return;o.ttl=u,o.start=l,o.now=i||r();let c=o.now-l;o.remainingTTL=u-c}};let i=0,r=()=>{let o=this.#c.now();if(this.ttlResolution>0){i=o;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{let a=this.#f.get(o);if(a===void 0)return 0;let u=e[a],l=s[a];if(!u||!l)return 1/0;let c=(i||r())-l;return u-c},this.#b=o=>{let a=s[o],u=e[o];return!!u&&!!a&&(i||r())-a>u}}#A=()=>{};#I=()=>{};#L=()=>{};#b=()=>!1;#V(){let e=new Js(this.#e);this.#d=0,this.#v=e,this.#O=s=>{this.#d-=e[s],e[s]=0},this.#M=(s,n,i,r)=>{if(this.#l(n))return 0;if(!Ot(i))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(i=r(n,s),!Ot(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#N=(s,n,i)=>{if(e[s]=n,this.#s){let r=this.#s-e[s];for(;this.#d>r;)this.#q(!0)}this.#d+=e[s],i&&(i.entrySize=n,i.totalCalculatedSize=this.#d)}}#O=e=>{};#N=(e,s,n)=>{};#M=(e,s,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#_({allowStale:e=this.allowStale}={}){if(this.#a)for(let s=this.#p;!(!this.#j(s)||((e||!this.#b(s))&&(yield s),s===this.#F));)s=this.#C[s]}*#B({allowStale:e=this.allowStale}={}){if(this.#a)for(let s=this.#F;!(!this.#j(s)||((e||!this.#b(s))&&(yield s),s===this.#p));)s=this.#h[s]}#j(e){return e!==void 0&&this.#f.get(this.#u[e])===e}*entries(){for(let e of this.#_())this.#n[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#n[e])&&(yield[this.#u[e],this.#n[e]])}*rentries(){for(let e of this.#B())this.#n[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#n[e])&&(yield[this.#u[e],this.#n[e]])}*keys(){for(let e of this.#_()){let s=this.#u[e];s!==void 0&&!this.#l(this.#n[e])&&(yield s)}}*rkeys(){for(let e of this.#B()){let s=this.#u[e];s!==void 0&&!this.#l(this.#n[e])&&(yield s)}}*values(){for(let e of this.#_())this.#n[e]!==void 0&&!this.#l(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#B())this.#n[e]!==void 0&&!this.#l(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,s={}){for(let n of this.#_()){let i=this.#n[n],r=this.#l(i)?i.__staleWhileFetching:i;if(r!==void 0&&e(r,this.#u[n],this))return this.get(this.#u[n],s)}}forEach(e,s=this){for(let n of this.#_()){let i=this.#n[n],r=this.#l(i)?i.__staleWhileFetching:i;r!==void 0&&e.call(s,r,this.#u[n],this)}}rforEach(e,s=this){for(let n of this.#B()){let i=this.#n[n],r=this.#l(i)?i.__staleWhileFetching:i;r!==void 0&&e.call(s,r,this.#u[n],this)}}purgeStale(){let e=!1;for(let s of this.#B({allowStale:!0}))this.#b(s)&&(this.#$(this.#u[s],"expire"),e=!0);return e}info(e){let s=this.#f.get(e);if(s===void 0)return;let n=this.#n[s],i=this.#l(n)?n.__staleWhileFetching:n;if(i===void 0)return;let r={value:i};if(this.#D&&this.#x){let o=this.#D[s],a=this.#x[s];if(o&&a){let u=o-(this.#c.now()-a);r.ttl=u,r.start=Date.now()}}return this.#v&&(r.size=this.#v[s]),r}dump(){let e=[];for(let s of this.#_({allowStale:!0})){let n=this.#u[s],i=this.#n[s],r=this.#l(i)?i.__staleWhileFetching:i;if(r===void 0||n===void 0)continue;let o={value:r};if(this.#D&&this.#x){o.ttl=this.#D[s];let a=this.#c.now()-this.#x[s];o.start=Math.floor(Date.now()-a)}this.#v&&(o.size=this.#v[s]),e.unshift([n,o])}return e}load(e){this.clear();for(let[s,n]of e){if(n.start){let i=Date.now()-n.start;n.start=this.#c.now()-i}this.set(s,n.value,n)}}set(e,s,n={}){if(s===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,c=this.#M(e,s,n.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#$(e,"set"),this;let f=this.#a===0?void 0:this.#f.get(e);if(f===void 0)f=this.#a===0?this.#p:this.#k.length!==0?this.#k.pop():this.#a===this.#e?this.#q(!1):this.#a,this.#u[f]=e,this.#n[f]=s,this.#f.set(e,f),this.#h[this.#p]=f,this.#C[f]=this.#p,this.#p=f,this.#a++,this.#N(f,c,u),u&&(u.set="add"),l=!1,this.#R&&this.#i?.(s,e,"add");else{this.#P(f);let d=this.#n[f];if(s!==d){if(this.#S&&this.#l(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=d;p!==void 0&&!o&&(this.#E&&this.#r?.(p,e,"set"),this.#t&&this.#m?.push([p,e,"set"]))}else o||(this.#E&&this.#r?.(d,e,"set"),this.#t&&this.#m?.push([d,e,"set"]));if(this.#O(f),this.#N(f,c,u),this.#n[f]=s,u){u.set="replace";let p=d&&this.#l(d)?d.__staleWhileFetching:d;p!==void 0&&(u.oldValue=p)}}else u&&(u.set="update");this.#R&&this.onInsert?.(s,e,s===d?"update":"replace")}if(i!==0&&!this.#D&&this.#T(),this.#D&&(l||this.#L(f,i,r),u&&this.#I(u,f)),!o&&this.#t&&this.#m){let d=this.#m,p;for(;p=d?.shift();)this.#o?.(...p)}return this}pop(){try{for(;this.#a;){let e=this.#n[this.#F];if(this.#q(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#t&&this.#m){let e=this.#m,s;for(;s=e?.shift();)this.#o?.(...s)}}}#q(e){let s=this.#F,n=this.#u[s],i=this.#n[s];return this.#S&&this.#l(i)?i.__abortController.abort(new Error("evicted")):(this.#E||this.#t)&&(this.#E&&this.#r?.(i,n,"evict"),this.#t&&this.#m?.push([i,n,"evict"])),this.#O(s),this.#y?.[s]&&(clearTimeout(this.#y[s]),this.#y[s]=void 0),e&&(this.#u[s]=void 0,this.#n[s]=void 0,this.#k.push(s)),this.#a===1?(this.#F=this.#p=0,this.#k.length=0):this.#F=this.#h[s],this.#f.delete(n),this.#a--,s}has(e,s={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=s,r=this.#f.get(e);if(r!==void 0){let o=this.#n[r];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(r))i&&(i.has="stale",this.#I(i,r));else return n&&this.#A(r),i&&(i.has="hit",this.#I(i,r)),!0}else i&&(i.has="miss");return!1}peek(e,s={}){let{allowStale:n=this.allowStale}=s,i=this.#f.get(e);if(i===void 0||!n&&this.#b(i))return;let r=this.#n[i];return this.#l(r)?r.__staleWhileFetching:r}#U(e,s,n,i){let r=s===void 0?void 0:this.#n[s];if(this.#l(r))return r;let o=new pr,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:n,context:i},l=(m,g=!1)=>{let{aborted:F}=o.signal,y=n.ignoreFetchAbort&&m!==void 0;if(n.status&&(F&&!g?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,y&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),F&&!y&&!g)return f(o.signal.reason);let C=p,w=this.#n[s];return(w===p||y&&g&&w===void 0)&&(m===void 0?C.__staleWhileFetching!==void 0?this.#n[s]=C.__staleWhileFetching:this.#$(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,m,u.options))),m},c=m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),f(m)),f=m=>{let{aborted:g}=o.signal,F=g&&n.allowStaleOnFetchAbort,y=F||n.allowStaleOnFetchRejection,C=y||n.noDeleteOnFetchRejection,w=p;if(this.#n[s]===p&&(!C||w.__staleWhileFetching===void 0?this.#$(e,"fetch"):F||(this.#n[s]=w.__staleWhileFetching)),y)return n.status&&w.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw m},d=(m,g)=>{let F=this.#w?.(e,r,u);F&&F instanceof Promise&&F.then(y=>m(y===void 0?void 0:y),g),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=y=>l(y,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(d).then(l,c),D=Object.assign(p,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return s===void 0?(this.set(e,D,{...u.options,status:void 0}),s=this.#f.get(e)):this.#n[s]=D,D}#l(e){if(!this.#S)return!1;let s=e;return!!s&&s instanceof Promise&&s.hasOwnProperty("__staleWhileFetching")&&s.__abortController instanceof pr}async fetch(e,s={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:D=this.allowStaleOnFetchAbort,context:m,forceRefresh:g=!1,status:F,signal:y}=s;if(!this.#S)return F&&(F.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:F});let C={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:D,ignoreFetchAbort:p,status:F,signal:y},w=this.#f.get(e);if(w===void 0){F&&(F.fetch="miss");let E=this.#U(e,w,C,m);return E.__returned=E}else{let E=this.#n[w];if(this.#l(E)){let P=n&&E.__staleWhileFetching!==void 0;return F&&(F.fetch="inflight",P&&(F.returnedStale=!0)),P?E.__staleWhileFetching:E.__returned=E}let v=this.#b(w);if(!g&&!v)return F&&(F.fetch="hit"),this.#P(w),i&&this.#A(w),F&&this.#I(F,w),E;let B=this.#U(e,w,C,m),$=B.__staleWhileFetching!==void 0&&n;return F&&(F.fetch=v?"stale":"refresh",$&&v&&(F.returnedStale=!0)),$?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,s={}){let n=await this.fetch(e,s);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,s={}){let n=this.#g;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:r,...o}=s,a=this.get(e,o);if(!r&&a!==void 0)return a;let u=n(e,a,{options:o,context:i});return this.set(e,u,o),u}get(e,s={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=s,a=this.#f.get(e);if(a!==void 0){let u=this.#n[a],l=this.#l(u);return o&&this.#I(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&n&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?u.__staleWhileFetching:void 0):(r||this.#$(e,"expire"),o&&n&&(o.returnedStale=!0),n?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(this.#P(a),i&&this.#A(a),u))}else o&&(o.get="miss")}#W(e,s){this.#C[s]=e,this.#h[e]=s}#P(e){e!==this.#p&&(e===this.#F?this.#F=this.#h[e]:this.#W(this.#C[e],this.#h[e]),this.#W(this.#p,e),this.#p=e)}delete(e){return this.#$(e,"delete")}#$(e,s){let n=!1;if(this.#a!==0){let i=this.#f.get(e);if(i!==void 0)if(this.#y?.[i]&&(clearTimeout(this.#y?.[i]),this.#y[i]=void 0),n=!0,this.#a===1)this.#z(s);else{this.#O(i);let r=this.#n[i];if(this.#l(r)?r.__abortController.abort(new Error("deleted")):(this.#E||this.#t)&&(this.#E&&this.#r?.(r,e,s),this.#t&&this.#m?.push([r,e,s])),this.#f.delete(e),this.#u[i]=void 0,this.#n[i]=void 0,i===this.#p)this.#p=this.#C[i];else if(i===this.#F)this.#F=this.#h[i];else{let o=this.#C[i];this.#h[o]=this.#h[i];let a=this.#h[i];this.#C[a]=this.#C[i]}this.#a--,this.#k.push(i)}}if(this.#t&&this.#m?.length){let i=this.#m,r;for(;r=i?.shift();)this.#o?.(...r)}return n}clear(){return this.#z("delete")}#z(e){for(let s of this.#B({allowStale:!0})){let n=this.#n[s];if(this.#l(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#u[s];this.#E&&this.#r?.(n,i,e),this.#t&&this.#m?.push([n,i,e])}}if(this.#f.clear(),this.#n.fill(void 0),this.#u.fill(void 0),this.#D&&this.#x){this.#D.fill(0),this.#x.fill(0);for(let s of this.#y??[])s!==void 0&&clearTimeout(s);this.#y?.fill(void 0)}if(this.#v&&this.#v.fill(0),this.#F=0,this.#p=0,this.#k.length=0,this.#d=0,this.#a=0,this.#t&&this.#m){let s=this.#m,n;for(;n=s?.shift();)this.#o?.(...n)}}}});var Cr,mu,sh,Qd,VE,zE,GE,Ct,Et,Lt,mr,On,Dr,Xd,gr,eh,Xe,Zs,re,Ln,Qs,oe,ve,ae,lu,yr,ye,X,cu,fu,th,du,ut,hu,Fr,Mn,ws,Re,jn,KE,YE,HE,JE,wr,pu,ZE,QE,Mt,Du=q(()=>{Cr=require("node:events"),mu=nt(require("node:stream"),1),sh=require("node:string_decoder"),Qd=typeof process=="object"&&process?process:{stdout:null,stderr:null},VE=t=>!!t&&typeof t=="object"&&(t instanceof Mt||t instanceof mu.default||zE(t)||GE(t)),zE=t=>!!t&&typeof t=="object"&&t instanceof Cr.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==mu.default.Writable.prototype.pipe,GE=t=>!!t&&typeof t=="object"&&t instanceof Cr.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",Ct=Symbol("EOF"),Et=Symbol("maybeEmitEnd"),Lt=Symbol("emittedEnd"),mr=Symbol("emittingEnd"),On=Symbol("emittedError"),Dr=Symbol("closed"),Xd=Symbol("read"),gr=Symbol("flush"),eh=Symbol("flushChunk"),Xe=Symbol("encoding"),Zs=Symbol("decoder"),re=Symbol("flowing"),Ln=Symbol("paused"),Qs=Symbol("resume"),oe=Symbol("buffer"),ve=Symbol("pipes"),ae=Symbol("bufferLength"),lu=Symbol("bufferPush"),yr=Symbol("bufferShift"),ye=Symbol("objectMode"),X=Symbol("destroyed"),cu=Symbol("error"),fu=Symbol("emitData"),th=Symbol("emitEnd"),du=Symbol("emitEnd2"),ut=Symbol("async"),hu=Symbol("abort"),Fr=Symbol("aborted"),Mn=Symbol("signal"),ws=Symbol("dataListeners"),Re=Symbol("discarded"),jn=t=>Promise.resolve().then(t),KE=t=>t(),YE=t=>t==="end"||t==="finish"||t==="prefinish",HE=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,JE=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),wr=class{src;dest;opts;ondrain;constructor(e,s,n){this.src=e,this.dest=s,this.opts=n,this.ondrain=()=>e[Qs](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},pu=class extends wr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,s,n){super(e,s,n),this.proxyErrors=i=>s.emit("error",i),e.on("error",this.proxyErrors)}},ZE=t=>!!t.objectMode,QE=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Mt=class extends Cr.EventEmitter{[re]=!1;[Ln]=!1;[ve]=[];[oe]=[];[ye];[Xe];[ut];[Zs];[Ct]=!1;[Lt]=!1;[mr]=!1;[Dr]=!1;[On]=null;[ae]=0;[X]=!1;[Mn];[Fr]=!1;[ws]=0;[Re]=!1;writable=!0;readable=!0;constructor(...e){let s=e[0]||{};if(super(),s.objectMode&&typeof s.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");ZE(s)?(this[ye]=!0,this[Xe]=null):QE(s)?(this[Xe]=s.encoding,this[ye]=!1):(this[ye]=!1,this[Xe]=null),this[ut]=!!s.async,this[Zs]=this[Xe]?new sh.StringDecoder(this[Xe]):null,s&&s.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[oe]}),s&&s.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[ve]});let{signal:n}=s;n&&(this[Mn]=n,n.aborted?this[hu]():n.addEventListener("abort",()=>this[hu]()))}get bufferLength(){return this[ae]}get encoding(){return this[Xe]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[ye]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ut]}set async(e){this[ut]=this[ut]||!!e}[hu](){this[Fr]=!0,this.emit("abort",this[Mn]?.reason),this.destroy(this[Mn]?.reason)}get aborted(){return this[Fr]}set aborted(e){}write(e,s,n){if(this[Fr])return!1;if(this[Ct])throw new Error("write after end");if(this[X])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof s=="function"&&(n=s,s="utf8"),s||(s="utf8");let i=this[ut]?jn:KE;if(!this[ye]&&!Buffer.isBuffer(e)){if(JE(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(HE(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[ye]?(this[re]&&this[ae]!==0&&this[gr](!0),this[re]?this.emit("data",e):this[lu](e),this[ae]!==0&&this.emit("readable"),n&&i(n),this[re]):e.length?(typeof e=="string"&&!(s===this[Xe]&&!this[Zs]?.lastNeed)&&(e=Buffer.from(e,s)),Buffer.isBuffer(e)&&this[Xe]&&(e=this[Zs].write(e)),this[re]&&this[ae]!==0&&this[gr](!0),this[re]?this.emit("data",e):this[lu](e),this[ae]!==0&&this.emit("readable"),n&&i(n),this[re]):(this[ae]!==0&&this.emit("readable"),n&&i(n),this[re])}read(e){if(this[X])return null;if(this[Re]=!1,this[ae]===0||e===0||e&&e>this[ae])return this[Et](),null;this[ye]&&(e=null),this[oe].length>1&&!this[ye]&&(this[oe]=[this[Xe]?this[oe].join(""):Buffer.concat(this[oe],this[ae])]);let s=this[Xd](e||null,this[oe][0]);return this[Et](),s}[Xd](e,s){if(this[ye])this[yr]();else{let n=s;e===n.length||e===null?this[yr]():typeof n=="string"?(this[oe][0]=n.slice(e),s=n.slice(0,e),this[ae]-=e):(this[oe][0]=n.subarray(e),s=n.subarray(0,e),this[ae]-=e)}return this.emit("data",s),!this[oe].length&&!this[Ct]&&this.emit("drain"),s}end(e,s,n){return typeof e=="function"&&(n=e,e=void 0),typeof s=="function"&&(n=s,s="utf8"),e!==void 0&&this.write(e,s),n&&this.once("end",n),this[Ct]=!0,this.writable=!1,(this[re]||!this[Ln])&&this[Et](),this}[Qs](){this[X]||(!this[ws]&&!this[ve].length&&(this[Re]=!0),this[Ln]=!1,this[re]=!0,this.emit("resume"),this[oe].length?this[gr]():this[Ct]?this[Et]():this.emit("drain"))}resume(){return this[Qs]()}pause(){this[re]=!1,this[Ln]=!0,this[Re]=!1}get destroyed(){return this[X]}get flowing(){return this[re]}get paused(){return this[Ln]}[lu](e){this[ye]?this[ae]+=1:this[ae]+=e.length,this[oe].push(e)}[yr](){return this[ye]?this[ae]-=1:this[ae]-=this[oe][0].length,this[oe].shift()}[gr](e=!1){do;while(this[eh](this[yr]())&&this[oe].length);!e&&!this[oe].length&&!this[Ct]&&this.emit("drain")}[eh](e){return this.emit("data",e),this[re]}pipe(e,s){if(this[X])return e;this[Re]=!1;let n=this[Lt];return s=s||{},e===Qd.stdout||e===Qd.stderr?s.end=!1:s.end=s.end!==!1,s.proxyErrors=!!s.proxyErrors,n?s.end&&e.end():(this[ve].push(s.proxyErrors?new pu(this,e,s):new wr(this,e,s)),this[ut]?jn(()=>this[Qs]()):this[Qs]()),e}unpipe(e){let s=this[ve].find(n=>n.dest===e);s&&(this[ve].length===1?(this[re]&&this[ws]===0&&(this[re]=!1),this[ve]=[]):this[ve].splice(this[ve].indexOf(s),1),s.unpipe())}addListener(e,s){return this.on(e,s)}on(e,s){let n=super.on(e,s);if(e==="data")this[Re]=!1,this[ws]++,!this[ve].length&&!this[re]&&this[Qs]();else if(e==="readable"&&this[ae]!==0)super.emit("readable");else if(YE(e)&&this[Lt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[On]){let i=s;this[ut]?jn(()=>i.call(this,this[On])):i.call(this,this[On])}return n}removeListener(e,s){return this.off(e,s)}off(e,s){let n=super.off(e,s);return e==="data"&&(this[ws]=this.listeners("data").length,this[ws]===0&&!this[Re]&&!this[ve].length&&(this[re]=!1)),n}removeAllListeners(e){let s=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[ws]=0,!this[Re]&&!this[ve].length&&(this[re]=!1)),s}get emittedEnd(){return this[Lt]}[Et](){!this[mr]&&!this[Lt]&&!this[X]&&this[oe].length===0&&this[Ct]&&(this[mr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Dr]&&this.emit("close"),this[mr]=!1)}emit(e,...s){let n=s[0];if(e!=="error"&&e!=="close"&&e!==X&&this[X])return!1;if(e==="data")return!this[ye]&&!n?!1:this[ut]?(jn(()=>this[fu](n)),!0):this[fu](n);if(e==="end")return this[th]();if(e==="close"){if(this[Dr]=!0,!this[Lt]&&!this[X])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(e==="error"){this[On]=n,super.emit(cu,n);let r=!this[Mn]||this.listeners("error").length?super.emit("error",n):!1;return this[Et](),r}else if(e==="resume"){let r=super.emit("resume");return this[Et](),r}else if(e==="finish"||e==="prefinish"){let r=super.emit(e);return this.removeAllListeners(e),r}let i=super.emit(e,...s);return this[Et](),i}[fu](e){for(let n of this[ve])n.dest.write(e)===!1&&this.pause();let s=this[Re]?!1:super.emit("data",e);return this[Et](),s}[th](){return this[Lt]?!1:(this[Lt]=!0,this.readable=!1,this[ut]?(jn(()=>this[du]()),!0):this[du]())}[du](){if(this[Zs]){let s=this[Zs].end();if(s){for(let n of this[ve])n.dest.write(s);this[Re]||super.emit("data",s)}}for(let s of this[ve])s.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[ye]||(e.dataLength=0);let s=this.promise();return this.on("data",n=>{e.push(n),this[ye]||(e.dataLength+=n.length)}),await s,e}async concat(){if(this[ye])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Xe]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,s)=>{this.on(X,()=>s(new Error("stream destroyed"))),this.on("error",n=>s(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Re]=!1;let e=!1,s=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return s();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Ct])return s();let r,o,a=f=>{this.off("data",u),this.off("end",l),this.off(X,c),s(),o(f)},u=f=>{this.off("error",a),this.off("end",l),this.off(X,c),this.pause(),r({value:f,done:!!this[Ct]})},l=()=>{this.off("error",a),this.off("data",u),this.off(X,c),s(),r({done:!0,value:void 0})},c=()=>a(new Error("stream destroyed"));return new Promise((f,d)=>{o=d,r=f,this.once(X,c),this.once("error",a),this.once("end",l),this.once("data",u)})},throw:s,return:s,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Re]=!1;let e=!1,s=()=>(this.pause(),this.off(cu,s),this.off(X,s),this.off("end",s),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return s();let i=this.read();return i===null?s():{done:!1,value:i}};return this.once("end",s),this.once(cu,s),this.once(X,s),{next:n,throw:s,return:s,[Symbol.iterator](){return this}}}destroy(e){if(this[X])return e?this.emit("error",e):this.emit(X),this;this[X]=!0,this[Re]=!0,this[oe].length=0,this[ae]=0;let s=this;return typeof s.close=="function"&&!this[Dr]&&s.close(),e?this.emit("error",e):this.emit(X),this}static get isStream(){return VE}}});var Xs,ah,ct,XE,jt,eb,Un,uh,lh,tb,sb,qe,ch,fh,lt,dh,hh,Cs,ph,je,qn,gu,nh,Wn,et,Er,vr,ih,nb,yu,rh,Vn,oh,br,xr,Fu,mh,Fe,Sr,Ar,kr,en,tn,zn,$k,Dh,gh=q(()=>{Zd();Xs=require("node:path"),ah=require("node:url"),ct=require("fs"),XE=nt(require("node:fs"),1),jt=require("node:fs/promises");Du();eb=ct.realpathSync.native,Un={lstatSync:ct.lstatSync,readdir:ct.readdir,readdirSync:ct.readdirSync,readlinkSync:ct.readlinkSync,realpathSync:eb,promises:{lstat:jt.lstat,readdir:jt.readdir,readlink:jt.readlink,realpath:jt.realpath}},uh=t=>!t||t===Un||t===XE?Un:{...Un,...t,promises:{...Un.promises,...t.promises||{}}},lh=/^\\\\\?\\([a-z]:)\\?$/i,tb=t=>t.replace(/\//g,"\\").replace(lh,"$1\\"),sb=/[\\\/]/,qe=0,ch=1,fh=2,lt=4,dh=6,hh=8,Cs=10,ph=12,je=15,qn=~je,gu=16,nh=32,Wn=64,et=128,Er=256,vr=512,ih=Wn|et|vr,nb=1023,yu=t=>t.isFile()?hh:t.isDirectory()?lt:t.isSymbolicLink()?Cs:t.isCharacterDevice()?fh:t.isBlockDevice()?dh:t.isSocket()?ph:t.isFIFO()?ch:qe,rh=new Fs({max:2**12}),Vn=t=>{let e=rh.get(t);if(e)return e;let s=t.normalize("NFKD");return rh.set(t,s),s},oh=new Fs({max:2**12}),br=t=>{let e=oh.get(t);if(e)return e;let s=Vn(t.toLowerCase());return oh.set(t,s),s},xr=class extends Fs{constructor(){super({max:256})}},Fu=class extends Fs{constructor(e=16*1024){super({maxSize:e,sizeCalculation:s=>s.length+1})}},mh=Symbol("PathScurry setAsCwd"),Fe=class{name;root;roots;parent;nocase;isCWD=!1;#e;#s;get dev(){return this.#s}#r;get mode(){return this.#r}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#w;get gid(){return this.#w}#g;get rdev(){return this.#g}#c;get blksize(){return this.#c}#a;get ino(){return this.#a}#d;get size(){return this.#d}#f;get blocks(){return this.#f}#u;get atimeMs(){return this.#u}#n;get mtimeMs(){return this.#n}#h;get ctimeMs(){return this.#h}#C;get birthtimeMs(){return this.#C}#F;get atime(){return this.#F}#p;get mtime(){return this.#p}#k;get ctime(){return this.#k}#m;get birthtime(){return this.#m}#v;#x;#D;#y;#E;#S;#t;#R;#T;#A;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,s=qe,n,i,r,o,a){this.name=e,this.#v=r?br(e):Vn(e),this.#t=s&nb,this.nocase=r,this.roots=i,this.root=n||this,this.#R=o,this.#D=a.fullpath,this.#E=a.relative,this.#S=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=uh(a.fs)}depth(){return this.#x!==void 0?this.#x:this.parent?this.#x=this.parent.depth()+1:this.#x=0}childrenCache(){return this.#R}resolve(e){if(!e)return this;let s=this.getRootString(e),i=e.substring(s.length).split(this.splitSep);return s?this.getRoot(s).#I(i):this.#I(i)}#I(e){let s=this;for(let n of e)s=s.child(n);return s}children(){let e=this.#R.get(this);if(e)return e;let s=Object.assign([],{provisional:0});return this.#R.set(this,s),this.#t&=~gu,s}child(e,s){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?br(e):Vn(e);for(let u of n)if(u.#v===i)return u;let r=this.parent?this.sep:"",o=this.#D?this.#D+r+e:void 0,a=this.newChild(e,qe,{...s,parent:this,fullpath:o});return this.canReaddir()||(a.#t|=et),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#E!==void 0)return this.#E;let e=this.name,s=this.parent;if(!s)return this.#E=this.name;let n=s.relative();return n+(!n||!s.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#S!==void 0)return this.#S;let e=this.name,s=this.parent;if(!s)return this.#S=this.fullpathPosix();let n=s.relativePosix();return n+(!n||!s.parent?"":"/")+e}fullpath(){if(this.#D!==void 0)return this.#D;let e=this.name,s=this.parent;if(!s)return this.#D=this.name;let i=s.fullpath()+(s.parent?this.sep:"")+e;return this.#D=i}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#y=`//?/${i}`:this.#y=i}let e=this.parent,s=e.fullpathPosix(),n=s+(!s||!e.parent?"":"/")+this.name;return this.#y=n}isUnknown(){return(this.#t&je)===qe}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#t&je)===hh}isDirectory(){return(this.#t&je)===lt}isCharacterDevice(){return(this.#t&je)===fh}isBlockDevice(){return(this.#t&je)===dh}isFIFO(){return(this.#t&je)===ch}isSocket(){return(this.#t&je)===ph}isSymbolicLink(){return(this.#t&Cs)===Cs}lstatCached(){return this.#t&nh?this:void 0}readlinkCached(){return this.#T}realpathCached(){return this.#A}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#T)return!0;if(!this.parent)return!1;let e=this.#t&je;return!(e!==qe&&e!==Cs||this.#t&Er||this.#t&et)}calledReaddir(){return!!(this.#t&gu)}isENOENT(){return!!(this.#t&et)}isNamed(e){return this.nocase?this.#v===br(e):this.#v===Vn(e)}async readlink(){let e=this.#T;if(e)return e;if(this.canReadlink()&&this.parent)try{let s=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(s);if(n)return this.#T=n}catch(s){this.#B(s.code);return}}readlinkSync(){let e=this.#T;if(e)return e;if(this.canReadlink()&&this.parent)try{let s=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(s);if(n)return this.#T=n}catch(s){this.#B(s.code);return}}#L(e){this.#t|=gu;for(let s=e.provisional;s<e.length;s++){let n=e[s];n&&n.#b()}}#b(){this.#t&et||(this.#t=(this.#t|et)&qn,this.#V())}#V(){let e=this.children();e.provisional=0;for(let s of e)s.#b()}#O(){this.#t|=vr,this.#N()}#N(){if(this.#t&Wn)return;let e=this.#t;(e&je)===lt&&(e&=qn),this.#t=e|Wn,this.#V()}#M(e=""){e==="ENOTDIR"||e==="EPERM"?this.#N():e==="ENOENT"?this.#b():this.children().provisional=0}#_(e=""){e==="ENOTDIR"?this.parent.#N():e==="ENOENT"&&this.#b()}#B(e=""){let s=this.#t;s|=Er,e==="ENOENT"&&(s|=et),(e==="EINVAL"||e==="UNKNOWN")&&(s&=qn),this.#t=s,e==="ENOTDIR"&&this.parent&&this.parent.#N()}#j(e,s){return this.#U(e,s)||this.#q(e,s)}#q(e,s){let n=yu(e),i=this.newChild(e.name,n,{parent:this}),r=i.#t&je;return r!==lt&&r!==Cs&&r!==qe&&(i.#t|=Wn),s.unshift(i),s.provisional++,i}#U(e,s){for(let n=s.provisional;n<s.length;n++){let i=s[n];if((this.nocase?br(e.name):Vn(e.name))===i.#v)return this.#l(e,i,n,s)}}#l(e,s,n,i){let r=s.name;return s.#t=s.#t&qn|yu(e),r!==e.name&&(s.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(s)),i.provisional++,s}async lstat(){if((this.#t&et)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#_(e.code)}}lstatSync(){if((this.#t&et)===0)try{return this.#W(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#_(e.code)}}#W(e){let{atime:s,atimeMs:n,birthtime:i,birthtimeMs:r,blksize:o,blocks:a,ctime:u,ctimeMs:l,dev:c,gid:f,ino:d,mode:p,mtime:D,mtimeMs:m,nlink:g,rdev:F,size:y,uid:C}=e;this.#F=s,this.#u=n,this.#m=i,this.#C=r,this.#c=o,this.#f=a,this.#k=u,this.#h=l,this.#s=c,this.#w=f,this.#a=d,this.#r=p,this.#p=D,this.#n=m,this.#i=g,this.#g=F,this.#d=y,this.#o=C;let w=yu(e);this.#t=this.#t&qn|w|nh,w!==qe&&w!==lt&&w!==Cs&&(this.#t|=Wn)}#P=[];#$=!1;#z(e){this.#$=!1;let s=this.#P.slice();this.#P.length=0,s.forEach(n=>n(null,e))}readdirCB(e,s=!1){if(!this.canReaddir()){s?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let r=n.slice(0,n.provisional);s?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#P.push(e),this.#$)return;this.#$=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(r,o)=>{if(r)this.#M(r.code),n.provisional=0;else{for(let a of o)this.#j(a,n);this.#L(n)}this.#z(n.slice(0,n.provisional))})}#G;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let s=this.fullpath();if(this.#G)await this.#G;else{let n=()=>{};this.#G=new Promise(i=>n=i);try{for(let i of await this.#e.promises.readdir(s,{withFileTypes:!0}))this.#j(i,e);this.#L(e)}catch(i){this.#M(i.code),e.provisional=0}this.#G=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let s=this.fullpath();try{for(let n of this.#e.readdirSync(s,{withFileTypes:!0}))this.#j(n,e);this.#L(e)}catch(n){this.#M(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#t&ih)return!1;let e=je&this.#t;return e===qe||e===lt||e===Cs}shouldWalk(e,s){return(this.#t<)===lt&&!(this.#t&ih)&&!e.has(this)&&(!s||s(this))}async realpath(){if(this.#A)return this.#A;if(!((vr|Er|et)&this.#t))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#A=this.resolve(e)}catch{this.#O()}}realpathSync(){if(this.#A)return this.#A;if(!((vr|Er|et)&this.#t))try{let e=this.#e.realpathSync(this.fullpath());return this.#A=this.resolve(e)}catch{this.#O()}}[mh](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let s=new Set([]),n=[],i=this;for(;i&&i.parent;)s.add(i),i.#E=n.join(this.sep),i.#S=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!s.has(i);)i.#E=void 0,i.#S=void 0,i=i.parent}},Sr=class t extends Fe{sep="\\";splitSep=sb;constructor(e,s=qe,n,i,r,o,a){super(e,s,n,i,r,o,a)}newChild(e,s=qe,n={}){return new t(e,s,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Xs.win32.parse(e).root}getRoot(e){if(e=tb(e.toUpperCase()),e===this.root.name)return this.root;for(let[s,n]of Object.entries(this.roots))if(this.sameRoot(e,s))return this.roots[e]=n;return this.roots[e]=new en(e,this).root}sameRoot(e,s=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(lh,"$1\\"),e===s}},Ar=class t extends Fe{splitSep="/";sep="/";constructor(e,s=qe,n,i,r,o,a){super(e,s,n,i,r,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,s=qe,n={}){return new t(e,s,this.root,this.roots,this.nocase,this.childrenCache(),n)}},kr=class{root;rootPath;roots;cwd;#e;#s;#r;nocase;#i;constructor(e=process.cwd(),s,n,{nocase:i,childrenCacheSize:r=16*1024,fs:o=Un}={}){this.#i=uh(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,ah.fileURLToPath)(e));let a=s.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new xr,this.#s=new xr,this.#r=new Fu(r);let u=a.substring(this.rootPath.length).split(n);if(u.length===1&&!u[0]&&u.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let l=this.root,c=u.length-1,f=s.sep,d=this.rootPath,p=!1;for(let D of u){let m=c--;l=l.child(D,{relative:new Array(m).fill("..").join(f),relativePosix:new Array(m).fill("..").join("/"),fullpath:d+=(p?"":f)+D}),p=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let s="";for(let r=e.length-1;r>=0;r--){let o=e[r];if(!(!o||o===".")&&(s=s?`${o}/${s}`:o,this.isAbsolute(o)))break}let n=this.#e.get(s);if(n!==void 0)return n;let i=this.cwd.resolve(s).fullpath();return this.#e.set(s,i),i}resolvePosix(...e){let s="";for(let r=e.length-1;r>=0;r--){let o=e[r];if(!(!o||o===".")&&(s=s?`${o}/${s}`:o,this.isAbsolute(o)))break}let n=this.#s.get(s);if(n!==void 0)return n;let i=this.cwd.resolve(s).fullpathPosix();return this.#s.set(s,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,s={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Fe||(s=e,e=this.cwd);let{withFileTypes:n}=s;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(r=>r.name)}else return[]}readdirSync(e=this.cwd,s={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Fe||(s=e,e=this.cwd);let{withFileTypes:n=!0}=s;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:s}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Fe||(s=e.withFileTypes,e=this.cwd);let n=await e.readlink();return s?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:s}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Fe||(s=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return s?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:s}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Fe||(s=e.withFileTypes,e=this.cwd);let n=await e.realpath();return s?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:s}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Fe||(s=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return s?n:n?.fullpath()}async walk(e=this.cwd,s={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Fe||(s=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:r,walkFilter:o}=s,a=[];(!r||r(e))&&a.push(n?e:e.fullpath());let u=new Set,l=(f,d)=>{u.add(f),f.readdirCB((p,D)=>{if(p)return d(p);let m=D.length;if(!m)return d();let g=()=>{--m===0&&d()};for(let F of D)(!r||r(F))&&a.push(n?F:F.fullpath()),i&&F.isSymbolicLink()?F.realpath().then(y=>y?.isUnknown()?y.lstat():y).then(y=>y?.shouldWalk(u,o)?l(y,g):g()):F.shouldWalk(u,o)?l(F,g):g()},!0)},c=e;return new Promise((f,d)=>{l(c,p=>{if(p)return d(p);f(a)})})}walkSync(e=this.cwd,s={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Fe||(s=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:r,walkFilter:o}=s,a=[];(!r||r(e))&&a.push(n?e:e.fullpath());let u=new Set([e]);for(let l of u){let c=l.readdirSync();for(let f of c){(!r||r(f))&&a.push(n?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(u,o)&&u.add(d)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,s={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Fe||(s=e,e=this.cwd),this.stream(e,s)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,s={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Fe||(s=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:r,walkFilter:o}=s;(!r||r(e))&&(yield n?e:e.fullpath());let a=new Set([e]);for(let u of a){let l=u.readdirSync();for(let c of l){(!r||r(c))&&(yield n?c:c.fullpath());let f=c;if(c.isSymbolicLink()){if(!(i&&(f=c.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(a,o)&&a.add(f)}}}stream(e=this.cwd,s={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Fe||(s=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:r,walkFilter:o}=s,a=new Mt({objectMode:!0});(!r||r(e))&&a.write(n?e:e.fullpath());let u=new Set,l=[e],c=0,f=()=>{let d=!1;for(;!d;){let p=l.shift();if(!p){c===0&&a.end();return}c++,u.add(p);let D=(g,F,y=!1)=>{if(g)return a.emit("error",g);if(i&&!y){let C=[];for(let w of F)w.isSymbolicLink()&&C.push(w.realpath().then(E=>E?.isUnknown()?E.lstat():E));if(C.length){Promise.all(C).then(()=>D(null,F,!0));return}}for(let C of F)C&&(!r||r(C))&&(a.write(n?C:C.fullpath())||(d=!0));c--;for(let C of F){let w=C.realpathCached()||C;w.shouldWalk(u,o)&&l.push(w)}d&&!a.flowing?a.once("drain",f):m||f()},m=!0;p.readdirCB(D,!0),m=!1}};return f(),a}streamSync(e=this.cwd,s={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Fe||(s=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:r,walkFilter:o}=s,a=new Mt({objectMode:!0}),u=new Set;(!r||r(e))&&a.write(n?e:e.fullpath());let l=[e],c=0,f=()=>{let d=!1;for(;!d;){let p=l.shift();if(!p){c===0&&a.end();return}c++,u.add(p);let D=p.readdirSync();for(let m of D)(!r||r(m))&&(a.write(n?m:m.fullpath())||(d=!0));c--;for(let m of D){let g=m;if(m.isSymbolicLink()){if(!(i&&(g=m.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(u,o)&&l.push(g)}}d&&!a.flowing&&a.once("drain",f)};return f(),a}chdir(e=this.cwd){let s=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[mh](s)}},en=class extends kr{sep="\\";constructor(e=process.cwd(),s={}){let{nocase:n=!0}=s;super(e,Xs.win32,"\\",{...s,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Xs.win32.parse(e).root.toUpperCase()}newRoot(e){return new Sr(this.rootPath,lt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},tn=class extends kr{sep="/";constructor(e=process.cwd(),s={}){let{nocase:n=!1}=s;super(e,Xs.posix,"/",{...s,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new Ar(this.rootPath,lt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},zn=class extends tn{constructor(e=process.cwd(),s={}){let{nocase:n=!0}=s;super(e,{...s,nocase:n})}},$k=process.platform==="win32"?Sr:Ar,Dh=process.platform==="win32"?en:process.platform==="darwin"?zn:tn});var ib,rb,sn,wu=q(()=>{Pt();ib=t=>t.length>=1,rb=t=>t.length>=1,sn=class t{#e;#s;#r;length;#i;#o;#w;#g;#c;#a;#d=!0;constructor(e,s,n,i){if(!ib(e))throw new TypeError("empty pattern list");if(!rb(s))throw new TypeError("empty glob list");if(s.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#s=s,this.#r=n,this.#i=i,this.#r===0){if(this.isUNC()){let[r,o,a,u,...l]=this.#e,[c,f,d,p,...D]=this.#s;l[0]===""&&(l.shift(),D.shift());let m=[r,o,a,u,""].join("/"),g=[c,f,d,p,""].join("/");this.#e=[m,...l],this.#s=[g,...D],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[r,...o]=this.#e,[a,...u]=this.#s;o[0]===""&&(o.shift(),u.shift());let l=r+"/",c=a+"/";this.#e=[l,...o],this.#s=[c,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===de}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#w=this.#w||(this.#r===0?this.isAbsolute()?this.#s[0]+this.#s.slice(1).join("/"):this.#s.join("/"):this.#s.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#s,this.#r+1,this.#i),this.#o.#a=this.#a,this.#o.#c=this.#c,this.#o.#g=this.#g,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=this.#i==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#g!==void 0?this.#g:this.#g=this.#i==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#d)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#d?!1:(this.#d=!1,!0)}}});var ob,Es,Cu=q(()=>{Pt();wu();ob=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Es=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:s,nocase:n,noext:i,noglobstar:r,platform:o=ob}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:s,nocase:n,noext:i,noglobstar:r,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let s=new Ie(e,this.mmopts);for(let n=0;n<s.set.length;n++){let i=s.set[n],r=s.globParts[n];if(!i||!r)throw new Error("invalid pattern object");for(;i[0]==="."&&r[0]===".";)i.shift(),r.shift();let o=new sn(i,r,0,this.platform),a=new Ie(o.globString(),this.mmopts),u=r[r.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),u&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let s=e.fullpath(),n=`${s}/`,i=e.relative()||".",r=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(r))return!0;for(let o of this.absolute)if(o.match(s)||o.match(n))return!0;return!1}childrenIgnored(e){let s=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(s))return!0;return!1}}});var Eu,bu,vu,Gn,yh=q(()=>{Pt();Eu=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,s){return this.store.get(e.fullpath())?.has(s.globString())}storeWalked(e,s){let n=e.fullpath(),i=this.store.get(n);i?i.add(s.globString()):this.store.set(n,new Set([s.globString()]))}},bu=class{store=new Map;add(e,s,n){let i=(s?2:0)|(n?1:0),r=this.store.get(e);this.store.set(e,r===void 0?i:i&r)}entries(){return[...this.store.entries()].map(([e,s])=>[e,!!(s&2),!!(s&1)])}},vu=class{store=new Map;add(e,s){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===s.globString())||n.push(s):this.store.set(e,[s])}get(e){let s=this.store.get(e);if(!s)throw new Error("attempting to walk unknown path");return s}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Gn=class t{hasWalkedCache;matches=new bu;subwalks=new vu;patterns;follow;dot;opts;constructor(e,s){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=s?s.copy():new Eu}processPatterns(e,s){this.patterns=s;let n=s.map(i=>[e,i]);for(let[i,r]of n){this.hasWalkedCache.storeWalked(i,r);let o=r.root(),a=r.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=r.rest();if(f)r=f;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,l,c=!1;for(;typeof(u=r.pattern())=="string"&&(l=r.rest());)i=i.resolve(u),r=l,c=!0;if(u=r.pattern(),l=r.rest(),c){if(this.hasWalkedCache.hasWalked(i,r))continue;this.hasWalkedCache.storeWalked(i,r)}if(typeof u=="string"){let f=u===".."||u===""||u===".";this.matches.add(i.resolve(u),a,f);continue}else if(u===de){(!i.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(i,r);let f=l?.pattern(),d=l?.rest();if(!l||(f===""||f===".")&&!d)this.matches.add(i,a,f===""||f===".");else if(f===".."){let p=i.parent||i;d?this.hasWalkedCache.hasWalked(p,d)||this.subwalks.add(p,d):this.matches.add(p,a,!0)}}else u instanceof RegExp&&this.subwalks.add(i,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,s){let n=this.subwalks.get(e),i=this.child();for(let r of s)for(let o of n){let a=o.isAbsolute(),u=o.pattern(),l=o.rest();u===de?i.testGlobstar(r,o,l,a):u instanceof RegExp?i.testRegExp(r,u,l,a):i.testString(r,u,l,a)}return i}testGlobstar(e,s,n,i){if((this.dot||!e.name.startsWith("."))&&(s.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,s):e.isSymbolicLink()&&(n&&s.checkFollowGlobstar()?this.subwalks.add(e,n):s.markFollowGlobstar()&&this.subwalks.add(e,s)))),n){let r=n.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(e,r,n.rest(),i);else if(r===".."){let o=e.parent||e;this.subwalks.add(o,n)}else r instanceof RegExp&&this.testRegExp(e,r,n.rest(),i)}}testRegExp(e,s,n,i){s.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,s,n,i){e.isNamed(s)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}}});var ab,$r,Kn,Yn,Fh=q(()=>{Du();Cu();yh();ab=(t,e)=>typeof t=="string"?new Es([t],e):Array.isArray(t)?new Es(t,e):t,$r=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#s;#r;signal;maxDepth;includeChildMatches;constructor(e,s,n){if(this.patterns=e,this.path=s,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#s=ab(n.ignore??[],n),!this.includeChildMatches&&typeof this.#s.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#s?.ignored?.(e)}#o(e){return!!this.#s?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,s){if(s&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=await r.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(r,s)}matchCheckTest(e,s){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!s||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,s){if(s&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=r.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(r,s)}matchFinish(e,s){if(this.#i(e))return;if(!this.includeChildMatches&&this.#s?.add){let r=`${e.relativePosix()}/**`;this.#s.add(r)}let n=this.opts.absolute===void 0?s:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let r=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(r+i)}else{let r=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!r.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(r?o+r+i:"."+i)}}async match(e,s,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,s)}matchSync(e,s,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,s)}walkCB(e,s,n){this.signal?.aborted&&n(),this.walkCB2(e,s,new Gn(this.opts),n)}walkCB2(e,s,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,s,n,i));return}n.processPatterns(e,s);let r=1,o=()=>{--r===0&&i()};for(let[a,u,l]of n.matches.entries())this.#i(a)||(r++,this.match(a,u,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,n,o):a.readdirCB((l,c)=>this.walkCB3(a,c,n,o),!0)}o()}walkCB3(e,s,n,i){n=n.filterEntries(e,s);let r=1,o=()=>{--r===0&&i()};for(let[a,u,l]of n.matches.entries())this.#i(a)||(r++,this.match(a,u,l).then(()=>o()));for(let[a,u]of n.subwalks.entries())r++,this.walkCB2(a,u,n.child(),o);o()}walkCBSync(e,s,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,s,new Gn(this.opts),n)}walkCB2Sync(e,s,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,s,n,i));return}n.processPatterns(e,s);let r=1,o=()=>{--r===0&&i()};for(let[a,u,l]of n.matches.entries())this.#i(a)||this.matchSync(a,u,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let u=a.readdirSync();this.walkCB3Sync(a,u,n,o)}o()}walkCB3Sync(e,s,n,i){n=n.filterEntries(e,s);let r=1,o=()=>{--r===0&&i()};for(let[a,u,l]of n.matches.entries())this.#i(a)||this.matchSync(a,u,l);for(let[a,u]of n.subwalks.entries())r++,this.walkCB2Sync(a,u,n.child(),o);o()}},Kn=class extends $r{matches=new Set;constructor(e,s,n){super(e,s,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,s)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?s(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Yn=class extends $r{results;constructor(e,s,n){super(e,s,n),this.results=new Mt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}});var wh,ub,Ue,xu=q(()=>{Pt();wh=require("node:url");gh();wu();Fh();ub=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ue=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,s){if(!s)throw new TypeError("glob options required");if(this.withFileTypes=!!s.withFileTypes,this.signal=s.signal,this.follow=!!s.follow,this.dot=!!s.dot,this.dotRelative=!!s.dotRelative,this.nodir=!!s.nodir,this.mark=!!s.mark,s.cwd?(s.cwd instanceof URL||s.cwd.startsWith("file://"))&&(s.cwd=(0,wh.fileURLToPath)(s.cwd)):this.cwd="",this.cwd=s.cwd||"",this.root=s.root,this.magicalBraces=!!s.magicalBraces,this.nobrace=!!s.nobrace,this.noext=!!s.noext,this.realpath=!!s.realpath,this.absolute=s.absolute,this.includeChildMatches=s.includeChildMatches!==!1,this.noglobstar=!!s.noglobstar,this.matchBase=!!s.matchBase,this.maxDepth=typeof s.maxDepth=="number"?s.maxDepth:1/0,this.stat=!!s.stat,this.ignore=s.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!s.windowsPathsNoEscape||s.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(s.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=s.platform||ub,this.opts={...s,platform:this.platform},s.scurry){if(this.scurry=s.scurry,s.nocase!==void 0&&s.nocase!==s.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=s.platform==="win32"?en:s.platform==="darwin"?zn:s.platform?tn:Dh;this.scurry=new u(this.cwd,{nocase:s.nocase,fs:s.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...s,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map(u=>new Ie(u,i)),[o,a]=r.reduce((u,l)=>(u[0].push(...l.set),u[1].push(...l.globParts),u),[[],[]]);this.patterns=o.map((u,l)=>{let c=a[l];if(!c)throw new Error("invalid pattern object");return new sn(u,c,0,this.platform)})}async walk(){return[...await new Kn(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Kn(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Yn(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Yn(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}});var _r,Su=q(()=>{Pt();_r=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let s of t)if(new Ie(s,e).hasMagic())return!0;return!1}});var Ah={};wn(Ah,{Glob:()=>Ue,Ignore:()=>Es,escape:()=>ys,glob:()=>bt,globIterate:()=>$u,globIterateSync:()=>Jn,globStream:()=>Au,globStreamSync:()=>Hn,globSync:()=>ku,hasMagic:()=>_r,iterate:()=>xh,iterateSync:()=>vh,stream:()=>bh,streamSync:()=>Eh,sync:()=>Sh,unescape:()=>Le});function Hn(t,e={}){return new Ue(t,e).streamSync()}function Au(t,e={}){return new Ue(t,e).stream()}function ku(t,e={}){return new Ue(t,e).walkSync()}async function Ch(t,e={}){return new Ue(t,e).walk()}function Jn(t,e={}){return new Ue(t,e).iterateSync()}function $u(t,e={}){return new Ue(t,e).iterate()}var Eh,bh,vh,xh,Sh,bt,Br=q(()=>{Pt();xu();Su();Pt();xu();Su();Cu();Eh=Hn,bh=Object.assign(Au,{sync:Hn}),vh=Jn,xh=Object.assign($u,{sync:Jn}),Sh=Object.assign(ku,{stream:Hn,iterate:Jn}),bt=Object.assign(Ch,{glob:Ch,globSync:ku,sync:Sh,globStream:Au,stream:bh,globStreamSync:Hn,streamSync:Eh,globIterate:$u,iterate:xh,globIterateSync:Jn,iterateSync:vh,Glob:Ue,hasMagic:_r,escape:ys,unescape:Le});bt.glob=bt});var K=S(he=>{"use strict";var _u=Symbol.for("yaml.alias"),kh=Symbol.for("yaml.document"),Tr=Symbol.for("yaml.map"),$h=Symbol.for("yaml.pair"),Bu=Symbol.for("yaml.scalar"),Ir=Symbol.for("yaml.seq"),vt=Symbol.for("yaml.node.type"),lb=t=>!!t&&typeof t=="object"&&t[vt]===_u,cb=t=>!!t&&typeof t=="object"&&t[vt]===kh,fb=t=>!!t&&typeof t=="object"&&t[vt]===Tr,db=t=>!!t&&typeof t=="object"&&t[vt]===$h,_h=t=>!!t&&typeof t=="object"&&t[vt]===Bu,hb=t=>!!t&&typeof t=="object"&&t[vt]===Ir;function Bh(t){if(t&&typeof t=="object")switch(t[vt]){case Tr:case Ir:return!0}return!1}function pb(t){if(t&&typeof t=="object")switch(t[vt]){case _u:case Tr:case Bu:case Ir:return!0}return!1}var mb=t=>(_h(t)||Bh(t))&&!!t.anchor;he.ALIAS=_u;he.DOC=kh;he.MAP=Tr;he.NODE_TYPE=vt;he.PAIR=$h;he.SCALAR=Bu;he.SEQ=Ir;he.hasAnchor=mb;he.isAlias=lb;he.isCollection=Bh;he.isDocument=cb;he.isMap=fb;he.isNode=pb;he.isPair=db;he.isScalar=_h;he.isSeq=hb});var Zn=S(Tu=>{"use strict";var ne=K(),$e=Symbol("break visit"),Th=Symbol("skip children"),ft=Symbol("remove node");function Rr(t,e){let s=Ih(e);ne.isDocument(t)?nn(null,t.contents,s,Object.freeze([t]))===ft&&(t.contents=null):nn(null,t,s,Object.freeze([]))}Rr.BREAK=$e;Rr.SKIP=Th;Rr.REMOVE=ft;function nn(t,e,s,n){let i=Rh(t,e,s,n);if(ne.isNode(i)||ne.isPair(i))return Nh(t,n,i),nn(t,i,s,n);if(typeof i!="symbol"){if(ne.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=nn(r,e.items[r],s,n);if(typeof o=="number")r=o-1;else{if(o===$e)return $e;o===ft&&(e.items.splice(r,1),r-=1)}}}else if(ne.isPair(e)){n=Object.freeze(n.concat(e));let r=nn("key",e.key,s,n);if(r===$e)return $e;r===ft&&(e.key=null);let o=nn("value",e.value,s,n);if(o===$e)return $e;o===ft&&(e.value=null)}}return i}async function Nr(t,e){let s=Ih(e);ne.isDocument(t)?await rn(null,t.contents,s,Object.freeze([t]))===ft&&(t.contents=null):await rn(null,t,s,Object.freeze([]))}Nr.BREAK=$e;Nr.SKIP=Th;Nr.REMOVE=ft;async function rn(t,e,s,n){let i=await Rh(t,e,s,n);if(ne.isNode(i)||ne.isPair(i))return Nh(t,n,i),rn(t,i,s,n);if(typeof i!="symbol"){if(ne.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await rn(r,e.items[r],s,n);if(typeof o=="number")r=o-1;else{if(o===$e)return $e;o===ft&&(e.items.splice(r,1),r-=1)}}}else if(ne.isPair(e)){n=Object.freeze(n.concat(e));let r=await rn("key",e.key,s,n);if(r===$e)return $e;r===ft&&(e.key=null);let o=await rn("value",e.value,s,n);if(o===$e)return $e;o===ft&&(e.value=null)}}return i}function Ih(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Rh(t,e,s,n){if(typeof s=="function")return s(t,e,n);if(ne.isMap(e))return s.Map?.(t,e,n);if(ne.isSeq(e))return s.Seq?.(t,e,n);if(ne.isPair(e))return s.Pair?.(t,e,n);if(ne.isScalar(e))return s.Scalar?.(t,e,n);if(ne.isAlias(e))return s.Alias?.(t,e,n)}function Nh(t,e,s){let n=e[e.length-1];if(ne.isCollection(n))n.items[t]=s;else if(ne.isPair(n))t==="key"?n.key=s:n.value=s;else if(ne.isDocument(n))n.contents=s;else{let i=ne.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}Tu.visit=Rr;Tu.visitAsync=Nr});var Iu=S(Oh=>{"use strict";var Ph=K(),Db=Zn(),gb={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},yb=t=>t.replace(/[!,[\]{}]/g,e=>gb[e]),Qn=class t{constructor(e,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,s)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,s){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return s(6,`Unsupported YAML version ${r}`,o),!1}}default:return s(0,`Unknown directive ${i}`,!0),!1}}tagName(e,s){if(e==="!")return"!";if(e[0]!=="!")return s(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(s(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&s("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||s(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return s(String(o)),null}return n==="!"?e:(s(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[s,n]of Object.entries(this.tags))if(e.startsWith(n))return s+yb(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&Ph.isNode(e.contents)){let r={};Db.visit(e.contents,(o,a)=>{Ph.isNode(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&s.push(`%TAG ${r} ${o}`);return s.join(`
|
|
59
|
+
`)}};Qn.defaultYaml={explicit:!1,version:"1.2"};Qn.defaultTags={"!!":"tag:yaml.org,2002:"};Oh.Directives=Qn});var Pr=S(Xn=>{"use strict";var Lh=K(),Fb=Zn();function wb(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(s)}return!0}function Mh(t){let e=new Set;return Fb.visit(t,{Value(s,n){n.anchor&&e.add(n.anchor)}}),e}function jh(t,e){for(let s=1;;++s){let n=`${t}${s}`;if(!e.has(n))return n}}function Cb(t,e){let s=[],n=new Map,i=null;return{onAnchor:r=>{s.push(r),i??(i=Mh(t));let o=jh(e,i);return i.add(o),o},setAnchors:()=>{for(let r of s){let o=n.get(r);if(typeof o=="object"&&o.anchor&&(Lh.isScalar(o.node)||Lh.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}Xn.anchorIsValid=wb;Xn.anchorNames=Mh;Xn.createNodeAnchors=Cb;Xn.findNewAnchor=jh});var Ru=S(qh=>{"use strict";function ei(t,e,s,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],a=ei(t,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=ei(t,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=ei(t,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let o=ei(t,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return t.call(e,s,n)}qh.applyReviver=ei});var qt=S(Wh=>{"use strict";var Eb=K();function Uh(t,e,s){if(Array.isArray(t))return t.map((n,i)=>Uh(n,String(i),s));if(t&&typeof t.toJSON=="function"){if(!s||!Eb.hasAnchor(t))return t.toJSON(e,s);let n={aliasCount:0,count:1,res:void 0};s.anchors.set(t,n),s.onCreate=r=>{n.res=r,delete s.onCreate};let i=t.toJSON(e,s);return s.onCreate&&s.onCreate(i),i}return typeof t=="bigint"&&!s?.keep?Number(t):t}Wh.toJS=Uh});var Or=S(zh=>{"use strict";var bb=Ru(),Vh=K(),vb=qt(),Nu=class{constructor(e){Object.defineProperty(this,Vh.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:s,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!Vh.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=vb.toJS(this,"",o);if(typeof i=="function")for(let{count:u,res:l}of o.anchors.values())i(l,u);return typeof r=="function"?bb.applyReviver(r,{"":a},"",a):a}};zh.NodeBase=Nu});var ti=S(Gh=>{"use strict";var xb=Pr(),Sb=Zn(),on=K(),Ab=Or(),kb=qt(),Pu=class extends Ab.NodeBase{constructor(e){super(on.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,s){let n;s?.aliasResolveCache?n=s.aliasResolveCache:(n=[],Sb.visit(e,{Node:(r,o)=>{(on.isAlias(o)||on.hasAnchor(o))&&n.push(o)}}),s&&(s.aliasResolveCache=n));let i;for(let r of n){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,s){if(!s)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:r}=s,o=this.resolve(i,s);if(!o){let u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let a=n.get(o);if(a||(kb.toJS(o,null,s),a=n.get(o)),a?.res===void 0){let u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Lr(i,o,n)),a.count*a.aliasCount>r)){let u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return a.res}toString(e,s,n){let i=`*${this.source}`;if(e){if(xb.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function Lr(t,e,s){if(on.isAlias(e)){let n=e.resolve(t),i=s&&n&&s.get(n);return i?i.count*i.aliasCount:0}else if(on.isCollection(e)){let n=0;for(let i of e.items){let r=Lr(t,i,s);r>n&&(n=r)}return n}else if(on.isPair(e)){let n=Lr(t,e.key,s),i=Lr(t,e.value,s);return Math.max(n,i)}return 1}Gh.Alias=Pu});var ee=S(Ou=>{"use strict";var $b=K(),_b=Or(),Bb=qt(),Tb=t=>!t||typeof t!="function"&&typeof t!="object",Ut=class extends _b.NodeBase{constructor(e){super($b.SCALAR),this.value=e}toJSON(e,s){return s?.keep?this.value:Bb.toJS(this.value,e,s)}toString(){return String(this.value)}};Ut.BLOCK_FOLDED="BLOCK_FOLDED";Ut.BLOCK_LITERAL="BLOCK_LITERAL";Ut.PLAIN="PLAIN";Ut.QUOTE_DOUBLE="QUOTE_DOUBLE";Ut.QUOTE_SINGLE="QUOTE_SINGLE";Ou.Scalar=Ut;Ou.isScalarValue=Tb});var si=S(Yh=>{"use strict";var Ib=ti(),bs=K(),Kh=ee(),Rb="tag:yaml.org,2002:";function Nb(t,e,s){if(e){let n=s.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return s.find(n=>n.identify?.(t)&&!n.format)}function Pb(t,e,s){if(bs.isDocument(t)&&(t=t.contents),bs.isNode(t))return t;if(bs.isPair(t)){let f=s.schema[bs.MAP].createNode?.(s.schema,null,s);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=s,u;if(n&&t&&typeof t=="object"){if(u=a.get(t),u)return u.anchor??(u.anchor=i(t)),new Ib.Alias(u.anchor);u={anchor:null,node:null},a.set(t,u)}e?.startsWith("!!")&&(e=Rb+e.slice(2));let l=Nb(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new Kh.Scalar(t);return u&&(u.node=f),f}l=t instanceof Map?o[bs.MAP]:Symbol.iterator in Object(t)?o[bs.SEQ]:o[bs.MAP]}r&&(r(l),delete s.onTagObj);let c=l?.createNode?l.createNode(s.schema,t,s):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(s.schema,t,s):new Kh.Scalar(t);return e?c.tag=e:l.default||(c.tag=l.tag),u&&(u.node=c),c}Yh.createNode=Pb});var jr=S(Mr=>{"use strict";var Ob=si(),dt=K(),Lb=Or();function Lu(t,e,s){let n=s;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return Ob.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Hh=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Mu=class extends Lb.NodeBase{constructor(e,s){super(e),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(e){let s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(s.schema=e),s.items=s.items.map(n=>dt.isNode(n)||dt.isPair(n)?n.clone(e):n),this.range&&(s.range=this.range.slice()),s}addIn(e,s){if(Hh(e))this.add(s);else{let[n,...i]=e,r=this.get(n,!0);if(dt.isCollection(r))r.addIn(i,s);else if(r===void 0&&this.schema)this.set(n,Lu(this.schema,i,s));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[s,...n]=e;if(n.length===0)return this.delete(s);let i=this.get(s,!0);if(dt.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}getIn(e,s){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!s&&dt.isScalar(r)?r.value:r:dt.isCollection(r)?r.getIn(i,s):void 0}hasAllNullValues(e){return this.items.every(s=>{if(!dt.isPair(s))return!1;let n=s.value;return n==null||e&&dt.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[s,...n]=e;if(n.length===0)return this.has(s);let i=this.get(s,!0);return dt.isCollection(i)?i.hasIn(n):!1}setIn(e,s){let[n,...i]=e;if(i.length===0)this.set(n,s);else{let r=this.get(n,!0);if(dt.isCollection(r))r.setIn(i,s);else if(r===void 0&&this.schema)this.set(n,Lu(this.schema,i,s));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Mr.Collection=Mu;Mr.collectionFromPath=Lu;Mr.isEmptyPath=Hh});var ni=S(qr=>{"use strict";var Mb=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ju(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var jb=(t,e,s)=>t.endsWith(`
|
|
60
|
+
`)?ju(s,e):s.includes(`
|
|
61
61
|
`)?`
|
|
62
|
-
`+
|
|
63
|
-
`)s===
|
|
62
|
+
`+ju(s,e):(t.endsWith(" ")?"":" ")+s;qr.indentComment=ju;qr.lineComment=jb;qr.stringifyComment=Mb});var Zh=S(ii=>{"use strict";var qb="flow",qu="block",Ur="quoted";function Ub(t,e,s="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return t;i<r&&(r=0);let u=Math.max(1+r,1+i-e.length);if(t.length<=u)return t;let l=[],c={},f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?l.push(0):f=i-n);let d,p,D=!1,m=-1,g=-1,F=-1;s===qu&&(m=Jh(t,m,e.length),m!==-1&&(f=m+u));for(let C;C=t[m+=1];){if(s===Ur&&C==="\\"){switch(g=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}F=m}if(C===`
|
|
63
|
+
`)s===qu&&(m=Jh(t,m,e.length)),f=m+e.length+u,d=void 0;else{if(C===" "&&p&&p!==" "&&p!==`
|
|
64
64
|
`&&p!==" "){let w=t[m+1];w&&w!==" "&&w!==`
|
|
65
|
-
`&&w!==" "&&(d=m)}if(m>=f)if(d)l.push(d),f=d+u,d=void 0;else if(s===
|
|
66
|
-
${e}${t.slice(0,
|
|
67
|
-
${e}${t.slice(w+1,
|
|
68
|
-
`);n=e,i=e+1,r=t[i]}return n}ii.FOLD_BLOCK=
|
|
65
|
+
`&&w!==" "&&(d=m)}if(m>=f)if(d)l.push(d),f=d+u,d=void 0;else if(s===Ur){for(;p===" "||p===" ";)p=C,C=t[m+=1],D=!0;let w=m>F+1?m-2:g-1;if(c[w])return t;l.push(w),c[w]=!0,f=w+u,d=void 0}else D=!0}p=C}if(D&&a&&a(),l.length===0)return t;o&&o();let y=t.slice(0,l[0]);for(let C=0;C<l.length;++C){let w=l[C],E=l[C+1]||t.length;w===0?y=`
|
|
66
|
+
${e}${t.slice(0,E)}`:(s===Ur&&c[w]&&(y+=`${t[w]}\\`),y+=`
|
|
67
|
+
${e}${t.slice(w+1,E)}`)}return y}function Jh(t,e,s){let n=e,i=e+1,r=t[i];for(;r===" "||r===" ";)if(e<i+s)r=t[++e];else{do r=t[++e];while(r&&r!==`
|
|
68
|
+
`);n=e,i=e+1,r=t[i]}return n}ii.FOLD_BLOCK=qu;ii.FOLD_FLOW=qb;ii.FOLD_QUOTED=Ur;ii.foldFlowLines=Ub});var oi=S(Qh=>{"use strict";var tt=ee(),Wt=Zh(),Vr=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),zr=t=>/^(%|---|\.\.\.)/m.test(t);function Wb(t,e,s){if(!e||e<0)return!1;let n=e-s,i=t.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(t[r]===`
|
|
69
69
|
`){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function ri(t,e){let s=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return s;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(zr(t)?" ":""),o="",a=0;for(let u=0,l=s[u];l;l=s[++u])if(l===" "&&s[u+1]==="\\"&&s[u+2]==="n"&&(o+=s.slice(a,u)+"\\ ",u+=1,a=u,l="\\"),l==="\\")switch(s[u+1]){case"u":{o+=s.slice(a,u);let c=s.substr(u+2,4);switch(c){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:c.substr(0,2)==="00"?o+="\\x"+c.substr(2):o+=s.substr(u,6)}u+=5,a=u+1}break;case"n":if(n||s[u+2]==='"'||s.length<i)u+=1;else{for(o+=s.slice(a,u)+`
|
|
70
70
|
|
|
71
71
|
`;s[u+2]==="\\"&&s[u+3]==="n"&&s[u+4]!=='"';)o+=`
|
|
72
|
-
`,u+=2;o+=r,s[u+2]===" "&&(o+="\\"),u+=1,a=u+1}break;default:u+=1}return o=a?o+s.slice(a):s,n?o:
|
|
72
|
+
`,u+=2;o+=r,s[u+2]===" "&&(o+="\\"),u+=1,a=u+1}break;default:u+=1}return o=a?o+s.slice(a):s,n?o:Wt.foldFlowLines(o,r,Wt.FOLD_QUOTED,Vr(e,!1))}function Uu(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
73
73
|
`)||/[ \t]\n|\n[ \t]/.test(t))return ri(t,e);let s=e.indent||(zr(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
74
|
-
${s}`)+"'";return e.implicitKey?n:
|
|
74
|
+
${s}`)+"'";return e.implicitKey?n:Wt.foldFlowLines(n,s,Wt.FOLD_FLOW,Vr(e,!1))}function an(t,e){let{singleQuote:s}=e.options,n;if(s===!1)n=ri;else{let i=t.includes('"'),r=t.includes("'");i&&!r?n=Uu:r&&!i?n=ri:n=s?Uu:ri}return n(t,e)}var Wu;try{Wu=new RegExp(`(^|(?<!
|
|
75
75
|
))
|
|
76
76
|
+(?!
|
|
77
|
-
|$)`,"g")}catch{
|
|
77
|
+
|$)`,"g")}catch{Wu=/\n+(?!\n|$)/g}function Wr({comment:t,type:e,value:s},n,i,r){let{blockQuote:o,commentString:a,lineWidth:u}=n.options;if(!o||/\n[\t ]+$/.test(s))return an(s,n);let l=n.indent||(n.forceBlockIndent||zr(s)?" ":""),c=o==="literal"?!0:o==="folded"||e===tt.Scalar.BLOCK_FOLDED?!1:e===tt.Scalar.BLOCK_LITERAL?!0:!Wb(s,u,l.length);if(!s)return c?`|
|
|
78
78
|
`:`>
|
|
79
|
-
`;let f,d;for(d=s.length;d>0;--d){let
|
|
80
|
-
`&&
|
|
79
|
+
`;let f,d;for(d=s.length;d>0;--d){let E=s[d-1];if(E!==`
|
|
80
|
+
`&&E!==" "&&E!==" ")break}let p=s.substring(d),D=p.indexOf(`
|
|
81
81
|
`);D===-1?f="-":s===p||D!==p.length-1?(f="+",r&&r()):f="",p&&(s=s.slice(0,-p.length),p[p.length-1]===`
|
|
82
|
-
`&&(p=p.slice(0,-1)),p=p.replace(
|
|
83
|
-
`)F=g;else break}let y=s.substring(0,F<g?F+1:g);y&&(s=s.substring(y.length),y=y.replace(/\n+/g,`$&${l}`));let w=(m?l?"2":"1":"")+f;if(t&&(w+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!c){let
|
|
84
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),
|
|
85
|
-
${l}${
|
|
86
|
-
${l}${y}${s}${p}`}function
|
|
87
|
-
`)||c&&/[[\]{},]/.test(r))return
|
|
88
|
-
`)?
|
|
89
|
-
`))return
|
|
90
|
-
${u}`);if(o){let d=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),{compat:p,tags:D}=e.doc.schema;if(D.some(d)||p?.some(d))return
|
|
91
|
-
${e.indent}${a}`:a}
|
|
92
|
-
${a}:`):(g=`${g}:`,d&&(g+=ui.lineComment(g,s.indent,l(d))));let F,y,C;
|
|
93
|
-
`:"",y){let
|
|
94
|
-
${ui.indentComment(
|
|
95
|
-
`&&C&&(
|
|
96
|
-
|
|
97
|
-
`):
|
|
98
|
-
${s.indent}`}else if(!p&&
|
|
99
|
-
`)
|
|
100
|
-
${s.indent}`)}}else(
|
|
101
|
-
`)&&(
|
|
82
|
+
`&&(p=p.slice(0,-1)),p=p.replace(Wu,`$&${l}`));let m=!1,g,F=-1;for(g=0;g<s.length;++g){let E=s[g];if(E===" ")m=!0;else if(E===`
|
|
83
|
+
`)F=g;else break}let y=s.substring(0,F<g?F+1:g);y&&(s=s.substring(y.length),y=y.replace(/\n+/g,`$&${l}`));let w=(m?l?"2":"1":"")+f;if(t&&(w+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!c){let E=s.replace(/\n+/g,`
|
|
84
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),v=!1,B=Vr(n,!0);o!=="folded"&&e!==tt.Scalar.BLOCK_FOLDED&&(B.onOverflow=()=>{v=!0});let A=Wt.foldFlowLines(`${y}${E}${p}`,l,Wt.FOLD_BLOCK,B);if(!v)return`>${w}
|
|
85
|
+
${l}${A}`}return s=s.replace(/\n+/g,`$&${l}`),`|${w}
|
|
86
|
+
${l}${y}${s}${p}`}function Vb(t,e,s,n){let{type:i,value:r}=t,{actualString:o,implicitKey:a,indent:u,indentStep:l,inFlow:c}=e;if(a&&r.includes(`
|
|
87
|
+
`)||c&&/[[\]{},]/.test(r))return an(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||c||!r.includes(`
|
|
88
|
+
`)?an(r,e):Wr(t,e,s,n);if(!a&&!c&&i!==tt.Scalar.PLAIN&&r.includes(`
|
|
89
|
+
`))return Wr(t,e,s,n);if(zr(r)){if(u==="")return e.forceBlockIndent=!0,Wr(t,e,s,n);if(a&&u===l)return an(r,e)}let f=r.replace(/\n+/g,`$&
|
|
90
|
+
${u}`);if(o){let d=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),{compat:p,tags:D}=e.doc.schema;if(D.some(d)||p?.some(d))return an(r,e)}return a?f:Wt.foldFlowLines(f,u,Wt.FOLD_FLOW,Vr(e,!1))}function zb(t,e,s,n){let{implicitKey:i,inFlow:r}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==tt.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=tt.Scalar.QUOTE_DOUBLE);let u=c=>{switch(c){case tt.Scalar.BLOCK_FOLDED:case tt.Scalar.BLOCK_LITERAL:return i||r?an(o.value,e):Wr(o,e,s,n);case tt.Scalar.QUOTE_DOUBLE:return ri(o.value,e);case tt.Scalar.QUOTE_SINGLE:return Uu(o.value,e);case tt.Scalar.PLAIN:return Vb(o,e,s,n);default:return null}},l=u(a);if(l===null){let{defaultKeyType:c,defaultStringType:f}=e.options,d=i&&c||f;if(l=u(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}Qh.stringifyString=zb});var ai=S(Vu=>{"use strict";var Gb=Pr(),Vt=K(),Kb=ni(),Yb=oi();function Hb(t,e){let s=Object.assign({blockQuote:!0,commentString:Kb.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(s.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:n,options:s}}function Jb(t,e){if(e.tag){let i=t.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let s,n;if(Vt.isScalar(e)){n=e.value;let i=t.filter(r=>r.identify?.(n));if(i.length>1){let r=i.filter(o=>o.test);r.length>0&&(i=r)}s=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else n=e,s=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!s){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return s}function Zb(t,e,{anchors:s,doc:n}){if(!n.directives)return"";let i=[],r=(Vt.isScalar(t)||Vt.isCollection(t))&&t.anchor;r&&Gb.anchorIsValid(r)&&(s.add(r),i.push(`&${r}`));let o=t.tag??(e.default?null:e.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}function Qb(t,e,s,n){if(Vt.isPair(t))return t.toString(e,s,n);if(Vt.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,r=Vt.isNode(t)?t:e.doc.createNode(t,{onTagObj:u=>i=u});i??(i=Jb(e.doc.schema.tags,r));let o=Zb(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(r,e,s,n):Vt.isScalar(r)?Yb.stringifyString(r,e,s,n):r.toString(e,s,n);return o?Vt.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
91
|
+
${e.indent}${a}`:a}Vu.createStringifyContext=Hb;Vu.stringify=Qb});var sp=S(tp=>{"use strict";var xt=K(),Xh=ee(),ep=ai(),ui=ni();function Xb({key:t,value:e},s,n,i){let{allNullValues:r,doc:o,indent:a,indentStep:u,options:{commentString:l,indentSeq:c,simpleKeys:f}}=s,d=xt.isNode(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(xt.isCollection(t)||!xt.isNode(t)&&typeof t=="object"){let B="With simple keys, collection cannot be used as a key value";throw new Error(B)}}let p=!f&&(!t||d&&e==null&&!s.inFlow||xt.isCollection(t)||(xt.isScalar(t)?t.type===Xh.Scalar.BLOCK_FOLDED||t.type===Xh.Scalar.BLOCK_LITERAL:typeof t=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!p&&(f||!r),indent:a+u});let D=!1,m=!1,g=ep.stringify(t,s,()=>D=!0,()=>m=!0);if(!p&&!s.inFlow&&g.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(s.inFlow){if(r||e==null)return D&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(r&&!f||e==null&&p)return g=`? ${g}`,d&&!D?g+=ui.lineComment(g,s.indent,l(d)):m&&i&&i(),g;D&&(d=null),p?(d&&(g+=ui.lineComment(g,s.indent,l(d))),g=`? ${g}
|
|
92
|
+
${a}:`):(g=`${g}:`,d&&(g+=ui.lineComment(g,s.indent,l(d))));let F,y,C;xt.isNode(e)?(F=!!e.spaceBefore,y=e.commentBefore,C=e.comment):(F=!1,y=null,C=null,e&&typeof e=="object"&&(e=o.createNode(e))),s.implicitKey=!1,!p&&!d&&xt.isScalar(e)&&(s.indentAtStart=g.length+1),m=!1,!c&&u.length>=2&&!s.inFlow&&!p&&xt.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(s.indent=s.indent.substring(2));let w=!1,E=ep.stringify(e,s,()=>w=!0,()=>m=!0),v=" ";if(d||F||y){if(v=F?`
|
|
93
|
+
`:"",y){let B=l(y);v+=`
|
|
94
|
+
${ui.indentComment(B,s.indent)}`}E===""&&!s.inFlow?v===`
|
|
95
|
+
`&&C&&(v=`
|
|
96
|
+
|
|
97
|
+
`):v+=`
|
|
98
|
+
${s.indent}`}else if(!p&&xt.isCollection(e)){let B=E[0],A=E.indexOf(`
|
|
99
|
+
`),$=A!==-1,P=s.inFlow??e.flow??e.items.length===0;if($||!P){let M=!1;if($&&(B==="&"||B==="!")){let L=E.indexOf(" ");B==="&"&&L!==-1&&L<A&&E[L+1]==="!"&&(L=E.indexOf(" ",L+1)),(L===-1||A<L)&&(M=!0)}M||(v=`
|
|
100
|
+
${s.indent}`)}}else(E===""||E[0]===`
|
|
101
|
+
`)&&(v="");return g+=v+E,s.inFlow?w&&n&&n():C&&!w?g+=ui.lineComment(g,s.indent,l(C)):m&&i&&i(),g}tp.stringifyPair=Xb});var Gu=S(zu=>{"use strict";var np=require("process");function e2(t,...e){t==="debug"&&console.log(...e)}function t2(t,e){(t==="debug"||t==="warn")&&(typeof np.emitWarning=="function"?np.emitWarning(e):console.warn(e))}zu.debug=e2;zu.warn=t2});var Hr=S(Yr=>{"use strict";var li=K(),ip=ee(),Gr="<<",Kr={identify:t=>t===Gr||typeof t=="symbol"&&t.description===Gr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ip.Scalar(Symbol(Gr)),{addToJSMap:rp}),stringify:()=>Gr},s2=(t,e)=>(Kr.identify(e)||li.isScalar(e)&&(!e.type||e.type===ip.Scalar.PLAIN)&&Kr.identify(e.value))&&t?.doc.schema.tags.some(s=>s.tag===Kr.tag&&s.default);function rp(t,e,s){if(s=t&&li.isAlias(s)?s.resolve(t.doc):s,li.isSeq(s))for(let n of s.items)Ku(t,e,n);else if(Array.isArray(s))for(let n of s)Ku(t,e,n);else Ku(t,e,s)}function Ku(t,e,s){let n=t&&li.isAlias(s)?s.resolve(t.doc):s;if(!li.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}Yr.addMergeToJSMap=rp;Yr.isMergeKey=s2;Yr.merge=Kr});var Hu=S(up=>{"use strict";var n2=Gu(),op=Hr(),i2=ai(),ap=K(),Yu=qt();function r2(t,e,{key:s,value:n}){if(ap.isNode(s)&&s.addToJSMap)s.addToJSMap(t,e,n);else if(op.isMergeKey(t,s))op.addMergeToJSMap(t,e,n);else{let i=Yu.toJS(s,"",t);if(e instanceof Map)e.set(i,Yu.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let r=o2(s,i,t),o=Yu.toJS(n,r,t);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function o2(t,e,s){if(e===null)return"";if(typeof e!="object")return String(e);if(ap.isNode(t)&&s?.doc){let n=i2.createStringifyContext(s.doc,{});n.anchors=new Set;for(let r of s.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!s.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),n2.warn(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return i}return JSON.stringify(e)}up.addPairToJSMap=r2});var zt=S(Ju=>{"use strict";var lp=si(),a2=sp(),u2=Hu(),Jr=K();function l2(t,e,s){let n=lp.createNode(t,void 0,s),i=lp.createNode(e,void 0,s);return new Zr(n,i)}var Zr=class t{constructor(e,s=null){Object.defineProperty(this,Jr.NODE_TYPE,{value:Jr.PAIR}),this.key=e,this.value=s}clone(e){let{key:s,value:n}=this;return Jr.isNode(s)&&(s=s.clone(e)),Jr.isNode(n)&&(n=n.clone(e)),new t(s,n)}toJSON(e,s){let n=s?.mapAsMap?new Map:{};return u2.addPairToJSMap(s,n,this)}toString(e,s,n){return e?.doc?a2.stringifyPair(this,e,s,n):JSON.stringify(this)}};Ju.Pair=Zr;Ju.createPair=l2});var Zu=S(fp=>{"use strict";var vs=K(),cp=ai(),Qr=ni();function c2(t,e,s){return(e.inFlow??t.flow?d2:f2)(t,e,s)}function f2({comment:t,items:e},s,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:u,options:{commentString:l}}=s,c=Object.assign({},s,{indent:r,type:null}),f=!1,d=[];for(let D=0;D<e.length;++D){let m=e[D],g=null;if(vs.isNode(m))!f&&m.spaceBefore&&d.push(""),Xr(s,d,m.commentBefore,f),m.comment&&(g=m.comment);else if(vs.isPair(m)){let y=vs.isNode(m.key)?m.key:null;y&&(!f&&y.spaceBefore&&d.push(""),Xr(s,d,y.commentBefore,f))}f=!1;let F=cp.stringify(m,c,()=>g=null,()=>f=!0);g&&(F+=Qr.lineComment(F,r,l(g))),f&&g&&(f=!1),d.push(n+F)}let p;if(d.length===0)p=i.start+i.end;else{p=d[0];for(let D=1;D<d.length;++D){let m=d[D];p+=m?`
|
|
102
102
|
${u}${m}`:`
|
|
103
103
|
`}}return t?(p+=`
|
|
104
|
-
`+
|
|
104
|
+
`+Qr.indentComment(l(t),u),a&&a()):f&&o&&o(),p}function d2({items:t},e,{flowChars:s,itemIndent:n}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;n+=r;let u=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,c=0,f=[];for(let D=0;D<t.length;++D){let m=t[D],g=null;if(vs.isNode(m))m.spaceBefore&&f.push(""),Xr(e,f,m.commentBefore,!1),m.comment&&(g=m.comment);else if(vs.isPair(m)){let y=vs.isNode(m.key)?m.key:null;y&&(y.spaceBefore&&f.push(""),Xr(e,f,y.commentBefore,!1),y.comment&&(l=!0));let C=vs.isNode(m.value)?m.value:null;C?(C.comment&&(g=C.comment),C.commentBefore&&(l=!0)):m.value==null&&y?.comment&&(g=y.comment)}g&&(l=!0);let F=cp.stringify(m,u,()=>g=null);D<t.length-1&&(F+=","),g&&(F+=Qr.lineComment(F,n,a(g))),!l&&(f.length>c||F.includes(`
|
|
105
105
|
`))&&(l=!0),f.push(F),c=f.length}let{start:d,end:p}=s;if(f.length===0)return d+p;if(!l){let D=f.reduce((m,g)=>m+g.length+2,2);l=e.options.lineWidth>0&&D>e.options.lineWidth}if(l){let D=d;for(let m of f)D+=m?`
|
|
106
106
|
${r}${i}${m}`:`
|
|
107
107
|
`;return`${D}
|
|
108
|
-
${i}${p}`}else return`${d}${o}${f.join(" ")}${o}${p}`}function
|
|
109
|
-
`:" ")}return
|
|
108
|
+
${i}${p}`}else return`${d}${o}${f.join(" ")}${o}${p}`}function Xr({indent:t,options:{commentString:e}},s,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let r=Qr.indentComment(e(n),t);s.push(r.trimStart())}}fp.stringifyCollection=c2});var Kt=S(Xu=>{"use strict";var h2=Zu(),p2=Hu(),m2=jr(),Gt=K(),eo=zt(),D2=ee();function ci(t,e){let s=Gt.isScalar(e)?e.value:e;for(let n of t)if(Gt.isPair(n)&&(n.key===e||n.key===s||Gt.isScalar(n.key)&&n.key.value===s))return n}var Qu=class extends m2.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Gt.MAP,e),this.items=[]}static from(e,s,n){let{keepUndefined:i,replacer:r}=n,o=new this(e),a=(u,l)=>{if(typeof r=="function")l=r.call(s,u,l);else if(Array.isArray(r)&&!r.includes(u))return;(l!==void 0||i)&&o.items.push(eo.createPair(u,l,n))};if(s instanceof Map)for(let[u,l]of s)a(u,l);else if(s&&typeof s=="object")for(let u of Object.keys(s))a(u,s[u]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,s){let n;Gt.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new eo.Pair(e,e?.value):n=new eo.Pair(e.key,e.value);let i=ci(this.items,n.key),r=this.schema?.sortMapEntries;if(i){if(!s)throw new Error(`Key ${n.key} already set`);Gt.isScalar(i.value)&&D2.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(r){let o=this.items.findIndex(a=>r(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let s=ci(this.items,e);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(e,s){let i=ci(this.items,e)?.value;return(!s&&Gt.isScalar(i)?i.value:i)??void 0}has(e){return!!ci(this.items,e)}set(e,s){this.add(new eo.Pair(e,s),!0)}toJSON(e,s,n){let i=n?new n:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(i);for(let r of this.items)p2.addPairToJSMap(s,i,r);return i}toString(e,s,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Gt.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),h2.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:s})}};Xu.YAMLMap=Qu;Xu.findPair=ci});var un=S(hp=>{"use strict";var g2=K(),dp=Kt(),y2={collection:"map",default:!0,nodeClass:dp.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return g2.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,s)=>dp.YAMLMap.from(t,e,s)};hp.map=y2});var Yt=S(pp=>{"use strict";var F2=si(),w2=Zu(),C2=jr(),so=K(),E2=ee(),b2=qt(),el=class extends C2.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(so.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let s=to(e);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(e,s){let n=to(e);if(typeof n!="number")return;let i=this.items[n];return!s&&so.isScalar(i)?i.value:i}has(e){let s=to(e);return typeof s=="number"&&s<this.items.length}set(e,s){let n=to(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];so.isScalar(i)&&E2.isScalarValue(s)?i.value=s:this.items[n]=s}toJSON(e,s){let n=[];s?.onCreate&&s.onCreate(n);let i=0;for(let r of this.items)n.push(b2.toJS(r,String(i++),s));return n}toString(e,s,n){return e?w2.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:s}):JSON.stringify(this)}static from(e,s,n){let{replacer:i}=n,r=new this(e);if(s&&Symbol.iterator in Object(s)){let o=0;for(let a of s){if(typeof i=="function"){let u=s instanceof Set?a:String(o++);a=i.call(s,u,a)}r.items.push(F2.createNode(a,void 0,n))}}return r}};function to(t){let e=so.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}pp.YAMLSeq=el});var ln=S(Dp=>{"use strict";var v2=K(),mp=Yt(),x2={collection:"seq",default:!0,nodeClass:mp.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return v2.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,s)=>mp.YAMLSeq.from(t,e,s)};Dp.seq=x2});var fi=S(gp=>{"use strict";var S2=oi(),A2={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,s,n){return e=Object.assign({actualString:!0},e),S2.stringifyString(t,e,s,n)}};gp.string=A2});var no=S(wp=>{"use strict";var yp=ee(),Fp={identify:t=>t==null,createNode:()=>new yp.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new yp.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Fp.test.test(t)?t:e.options.nullStr};wp.nullTag=Fp});var tl=S(Ep=>{"use strict";var k2=ee(),Cp={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new k2.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},s){if(t&&Cp.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?s.options.trueStr:s.options.falseStr}};Ep.boolTag=Cp});var cn=S(bp=>{"use strict";function $2({format:t,minFractionDigits:e,tag:s,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!s||s==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}bp.stringifyNumber=$2});var nl=S(io=>{"use strict";var _2=ee(),sl=cn(),B2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:sl.stringifyNumber},T2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():sl.stringifyNumber(t)}},I2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new _2.Scalar(parseFloat(t)),s=t.indexOf(".");return s!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-s-1),e},stringify:sl.stringifyNumber};io.float=I2;io.floatExp=T2;io.floatNaN=B2});var rl=S(oo=>{"use strict";var vp=cn(),ro=t=>typeof t=="bigint"||Number.isInteger(t),il=(t,e,s,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),s);function xp(t,e,s){let{value:n}=t;return ro(n)&&n>=0?s+n.toString(e):vp.stringifyNumber(t)}var R2={identify:t=>ro(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,s)=>il(t,2,8,s),stringify:t=>xp(t,8,"0o")},N2={identify:ro,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,s)=>il(t,0,10,s),stringify:vp.stringifyNumber},P2={identify:t=>ro(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,s)=>il(t,2,16,s),stringify:t=>xp(t,16,"0x")};oo.int=N2;oo.intHex=P2;oo.intOct=R2});var Ap=S(Sp=>{"use strict";var O2=un(),L2=no(),M2=ln(),j2=fi(),q2=tl(),ol=nl(),al=rl(),U2=[O2.map,M2.seq,j2.string,L2.nullTag,q2.boolTag,al.intOct,al.int,al.intHex,ol.floatNaN,ol.floatExp,ol.float];Sp.schema=U2});var _p=S($p=>{"use strict";var W2=ee(),V2=un(),z2=ln();function kp(t){return typeof t=="bigint"||Number.isInteger(t)}var ao=({value:t})=>JSON.stringify(t),G2=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:ao},{identify:t=>t==null,createNode:()=>new W2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ao},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:ao},{identify:kp,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:s})=>s?BigInt(t):parseInt(t,10),stringify:({value:t})=>kp(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:ao}],K2={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Y2=[V2.map,z2.seq].concat(G2,K2);$p.schema=Y2});var ll=S(Bp=>{"use strict";var di=require("buffer"),ul=ee(),H2=oi(),J2={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof di.Buffer=="function")return di.Buffer.from(t,"base64");if(typeof atob=="function"){let s=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(s.length);for(let i=0;i<s.length;++i)n[i]=s.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:s},n,i,r){if(!s)return"";let o=s,a;if(typeof di.Buffer=="function")a=o instanceof di.Buffer?o.toString("base64"):di.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let u="";for(let l=0;l<o.length;++l)u+=String.fromCharCode(o[l]);a=btoa(u)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=ul.Scalar.BLOCK_LITERAL),e!==ul.Scalar.QUOTE_DOUBLE){let u=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/u),c=new Array(l);for(let f=0,d=0;f<l;++f,d+=u)c[f]=a.substr(d,u);a=c.join(e===ul.Scalar.BLOCK_LITERAL?`
|
|
109
|
+
`:" ")}return H2.stringifyString({comment:t,type:e,value:a},n,i,r)}};Bp.binary=J2});var co=S(lo=>{"use strict";var uo=K(),cl=zt(),Z2=ee(),Q2=Yt();function Tp(t,e){if(uo.isSeq(t))for(let s=0;s<t.items.length;++s){let n=t.items[s];if(!uo.isPair(n)){if(uo.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new cl.Pair(new Z2.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
110
110
|
${i.key.commentBefore}`:n.commentBefore),n.comment){let r=i.value??i.key;r.comment=r.comment?`${n.comment}
|
|
111
|
-
${r.comment}`:n.comment}n=i}t.items[s]=lo.isPair(n)?n:new nl.Pair(n)}}else e("Expected a sequence for this tag");return t}function pp(t,e,s){let{replacer:n}=s,i=new Yb.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),o));let a,u;if(Array.isArray(o))if(o.length===2)a=o[0],u=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],u=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;i.items.push(nl.createPair(a,u,s))}return i}var Jb={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:hp,createNode:pp};co.createPairs=pp;co.pairs=Jb;co.resolvePairs=hp});var ol=A(rl=>{"use strict";var mp=G(),il=Pt(),hi=Wt(),Hb=Vt(),Dp=fo(),vs=class t extends Hb.YAMLSeq{constructor(){super(),this.add=hi.YAMLMap.prototype.add.bind(this),this.delete=hi.YAMLMap.prototype.delete.bind(this),this.get=hi.YAMLMap.prototype.get.bind(this),this.has=hi.YAMLMap.prototype.has.bind(this),this.set=hi.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,s){if(!s)return super.toJSON(e);let n=new Map;s?.onCreate&&s.onCreate(n);for(let i of this.items){let r,o;if(mp.isPair(i)?(r=il.toJS(i.key,"",s),o=il.toJS(i.value,r,s)):r=il.toJS(i,"",s),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,s,n){let i=Dp.createPairs(e,s,n),r=new this;return r.items=i.items,r}};vs.tag="tag:yaml.org,2002:omap";var Zb={collection:"seq",identify:t=>t instanceof Map,nodeClass:vs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let s=Dp.resolvePairs(t,e),n=[];for(let{key:i}of s.items)mp.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new vs,s)},createNode:(t,e,s)=>vs.from(t,e,s)};rl.YAMLOMap=vs;rl.omap=Zb});var wp=A(al=>{"use strict";var gp=te();function yp({value:t,source:e},s){return e&&(t?Fp:Cp).test.test(e)?e:t?s.options.trueStr:s.options.falseStr}var Fp={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new gp.Scalar(!0),stringify:yp},Cp={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new gp.Scalar(!1),stringify:yp};al.falseTag=Cp;al.trueTag=Fp});var Ep=A(ho=>{"use strict";var Qb=te(),ul=ln(),Xb={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ul.stringifyNumber},e2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():ul.stringifyNumber(t)}},t2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Qb.Scalar(parseFloat(t.replace(/_/g,""))),s=t.indexOf(".");if(s!==-1){let n=t.substring(s+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:ul.stringifyNumber};ho.float=t2;ho.floatExp=e2;ho.floatNaN=Xb});var vp=A(mi=>{"use strict";var bp=ln(),pi=t=>typeof t=="bigint"||Number.isInteger(t);function po(t,e,s,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(s){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let r=parseInt(t,s);return i==="-"?-1*r:r}function ll(t,e,s){let{value:n}=t;if(pi(n)){let i=n.toString(e);return n<0?"-"+s+i.substr(1):s+i}return bp.stringifyNumber(t)}var s2={identify:pi,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,s)=>po(t,2,2,s),stringify:t=>ll(t,2,"0b")},n2={identify:pi,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,s)=>po(t,1,8,s),stringify:t=>ll(t,8,"0")},i2={identify:pi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,s)=>po(t,0,10,s),stringify:bp.stringifyNumber},r2={identify:pi,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,s)=>po(t,2,16,s),stringify:t=>ll(t,16,"0x")};mi.int=i2;mi.intBin=s2;mi.intHex=r2;mi.intOct=n2});var fl=A(cl=>{"use strict";var go=G(),mo=qt(),Do=Wt(),xs=class t extends Do.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let s;go.isPair(e)?s=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?s=new mo.Pair(e.key,null):s=new mo.Pair(e,null),Do.findPair(this.items,s.key)||this.items.push(s)}get(e,s){let n=Do.findPair(this.items,e);return!s&&go.isPair(n)?go.isScalar(n.key)?n.key.value:n.key:n}set(e,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);let n=Do.findPair(this.items,e);n&&!s?this.items.splice(this.items.indexOf(n),1):!n&&s&&this.items.push(new mo.Pair(e))}toJSON(e,s){return super.toJSON(e,s,Set)}toString(e,s,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),s,n);throw new Error("Set items must all have null values")}static from(e,s,n){let{replacer:i}=n,r=new this(e);if(s&&Symbol.iterator in Object(s))for(let o of s)typeof i=="function"&&(o=i.call(s,o,o)),r.items.push(mo.createPair(o,null,n));return r}};xs.tag="tag:yaml.org,2002:set";var o2={collection:"map",identify:t=>t instanceof Set,nodeClass:xs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,s)=>xs.from(t,e,s),resolve(t,e){if(go.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new xs,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};cl.YAMLSet=xs;cl.set=o2});var hl=A(yo=>{"use strict";var a2=ln();function dl(t,e){let s=t[0],n=s==="-"||s==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return s==="-"?i(-1)*r:r}function xp(t){let{value:e}=t,s=o=>o;if(typeof e=="bigint")s=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return a2.stringifyNumber(t);let n="";e<0&&(n="-",e*=s(-1));let i=s(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var u2={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:s})=>dl(t,s),stringify:xp},l2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>dl(t,!1),stringify:xp},Sp={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(Sp.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,n,i,r,o,a]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(s,n-1,i,r||0,o||0,a||0,u),c=e[8];if(c&&c!=="Z"){let f=dl(c,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};yo.floatTime=l2;yo.intTime=u2;yo.timestamp=Sp});var _p=A(kp=>{"use strict";var c2=an(),f2=io(),d2=un(),h2=fi(),p2=sl(),Ap=wp(),pl=Ep(),Fo=vp(),m2=Hr(),D2=ol(),g2=fo(),y2=fl(),ml=hl(),F2=[c2.map,d2.seq,h2.string,f2.nullTag,Ap.trueTag,Ap.falseTag,Fo.intBin,Fo.intOct,Fo.int,Fo.intHex,pl.floatNaN,pl.floatExp,pl.float,p2.binary,m2.merge,D2.omap,g2.pairs,y2.set,ml.intTime,ml.floatTime,ml.timestamp];kp.schema=F2});var Mp=A(yl=>{"use strict";var Ip=an(),C2=io(),Rp=un(),w2=fi(),E2=Yu(),Dl=Hu(),gl=Qu(),b2=up(),v2=fp(),Np=sl(),Di=Hr(),Op=ol(),Pp=fo(),$p=_p(),Lp=fl(),Co=hl(),Bp=new Map([["core",b2.schema],["failsafe",[Ip.map,Rp.seq,w2.string]],["json",v2.schema],["yaml11",$p.schema],["yaml-1.1",$p.schema]]),Tp={binary:Np.binary,bool:E2.boolTag,float:Dl.float,floatExp:Dl.floatExp,floatNaN:Dl.floatNaN,floatTime:Co.floatTime,int:gl.int,intHex:gl.intHex,intOct:gl.intOct,intTime:Co.intTime,map:Ip.map,merge:Di.merge,null:C2.nullTag,omap:Op.omap,pairs:Pp.pairs,seq:Rp.seq,set:Lp.set,timestamp:Co.timestamp},x2={"tag:yaml.org,2002:binary":Np.binary,"tag:yaml.org,2002:merge":Di.merge,"tag:yaml.org,2002:omap":Op.omap,"tag:yaml.org,2002:pairs":Pp.pairs,"tag:yaml.org,2002:set":Lp.set,"tag:yaml.org,2002:timestamp":Co.timestamp};function S2(t,e,s){let n=Bp.get(e);if(n&&!t)return s&&!n.includes(Di.merge)?n.concat(Di.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let r=Array.from(Bp.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(t))for(let r of t)i=i.concat(r);else typeof t=="function"&&(i=t(i.slice()));return s&&(i=i.concat(Di.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?Tp[o]:o;if(!a){let u=JSON.stringify(o),l=Object.keys(Tp).map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${l}`)}return r.includes(a)||r.push(a),r},[])}yl.coreKnownTags=x2;yl.getTags=S2});var wl=A(jp=>{"use strict";var Fl=G(),A2=an(),k2=un(),_2=fi(),wo=Mp(),$2=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Cl=class t{constructor({compat:e,customTags:s,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?wo.getTags(e,"compat"):e?wo.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?wo.coreKnownTags:{},this.tags=wo.getTags(s,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,Fl.MAP,{value:A2.map}),Object.defineProperty(this,Fl.SCALAR,{value:_2.string}),Object.defineProperty(this,Fl.SEQ,{value:k2.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?$2:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};jp.Schema=Cl});var Up=A(qp=>{"use strict";var B2=G(),El=ai(),gi=ni();function T2(t,e){let s=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let u=t.directives.toString(t);u?(s.push(u),n=!0):t.directives.docStart&&(n=!0)}n&&s.push("---");let i=El.createStringifyContext(t,e),{commentString:r}=i.options;if(t.commentBefore){s.length!==1&&s.unshift("");let u=r(t.commentBefore);s.unshift(gi.indentComment(u,""))}let o=!1,a=null;if(t.contents){if(B2.isNode(t.contents)){if(t.contents.spaceBefore&&n&&s.push(""),t.contents.commentBefore){let c=r(t.contents.commentBefore);s.push(gi.indentComment(c,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let u=a?void 0:()=>o=!0,l=El.stringify(t.contents,i,()=>a=null,u);a&&(l+=gi.lineComment(l,"",r(a))),(l[0]==="|"||l[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${l}`:s.push(l)}else s.push(El.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let u=r(t.comment);u.includes(`
|
|
111
|
+
${r.comment}`:n.comment}n=i}t.items[s]=uo.isPair(n)?n:new cl.Pair(n)}}else e("Expected a sequence for this tag");return t}function Ip(t,e,s){let{replacer:n}=s,i=new Q2.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),o));let a,u;if(Array.isArray(o))if(o.length===2)a=o[0],u=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],u=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;i.items.push(cl.createPair(a,u,s))}return i}var X2={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Tp,createNode:Ip};lo.createPairs=Ip;lo.pairs=X2;lo.resolvePairs=Tp});var hl=S(dl=>{"use strict";var Rp=K(),fl=qt(),hi=Kt(),ev=Yt(),Np=co(),xs=class t extends ev.YAMLSeq{constructor(){super(),this.add=hi.YAMLMap.prototype.add.bind(this),this.delete=hi.YAMLMap.prototype.delete.bind(this),this.get=hi.YAMLMap.prototype.get.bind(this),this.has=hi.YAMLMap.prototype.has.bind(this),this.set=hi.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,s){if(!s)return super.toJSON(e);let n=new Map;s?.onCreate&&s.onCreate(n);for(let i of this.items){let r,o;if(Rp.isPair(i)?(r=fl.toJS(i.key,"",s),o=fl.toJS(i.value,r,s)):r=fl.toJS(i,"",s),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,s,n){let i=Np.createPairs(e,s,n),r=new this;return r.items=i.items,r}};xs.tag="tag:yaml.org,2002:omap";var tv={collection:"seq",identify:t=>t instanceof Map,nodeClass:xs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let s=Np.resolvePairs(t,e),n=[];for(let{key:i}of s.items)Rp.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new xs,s)},createNode:(t,e,s)=>xs.from(t,e,s)};dl.YAMLOMap=xs;dl.omap=tv});var jp=S(pl=>{"use strict";var Pp=ee();function Op({value:t,source:e},s){return e&&(t?Lp:Mp).test.test(e)?e:t?s.options.trueStr:s.options.falseStr}var Lp={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Pp.Scalar(!0),stringify:Op},Mp={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Pp.Scalar(!1),stringify:Op};pl.falseTag=Mp;pl.trueTag=Lp});var qp=S(fo=>{"use strict";var sv=ee(),ml=cn(),nv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ml.stringifyNumber},iv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():ml.stringifyNumber(t)}},rv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new sv.Scalar(parseFloat(t.replace(/_/g,""))),s=t.indexOf(".");if(s!==-1){let n=t.substring(s+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:ml.stringifyNumber};fo.float=rv;fo.floatExp=iv;fo.floatNaN=nv});var Wp=S(mi=>{"use strict";var Up=cn(),pi=t=>typeof t=="bigint"||Number.isInteger(t);function ho(t,e,s,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(s){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let r=parseInt(t,s);return i==="-"?-1*r:r}function Dl(t,e,s){let{value:n}=t;if(pi(n)){let i=n.toString(e);return n<0?"-"+s+i.substr(1):s+i}return Up.stringifyNumber(t)}var ov={identify:pi,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,s)=>ho(t,2,2,s),stringify:t=>Dl(t,2,"0b")},av={identify:pi,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,s)=>ho(t,1,8,s),stringify:t=>Dl(t,8,"0")},uv={identify:pi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,s)=>ho(t,0,10,s),stringify:Up.stringifyNumber},lv={identify:pi,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,s)=>ho(t,2,16,s),stringify:t=>Dl(t,16,"0x")};mi.int=uv;mi.intBin=ov;mi.intHex=lv;mi.intOct=av});var yl=S(gl=>{"use strict";var Do=K(),po=zt(),mo=Kt(),Ss=class t extends mo.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let s;Do.isPair(e)?s=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?s=new po.Pair(e.key,null):s=new po.Pair(e,null),mo.findPair(this.items,s.key)||this.items.push(s)}get(e,s){let n=mo.findPair(this.items,e);return!s&&Do.isPair(n)?Do.isScalar(n.key)?n.key.value:n.key:n}set(e,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);let n=mo.findPair(this.items,e);n&&!s?this.items.splice(this.items.indexOf(n),1):!n&&s&&this.items.push(new po.Pair(e))}toJSON(e,s){return super.toJSON(e,s,Set)}toString(e,s,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),s,n);throw new Error("Set items must all have null values")}static from(e,s,n){let{replacer:i}=n,r=new this(e);if(s&&Symbol.iterator in Object(s))for(let o of s)typeof i=="function"&&(o=i.call(s,o,o)),r.items.push(po.createPair(o,null,n));return r}};Ss.tag="tag:yaml.org,2002:set";var cv={collection:"map",identify:t=>t instanceof Set,nodeClass:Ss,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,s)=>Ss.from(t,e,s),resolve(t,e){if(Do.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ss,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};gl.YAMLSet=Ss;gl.set=cv});var wl=S(go=>{"use strict";var fv=cn();function Fl(t,e){let s=t[0],n=s==="-"||s==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return s==="-"?i(-1)*r:r}function Vp(t){let{value:e}=t,s=o=>o;if(typeof e=="bigint")s=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return fv.stringifyNumber(t);let n="";e<0&&(n="-",e*=s(-1));let i=s(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var dv={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:s})=>Fl(t,s),stringify:Vp},hv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Fl(t,!1),stringify:Vp},zp={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(zp.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,n,i,r,o,a]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(s,n-1,i,r||0,o||0,a||0,u),c=e[8];if(c&&c!=="Z"){let f=Fl(c,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};go.floatTime=hv;go.intTime=dv;go.timestamp=zp});var Yp=S(Kp=>{"use strict";var pv=un(),mv=no(),Dv=ln(),gv=fi(),yv=ll(),Gp=jp(),Cl=qp(),yo=Wp(),Fv=Hr(),wv=hl(),Cv=co(),Ev=yl(),El=wl(),bv=[pv.map,Dv.seq,gv.string,mv.nullTag,Gp.trueTag,Gp.falseTag,yo.intBin,yo.intOct,yo.int,yo.intHex,Cl.floatNaN,Cl.floatExp,Cl.float,yv.binary,Fv.merge,wv.omap,Cv.pairs,Ev.set,El.intTime,El.floatTime,El.timestamp];Kp.schema=bv});var im=S(xl=>{"use strict";var Qp=un(),vv=no(),Xp=ln(),xv=fi(),Sv=tl(),bl=nl(),vl=rl(),Av=Ap(),kv=_p(),em=ll(),Di=Hr(),tm=hl(),sm=co(),Hp=Yp(),nm=yl(),Fo=wl(),Jp=new Map([["core",Av.schema],["failsafe",[Qp.map,Xp.seq,xv.string]],["json",kv.schema],["yaml11",Hp.schema],["yaml-1.1",Hp.schema]]),Zp={binary:em.binary,bool:Sv.boolTag,float:bl.float,floatExp:bl.floatExp,floatNaN:bl.floatNaN,floatTime:Fo.floatTime,int:vl.int,intHex:vl.intHex,intOct:vl.intOct,intTime:Fo.intTime,map:Qp.map,merge:Di.merge,null:vv.nullTag,omap:tm.omap,pairs:sm.pairs,seq:Xp.seq,set:nm.set,timestamp:Fo.timestamp},$v={"tag:yaml.org,2002:binary":em.binary,"tag:yaml.org,2002:merge":Di.merge,"tag:yaml.org,2002:omap":tm.omap,"tag:yaml.org,2002:pairs":sm.pairs,"tag:yaml.org,2002:set":nm.set,"tag:yaml.org,2002:timestamp":Fo.timestamp};function _v(t,e,s){let n=Jp.get(e);if(n&&!t)return s&&!n.includes(Di.merge)?n.concat(Di.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let r=Array.from(Jp.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(t))for(let r of t)i=i.concat(r);else typeof t=="function"&&(i=t(i.slice()));return s&&(i=i.concat(Di.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?Zp[o]:o;if(!a){let u=JSON.stringify(o),l=Object.keys(Zp).map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${l}`)}return r.includes(a)||r.push(a),r},[])}xl.coreKnownTags=$v;xl.getTags=_v});var kl=S(rm=>{"use strict";var Sl=K(),Bv=un(),Tv=ln(),Iv=fi(),wo=im(),Rv=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Al=class t{constructor({compat:e,customTags:s,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?wo.getTags(e,"compat"):e?wo.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?wo.coreKnownTags:{},this.tags=wo.getTags(s,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,Sl.MAP,{value:Bv.map}),Object.defineProperty(this,Sl.SCALAR,{value:Iv.string}),Object.defineProperty(this,Sl.SEQ,{value:Tv.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Rv:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};rm.Schema=Al});var am=S(om=>{"use strict";var Nv=K(),$l=ai(),gi=ni();function Pv(t,e){let s=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let u=t.directives.toString(t);u?(s.push(u),n=!0):t.directives.docStart&&(n=!0)}n&&s.push("---");let i=$l.createStringifyContext(t,e),{commentString:r}=i.options;if(t.commentBefore){s.length!==1&&s.unshift("");let u=r(t.commentBefore);s.unshift(gi.indentComment(u,""))}let o=!1,a=null;if(t.contents){if(Nv.isNode(t.contents)){if(t.contents.spaceBefore&&n&&s.push(""),t.contents.commentBefore){let c=r(t.contents.commentBefore);s.push(gi.indentComment(c,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let u=a?void 0:()=>o=!0,l=$l.stringify(t.contents,i,()=>a=null,u);a&&(l+=gi.lineComment(l,"",r(a))),(l[0]==="|"||l[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${l}`:s.push(l)}else s.push($l.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let u=r(t.comment);u.includes(`
|
|
112
112
|
`)?(s.push("..."),s.push(gi.indentComment(u,""))):s.push(`... ${u}`)}else s.push("...");else{let u=t.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||a)&&s[s.length-1]!==""&&s.push(""),s.push(gi.indentComment(r(u),"")))}return s.join(`
|
|
113
113
|
`)+`
|
|
114
|
-
`}
|
|
114
|
+
`}om.stringifyDocument=Pv});var yi=S(um=>{"use strict";var Ov=ti(),fn=jr(),We=K(),Lv=zt(),Mv=qt(),jv=kl(),qv=am(),_l=Pr(),Uv=Ru(),Wv=si(),Bl=Iu(),Tl=class t{constructor(e,s,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,We.NODE_TYPE,{value:We.DOC});let i=null;typeof s=="function"||Array.isArray(s)?i=s:n===void 0&&s&&(n=s,s=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Bl.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[We.NODE_TYPE]:{value:We.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=We.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){dn(this.contents)&&this.contents.add(e)}addIn(e,s){dn(this.contents)&&this.contents.addIn(e,s)}createAlias(e,s){if(!e.anchor){let n=_l.anchorNames(this);e.anchor=!s||n.has(s)?_l.findNewAnchor(s||"a",n):s}return new Ov.Alias(e.anchor)}createNode(e,s,n){let i;if(typeof s=="function")e=s.call({"":e},"",e),i=s;else if(Array.isArray(s)){let g=y=>typeof y=="number"||y instanceof String||y instanceof Number,F=s.filter(g).map(String);F.length>0&&(s=s.concat(F)),i=s}else n===void 0&&s&&(n=s,s=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:u,onTagObj:l,tag:c}=n??{},{onAnchor:f,setAnchors:d,sourceObjects:p}=_l.createNodeAnchors(this,o||"a"),D={aliasDuplicateObjects:r??!0,keepUndefined:u??!1,onAnchor:f,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},m=Wv.createNode(e,c,D);return a&&We.isCollection(m)&&(m.flow=!0),d(),m}createPair(e,s,n={}){let i=this.createNode(e,null,n),r=this.createNode(s,null,n);return new Lv.Pair(i,r)}delete(e){return dn(this.contents)?this.contents.delete(e):!1}deleteIn(e){return fn.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):dn(this.contents)?this.contents.deleteIn(e):!1}get(e,s){return We.isCollection(this.contents)?this.contents.get(e,s):void 0}getIn(e,s){return fn.isEmptyPath(e)?!s&&We.isScalar(this.contents)?this.contents.value:this.contents:We.isCollection(this.contents)?this.contents.getIn(e,s):void 0}has(e){return We.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return fn.isEmptyPath(e)?this.contents!==void 0:We.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,s){this.contents==null?this.contents=fn.collectionFromPath(this.schema,[e],s):dn(this.contents)&&this.contents.set(e,s)}setIn(e,s){fn.isEmptyPath(e)?this.contents=s:this.contents==null?this.contents=fn.collectionFromPath(this.schema,Array.from(e),s):dn(this.contents)&&this.contents.setIn(e,s)}setSchema(e,s={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Bl.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Bl.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(n)this.schema=new jv.Schema(Object.assign(n,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:s,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},u=Mv.toJS(this.contents,s??"",a);if(typeof r=="function")for(let{count:l,res:c}of a.anchors.values())r(c,l);return typeof o=="function"?Uv.applyReviver(o,{"":u},"",u):u}toJSON(e,s){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:s})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let s=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return qv.stringifyDocument(this,e)}};function dn(t){if(We.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}um.Document=Tl});var Ci=S(wi=>{"use strict";var Fi=class extends Error{constructor(e,s,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=s}},Il=class extends Fi{constructor(e,s,n){super("YAMLParseError",e,s,n)}},Rl=class extends Fi{constructor(e,s,n){super("YAMLWarning",e,s,n)}},Vv=(t,e)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(a=>e.linePos(a));let{line:n,col:i}=s.linePos[0];s.message+=` at line ${n}, column ${i}`;let r=i-1,o=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,r))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
115
115
|
`),o=a+o}if(/[^ ]/.test(o)){let a=1,u=s.linePos[1];u?.line===n&&u.col>i&&(a=Math.max(1,Math.min(u.col-i,80-r)));let l=" ".repeat(r)+"^".repeat(a);s.message+=`:
|
|
116
116
|
|
|
117
117
|
${o}
|
|
118
118
|
${l}
|
|
119
|
-
`}};
|
|
120
|
-
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let s of e.start)if(s.type==="newline")return!0;if(e.sep){for(let s of e.sep)if(s.type==="newline")return!0}if(
|
|
121
|
-
`+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||
|
|
122
|
-
`+C.comment:y.comment=C.comment);let w=new
|
|
123
|
-
`+
|
|
124
|
-
`+
|
|
125
|
-
|
|
126
|
-
`+g.comment:l.comment=g.comment),l.range=[n.offset,m,g.offset]}else l.range=[n.offset,m,m];return l}
|
|
119
|
+
`}};wi.YAMLError=Fi;wi.YAMLParseError=Il;wi.YAMLWarning=Rl;wi.prettifyError=Vv});var Ei=S(lm=>{"use strict";function zv(t,{flow:e,indicator:s,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let u=!1,l=a,c=a,f="",d="",p=!1,D=!1,m=null,g=null,F=null,y=null,C=null,w=null,E=null;for(let A of t)switch(D&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&r(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),D=!1),m&&(l&&A.type!=="comment"&&A.type!=="newline"&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),A.type){case"space":!e&&(s!=="doc-start"||n?.type!=="flow-collection")&&A.source.includes(" ")&&(m=A),c=!0;break;case"comment":{c||r(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let $=A.source.substring(1)||" ";f?f+=d+$:f=$,d="",l=!1;break}case"newline":l?f?f+=A.source:(!w||s!=="seq-item-ind")&&(u=!0):d+=A.source,l=!0,p=!0,(g||F)&&(y=A),c=!0;break;case"anchor":g&&r(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&r(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=A,E??(E=A.offset),l=!1,c=!1,D=!0;break;case"tag":{F&&r(A,"MULTIPLE_TAGS","A node can have at most one tag"),F=A,E??(E=A.offset),l=!1,c=!1,D=!0;break}case s:(g||F)&&r(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),w&&r(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e??"collection"}`),w=A,l=s==="seq-item-ind"||s==="explicit-key-ind",c=!1;break;case"comma":if(e){C&&r(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),C=A,l=!1,c=!1;break}default:r(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),l=!1,c=!1}let v=t[t.length-1],B=v?v.offset+v.source.length:i;return D&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(l&&m.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:C,found:w,spaceBefore:u,comment:f,hasNewline:p,anchor:g,tag:F,newlineAfterProp:y,end:B,start:E??B}}lm.resolveProps=zv});var Co=S(cm=>{"use strict";function Nl(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
120
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let s of e.start)if(s.type==="newline")return!0;if(e.sep){for(let s of e.sep)if(s.type==="newline")return!0}if(Nl(e.key)||Nl(e.value))return!0}return!1;default:return!0}}cm.containsNewline=Nl});var Pl=S(fm=>{"use strict";var Gv=Co();function Kv(t,e,s){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Gv.containsNewline(e)&&s(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}fm.flowIndentCheck=Kv});var Ol=S(hm=>{"use strict";var dm=K();function Yv(t,e,s){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(r,o)=>r===o||dm.isScalar(r)&&dm.isScalar(o)&&r.value===o.value;return e.some(r=>i(r.key,s))}hm.mapIncludes=Yv});var Fm=S(ym=>{"use strict";var pm=zt(),Hv=Kt(),mm=Ei(),Jv=Co(),Dm=Pl(),Zv=Ol(),gm="All mapping items must start at the same column";function Qv({composeNode:t,composeEmptyNode:e},s,n,i,r){let o=r?.nodeClass??Hv.YAMLMap,a=new o(s.schema);s.atRoot&&(s.atRoot=!1);let u=n.offset,l=null;for(let c of n.items){let{start:f,key:d,sep:p,value:D}=c,m=mm.resolveProps(f,{indicator:"explicit-key-ind",next:d??p?.[0],offset:u,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!m.found;if(g){if(d&&(d.type==="block-seq"?i(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==n.indent&&i(u,"BAD_INDENT",gm)),!m.anchor&&!m.tag&&!p){l=m.end,m.comment&&(a.comment?a.comment+=`
|
|
121
|
+
`+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||Jv.containsNewline(d))&&i(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==n.indent&&i(u,"BAD_INDENT",gm);s.atKey=!0;let F=m.end,y=d?t(s,d,m,i):e(s,F,f,null,m,i);s.schema.compat&&Dm.flowIndentCheck(n.indent,d,i),s.atKey=!1,Zv.mapIncludes(s,a.items,y)&&i(F,"DUPLICATE_KEY","Map keys must be unique");let C=mm.resolveProps(p??[],{indicator:"map-value-ind",next:D,offset:y.range[2],onError:i,parentIndent:n.indent,startOnNewline:!d||d.type==="block-scalar"});if(u=C.end,C.found){g&&(D?.type==="block-map"&&!C.hasNewline&&i(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&m.start<C.found.offset-1024&&i(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let w=D?t(s,D,C,i):e(s,u,p,null,C,i);s.schema.compat&&Dm.flowIndentCheck(n.indent,D,i),u=w.range[2];let E=new pm.Pair(y,w);s.options.keepSourceTokens&&(E.srcToken=c),a.items.push(E)}else{g&&i(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),C.comment&&(y.comment?y.comment+=`
|
|
122
|
+
`+C.comment:y.comment=C.comment);let w=new pm.Pair(y);s.options.keepSourceTokens&&(w.srcToken=c),a.items.push(w)}}return l&&l<u&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,u,l??u],a}ym.resolveBlockMap=Qv});var Cm=S(wm=>{"use strict";var Xv=Yt(),e1=Ei(),t1=Pl();function s1({composeNode:t,composeEmptyNode:e},s,n,i,r){let o=r?.nodeClass??Xv.YAMLSeq,a=new o(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let u=n.offset,l=null;for(let{start:c,value:f}of n.items){let d=e1.resolveProps(c,{indicator:"seq-item-ind",next:f,offset:u,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?i(d.end,"BAD_INDENT","All sequence items must start at the same column"):i(u,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(a.comment=d.comment);continue}let p=f?t(s,f,d,i):e(s,d.end,c,null,d,i);s.schema.compat&&t1.flowIndentCheck(n.indent,f,i),u=p.range[2],a.items.push(p)}return a.range=[n.offset,u,l??u],a}wm.resolveBlockSeq=s1});var hn=S(Em=>{"use strict";function n1(t,e,s,n){let i="";if(t){let r=!1,o="";for(let a of t){let{source:u,type:l}=a;switch(l){case"space":r=!0;break;case"comment":{s&&!r&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let c=u.substring(1)||" ";i?i+=o+c:i=c,o="";break}case"newline":i&&(o+=u),r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=u.length}}return{comment:i,offset:e}}Em.resolveEnd=n1});var Sm=S(xm=>{"use strict";var i1=K(),r1=zt(),bm=Kt(),o1=Yt(),a1=hn(),vm=Ei(),u1=Co(),l1=Ol(),Ll="Block collections are not allowed within flow collections",Ml=t=>t&&(t.type==="block-map"||t.type==="block-seq");function c1({composeNode:t,composeEmptyNode:e},s,n,i,r){let o=n.start.source==="{",a=o?"flow map":"flow sequence",u=r?.nodeClass??(o?bm.YAMLMap:o1.YAMLSeq),l=new u(s.schema);l.flow=!0;let c=s.atRoot;c&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let f=n.offset+n.start.source.length;for(let g=0;g<n.items.length;++g){let F=n.items[g],{start:y,key:C,sep:w,value:E}=F,v=vm.resolveProps(y,{flow:a,indicator:"explicit-key-ind",next:C??w?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!v.found){if(!v.anchor&&!v.tag&&!w&&!E){g===0&&v.comma?i(v.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):g<n.items.length-1&&i(v.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),v.comment&&(l.comment?l.comment+=`
|
|
123
|
+
`+v.comment:l.comment=v.comment),f=v.end;continue}!o&&s.options.strict&&u1.containsNewline(C)&&i(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)v.comma&&i(v.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(v.comma||i(v.start,"MISSING_CHAR",`Missing , between ${a} items`),v.comment){let B="";e:for(let A of y)switch(A.type){case"comma":case"space":break;case"comment":B=A.source.substring(1);break e;default:break e}if(B){let A=l.items[l.items.length-1];i1.isPair(A)&&(A=A.value??A.key),A.comment?A.comment+=`
|
|
124
|
+
`+B:A.comment=B,v.comment=v.comment.substring(B.length+1)}}if(!o&&!w&&!v.found){let B=E?t(s,E,v,i):e(s,v.end,w,null,v,i);l.items.push(B),f=B.range[2],Ml(E)&&i(B.range,"BLOCK_IN_FLOW",Ll)}else{s.atKey=!0;let B=v.end,A=C?t(s,C,v,i):e(s,B,y,null,v,i);Ml(C)&&i(A.range,"BLOCK_IN_FLOW",Ll),s.atKey=!1;let $=vm.resolveProps(w??[],{flow:a,indicator:"map-value-ind",next:E,offset:A.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if($.found){if(!o&&!v.found&&s.options.strict){if(w)for(let L of w){if(L===$.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}v.start<$.found.offset-1024&&i($.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source?.[0]===":"?i(E,"MISSING_CHAR",`Missing space after : in ${a}`):i($.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let P=E?t(s,E,$,i):$.found?e(s,$.end,w,null,$,i):null;P?Ml(E)&&i(P.range,"BLOCK_IN_FLOW",Ll):$.comment&&(A.comment?A.comment+=`
|
|
125
|
+
`+$.comment:A.comment=$.comment);let M=new r1.Pair(A,P);if(s.options.keepSourceTokens&&(M.srcToken=F),o){let L=l;l1.mapIncludes(s,L.items,A)&&i(B,"DUPLICATE_KEY","Map keys must be unique"),L.items.push(M)}else{let L=new bm.YAMLMap(s.schema);L.flow=!0,L.items.push(M);let te=(P??A).range;L.range=[A.range[0],te[1],te[2]],l.items.push(L)}f=P?P.range[2]:$.end}}let d=o?"}":"]",[p,...D]=n.end,m=f;if(p?.source===d)m=p.offset+p.source.length;else{let g=a[0].toUpperCase()+a.substring(1),F=c?`${g} must end with a ${d}`:`${g} in block collection must be sufficiently indented and end with a ${d}`;i(f,c?"MISSING_CHAR":"BAD_INDENT",F),p&&p.source.length!==1&&D.unshift(p)}if(D.length>0){let g=a1.resolveEnd(D,m,s.options.strict,i);g.comment&&(l.comment?l.comment+=`
|
|
126
|
+
`+g.comment:l.comment=g.comment),l.range=[n.offset,m,g.offset]}else l.range=[n.offset,m,m];return l}xm.resolveFlowCollection=c1});var km=S(Am=>{"use strict";var f1=K(),d1=ee(),h1=Kt(),p1=Yt(),m1=Fm(),D1=Cm(),g1=Sm();function jl(t,e,s,n,i,r){let o=s.type==="block-map"?m1.resolveBlockMap(t,e,s,n,r):s.type==="block-seq"?D1.resolveBlockSeq(t,e,s,n,r):g1.resolveFlowCollection(t,e,s,n,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function y1(t,e,s,n,i){let r=n.tag,o=r?e.directives.tagName(r.source,d=>i(r,"TAG_RESOLVE_FAILED",d)):null;if(s.type==="block-seq"){let{anchor:d,newlineAfterProp:p}=n,D=d&&r?d.offset>r.offset?d:r:d??r;D&&(!p||p.offset<D.offset)&&i(D,"MISSING_CHAR","Missing newline after block sequence props")}let a=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===h1.YAMLMap.tagName&&a==="map"||o===p1.YAMLSeq.tagName&&a==="seq")return jl(t,e,s,i,o);let u=e.schema.tags.find(d=>d.tag===o&&d.collection===a);if(!u){let d=e.schema.knownTags[o];if(d?.collection===a)e.schema.tags.push(Object.assign({},d,{default:!1})),u=d;else return d?i(r,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),jl(t,e,s,i,o)}let l=jl(t,e,s,i,o,u),c=u.resolve?.(l,d=>i(r,"TAG_RESOLVE_FAILED",d),e.options)??l,f=f1.isNode(c)?c:new d1.Scalar(c);return f.range=l.range,f.tag=o,u?.format&&(f.format=u.format),f}Am.composeCollection=y1});var Ul=S($m=>{"use strict";var ql=ee();function F1(t,e,s){let n=e.offset,i=w1(e,t.options.strict,s);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=i.mode===">"?ql.Scalar.BLOCK_FOLDED:ql.Scalar.BLOCK_LITERAL,o=e.source?C1(e.source):[],a=o.length;for(let m=o.length-1;m>=0;--m){let g=o[m][1];if(g===""||g==="\r")a=m;else break}if(a===0){let m=i.chomp==="+"&&o.length>0?`
|
|
127
127
|
`.repeat(Math.max(1,o.length-1)):"",g=n+i.length;return e.source&&(g+=e.source.length),{value:m,type:r,comment:i.comment,range:[n,g,g]}}let u=e.indent+i.indent,l=e.offset+i.length,c=0;for(let m=0;m<a;++m){let[g,F]=o[m];if(F===""||F==="\r")i.indent===0&&g.length>u&&(u=g.length);else{g.length<u&&s(l+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(u=g.length),c=m,u===0&&!t.atRoot&&s(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=g.length+F.length+1}for(let m=o.length-1;m>=a;--m)o[m][0].length>u&&(a=m+1);let f="",d="",p=!1;for(let m=0;m<c;++m)f+=o[m][0].slice(u)+`
|
|
128
|
-
`;for(let m=c;m<a;++m){let[g,F]=o[m];l+=g.length+F.length+1;let y=F[F.length-1]==="\r";if(y&&(F=F.slice(0,-1)),F&&g.length<u){let w=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;s(l-F.length-(y?2:1),"BAD_INDENT",w),g=""}r===
|
|
128
|
+
`;for(let m=c;m<a;++m){let[g,F]=o[m];l+=g.length+F.length+1;let y=F[F.length-1]==="\r";if(y&&(F=F.slice(0,-1)),F&&g.length<u){let w=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;s(l-F.length-(y?2:1),"BAD_INDENT",w),g=""}r===ql.Scalar.BLOCK_LITERAL?(f+=d+g.slice(u)+F,d=`
|
|
129
129
|
`):g.length>u||F[0]===" "?(d===" "?d=`
|
|
130
130
|
`:!p&&d===`
|
|
131
131
|
`&&(d=`
|
|
@@ -138,108 +138,108 @@ ${l}
|
|
|
138
138
|
`+o[m][0].slice(u);f[f.length-1]!==`
|
|
139
139
|
`&&(f+=`
|
|
140
140
|
`);break;default:f+=`
|
|
141
|
-
`}let D=n+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[n,D,D]}}function
|
|
141
|
+
`}let D=n+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[n,D,D]}}function w1({offset:t,props:e},s,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],r=i[0],o=0,a="",u=-1;for(let d=1;d<i.length;++d){let p=i[d];if(!a&&(p==="-"||p==="+"))a=p;else{let D=Number(p);!o&&D?o=D:u===-1&&(u=t+d)}}u!==-1&&n(u,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,c="",f=i.length;for(let d=1;d<e.length;++d){let p=e[d];switch(p.type){case"space":l=!0;case"newline":f+=p.source.length;break;case"comment":s&&!l&&n(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,c=p.source.substring(1);break;case"error":n(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{let D=`Unexpected token in block scalar header: ${p.type}`;n(p,"UNEXPECTED_TOKEN",D);let m=p.source;m&&typeof m=="string"&&(f+=m.length)}}}return{mode:r,indent:o,chomp:a,comment:c,length:f}}function C1(t){let e=t.split(/\n( *)/),s=e[0],n=s.match(/^( *)/),r=[n?.[1]?[n[1],s.slice(n[1].length)]:["",s]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}$m.resolveBlockScalar=F1});var Vl=S(Bm=>{"use strict";var Wl=ee(),E1=hn();function b1(t,e,s){let{offset:n,type:i,source:r,end:o}=t,a,u,l=(d,p,D)=>s(n+d,p,D);switch(i){case"scalar":a=Wl.Scalar.PLAIN,u=v1(r,l);break;case"single-quoted-scalar":a=Wl.Scalar.QUOTE_SINGLE,u=x1(r,l);break;case"double-quoted-scalar":a=Wl.Scalar.QUOTE_DOUBLE,u=S1(r,l);break;default:return s(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}let c=n+r.length,f=E1.resolveEnd(o,c,e,s);return{value:u,type:a,comment:f.comment,range:[n,c,f.offset]}}function v1(t,e){let s="";switch(t[0]){case" ":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${t[0]}`;break}case"@":case"`":{s=`reserved character ${t[0]}`;break}}return s&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),_m(t)}function x1(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),_m(t.slice(1,-1)).replace(/''/g,"'")}function _m(t){let e,s;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
142
142
|
`,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
143
143
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(t);if(!n)return t;let i=n[1],r=" ",o=e.lastIndex;for(s.lastIndex=o;n=s.exec(t);)n[1]===""?r===`
|
|
144
144
|
`?i+=r:r=`
|
|
145
|
-
`:(i+=r+n[1],r=" "),o=s.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(t),i+r+(n?.[1]??"")}function
|
|
145
|
+
`:(i+=r+n[1],r=" "),o=s.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(t),i+r+(n?.[1]??"")}function S1(t,e){let s="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
|
|
146
146
|
`))if(i===`
|
|
147
|
-
`){let{fold:r,offset:o}=
|
|
147
|
+
`){let{fold:r,offset:o}=A1(t,n);s+=r,n=o}else if(i==="\\"){let r=t[++n],o=k1[r];if(o)s+=o;else if(r===`
|
|
148
148
|
`)for(r=t[n+1];r===" "||r===" ";)r=t[++n+1];else if(r==="\r"&&t[n+1]===`
|
|
149
|
-
`)for(r=t[++n+1];r===" "||r===" ";)r=t[++n+1];else if(r==="x"||r==="u"||r==="U"){let a={x:2,u:4,U:8}[r];s
|
|
149
|
+
`)for(r=t[++n+1];r===" "||r===" ";)r=t[++n+1];else if(r==="x"||r==="u"||r==="U"){let a={x:2,u:4,U:8}[r];s+=$1(t,n+1,a,e),n+=a}else{let a=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),s+=a}}else if(i===" "||i===" "){let r=n,o=t[n+1];for(;o===" "||o===" ";)o=t[++n+1];o!==`
|
|
150
150
|
`&&!(o==="\r"&&t[n+2]===`
|
|
151
|
-
`)&&(s+=n>r?t.slice(r,n+1):i)}else s+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),s}function
|
|
151
|
+
`)&&(s+=n>r?t.slice(r,n+1):i)}else s+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),s}function A1(t,e){let s="",n=t[e+1];for(;(n===" "||n===" "||n===`
|
|
152
152
|
`||n==="\r")&&!(n==="\r"&&t[e+2]!==`
|
|
153
153
|
`);)n===`
|
|
154
154
|
`&&(s+=`
|
|
155
|
-
`),e+=1,n=t[e+1];return s||(s=" "),{fold:s,offset:e}}var
|
|
156
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
155
|
+
`),e+=1,n=t[e+1];return s||(s=" "),{fold:s,offset:e}}var k1={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
156
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function $1(t,e,s,n){let i=t.substr(e,s),o=i.length===s&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){let a=t.substr(e-2,s+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}Bm.resolveFlowScalar=b1});var Rm=S(Im=>{"use strict";var As=K(),Tm=ee(),_1=Ul(),B1=Vl();function T1(t,e,s,n){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?_1.resolveBlockScalar(t,e,n):B1.resolveFlowScalar(e,t.options.strict,n),u=s?t.directives.tagName(s.source,f=>n(s,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[As.SCALAR]:u?l=I1(t.schema,i,u,s,n):e.type==="scalar"?l=R1(t,i,e,n):l=t.schema[As.SCALAR];let c;try{let f=l.resolve(i,d=>n(s??e,"TAG_RESOLVE_FAILED",d),t.options);c=As.isScalar(f)?f:new Tm.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);n(s??e,"TAG_RESOLVE_FAILED",d),c=new Tm.Scalar(i)}return c.range=a,c.source=i,r&&(c.type=r),u&&(c.tag=u),l.format&&(c.format=l.format),o&&(c.comment=o),c}function I1(t,e,s,n,i){if(s==="!")return t[As.SCALAR];let r=[];for(let a of t.tags)if(!a.collection&&a.tag===s)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(e))return a;let o=t.knownTags[s];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),t[As.SCALAR])}function R1({atKey:t,directives:e,schema:s},n,i,r){let o=s.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||s[As.SCALAR];if(s.compat){let a=s.compat.find(u=>u.default&&u.test?.test(n))??s[As.SCALAR];if(o.tag!==a.tag){let u=e.tagString(o.tag),l=e.tagString(a.tag),c=`Value may be parsed as either ${u} or ${l}`;r(i,"TAG_RESOLVE_FAILED",c,!0)}}return o}Im.composeScalar=T1});var Pm=S(Nm=>{"use strict";function N1(t,e,s){if(e){s??(s=e.length);for(let n=s-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}Nm.emptyScalarPosition=N1});var Mm=S(Gl=>{"use strict";var P1=ti(),O1=K(),L1=km(),Om=Rm(),M1=hn(),j1=Pm(),q1={composeNode:Lm,composeEmptyNode:zl};function Lm(t,e,s,n){let i=t.atKey,{spaceBefore:r,comment:o,anchor:a,tag:u}=s,l,c=!0;switch(e.type){case"alias":l=U1(t,e,n),(a||u)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Om.composeScalar(t,e,u,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=L1.composeCollection(q1,t,e,s,n),a&&(l.anchor=a.source.substring(1));break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),l=zl(t,e.offset,void 0,null,s,n),c=!1}}return a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!O1.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(u??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&c&&(l.srcToken=e),l}function zl(t,e,s,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:u},l){let c={type:"scalar",offset:j1.emptyScalarPosition(e,s,n),indent:-1,source:""},f=Om.composeScalar(t,c,a,l);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=u),f}function U1({options:t},{offset:e,source:s,end:n},i){let r=new P1.Alias(s.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+s.length,a=M1.resolveEnd(n,o,t.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}Gl.composeEmptyNode=zl;Gl.composeNode=Lm});var Um=S(qm=>{"use strict";var W1=yi(),jm=Mm(),V1=hn(),z1=Ei();function G1(t,e,{offset:s,start:n,value:i,end:r},o){let a=Object.assign({_directives:e},t),u=new W1.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},c=z1.resolveProps(n,{indicator:"doc-start",next:i??r?.[0],offset:s,onError:o,parentIndent:0,startOnNewline:!0});c.found&&(u.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!c.hasNewline&&o(c.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=i?jm.composeNode(l,i,c,o):jm.composeEmptyNode(l,c.end,n,null,c,o);let f=u.contents.range[2],d=V1.resolveEnd(r,f,!1,o);return d.comment&&(u.comment=d.comment),u.range=[s,f,d.offset],u}qm.composeDoc=G1});var Yl=S(zm=>{"use strict";var K1=require("process"),Y1=Iu(),H1=yi(),bi=Ci(),Wm=K(),J1=Um(),Z1=hn();function vi(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:s}=t;return[e,e+(typeof s=="string"?s.length:1)]}function Vm(t){let e="",s=!1,n=!1;for(let i=0;i<t.length;++i){let r=t[i];switch(r[0]){case"#":e+=(e===""?"":n?`
|
|
157
157
|
|
|
158
158
|
`:`
|
|
159
|
-
`)+(r.substring(1)||" "),s=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),s=!1;break;default:s||(n=!0),s=!1}}return{comment:e,afterEmptyLine:n}}var
|
|
160
|
-
${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(
|
|
159
|
+
`)+(r.substring(1)||" "),s=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),s=!1;break;default:s||(n=!0),s=!1}}return{comment:e,afterEmptyLine:n}}var Kl=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,n,i,r)=>{let o=vi(s);r?this.warnings.push(new bi.YAMLWarning(o,n,i)):this.errors.push(new bi.YAMLParseError(o,n,i))},this.directives=new Y1.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,s){let{comment:n,afterEmptyLine:i}=Vm(this.prelude);if(n){let r=e.contents;if(s)e.comment=e.comment?`${e.comment}
|
|
160
|
+
${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(Wm.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Wm.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
|
|
161
161
|
${a}`:n}else{let o=r.commentBefore;r.commentBefore=o?`${n}
|
|
162
|
-
${o}`:n}}s?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:
|
|
163
|
-
${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new bi.YAMLParseError(vi(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new
|
|
162
|
+
${o}`:n}}s?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Vm(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,s=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(s,n)}*next(e){switch(K1.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(s,n,i)=>{let r=vi(e);r[0]+=s,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let s=J1.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(s,!1),this.doc&&(yield this.doc),this.doc=s,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let s=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new bi.YAMLParseError(vi(e),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new bi.YAMLParseError(vi(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let s=Z1.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
163
|
+
${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new bi.YAMLParseError(vi(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new H1.Document(void 0,n);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,s,s],this.decorate(i,!1),yield i}}};zm.Composer=Kl});var Ym=S(Eo=>{"use strict";var Q1=Ul(),X1=Vl(),ex=Ci(),Gm=oi();function tx(t,e=!0,s){if(t){let n=(i,r,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(s)s(a,r,o);else throw new ex.YAMLParseError([a,a+1],r,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return X1.resolveFlowScalar(t,e,n);case"block-scalar":return Q1.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function sx(t,e){let{implicitKey:s=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=Gm.stringifyString({type:o,value:t},{implicitKey:s,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),u=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
164
164
|
`}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
|
|
165
165
|
`),c=a.substring(0,l),f=a.substring(l+1)+`
|
|
166
|
-
`,d=[{type:"block-scalar-header",offset:r,indent:n,source:c}];return
|
|
167
|
-
`}),{type:"block-scalar",offset:r,indent:n,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:u};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:u};default:return{type:"scalar",offset:r,indent:n,source:a,end:u}}}function
|
|
166
|
+
`,d=[{type:"block-scalar-header",offset:r,indent:n,source:c}];return Km(d,u)||d.push({type:"newline",offset:-1,indent:n,source:`
|
|
167
|
+
`}),{type:"block-scalar",offset:r,indent:n,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:u};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:u};default:return{type:"scalar",offset:r,indent:n,source:a,end:u}}}function nx(t,e,s={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=s,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let u=Gm.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(u[0]){case"|":case">":ix(t,u);break;case'"':Hl(t,u,"double-quoted-scalar");break;case"'":Hl(t,u,"single-quoted-scalar");break;default:Hl(t,u,"scalar")}}function ix(t,e){let s=e.indexOf(`
|
|
168
168
|
`),n=e.substring(0,s),i=e.substring(s+1)+`
|
|
169
|
-
`;if(t.type==="block-scalar"){let r=t.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,t.source=i}else{let{offset:r}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];
|
|
170
|
-
`});for(let u of Object.keys(t))u!=="type"&&u!=="offset"&&delete t[u];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:i})}}function
|
|
171
|
-
`};delete t.items,Object.assign(t,{type:s,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(t))r!=="type"&&r!=="offset"&&delete t[r];Object.assign(t,{type:s,indent:n,source:e,end:i})}}}
|
|
169
|
+
`;if(t.type==="block-scalar"){let r=t.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,t.source=i}else{let{offset:r}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];Km(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
170
|
+
`});for(let u of Object.keys(t))u!=="type"&&u!=="offset"&&delete t[u];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:i})}}function Km(t,e){if(e)for(let s of e)switch(s.type){case"space":case"comment":t.push(s);break;case"newline":return t.push(s),!0}return!1}function Hl(t,e,s){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=s,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let r of n)r.offset+=i;delete t.props,Object.assign(t,{type:s,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
171
|
+
`};delete t.items,Object.assign(t,{type:s,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(t))r!=="type"&&r!=="offset"&&delete t[r];Object.assign(t,{type:s,indent:n,source:e,end:i})}}}Eo.createScalarToken=sx;Eo.resolveAsScalar=tx;Eo.setScalarValue=nx});var Jm=S(Hm=>{"use strict";var rx=t=>"type"in t?vo(t):bo(t);function vo(t){switch(t.type){case"block-scalar":{let e="";for(let s of t.props)e+=vo(s);return e+t.source}case"block-map":case"block-seq":{let e="";for(let s of t.items)e+=bo(s);return e}case"flow-collection":{let e=t.start.source;for(let s of t.items)e+=bo(s);for(let s of t.end)e+=s.source;return e}case"document":{let e=bo(t);if(t.end)for(let s of t.end)e+=s.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let s of t.end)e+=s.source;return e}}}function bo({start:t,key:e,sep:s,value:n}){let i="";for(let r of t)i+=r.source;if(e&&(i+=vo(e)),s)for(let r of s)i+=r.source;return n&&(i+=vo(n)),i}Hm.stringify=rx});var eD=S(Xm=>{"use strict";var Jl=Symbol("break visit"),ox=Symbol("skip children"),Zm=Symbol("remove item");function ks(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Qm(Object.freeze([]),t,e)}ks.BREAK=Jl;ks.SKIP=ox;ks.REMOVE=Zm;ks.itemAtPath=(t,e)=>{let s=t;for(let[n,i]of e){let r=s?.[n];if(r&&"items"in r)s=r.items[i];else return}return s};ks.parentCollection=(t,e)=>{let s=ks.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=s?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Qm(t,e,s){let n=s(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=Qm(Object.freeze(t.concat([[i,o]])),r.items[o],s);if(typeof a=="number")o=a-1;else{if(a===Jl)return Jl;a===Zm&&(r.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}Xm.visit=ks});var xo=S(_e=>{"use strict";var Zl=Ym(),ax=Jm(),ux=eD(),Ql="\uFEFF",Xl="",ec="",tc="",lx=t=>!!t&&"items"in t,cx=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function fx(t){switch(t){case Ql:return"<BOM>";case Xl:return"<DOC>";case ec:return"<FLOW_END>";case tc:return"<SCALAR>";default:return JSON.stringify(t)}}function dx(t){switch(t){case Ql:return"byte-order-mark";case Xl:return"doc-mode";case ec:return"flow-error-end";case tc:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
172
172
|
`:case`\r
|
|
173
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}
|
|
174
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
175
|
-
\r `),
|
|
173
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}_e.createScalarToken=Zl.createScalarToken;_e.resolveAsScalar=Zl.resolveAsScalar;_e.setScalarValue=Zl.setScalarValue;_e.stringify=ax.stringify;_e.visit=ux.visit;_e.BOM=Ql;_e.DOCUMENT=Xl;_e.FLOW_END=ec;_e.SCALAR=tc;_e.isCollection=lx;_e.isScalar=cx;_e.prettyToken=fx;_e.tokenType=dx});var ic=S(sD=>{"use strict";var xi=xo();function st(t){switch(t){case void 0:case" ":case`
|
|
174
|
+
`:case"\r":case" ":return!0;default:return!1}}var tD=new Set("0123456789ABCDEFabcdef"),hx=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),So=new Set(",[]{}"),px=new Set(` ,[]{}
|
|
175
|
+
\r `),sc=t=>!t||px.has(t),nc=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,s=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!s;let n=this.next??"stream";for(;n&&(s||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,s=this.buffer[e];for(;s===" "||s===" ";)s=this.buffer[++e];return!s||s==="#"||s===`
|
|
176
176
|
`?!0:s==="\r"?this.buffer[e+1]===`
|
|
177
177
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let s=this.buffer[e];if(this.indentNext>0){let n=0;for(;s===" ";)s=this.buffer[++n+e];if(s==="\r"){let i=this.buffer[n+e+1];if(i===`
|
|
178
178
|
`||!i&&!this.atEnd)return e+n+1}return s===`
|
|
179
|
-
`||n>=this.indentNext||!s&&!this.atEnd?e+n:-1}if(s==="-"||s==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&
|
|
180
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===xi.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let s=e.length,n=e.indexOf("#");for(;n!==-1;){let r=e[n-1];if(r===" "||r===" "){s=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let r=e[s-1];if(r===" "||r===" ")s-=1;else break}let i=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let s=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-s),yield*this.pushNewline(),"stream"}return yield xi.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let s=this.peek(3);if((s==="---"||s==="...")&&
|
|
179
|
+
`||n>=this.indentNext||!s&&!this.atEnd?e+n:-1}if(s==="-"||s==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&st(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
180
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===xi.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let s=e.length,n=e.indexOf("#");for(;n!==-1;){let r=e[n-1];if(r===" "||r===" "){s=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let r=e[s-1];if(r===" "||r===" ")s-=1;else break}let i=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let s=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-s),yield*this.pushNewline(),"stream"}return yield xi.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let s=this.peek(3);if((s==="---"||s==="...")&&st(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,s==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!st(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&st(s)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(e[s]){case"#":yield*this.pushCount(e.length-s);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(sc),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return s+=yield*this.parseBlockScalarHeader(),s+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,s,n=-1;do e=yield*this.pushNewline(),e>0?(s=yield*this.pushSpaces(!1),this.indentValue=n=s):s=0,s+=yield*this.pushSpaces(!0);while(e+s>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&st(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield xi.FLOW_END,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(sc),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||st(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),s=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let r=0;for(;this.buffer[s-1-r]==="\\";)r+=1;if(r%2===0)break;s=this.buffer.indexOf('"',s+1)}let n=this.buffer.substring(0,s),i=n.indexOf(`
|
|
181
181
|
`,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
|
|
182
|
-
`,r)}i!==-1&&(s=i-(n[i-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*this.pushToIndex(s+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let s=this.buffer[++e];if(s==="+")this.blockScalarKeep=!0;else if(s>"0"&&s<="9")this.blockScalarIndent=Number(s)-1;else if(s!=="-")break}return yield*this.pushUntil(s=>
|
|
182
|
+
`,r)}i!==-1&&(s=i-(n[i-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*this.pushToIndex(s+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let s=this.buffer[++e];if(s==="+")this.blockScalarKeep=!0;else if(s>"0"&&s<="9")this.blockScalarIndent=Number(s)-1;else if(s!=="-")break}return yield*this.pushUntil(s=>st(s)||s==="#")}*parseBlockScalar(){let e=this.pos-1,s=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":s+=1;break;case`
|
|
183
183
|
`:e=r,s=0;break;case"\r":{let o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
184
184
|
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=s:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
|
|
185
185
|
`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
186
186
|
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);let a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
|
|
187
|
-
`&&r>=this.pos&&r+1+s>a)e=r;else break}while(!0);return yield xi.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,s=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let r=this.buffer[n+1];if(
|
|
187
|
+
`&&r>=this.pos&&r+1+s>a)e=r;else break}while(!0);return yield xi.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,s=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let r=this.buffer[n+1];if(st(r)||e&&So.has(r))break;s=n}else if(st(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
|
|
188
188
|
`?(n+=1,i=`
|
|
189
|
-
`,r=this.buffer[n+1]):s=n),r==="#"||e&&
|
|
190
|
-
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&
|
|
189
|
+
`,r=this.buffer[n+1]):s=n),r==="#"||e&&So.has(r))break;if(i===`
|
|
190
|
+
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&So.has(i))break;s=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield xi.SCALAR,yield*this.pushToIndex(s+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,s){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(s&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(sc))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,s=this.charAt(1);if(st(s)||e&&So.has(s))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,s=this.buffer[e];for(;!st(s)&&s!==">";)s=this.buffer[++e];return yield*this.pushToIndex(s===">"?e+1:e,!1)}else{let e=this.pos+1,s=this.buffer[e];for(;s;)if(hx.has(s))s=this.buffer[++e];else if(s==="%"&&tD.has(this.buffer[e+1])&&tD.has(this.buffer[e+2]))s=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
191
191
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
192
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let s=this.pos-1,n;do n=this.buffer[++s];while(n===" "||e&&n===" ");let i=s-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=s),i}*pushUntil(e){let s=this.pos,n=this.buffer[s];for(;!e(n);)n=this.buffer[++s];return yield*this.pushToIndex(s,!1)}};
|
|
192
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let s=this.pos-1,n;do n=this.buffer[++s];while(n===" "||e&&n===" ");let i=s-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=s),i}*pushUntil(e){let s=this.pos,n=this.buffer[s];for(;!e(n);)n=this.buffer[++s];return yield*this.pushToIndex(s,!1)}};sD.Lexer=nc});var oc=S(nD=>{"use strict";var rc=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let s=0,n=this.lineStarts.length;for(;s<n;){let r=s+n>>1;this.lineStarts[r]<e?s=r+1:n=r}if(this.lineStarts[s]===e)return{line:s+1,col:1};if(s===0)return{line:0,col:e};let i=this.lineStarts[s-1];return{line:s,col:e-i+1}}}};nD.LineCounter=rc});var uc=S(uD=>{"use strict";var mx=require("process"),iD=xo(),Dx=ic();function Ht(t,e){for(let s=0;s<t.length;++s)if(t[s].type===e)return!0;return!1}function rD(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function aD(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ao(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function pn(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function oD(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Ht(e.start,"explicit-key-ind")&&!Ht(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,aD(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var ac=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Dx.Lexer,this.onNewLine=e}*parse(e,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,s))yield*this.next(n);s||(yield*this.end())}*next(e){if(this.source=e,mx.env.LOG_TOKENS&&console.log("|",iD.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let s=iD.tokenType(e);if(s)if(s==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=s,yield*this.step(),s){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let s=e??this.stack.pop();if(!s)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield s;else{let n=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in n?n.indent:0:s.type==="flow-collection"&&n.type==="document"&&(s.indent=0),s.type==="flow-collection"&&oD(s),n.type){case"document":n.value=s;break;case"block-scalar":n.props.push(s);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=s;else{Object.assign(i,{key:s,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:s}):i.value=s;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:s,sep:[]}):i.sep?i.value=s:Object.assign(i,{key:s,sep:[]});return}default:yield*this.pop(),yield*this.pop(s)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){let i=s.items[s.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&rD(i.start)===-1&&(s.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<s.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),s.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{rD(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let s=this.startBlockValue(e);s?this.stack.push(s):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let s=Ao(this.peek(2)),n=pn(s),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let s=this.source.indexOf(`
|
|
193
193
|
`)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
|
|
194
|
-
`,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let s=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){let n="end"in s.value?s.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)e.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,s.start),i.push(this.sourceToken),e.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&s.sep&&!s.value){let o=[];for(let a=0;a<s.sep.length;++a){let u=s.sep[a];switch(u.type){case"newline":o.push(a);break;case"space":break;case"comment":u.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=s.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||s.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):i||s.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(s.explicitKey)if(s.sep)if(s.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(
|
|
194
|
+
`,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let s=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){let n="end"in s.value?s.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)e.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,s.start),i.push(this.sourceToken),e.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&s.sep&&!s.value){let o=[];for(let a=0;a<s.sep.length;++a){let u=s.sep[a];switch(u.type){case"newline":o.push(a);break;case"space":break;case"comment":u.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=s.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||s.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):i||s.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(s.explicitKey)if(s.sep)if(s.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ht(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(aD(s.key)&&!Ht(s.sep,"newline")){let o=pn(s.start),a=s.key,u=s.sep;u.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:u}]})}else r.length>0?s.sep=s.sep.concat(r,this.sourceToken):s.sep.push(this.sourceToken);else if(Ht(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{let o=pn(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):Ht(s.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||s.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(o):(Object.assign(s,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!s.explicitKey&&s.sep&&!Ht(s.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let s=e.items[e.items.length-1];switch(this.type){case"newline":if(s.value){let n="end"in s.value?s.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,s.start),i.push(this.sourceToken),e.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=e.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;s.value||Ht(s.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let s=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?e.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!s||s.value?e.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!s||s.value?e.items.push({start:[],key:i,sep:[]}):s.sep?this.stack.push(i):Object.assign(s,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Ao(n),r=pn(i);oD(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let s=this.source.indexOf(`
|
|
195
195
|
`)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
|
|
196
|
-
`,s)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let s=ko(e),n=hn(s);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let s=ko(e),n=hn(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,s){return this.type!=="comment"||this.indent<=s?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Wm.Parser=ec});var Ym=A(Ai=>{"use strict";var Vm=ql(),h1=yi(),Si=wi(),p1=Mu(),m1=G(),D1=Xl(),Gm=tc();function zm(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new D1.LineCounter||null,prettyErrors:e}}function g1(t,e={}){let{lineCounter:s,prettyErrors:n}=zm(e),i=new Gm.Parser(s?.addNewLine),r=new Vm.Composer(e),o=Array.from(r.compose(i.parse(t)));if(n&&s)for(let a of o)a.errors.forEach(Si.prettifyError(t,s)),a.warnings.forEach(Si.prettifyError(t,s));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function Km(t,e={}){let{lineCounter:s,prettyErrors:n}=zm(e),i=new Gm.Parser(s?.addNewLine),r=new Vm.Composer(e),o=null;for(let a of r.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Si.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&s&&(o.errors.forEach(Si.prettifyError(t,s)),o.warnings.forEach(Si.prettifyError(t,s))),o}function y1(t,e,s){let n;typeof e=="function"?n=e:s===void 0&&e&&typeof e=="object"&&(s=e);let i=Km(t,s);if(!i)return null;if(i.warnings.forEach(r=>p1.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},s))}function F1(t,e,s){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:s===void 0&&e&&(s=e),typeof s=="string"&&(s=s.length),typeof s=="number"){let i=Math.round(s);s=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=s??e??{};if(!i)return}return m1.isDocument(t)&&!n?t.toString(s):new h1.Document(t,n,s).toString(s)}Ai.parse=y1;Ai.parseAllDocuments=g1;Ai.parseDocument=Km;Ai.stringify=F1});var Hm=A(Y=>{"use strict";var C1=ql(),w1=yi(),E1=wl(),sc=wi(),b1=ti(),zt=G(),v1=qt(),x1=te(),S1=Wt(),A1=Vt(),k1=So(),_1=Zl(),$1=Xl(),B1=tc(),_o=Ym(),Jm=Zn();Y.Composer=C1.Composer;Y.Document=w1.Document;Y.Schema=E1.Schema;Y.YAMLError=sc.YAMLError;Y.YAMLParseError=sc.YAMLParseError;Y.YAMLWarning=sc.YAMLWarning;Y.Alias=b1.Alias;Y.isAlias=zt.isAlias;Y.isCollection=zt.isCollection;Y.isDocument=zt.isDocument;Y.isMap=zt.isMap;Y.isNode=zt.isNode;Y.isPair=zt.isPair;Y.isScalar=zt.isScalar;Y.isSeq=zt.isSeq;Y.Pair=v1.Pair;Y.Scalar=x1.Scalar;Y.YAMLMap=S1.YAMLMap;Y.YAMLSeq=A1.YAMLSeq;Y.CST=k1;Y.Lexer=_1.Lexer;Y.LineCounter=$1.LineCounter;Y.Parser=B1.Parser;Y.parse=_o.parse;Y.parseAllDocuments=_o.parseAllDocuments;Y.parseDocument=_o.parseDocument;Y.stringify=_o.stringify;Y.visit=Jm.visit;Y.visitAsync=Jm.visitAsync});function nc(){return(0,ki.join)(T1,"defaults")}function $o(...t){return(0,ki.join)(nc(),...t)}var ki,Zm,I1,T1,Bo=L(()=>{"use strict";ki=require("node:path"),Zm=require("node:url"),I1={},T1=typeof __dirname<"u"?__dirname:(0,ki.dirname)((0,Zm.fileURLToPath)(I1.url))});function R1(t,e){let s=t.name;if(typeof s!="string")return null;let n=e.trim();if(!n)return null;let i=t.executorSettings&&typeof t.executorSettings=="object"&&!Array.isArray(t.executorSettings)?t.executorSettings:void 0,r=t.stage==="validation"?"validation":"review";return{name:s,description:typeof t.description=="string"?t.description:"",systemPrompt:n,enabled:typeof t.enabled=="boolean"?t.enabled:!0,order:typeof t.order=="number"?t.order:0,...typeof t.executor=="string"&&{executor:t.executor},stage:r,...i&&{executorSettings:i}}}async function _i(t){let{glob:e}=await Promise.resolve().then(()=>(Tr(),uh)),{join:s}=await import("node:path");try{let n=await e("*.md",{cwd:t}),i=[],r=[],o=await Promise.all(n.map(async a=>{let u=s(t,a);try{return{agents:(await $i(u,R1)).map(c=>({...c,path:u})),failed:null}}catch(l){return h.error(`Error loading agent from ${a}:`,l),{agents:[],failed:a}}}));return i.push(...o.flatMap(a=>a.agents)),r.push(...o.map(a=>a.failed).filter(a=>a!==null)),r.length>0&&h.warn(`Loaded ${i.length}/${n.length} agents, ${r.length} failed: ${r.join(", ")}`),i}catch(n){if(n.code==="ENOENT")return[];throw n}}var ic=L(()=>{"use strict";Bi();J()});function Io(t){if(!t||typeof t!="string")return null;let e=t.lastIndexOf("#"),s,n;if(e!==-1){if(s=t.slice(0,e),n=t.slice(e+1),!n||n.includes("..")||n.includes("\0"))return null}else s=t;return L1(s)?{url:s,ref:n}:null}function L1(t){return N1.test(t)||O1.test(t)||P1.test(t)}function rc(t){let e=t.url;return e=e.replace(/^https?:\/\//,""),e=e.replace(/^git@/,""),e=e.replace(/^ssh:\/\//,""),e=e.replace(/\.git$/,""),e=e.replace(/[/:@]/g,"--"),t.ref&&(e=`${e}@${t.ref}`),e}function Ro(t){let e=t.url;return e.startsWith("git@")?e=e.replace(/^git@[^:]+:/,""):e=e.replace(/^https?:\/\/[^/]+\//,""),e=e.replace(/\.git$/,""),e}var N1,O1,P1,oc=L(()=>{"use strict";N1=/^https?:\/\/.+/,O1=/^git@.+:.+/,P1=/^ssh:\/\/.+/});function Ti(){return(0,No.join)((0,ac.homedir)(),".diffray","extends")}function Ii(){return(0,No.join)((0,ac.homedir)(),".diffray","extends.lock.json")}function Qm(t){return(0,No.join)(Ti(),rc(t))}function uc(t,e){return{ref:t,refString:e,localPath:Qm(t)}}var ac,No,Oo=L(()=>{"use strict";ac=require("node:os"),No=require("node:path");oc()});function q1(){return Ii()+".lock"}async function U1(){let t=q1(),e=Date.now();for(;;)try{return await(0,we.mkdir)(t),async()=>{try{await(0,we.rm)(t,{recursive:!0,force:!0})}catch{}}}catch(s){if(s.code==="EEXIST"){if(Date.now()-e>M1){await(0,we.rm)(t,{recursive:!0,force:!0});continue}await new Promise(n=>setTimeout(n,j1));continue}throw s}}async function eD(t){let e=await U1();try{return await t()}finally{await e()}}function W1(){return{version:1,updated:new Date().toISOString(),packages:{}}}async function wt(){let t=Ii();try{await(0,we.access)(t);let e=await(0,we.readFile)(t,"utf-8"),s=JSON.parse(e);if(s.version!==1)throw new Error(`Unsupported lock file version: ${s.version}`);return s}catch(e){if(e.code==="ENOENT")return W1();throw e}}async function tD(t){let e=Ii();await(0,we.mkdir)((0,Xm.dirname)(e),{recursive:!0}),t.updated=new Date().toISOString();let s=e+".tmp."+process.pid;await(0,we.writeFile)(s,JSON.stringify(t,null,2),"utf-8"),await(0,we.rename)(s,e)}async function sD(t){return(await wt()).packages[t]||null}async function lc(t,e){await eD(async()=>{let s=await wt();s.packages[t]=e,await tD(s)})}async function cc(t){await eD(async()=>{let e=await wt();delete e.packages[t],await tD(e)})}async function Po(t){let e=await sD(t);if(!e)return!1;try{return await(0,we.access)(e.path),!0}catch{return!1}}var we,Xm,M1,j1,fc=L(()=>{"use strict";we=require("node:fs/promises"),Xm=require("node:path");Oo();M1=1e4,j1=100});function Lo(t){let e=(0,je.resolve)(Ti()),s=(0,je.resolve)(t),n=(0,je.relative)(e,s);if(n.startsWith("..")||(0,je.resolve)(e,n)!==s)throw new Error("Invalid extend path: path traversal detected");let i=n.split(/[/\\]/);for(let r of i)if(r==="."||r===".."||r.includes("\0"))throw new Error("Invalid extend path: suspicious path component")}async function dc(t){let{ref:e,localPath:s}=t;Lo(s),await(0,Kt.mkdir)(Ti(),{recursive:!0}),await(0,Kt.rm)(s,{recursive:!0,force:!0});let n=["clone","--depth","1"];e.ref&&n.push("--branch",e.ref),n.push(e.url,s);try{await nD("git",n,{timeout:6e4})}catch(r){let o=r instanceof Error?r.message:String(r);throw o.includes("not found")||o.includes("does not exist")?new Error(`Repository or ref not found: ${e.url}${e.ref?`#${e.ref}`:""}`):o.includes("Authentication failed")||o.includes("Permission denied")?new Error(`Authentication failed for: ${e.url}`):new Error(`Git clone failed: ${o}`)}let{stdout:i}=await nD("git",["rev-parse","HEAD"],{cwd:s});return await(0,Kt.rm)((0,je.join)(s,".git"),{recursive:!0,force:!0}),i.trim()}async function hc(t){let e={agents:[],rules:[]},s=(0,je.join)(t,"agents");try{let i=await yt("*.md",{cwd:s});for(let r of i){let o=await iD((0,je.join)(s,r));o&&e.agents.push(o)}}catch{}let n=(0,je.join)(t,"rules");try{let i=await yt("**/*.md",{cwd:n});for(let r of i){let o=await iD((0,je.join)(n,r));o&&e.rules.push(o)}}catch{}return e}async function iD(t){try{let e=await(0,Kt.readFile)(t,"utf-8");if(!e.startsWith("---"))return null;let s=e.indexOf("---",3);if(s===-1)return null;let i=e.slice(3,s).match(/^name:\s*(.+)$/m);return i&&i[1]?i[1].trim().replace(/^["']|["']$/g,""):null}catch{return null}}async function pc(t){Lo(t),await(0,Kt.rm)(t,{recursive:!0,force:!0})}var Kt,je,rD,oD,nD,mc=L(()=>{"use strict";Kt=require("node:fs/promises"),je=require("node:path"),rD=require("node:child_process"),oD=require("node:util");Oo();Tr();nD=(0,oD.promisify)(rD.execFile)});var Dc={};yn(Dc,{getInstalledExtendPaths:()=>Ri,loadAgentsFromExtends:()=>aD,loadFromExtends:()=>lD,scanRuleRefsFromExtends:()=>uD});async function Ri(t){let e=await wt(),s=[];for(let n of t){let i=e.packages[n];i?(Lo(i.path),s.push(i.path)):h.warn(`Extension not installed: ${n}. Run 'diffray extends install'`)}return s}async function aD(t){let e=await Ri(t),s=[];for(let n of e){let i=(0,Mo.join)(n,"agents");try{let r=await _i(i);s.push(...r.map(o=>({...o,source:"extends"})))}catch{}}return s}async function uD(t){let e=await Ri(t),s=[];for(let n of e){let i=(0,Mo.join)(n,"rules");try{let r=await Yt(i,"extends");s.push(...r)}catch{}}return s}async function lD(t,e,s){let n=await Ri(s),i=[];for(let r of n){let o=(0,Mo.join)(r,t);try{let a=await e(o);i.push(a)}catch{i.push([])}}return i}var Mo,jo=L(()=>{"use strict";Mo=require("node:path");ic();Bi();fc();mc();J()});function Ni(t){if(!t||t.trim()==="")return{frontmatter:{},body:""};if(!t.startsWith("---"))return{frontmatter:{},body:t};let e=t.indexOf("---",3);if(e===-1)throw new Error("Invalid frontmatter: missing closing delimiter ---");let s=t.slice(3,e).trim(),n=t.slice(e+3).trim();if(!s)return{frontmatter:{},body:n};let i;try{i=fD.default.parse(s)}catch(r){throw new Error(`Invalid YAML in frontmatter: ${r instanceof Error?r.message:String(r)}`)}return{frontmatter:i,body:n}}function To(t,e){try{let{frontmatter:s,body:n}=Ni(t),i=e(s,n);return i?[i]:[]}catch(s){return h.error("Failed to parse markdown:",s),[]}}async function $i(t,e){try{let s=await(0,gc.readFile)(t,"utf-8");return e?To(s,e):Ni(s)}catch(s){throw s instanceof Error?new Error(`Failed to load markdown file "${t}": ${s.message}`):new Error(`Failed to load markdown file "${t}": Unknown error`)}}async function dD(t,e,s){try{let n=await yt("**/*.md",{cwd:t});if(n.length===0)return[];let i=[];for(let o of n){let a=(0,ks.join)(t,o);try{let u=await $i(a,e);i.push(...u)}catch(u){h.error(`Error processing file ${o}:`,u)}}let r=s?s(i):i;return h.info(`Loaded ${r.length} items from ${n.length} files in ${t} (recursive)`),r}catch{return[]}}function hD(...t){let e=new Map;for(let s of t)for(let n of s)e.set(n.name,n);return Array.from(e.values())}function qo(t,e){return{defaults:(0,ks.join)(nc(),t),user:(0,ks.join)((0,cD.homedir)(),".diffray",t),project:(0,ks.join)(e,".diffray",t)}}async function pD(t,e,s){let n=qo(t,s),[i,r,o]=await Promise.all([e(n.defaults),e(n.user),e(n.project)]);return hD(i,r,o)}async function Yt(t,e){try{let s=await yt("**/*.md",{cwd:t}),n=await Promise.all(s.map(async r=>{let o=(0,ks.join)(t,r);try{let a=await(0,gc.readFile)(o,"utf-8");return{filePath:o,content:a}}catch{return null}})),i=[];for(let r of n)if(r)try{let{frontmatter:o}=Ni(r.content),a=o.name,u=o.description,l=o.agent,c=o.patterns;typeof a=="string"&&typeof l=="string"&&Array.isArray(c)&&c.length>0&&i.push({name:a,description:typeof u=="string"?u:"",path:r.filePath,patterns:c.filter(f=>typeof f=="string"),agent:l,source:e})}catch{}return i}catch{return[]}}async function mD(t){let e=qo("rules",t),[s,n,i]=await Promise.all([Yt(e.defaults,"defaults"),Yt(e.user,"user"),Yt(e.project,"project")]),r=new Map;for(let o of[...s,...n,...i])r.set(o.name,o);return Array.from(r.values())}async function DD(t,e,s,n){let i=qo(t,s),{loadFromExtends:r}=await Promise.resolve().then(()=>(jo(),Dc)),[o,a,u,l]=await Promise.all([e(i.defaults),r(t,e,n),e(i.user),e(i.project)]);return hD(o,...a,u,l)}async function gD(t,e){let s=qo("rules",t),{scanRuleRefsFromExtends:n}=await Promise.resolve().then(()=>(jo(),Dc)),[i,r,o,a]=await Promise.all([Yt(s.defaults,"defaults"),n(e),Yt(s.user,"user"),Yt(s.project,"project")]),u=new Map;for(let l of[...i,...r,...o,...a])u.set(l.name,l);return Array.from(u.values())}var gc,ks,cD,fD,Bi=L(()=>{"use strict";J();Tr();gc=require("node:fs/promises"),ks=require("node:path"),cD=require("node:os"),fD=bt(Hm(),1);Bo()});var vD={};yn(vD,{expandBraces:()=>wc,loadRuleFromRef:()=>Fc,loadRuleMarkdown:()=>V1,loadRuleRefs:()=>Jt,loadRules:()=>K1,loadRulesFromDirectoryRecursive:()=>G1,loadRulesFromRefs:()=>wD,matchAndLoadRules:()=>Cc,matchPattern:()=>Ht,matchRuleRefs:()=>bD,matchRules:()=>Y1,parseRuleMarkdown:()=>CD,parseSingleRule:()=>z1});function yc(t,e){let s=t.name,n=t.agent,i=t.patterns,r=e.trim();return typeof s!="string"||typeof n!="string"||!Array.isArray(i)||i.length===0||!r?null:{name:s,description:typeof t.description=="string"?t.description:"",patterns:i.filter(a=>typeof a=="string"),agent:n,prompt:r}}function CD(t){return To(t,yc)}async function V1(t){try{return await $i(t,yc)}catch(e){return h.error(`Error loading rule markdown from ${t}:`,e),[]}}async function G1(t){return dD(t,yc)}function z1(t){let e=CD(t);return e.length>0?e[0]??null:null}async function Jt(t){let e=t||process.cwd(),s=await ye(e);return(s.extends.length>0?await gD(e,s.extends):await mD(e)).map(i=>{let r=s.rules[i.name]||{};return{...i,agent:r.agent??i.agent,_enabled:r.enabled??!0}}).filter(i=>i._enabled!==!1).map(({_enabled:i,...r})=>r)}async function Fc(t){try{let e=await(0,FD.readFile)(t.path,"utf-8"),{body:s}=Ni(e);return{name:t.name,description:t.description,patterns:t.patterns,agent:t.agent,prompt:s.trim(),source:t.source,path:t.path}}catch(e){return h.error(`Failed to load rule from ${t.path}:`,e),null}}async function wD(t){return(await Promise.all(t.map(Fc))).filter(s=>s!==null)}async function K1(t){let e=await Jt(t);return wD(e)}function ED(t,e,s){let n=new Map(s.map(r=>[r.name,r])),i=[];for(let r of t){let o=n.get(r.agent);if(!o){h.warn(`Rule references unknown agent "${r.agent}"`);continue}let a=e.filter(u=>r.patterns.some(l=>Ht(u.file,l))).map(u=>u.file);a.length!==0&&i.push({item:r,files:a,agent:o})}return i}function bD(t,e,s){return ED(t,e,s).map(({item:n,...i})=>({ref:n,...i}))}async function Cc(t,e,s){let n=bD(t,e,s);return(await Promise.all(n.map(async({ref:r,files:o,agent:a})=>{let u=await Fc(r);return u?{rule:u,files:o,agent:a}:null}))).filter(r=>r!==null)}function Y1(t,e,s){return ED(t,e,s).map(({item:n,...i})=>({rule:n,...i}))}function wc(t){let e=t.match(J1);if(!e||e.index===void 0||!e[1])return[t];let s=e[1].split(",").map(o=>o.trim()),n=t.substring(0,e.index),i=t.substring(e.index+e[0].length),r=[];for(let o of s){let a=n+o+i;r.push(...wc(a))}return r}function Ht(t,e){return wc(e).some(n=>H1(t,n))}function H1(t,e){let s=e.replace(/\*\*/g,"\0DOUBLESTAR\0").replace(/\*/g,"\0STAR\0").replace(/\?/g,"\0QUESTION\0");s=s.replace(/[.+^${}()|[\]\\]/g,"\\$&"),s=s.replace(/\x00DOUBLESTAR\x00\//g,"(?:.*\\/)?").replace(/\x00DOUBLESTAR\x00/g,".*").replace(/\x00STAR\x00/g,"[^/]*").replace(/\x00QUESTION\x00/g,".");let n=yD.get(s);return n||(n=new RegExp(`^${s}$`),yD.set(s,n)),n.test(t)}var FD,J1,yD,_s=L(()=>{"use strict";Bi();FD=require("node:fs/promises");J();ze();J1=/\{([^}]+)\}/;yD=new Map});var ue={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},oa={silent:{level:-1},fatal:{level:ue.fatal},error:{level:ue.error},warn:{level:ue.warn},log:{level:ue.log},info:{level:ue.info},success:{level:ue.success},fail:{level:ue.fail},ready:{level:ue.info},start:{level:ue.info},box:{level:ue.info},debug:{level:ue.debug},trace:{level:ue.trace},verbose:{level:ue.verbose}};function na(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function aa(t,e,s=".",n){if(!na(e))return aa(t,{},s,n);let i=Object.assign({},e);for(let r in t){if(r==="__proto__"||r==="constructor")continue;let o=t[r];o!=null&&(n&&n(i,r,o,s)||(Array.isArray(o)&&Array.isArray(i[r])?i[r]=[...o,...i[r]]:na(o)&&na(i[r])?i[r]=aa(o,i[r],(s?`${s}.`:"")+r.toString(),n):i[r]=o))}return i}function c0(t){return(...e)=>e.reduce((s,n)=>aa(s,n,"",t),{})}var f0=c0();function d0(t){return Object.prototype.toString.call(t)==="[object Object]"}function h0(t){return!(!d0(t)||!t.message&&!t.args||t.stack)}var ia=!1,$c=[],ie=class t{options;_lastLog;_mockFn;constructor(e={}){let s=e.types||oa;this.options=f0({...e,defaults:{...e.defaults},level:ra(e.level,s),reporters:[...e.reporters||[]]},{types:oa,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let n in s){let i={type:n,...this.options.defaults,...s[n]};this[n]=this._wrapLogFn(i),this[n].raw=this._wrapLogFn(i,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=ra(e,this.options.types,this.options.level)}prompt(e,s){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,s)}create(e){let s=new t({...this.options,...e});return this._mockFn&&s.mockTypes(this._mockFn),s}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){let s=this.options.reporters.indexOf(e);if(s!==-1)return this.options.reporters.splice(s,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(let e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,s){e&&(e.__write||(e.__write=e.write),e.write=n=>{this[s].raw(String(n).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){ia=!0}resumeLogs(){ia=!1;let e=$c.splice(0);for(let s of e)s[0]._logFn(s[1],s[2])}mockTypes(e){let s=e||this.options.mockFn;if(this._mockFn=s,typeof s=="function")for(let n in this.options.types)this[n]=s(n,this.options.types[n])||this[n],this[n].raw=this[n]}_wrapLogFn(e,s){return(...n)=>{if(ia){$c.push([this,e,n,s]);return}return this._logFn(e,n,s)}}_logFn(e,s,n){if((e.level||0)>this.level)return!1;let i={date:new Date,args:[],...e,level:ra(e.level,this.options.types)};!n&&s.length===1&&h0(s[0])?Object.assign(i,s[0]):i.args=[...s],i.message&&(i.args.unshift(i.message),delete i.message),i.additional&&(Array.isArray(i.additional)||(i.additional=i.additional.split(`
|
|
196
|
+
`,s)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let s=Ao(e),n=pn(s);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let s=Ao(e),n=pn(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,s){return this.type!=="comment"||this.indent<=s?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};uD.Parser=ac});var hD=S(Ai=>{"use strict";var lD=Yl(),gx=yi(),Si=Ci(),yx=Gu(),Fx=K(),wx=oc(),cD=uc();function fD(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new wx.LineCounter||null,prettyErrors:e}}function Cx(t,e={}){let{lineCounter:s,prettyErrors:n}=fD(e),i=new cD.Parser(s?.addNewLine),r=new lD.Composer(e),o=Array.from(r.compose(i.parse(t)));if(n&&s)for(let a of o)a.errors.forEach(Si.prettifyError(t,s)),a.warnings.forEach(Si.prettifyError(t,s));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function dD(t,e={}){let{lineCounter:s,prettyErrors:n}=fD(e),i=new cD.Parser(s?.addNewLine),r=new lD.Composer(e),o=null;for(let a of r.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Si.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&s&&(o.errors.forEach(Si.prettifyError(t,s)),o.warnings.forEach(Si.prettifyError(t,s))),o}function Ex(t,e,s){let n;typeof e=="function"?n=e:s===void 0&&e&&typeof e=="object"&&(s=e);let i=dD(t,s);if(!i)return null;if(i.warnings.forEach(r=>yx.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},s))}function bx(t,e,s){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:s===void 0&&e&&(s=e),typeof s=="string"&&(s=s.length),typeof s=="number"){let i=Math.round(s);s=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=s??e??{};if(!i)return}return Fx.isDocument(t)&&!n?t.toString(s):new gx.Document(t,n,s).toString(s)}Ai.parse=Ex;Ai.parseAllDocuments=Cx;Ai.parseDocument=dD;Ai.stringify=bx});var mD=S(Y=>{"use strict";var vx=Yl(),xx=yi(),Sx=kl(),lc=Ci(),Ax=ti(),Jt=K(),kx=zt(),$x=ee(),_x=Kt(),Bx=Yt(),Tx=xo(),Ix=ic(),Rx=oc(),Nx=uc(),ko=hD(),pD=Zn();Y.Composer=vx.Composer;Y.Document=xx.Document;Y.Schema=Sx.Schema;Y.YAMLError=lc.YAMLError;Y.YAMLParseError=lc.YAMLParseError;Y.YAMLWarning=lc.YAMLWarning;Y.Alias=Ax.Alias;Y.isAlias=Jt.isAlias;Y.isCollection=Jt.isCollection;Y.isDocument=Jt.isDocument;Y.isMap=Jt.isMap;Y.isNode=Jt.isNode;Y.isPair=Jt.isPair;Y.isScalar=Jt.isScalar;Y.isSeq=Jt.isSeq;Y.Pair=kx.Pair;Y.Scalar=$x.Scalar;Y.YAMLMap=_x.YAMLMap;Y.YAMLSeq=Bx.YAMLSeq;Y.CST=Tx;Y.Lexer=Ix.Lexer;Y.LineCounter=Rx.LineCounter;Y.Parser=Nx.Parser;Y.parse=ko.parse;Y.parseAllDocuments=ko.parseAllDocuments;Y.parseDocument=ko.parseDocument;Y.stringify=ko.stringify;Y.visit=pD.visit;Y.visitAsync=pD.visitAsync});function cc(){return(0,ki.join)(Px,"defaults")}function $o(...t){return(0,ki.join)(cc(),...t)}var ki,DD,Ox,Px,_o=q(()=>{"use strict";ki=require("node:path"),DD=require("node:url"),Ox={},Px=typeof __dirname<"u"?__dirname:(0,ki.dirname)((0,DD.fileURLToPath)(Ox.url))});function Lx(t,e){let s=t.name;if(typeof s!="string")return null;let n=e.trim();if(!n)return null;let i=t.executorSettings&&typeof t.executorSettings=="object"&&!Array.isArray(t.executorSettings)?t.executorSettings:void 0,r=t.stage==="validation"?"validation":"review";return{name:s,description:typeof t.description=="string"?t.description:"",systemPrompt:n,enabled:typeof t.enabled=="boolean"?t.enabled:!0,order:typeof t.order=="number"?t.order:0,...typeof t.executor=="string"&&{executor:t.executor},stage:r,...i&&{executorSettings:i}}}async function $i(t){let{glob:e}=await Promise.resolve().then(()=>(Br(),Ah)),{join:s}=await import("node:path");try{let n=await e("*.md",{cwd:t}),i=[],r=[],o=await Promise.all(n.map(async a=>{let u=s(t,a);try{return{agents:(await _i(u,Lx)).map(c=>({...c,path:u})),failed:null}}catch(l){return h.error(`Error loading agent from ${a}:`,l),{agents:[],failed:a}}}));return i.push(...o.flatMap(a=>a.agents)),r.push(...o.map(a=>a.failed).filter(a=>a!==null)),r.length>0&&h.warn(`Loaded ${i.length}/${n.length} agents, ${r.length} failed: ${r.join(", ")}`),i}catch(n){if(n.code==="ENOENT")return[];throw n}}var fc=q(()=>{"use strict";Bi();H()});function To(t){if(!t||typeof t!="string")return null;let e=t.lastIndexOf("#"),s,n;if(e!==-1){if(s=t.slice(0,e),n=t.slice(e+1),!n||n.includes("..")||n.includes("\0"))return null}else s=t;return Ux(s)?{url:s,ref:n}:null}function Ux(t){return Mx.test(t)||jx.test(t)||qx.test(t)}function dc(t){let e=t.url;return e=e.replace(/^https?:\/\//,""),e=e.replace(/^git@/,""),e=e.replace(/^ssh:\/\//,""),e=e.replace(/\.git$/,""),e=e.replace(/[/:@]/g,"--"),t.ref&&(e=`${e}@${t.ref}`),e}function Io(t){let e=t.url;return e.startsWith("git@")?e=e.replace(/^git@[^:]+:/,""):e=e.replace(/^https?:\/\/[^/]+\//,""),e=e.replace(/\.git$/,""),e}var Mx,jx,qx,hc=q(()=>{"use strict";Mx=/^https?:\/\/.+/,jx=/^git@.+:.+/,qx=/^ssh:\/\/.+/});function Ti(){return(0,Ro.join)((0,pc.homedir)(),".diffray","extends")}function Ii(){return(0,Ro.join)((0,pc.homedir)(),".diffray","extends.lock.json")}function gD(t){return(0,Ro.join)(Ti(),dc(t))}function mc(t,e){return{ref:t,refString:e,localPath:gD(t)}}var pc,Ro,No=q(()=>{"use strict";pc=require("node:os"),Ro=require("node:path");hc()});function zx(){return Ii()+".lock"}async function Gx(){let t=zx(),e=Date.now();for(;;)try{return await(0,xe.mkdir)(t),async()=>{try{await(0,xe.rm)(t,{recursive:!0,force:!0})}catch{}}}catch(s){if(s.code==="EEXIST"){if(Date.now()-e>Wx){await(0,xe.rm)(t,{recursive:!0,force:!0});continue}await new Promise(n=>setTimeout(n,Vx));continue}throw s}}async function FD(t){let e=await Gx();try{return await t()}finally{await e()}}function Kx(){return{version:1,updated:new Date().toISOString(),packages:{}}}async function St(){let t=Ii();try{await(0,xe.access)(t);let e=await(0,xe.readFile)(t,"utf-8"),s=JSON.parse(e);if(s.version!==1)throw new Error(`Unsupported lock file version: ${s.version}`);return s}catch(e){if(e.code==="ENOENT")return Kx();throw e}}async function wD(t){let e=Ii();await(0,xe.mkdir)((0,yD.dirname)(e),{recursive:!0}),t.updated=new Date().toISOString();let s=e+".tmp."+process.pid;await(0,xe.writeFile)(s,JSON.stringify(t,null,2),"utf-8"),await(0,xe.rename)(s,e)}async function CD(t){return(await St()).packages[t]||null}async function Dc(t,e){await FD(async()=>{let s=await St();s.packages[t]=e,await wD(s)})}async function gc(t){await FD(async()=>{let e=await St();delete e.packages[t],await wD(e)})}async function Po(t){let e=await CD(t);if(!e)return!1;try{return await(0,xe.access)(e.path),!0}catch{return!1}}var xe,yD,Wx,Vx,yc=q(()=>{"use strict";xe=require("node:fs/promises"),yD=require("node:path");No();Wx=1e4,Vx=100});function Oo(t){let e=(0,Ve.resolve)(Ti()),s=(0,Ve.resolve)(t),n=(0,Ve.relative)(e,s);if(n.startsWith("..")||(0,Ve.resolve)(e,n)!==s)throw new Error("Invalid extend path: path traversal detected");let i=n.split(/[/\\]/);for(let r of i)if(r==="."||r===".."||r.includes("\0"))throw new Error("Invalid extend path: suspicious path component")}async function Fc(t){let{ref:e,localPath:s}=t;Oo(s),await(0,Zt.mkdir)(Ti(),{recursive:!0}),await(0,Zt.rm)(s,{recursive:!0,force:!0});let n=["clone","--depth","1"];e.ref&&n.push("--branch",e.ref),n.push(e.url,s);try{await ED("git",n,{timeout:6e4})}catch(r){let o=r instanceof Error?r.message:String(r);throw o.includes("not found")||o.includes("does not exist")?new Error(`Repository or ref not found: ${e.url}${e.ref?`#${e.ref}`:""}`):o.includes("Authentication failed")||o.includes("Permission denied")?new Error(`Authentication failed for: ${e.url}`):new Error(`Git clone failed: ${o}`)}let{stdout:i}=await ED("git",["rev-parse","HEAD"],{cwd:s});return await(0,Zt.rm)((0,Ve.join)(s,".git"),{recursive:!0,force:!0}),i.trim()}async function wc(t){let e={agents:[],rules:[]},s=(0,Ve.join)(t,"agents");try{let i=await bt("*.md",{cwd:s});for(let r of i){let o=await bD((0,Ve.join)(s,r));o&&e.agents.push(o)}}catch{}let n=(0,Ve.join)(t,"rules");try{let i=await bt("**/*.md",{cwd:n});for(let r of i){let o=await bD((0,Ve.join)(n,r));o&&e.rules.push(o)}}catch{}return e}async function bD(t){try{let e=await(0,Zt.readFile)(t,"utf-8");if(!e.startsWith("---"))return null;let s=e.indexOf("---",3);if(s===-1)return null;let i=e.slice(3,s).match(/^name:\s*(.+)$/m);return i&&i[1]?i[1].trim().replace(/^["']|["']$/g,""):null}catch{return null}}async function Cc(t){Oo(t),await(0,Zt.rm)(t,{recursive:!0,force:!0})}var Zt,Ve,vD,xD,ED,Ec=q(()=>{"use strict";Zt=require("node:fs/promises"),Ve=require("node:path"),vD=require("node:child_process"),xD=require("node:util");No();Br();ED=(0,xD.promisify)(vD.execFile)});var bc={};wn(bc,{getInstalledExtendPaths:()=>Ri,loadAgentsFromExtends:()=>SD,loadFromExtends:()=>kD,scanRuleRefsFromExtends:()=>AD});async function Ri(t){let e=await St(),s=[];for(let n of t){let i=e.packages[n];i?(Oo(i.path),s.push(i.path)):h.warn(`Extension not installed: ${n}. Run 'diffray extends install'`)}return s}async function SD(t){let e=await Ri(t),s=[];for(let n of e){let i=(0,Lo.join)(n,"agents");try{let r=await $i(i);s.push(...r.map(o=>({...o,source:"extends"})))}catch{}}return s}async function AD(t){let e=await Ri(t),s=[];for(let n of e){let i=(0,Lo.join)(n,"rules");try{let r=await Qt(i,"extends");s.push(...r)}catch{}}return s}async function kD(t,e,s){let n=await Ri(s),i=[];for(let r of n){let o=(0,Lo.join)(r,t);try{let a=await e(o);i.push(a)}catch{i.push([])}}return i}var Lo,Mo=q(()=>{"use strict";Lo=require("node:path");fc();Bi();yc();Ec();H()});function Ni(t){if(!t||t.trim()==="")return{frontmatter:{},body:""};if(!t.startsWith("---"))return{frontmatter:{},body:t};let e=t.indexOf("---",3);if(e===-1)throw new Error("Invalid frontmatter: missing closing delimiter ---");let s=t.slice(3,e).trim(),n=t.slice(e+3).trim();if(!s)return{frontmatter:{},body:n};let i;try{i=_D.default.parse(s)}catch(r){throw new Error(`Invalid YAML in frontmatter: ${r instanceof Error?r.message:String(r)}`)}return{frontmatter:i,body:n}}function Bo(t,e){try{let{frontmatter:s,body:n}=Ni(t),i=e(s,n);return i?[i]:[]}catch(s){return h.error("Failed to parse markdown:",s),[]}}async function _i(t,e){try{let s=await(0,vc.readFile)(t,"utf-8");return e?Bo(s,e):Ni(s)}catch(s){throw s instanceof Error?new Error(`Failed to load markdown file "${t}": ${s.message}`):new Error(`Failed to load markdown file "${t}": Unknown error`)}}async function BD(t,e,s){try{let n=await bt("**/*.md",{cwd:t});if(n.length===0)return[];let i=[];for(let o of n){let a=(0,$s.join)(t,o);try{let u=await _i(a,e);i.push(...u)}catch(u){h.error(`Error processing file ${o}:`,u)}}let r=s?s(i):i;return h.info(`Loaded ${r.length} items from ${n.length} files in ${t} (recursive)`),r}catch{return[]}}function TD(...t){let e=new Map;for(let s of t)for(let n of s)e.set(n.name,n);return Array.from(e.values())}function jo(t,e){return{defaults:(0,$s.join)(cc(),t),user:(0,$s.join)((0,$D.homedir)(),".diffray",t),project:(0,$s.join)(e,".diffray",t)}}async function ID(t,e,s){let n=jo(t,s),[i,r,o]=await Promise.all([e(n.defaults),e(n.user),e(n.project)]);return TD(i,r,o)}async function Qt(t,e){try{let s=await bt("**/*.md",{cwd:t}),n=await Promise.all(s.map(async r=>{let o=(0,$s.join)(t,r);try{let a=await(0,vc.readFile)(o,"utf-8");return{filePath:o,content:a}}catch{return null}})),i=[];for(let r of n)if(r)try{let{frontmatter:o}=Ni(r.content),a=o.name,u=o.description,l=o.agent,c=o.patterns;typeof a=="string"&&typeof l=="string"&&Array.isArray(c)&&c.length>0&&i.push({name:a,description:typeof u=="string"?u:"",path:r.filePath,patterns:c.filter(f=>typeof f=="string"),agent:l,source:e})}catch{}return i}catch{return[]}}async function RD(t){let e=jo("rules",t),[s,n,i]=await Promise.all([Qt(e.defaults,"defaults"),Qt(e.user,"user"),Qt(e.project,"project")]),r=new Map;for(let o of[...s,...n,...i])r.set(o.name,o);return Array.from(r.values())}async function ND(t,e,s,n){let i=jo(t,s),{loadFromExtends:r}=await Promise.resolve().then(()=>(Mo(),bc)),[o,a,u,l]=await Promise.all([e(i.defaults),r(t,e,n),e(i.user),e(i.project)]);return TD(o,...a,u,l)}async function PD(t,e){let s=jo("rules",t),{scanRuleRefsFromExtends:n}=await Promise.resolve().then(()=>(Mo(),bc)),[i,r,o,a]=await Promise.all([Qt(s.defaults,"defaults"),n(e),Qt(s.user,"user"),Qt(s.project,"project")]),u=new Map;for(let l of[...i,...r,...o,...a])u.set(l.name,l);return Array.from(u.values())}var vc,$s,$D,_D,Bi=q(()=>{"use strict";H();Br();vc=require("node:fs/promises"),$s=require("node:path"),$D=require("node:os"),_D=nt(mD(),1);_o()});var WD={};wn(WD,{expandBraces:()=>kc,loadRuleFromRef:()=>Sc,loadRuleMarkdown:()=>Yx,loadRuleRefs:()=>Xt,loadRules:()=>Zx,loadRulesFromDirectoryRecursive:()=>Hx,loadRulesFromRefs:()=>jD,matchAndLoadRules:()=>Ac,matchPattern:()=>es,matchRuleRefs:()=>UD,matchRules:()=>Qx,parseRuleMarkdown:()=>MD,parseSingleRule:()=>Jx});function xc(t,e){let s=t.name,n=t.agent,i=t.patterns,r=e.trim();return typeof s!="string"||typeof n!="string"||!Array.isArray(i)||i.length===0||!r?null:{name:s,description:typeof t.description=="string"?t.description:"",patterns:i.filter(a=>typeof a=="string"),agent:n,prompt:r}}function MD(t){return Bo(t,xc)}async function Yx(t){try{return await _i(t,xc)}catch(e){return h.error(`Error loading rule markdown from ${t}:`,e),[]}}async function Hx(t){return BD(t,xc)}function Jx(t){let e=MD(t);return e.length>0?e[0]??null:null}async function Xt(t){let e=t||process.cwd(),s=await Ee(e);return(s.extends.length>0?await PD(e,s.extends):await RD(e)).map(i=>{let r=s.rules[i.name]||{};return{...i,agent:r.agent??i.agent,_enabled:r.enabled??!0}}).filter(i=>i._enabled!==!1).map(({_enabled:i,...r})=>r)}async function Sc(t){try{let e=await(0,LD.readFile)(t.path,"utf-8"),{body:s}=Ni(e);return{name:t.name,description:t.description,patterns:t.patterns,agent:t.agent,prompt:s.trim(),source:t.source,path:t.path}}catch(e){return h.error(`Failed to load rule from ${t.path}:`,e),null}}async function jD(t){return(await Promise.all(t.map(Sc))).filter(s=>s!==null)}async function Zx(t){let e=await Xt(t);return jD(e)}function qD(t,e,s){let n=new Map(s.map(r=>[r.name,r])),i=[];for(let r of t){let o=n.get(r.agent);if(!o){h.warn(`Rule references unknown agent "${r.agent}"`);continue}let a=e.filter(u=>r.patterns.some(l=>es(u.file,l))).map(u=>u.file);a.length!==0&&i.push({item:r,files:a,agent:o})}return i}function UD(t,e,s){return qD(t,e,s).map(({item:n,...i})=>({ref:n,...i}))}async function Ac(t,e,s){let n=UD(t,e,s);return(await Promise.all(n.map(async({ref:r,files:o,agent:a})=>{let u=await Sc(r);return u?{rule:u,files:o,agent:a}:null}))).filter(r=>r!==null)}function Qx(t,e,s){return qD(t,e,s).map(({item:n,...i})=>({rule:n,...i}))}function kc(t){let e=t.match(Xx);if(!e||e.index===void 0||!e[1])return[t];let s=e[1].split(",").map(o=>o.trim()),n=t.substring(0,e.index),i=t.substring(e.index+e[0].length),r=[];for(let o of s){let a=n+o+i;r.push(...kc(a))}return r}function es(t,e){return kc(e).some(n=>eS(t,n))}function eS(t,e){let s=e.replace(/\*\*/g,"\0DOUBLESTAR\0").replace(/\*/g,"\0STAR\0").replace(/\?/g,"\0QUESTION\0");s=s.replace(/[.+^${}()|[\]\\]/g,"\\$&"),s=s.replace(/\x00DOUBLESTAR\x00\//g,"(?:.*\\/)?").replace(/\x00DOUBLESTAR\x00/g,".*").replace(/\x00STAR\x00/g,"[^/]*").replace(/\x00QUESTION\x00/g,".");let n=OD.get(s);return n||(n=new RegExp(`^${s}$`),OD.set(s,n)),n.test(t)}var LD,Xx,OD,_s=q(()=>{"use strict";Bi();LD=require("node:fs/promises");H();Qe();Xx=/\{([^}]+)\}/;OD=new Map});var sg=S((d8,tg)=>{tg.exports=eg;eg.sync=oS;var QD=require("fs");function rS(t,e){var s=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!s||(s=s.split(";"),s.indexOf("")!==-1))return!0;for(var n=0;n<s.length;n++){var i=s[n].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function XD(t,e,s){return!t.isSymbolicLink()&&!t.isFile()?!1:rS(e,s)}function eg(t,e,s){QD.stat(t,function(n,i){s(n,n?!1:XD(i,t,e))})}function oS(t,e){return XD(QD.statSync(t),t,e)}});var ag=S((h8,og)=>{og.exports=ig;ig.sync=aS;var ng=require("fs");function ig(t,e,s){ng.stat(t,function(n,i){s(n,n?!1:rg(i,e))})}function aS(t,e){return rg(ng.statSync(t),e)}function rg(t,e){return t.isFile()&&uS(t,e)}function uS(t,e){var s=t.mode,n=t.uid,i=t.gid,r=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),u=parseInt("010",8),l=parseInt("001",8),c=a|u,f=s&l||s&u&&i===o||s&a&&n===r||s&c&&r===0;return f}});var lg=S((m8,ug)=>{var p8=require("fs"),Go;process.platform==="win32"||global.TESTING_WINDOWS?Go=sg():Go=ag();ug.exports=_c;_c.sync=lS;function _c(t,e,s){if(typeof e=="function"&&(s=e,e={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){_c(t,e||{},function(r,o){r?i(r):n(o)})})}Go(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),s(n,i)})}function lS(t,e){try{return Go.sync(t,e||{})}catch(s){if(e&&e.ignoreErrors||s.code==="EACCES")return!1;throw s}}});var Dg=S((D8,mg)=>{var Dn=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",cg=require("path"),cS=Dn?";":":",fg=lg(),dg=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),hg=(t,e)=>{let s=e.colon||cS,n=t.match(/\//)||Dn&&t.match(/\\/)?[""]:[...Dn?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(s)],i=Dn?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",r=Dn?i.split(s):[""];return Dn&&t.indexOf(".")!==-1&&r[0]!==""&&r.unshift(""),{pathEnv:n,pathExt:r,pathExtExe:i}},pg=(t,e,s)=>{typeof e=="function"&&(s=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:r}=hg(t,e),o=[],a=l=>new Promise((c,f)=>{if(l===n.length)return e.all&&o.length?c(o):f(dg(t));let d=n[l],p=/^".*"$/.test(d)?d.slice(1,-1):d,D=cg.join(p,t),m=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+D:D;c(u(m,l,0))}),u=(l,c,f)=>new Promise((d,p)=>{if(f===i.length)return d(a(c+1));let D=i[f];fg(l+D,{pathExt:r},(m,g)=>{if(!m&&g)if(e.all)o.push(l+D);else return d(l+D);return d(u(l,c,f+1))})});return s?a(0).then(l=>s(null,l),s):a(0)},fS=(t,e)=>{e=e||{};let{pathEnv:s,pathExt:n,pathExtExe:i}=hg(t,e),r=[];for(let o=0;o<s.length;o++){let a=s[o],u=/^".*"$/.test(a)?a.slice(1,-1):a,l=cg.join(u,t),c=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+l:l;for(let f=0;f<n.length;f++){let d=c+n[f];try{if(fg.sync(d,{pathExt:i}))if(e.all)r.push(d);else return d}catch{}}}if(e.all&&r.length)return r;if(e.nothrow)return null;throw dg(t)};mg.exports=pg;pg.sync=fS});var yg=S((g8,Bc)=>{"use strict";var gg=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Bc.exports=gg;Bc.exports.default=gg});var Eg=S((y8,Cg)=>{"use strict";var Fg=require("path"),dS=Dg(),hS=yg();function wg(t,e){let s=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,r=i&&process.chdir!==void 0&&!process.chdir.disabled;if(r)try{process.chdir(t.options.cwd)}catch{}let o;try{o=dS.sync(t.command,{path:s[hS({env:s})],pathExt:e?Fg.delimiter:void 0})}catch{}finally{r&&process.chdir(n)}return o&&(o=Fg.resolve(i?t.options.cwd:"",o)),o}function pS(t){return wg(t)||wg(t,!0)}Cg.exports=pS});var bg=S((F8,Ic)=>{"use strict";var Tc=/([()\][%!^"`<>&|;, *?])/g;function mS(t){return t=t.replace(Tc,"^$1"),t}function DS(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Tc,"^$1"),e&&(t=t.replace(Tc,"^$1")),t}Ic.exports.command=mS;Ic.exports.argument=DS});var xg=S((w8,vg)=>{"use strict";vg.exports=/^#!(.*)/});var Ag=S((C8,Sg)=>{"use strict";var gS=xg();Sg.exports=(t="")=>{let e=t.match(gS);if(!e)return null;let[s,n]=e[0].replace(/#! ?/,"").split(" "),i=s.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var $g=S((E8,kg)=>{"use strict";var Rc=require("fs"),yS=Ag();function FS(t){let s=Buffer.alloc(150),n;try{n=Rc.openSync(t,"r"),Rc.readSync(n,s,0,150,0),Rc.closeSync(n)}catch{}return yS(s.toString())}kg.exports=FS});var Ig=S((b8,Tg)=>{"use strict";var wS=require("path"),_g=Eg(),Bg=bg(),CS=$g(),ES=process.platform==="win32",bS=/\.(?:com|exe)$/i,vS=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function xS(t){t.file=_g(t);let e=t.file&&CS(t.file);return e?(t.args.unshift(t.file),t.command=e,_g(t)):t.file}function SS(t){if(!ES)return t;let e=xS(t),s=!bS.test(e);if(t.options.forceShell||s){let n=vS.test(e);t.command=wS.normalize(t.command),t.command=Bg.command(t.command),t.args=t.args.map(r=>Bg.argument(r,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function AS(t,e,s){e&&!Array.isArray(e)&&(s=e,e=null),e=e?e.slice(0):[],s=Object.assign({},s);let n={command:t,args:e,options:s,file:void 0,original:{command:t,args:e}};return s.shell?n:SS(n)}Tg.exports=AS});var Pg=S((v8,Ng)=>{"use strict";var Nc=process.platform==="win32";function Pc(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function kS(t,e){if(!Nc)return;let s=t.emit;t.emit=function(n,i){if(n==="exit"){let r=Rg(i,e);if(r)return s.call(t,"error",r)}return s.apply(t,arguments)}}function Rg(t,e){return Nc&&t===1&&!e.file?Pc(e.original,"spawn"):null}function $S(t,e){return Nc&&t===1&&!e.file?Pc(e.original,"spawnSync"):null}Ng.exports={hookChildProcess:kS,verifyENOENT:Rg,verifyENOENTSync:$S,notFoundError:Pc}});var Mc=S((x8,gn)=>{"use strict";var Og=require("child_process"),Oc=Ig(),Lc=Pg();function Lg(t,e,s){let n=Oc(t,e,s),i=Og.spawn(n.command,n.args,n.options);return Lc.hookChildProcess(i,n),i}function _S(t,e,s){let n=Oc(t,e,s),i=Og.spawnSync(n.command,n.args,n.options);return i.error=i.error||Lc.verifyENOENTSync(i.status,n),i}gn.exports=Lg;gn.exports.spawn=Lg;gn.exports.sync=_S;gn.exports._parse=Oc;gn.exports._enoent=Lc});var le={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},fa={silent:{level:-1},fatal:{level:le.fatal},error:{level:le.error},warn:{level:le.warn},log:{level:le.log},info:{level:le.info},success:{level:le.success},fail:{level:le.fail},ready:{level:le.info},start:{level:le.info},box:{level:le.info},debug:{level:le.debug},trace:{level:le.trace},verbose:{level:le.verbose}};function ua(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function da(t,e,s=".",n){if(!ua(e))return da(t,{},s,n);let i=Object.assign({},e);for(let r in t){if(r==="__proto__"||r==="constructor")continue;let o=t[r];o!=null&&(n&&n(i,r,o,s)||(Array.isArray(o)&&Array.isArray(i[r])?i[r]=[...o,...i[r]]:ua(o)&&ua(i[r])?i[r]=da(o,i[r],(s?`${s}.`:"")+r.toString(),n):i[r]=o))}return i}function hy(t){return(...e)=>e.reduce((s,n)=>da(s,n,"",t),{})}var py=hy();function my(t){return Object.prototype.toString.call(t)==="[object Object]"}function Dy(t){return!(!my(t)||!t.message&&!t.args||t.stack)}var la=!1,Hc=[],ie=class t{options;_lastLog;_mockFn;constructor(e={}){let s=e.types||fa;this.options=py({...e,defaults:{...e.defaults},level:ca(e.level,s),reporters:[...e.reporters||[]]},{types:fa,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let n in s){let i={type:n,...this.options.defaults,...s[n]};this[n]=this._wrapLogFn(i),this[n].raw=this._wrapLogFn(i,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=ca(e,this.options.types,this.options.level)}prompt(e,s){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,s)}create(e){let s=new t({...this.options,...e});return this._mockFn&&s.mockTypes(this._mockFn),s}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){let s=this.options.reporters.indexOf(e);if(s!==-1)return this.options.reporters.splice(s,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(let e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,s){e&&(e.__write||(e.__write=e.write),e.write=n=>{this[s].raw(String(n).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){la=!0}resumeLogs(){la=!1;let e=Hc.splice(0);for(let s of e)s[0]._logFn(s[1],s[2])}mockTypes(e){let s=e||this.options.mockFn;if(this._mockFn=s,typeof s=="function")for(let n in this.options.types)this[n]=s(n,this.options.types[n])||this[n],this[n].raw=this[n]}_wrapLogFn(e,s){return(...n)=>{if(la){Hc.push([this,e,n,s]);return}return this._logFn(e,n,s)}}_logFn(e,s,n){if((e.level||0)>this.level)return!1;let i={date:new Date,args:[],...e,level:ca(e.level,this.options.types)};!n&&s.length===1&&Dy(s[0])?Object.assign(i,s[0]):i.args=[...s],i.message&&(i.args.unshift(i.message),delete i.message),i.additional&&(Array.isArray(i.additional)||(i.additional=i.additional.split(`
|
|
197
197
|
`)),i.args.push(`
|
|
198
198
|
`+i.additional.join(`
|
|
199
|
-
`)),delete i.additional),i.type=typeof i.type=="string"?i.type.toLowerCase():"log",i.tag=typeof i.tag=="string"?i.tag:"";let r=(a=!1)=>{let u=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&u>0){let l=[...this._lastLog.object.args];u>1&&l.push(`(repeated ${u} times)`),this._log({...this._lastLog.object,args:l}),this._lastLog.count=1}a&&(this._lastLog.object=i,this._log(i))};clearTimeout(this._lastLog.timeout);let o=this._lastLog.time&&i.date?i.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=i.date,o<this.options.throttle)try{let a=JSON.stringify([i.type,i.tag,i.args]),u=this._lastLog.serialized===a;if(this._lastLog.serialized=a,u&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(r,this.options.throttle);return}}catch{}r(!0)}_log(e){for(let s of this.options.reporters)s.log(e,{options:this.options})}};function
|
|
199
|
+
`)),delete i.additional),i.type=typeof i.type=="string"?i.type.toLowerCase():"log",i.tag=typeof i.tag=="string"?i.tag:"";let r=(a=!1)=>{let u=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&u>0){let l=[...this._lastLog.object.args];u>1&&l.push(`(repeated ${u} times)`),this._log({...this._lastLog.object,args:l}),this._lastLog.count=1}a&&(this._lastLog.object=i,this._log(i))};clearTimeout(this._lastLog.timeout);let o=this._lastLog.time&&i.date?i.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=i.date,o<this.options.throttle)try{let a=JSON.stringify([i.type,i.tag,i.args]),u=this._lastLog.serialized===a;if(this._lastLog.serialized=a,u&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(r,this.options.throttle);return}}catch{}r(!0)}_log(e){for(let s of this.options.reporters)s.log(e,{options:this.options})}};function ca(t,e={},s=3){return t===void 0?s:typeof t=="number"?t:e[t]&&e[t].level!==void 0?e[t].level:s}ie.prototype.add=ie.prototype.addReporter;ie.prototype.remove=ie.prototype.removeReporter;ie.prototype.clear=ie.prototype.removeReporter;ie.prototype.withScope=ie.prototype.withTag;ie.prototype.mock=ie.prototype.mockTypes;ie.prototype.pause=ie.prototype.pauseLogs;ie.prototype.resume=ie.prototype.resumeLogs;function Jc(t={}){return new ie(t)}var pa=require("node:util"),Zc=require("node:path");function ma(t,e){let s=process.cwd()+Zc.sep;return t.split(`
|
|
200
200
|
`).splice(e.split(`
|
|
201
|
-
`).length).map(i=>i.trim().replace("file://","").replace(s,""))}function
|
|
202
|
-
${i}`)}formatError(e,s){let n=e.message??(0,
|
|
201
|
+
`).length).map(i=>i.trim().replace("file://","").replace(s,""))}function gy(t,e){return(e.__write||e.write).call(e,t)}var ha=t=>t?`[${t}]`:"",Cn=class{formatStack(e,s,n){let i=" ".repeat((n?.errorLevel||0)+1);return i+ma(e,s).join(`
|
|
202
|
+
${i}`)}formatError(e,s){let n=e.message??(0,pa.formatWithOptions)(s,e),i=e.stack?this.formatStack(e.stack,n,s):"",r=s?.errorLevel||0,o=r>0?`${" ".repeat(r)}[cause]: `:"",a=e.cause?`
|
|
203
203
|
|
|
204
204
|
`+this.formatError(e.cause,{...s,errorLevel:r+1}):"";return o+n+`
|
|
205
|
-
`+i+a}formatArgs(e,s){let n=e.map(i=>i&&typeof i.stack=="string"?this.formatError(i,s):i);return(0,
|
|
206
|
-
`+[
|
|
205
|
+
`+i+a}formatArgs(e,s){let n=e.map(i=>i&&typeof i.stack=="string"?this.formatError(i,s):i);return(0,pa.formatWithOptions)(s,...n)}formatDate(e,s){return s.date?e.toLocaleTimeString():""}filterAndJoin(e){return e.filter(Boolean).join(" ")}formatLogObj(e,s){let n=this.formatArgs(e.args,s);return e.type==="box"?`
|
|
206
|
+
`+[ha(e.tag),e.title&&e.title,...n.split(`
|
|
207
207
|
`)].filter(Boolean).map(i=>" > "+i).join(`
|
|
208
208
|
`)+`
|
|
209
|
-
`:this.filterAndJoin([
|
|
210
|
-
`,e.level<2?s.options.stderr||process.stderr:s.options.stdout||process.stdout)}};var
|
|
211
|
-
`),i=[],r=
|
|
212
|
-
`)}var SS=require("node:util"),AS=require("node:path"),kS=require("node:tty"),Zy={},Zi=Object.create(null),wn=t=>globalThis.process?.env||Zy.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?Zi:globalThis),xt=new Proxy(Zi,{get(t,e){return wn()[e]??Zi[e]},has(t,e){let s=wn();return e in s||e in Zi},set(t,e,s){let n=wn(!0);return n[e]=s,!0},deleteProperty(t,e){if(!e)return!1;let s=wn(!0);return delete s[e],!0},ownKeys(){let t=wn(!0);return Object.keys(t)}}),hy=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",py=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function my(){if(globalThis.process?.env)for(let t of py){let e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}var df=my();df.name;function es(t){return t?t!=="false":!1}var Dy=globalThis.process?.platform||"",Sa=es(xt.CI)||df.ci!==!1,hf=es(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),gy=es(xt.DEBUG),Aa=hy==="test"||es(xt.TEST);es(xt.MINIMAL);var yy=/^win/i.test(Dy);!es(xt.NO_COLOR)&&(es(xt.FORCE_COLOR)||(hf||yy)&&xt.TERM);var Fy=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(Fy?.split(".")[0]);var Cy=globalThis.process||Object.create(null),lf={versions:{}};new Proxy(Cy,{get(t,e){if(e==="env")return xt;if(e in t)return t[e];if(e in lf)return lf[e]}});var wy=globalThis.process?.release?.name==="node",Ey=!!globalThis.Bun||!!globalThis.process?.versions?.bun,by=!!globalThis.Deno,vy=!!globalThis.fastly,xy=!!globalThis.Netlify,Sy=!!globalThis.EdgeRuntime,Ay=globalThis.navigator?.userAgent==="Cloudflare-Workers",ky=[[xy,"netlify"],[Sy,"edge-light"],[Ay,"workerd"],[vy,"fastly"],[by,"deno"],[Ey,"bun"],[wy,"node"]];function _y(){let t=ky.find(e=>e[0]);if(t)return{name:t[1]}}var $y=_y();$y?.name;function By({onlyFirst:t=!1}={}){let s=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(s,t?void 0:"g")}var Ty=By();function Iy(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Ty,"")}function Ry(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function Ny(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function Oy(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function Py(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function Ly(t,{ambiguousAsWide:e=!1}={}){return Py(t),Ny(t)||Oy(t)||e&&Ry(t)?2:1}var My=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,jy=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:t=>t.split("")},qy=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function Uy(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:s=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=Iy(t)),t.length===0)return 0;let i=0,r={ambiguousAsWide:!s};for(let{segment:o}of jy.segment(t)){let a=o.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!qy.test(o)){if(My().test(o)){i+=2;continue}i+=Ly(a,r)}}return i}function Wy(){let{env:t}=va.default,{TERM:e,TERM_PROGRAM:s}=t;return va.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||s==="Terminus-Sublime"||s==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Vy={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},Gy={0:"red",1:"yellow"},zy=Wy(),Xe=(t,e)=>zy?t:e,cf={error:Xe("\u2716","\xD7"),fatal:Xe("\u2716","\xD7"),ready:Xe("\u2714","\u221A"),warn:Xe("\u26A0","\u203C"),info:Xe("\u2139","i"),success:Xe("\u2714","\u221A"),debug:Xe("\u2699","D"),trace:Xe("\u2192","\u2192"),fail:Xe("\u2716","\xD7"),start:Xe("\u25D0","o"),log:""};function ff(t){return!(typeof Intl=="object")||!Intl.Segmenter?ct(t).length:Uy(t)}var xa=class extends Fn{formatStack(e,s,n){let i=" ".repeat((n?.errorLevel||0)+1);return`
|
|
213
|
-
${i}`+
|
|
214
|
-
${i}`)}formatType(e,s,n){let i=
|
|
215
|
-
`);if(e.type==="box")return
|
|
209
|
+
`:this.filterAndJoin([ha(e.type),ha(e.tag),n])}log(e,s){let n=this.formatLogObj(e,{columns:s.options.stdout.columns||0,...s.options.formatOptions});return gy(n+`
|
|
210
|
+
`,e.level<2?s.options.stderr||process.stderr:s.options.stdout||process.stdout)}};var $a=nt(require("node:process"),1);var Wi=nt(require("node:tty"),1),{env:kt={},argv:ef=[],platform:yy=""}=typeof process>"u"?{}:process,Fy="NO_COLOR"in kt||ef.includes("--no-color"),wy="FORCE_COLOR"in kt||ef.includes("--color"),Cy=yy==="win32",tf=kt.TERM==="dumb",Ey=Wi&&Wi.isatty&&Wi.isatty(1)&&kt.TERM&&!tf,by="CI"in kt&&("GITHUB_ACTIONS"in kt||"GITLAB_CI"in kt||"CIRCLECI"in kt),vy=!Fy&&(wy||Cy&&!tf||Ey||by);function sf(t,e,s,n,i=e.slice(0,Math.max(0,t))+n,r=e.slice(Math.max(0,t+s.length)),o=r.indexOf(s)){return i+(o<0?r:sf(o,r,s,n))}function xy(t,e,s,n,i){return t<0?s+e+n:s+sf(t,e,n,i)+n}function Sy(t,e,s=t,n=t.length+1){return i=>i||!(i===""||i===void 0)?xy((""+i).indexOf(e,n),i,t,e,s):""}function U(t,e,s){return Sy(`\x1B[${t}m`,`\x1B[${e}m`,s)}var Qc={reset:U(0,0),bold:U(1,22,"\x1B[22m\x1B[1m"),dim:U(2,22,"\x1B[22m\x1B[2m"),italic:U(3,23),underline:U(4,24),inverse:U(7,27),hidden:U(8,28),strikethrough:U(9,29),black:U(30,39),red:U(31,39),green:U(32,39),yellow:U(33,39),blue:U(34,39),magenta:U(35,39),cyan:U(36,39),white:U(37,39),gray:U(90,39),bgBlack:U(40,49),bgRed:U(41,49),bgGreen:U(42,49),bgYellow:U(43,49),bgBlue:U(44,49),bgMagenta:U(45,49),bgCyan:U(46,49),bgWhite:U(47,49),blackBright:U(90,39),redBright:U(91,39),greenBright:U(92,39),yellowBright:U(93,39),blueBright:U(94,39),magentaBright:U(95,39),cyanBright:U(96,39),whiteBright:U(97,39),bgBlackBright:U(100,49),bgRedBright:U(101,49),bgGreenBright:U(102,49),bgYellowBright:U(103,49),bgBlueBright:U(104,49),bgMagentaBright:U(105,49),bgCyanBright:U(106,49),bgWhiteBright:U(107,49)};function Ay(t=vy){return t?Qc:Object.fromEntries(Object.keys(Qc).map(e=>[e,String]))}var J=Ay();function nf(t,e="reset"){return J[t]||J[e]}var ky=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function mt(t){return t.replace(new RegExp(ky,"g"),"")}var Xc={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},$y={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function Da(t,e={}){let s={...e,style:{...$y,...e.style}},n=t.split(`
|
|
211
|
+
`),i=[],r=nf(s.style.borderColor),o={...typeof s.style.borderStyle=="string"?Xc[s.style.borderStyle]||Xc.solid:s.style.borderStyle};if(r)for(let p in o)o[p]=r(o[p]);let a=s.style.padding%2===0?s.style.padding:s.style.padding+1,u=n.length+a,l=Math.max(...n.map(p=>mt(p).length),s.title?mt(s.title).length:0)+a,c=l+a,f=s.style.marginLeft>0?" ".repeat(s.style.marginLeft):"";if(s.style.marginTop>0&&i.push("".repeat(s.style.marginTop)),s.title){let p=r?r(s.title):s.title,D=o.h.repeat(Math.floor((l-mt(s.title).length)/2)),m=o.h.repeat(l-mt(s.title).length-mt(D).length+a);i.push(`${f}${o.tl}${D}${p}${m}${o.tr}`)}else i.push(`${f}${o.tl}${o.h.repeat(c)}${o.tr}`);let d=s.style.valign==="center"?Math.floor((u-n.length)/2):s.style.valign==="top"?u-n.length-a:u-n.length;for(let p=0;p<u;p++)if(p<d||p>=d+n.length)i.push(`${f}${o.v}${" ".repeat(c)}${o.v}`);else{let D=n[p-d],m=" ".repeat(a),g=" ".repeat(l-mt(D).length);i.push(`${f}${o.v}${m}${D}${g}${o.v}`)}return i.push(`${f}${o.bl}${o.h.repeat(c)}${o.br}`),s.style.marginBottom>0&&i.push("".repeat(s.style.marginBottom)),i.join(`
|
|
212
|
+
`)}var ZA=require("node:util"),QA=require("node:path"),XA=require("node:tty"),ew={},Ji=Object.create(null),bn=t=>globalThis.process?.env||ew.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?Ji:globalThis),$t=new Proxy(Ji,{get(t,e){return bn()[e]??Ji[e]},has(t,e){let s=bn();return e in s||e in Ji},set(t,e,s){let n=bn(!0);return n[e]=s,!0},deleteProperty(t,e){if(!e)return!1;let s=bn(!0);return delete s[e],!0},ownKeys(){let t=bn(!0);return Object.keys(t)}}),DF=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",gF=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function yF(){if(globalThis.process?.env)for(let t of gF){let e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}var Bf=yF();Bf.name;function ts(t){return t?t!=="false":!1}var FF=globalThis.process?.platform||"",Ba=ts($t.CI)||Bf.ci!==!1,Tf=ts(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),wF=ts($t.DEBUG),Ta=DF==="test"||ts($t.TEST);ts($t.MINIMAL);var CF=/^win/i.test(FF);!ts($t.NO_COLOR)&&(ts($t.FORCE_COLOR)||(Tf||CF)&&$t.TERM);var EF=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(EF?.split(".")[0]);var bF=globalThis.process||Object.create(null),kf={versions:{}};new Proxy(bF,{get(t,e){if(e==="env")return $t;if(e in t)return t[e];if(e in kf)return kf[e]}});var vF=globalThis.process?.release?.name==="node",xF=!!globalThis.Bun||!!globalThis.process?.versions?.bun,SF=!!globalThis.Deno,AF=!!globalThis.fastly,kF=!!globalThis.Netlify,$F=!!globalThis.EdgeRuntime,_F=globalThis.navigator?.userAgent==="Cloudflare-Workers",BF=[[kF,"netlify"],[$F,"edge-light"],[_F,"workerd"],[AF,"fastly"],[SF,"deno"],[xF,"bun"],[vF,"node"]];function TF(){let t=BF.find(e=>e[0]);if(t)return{name:t[1]}}var IF=TF();IF?.name;function RF({onlyFirst:t=!1}={}){let s=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(s,t?void 0:"g")}var NF=RF();function PF(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(NF,"")}function OF(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function LF(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function MF(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function jF(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function qF(t,{ambiguousAsWide:e=!1}={}){return jF(t),LF(t)||MF(t)||e&&OF(t)?2:1}var UF=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,WF=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:t=>t.split("")},VF=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function zF(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:s=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=PF(t)),t.length===0)return 0;let i=0,r={ambiguousAsWide:!s};for(let{segment:o}of WF.segment(t)){let a=o.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!VF.test(o)){if(UF().test(o)){i+=2;continue}i+=qF(a,r)}}return i}function GF(){let{env:t}=$a.default,{TERM:e,TERM_PROGRAM:s}=t;return $a.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||s==="Terminus-Sublime"||s==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var KF={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},YF={0:"red",1:"yellow"},HF=GF(),it=(t,e)=>HF?t:e,$f={error:it("\u2716","\xD7"),fatal:it("\u2716","\xD7"),ready:it("\u2714","\u221A"),warn:it("\u26A0","\u203C"),info:it("\u2139","i"),success:it("\u2714","\u221A"),debug:it("\u2699","D"),trace:it("\u2192","\u2192"),fail:it("\u2716","\xD7"),start:it("\u25D0","o"),log:""};function _f(t){return!(typeof Intl=="object")||!Intl.Segmenter?mt(t).length:zF(t)}var _a=class extends Cn{formatStack(e,s,n){let i=" ".repeat((n?.errorLevel||0)+1);return`
|
|
213
|
+
${i}`+ma(e,s).map(r=>" "+r.replace(/^at +/,o=>J.gray(o)).replace(/\((.+)\)/,(o,a)=>`(${J.cyan(a)})`)).join(`
|
|
214
|
+
${i}`)}formatType(e,s,n){let i=KF[e.type]||YF[e.level]||"gray";if(s)return ZF(i)(J.black(` ${e.type.toUpperCase()} `));let r=typeof $f[e.type]=="string"?$f[e.type]:e.icon||e.type;return r?JF(i)(r):""}formatLogObj(e,s){let[n,...i]=this.formatArgs(e.args,s).split(`
|
|
215
|
+
`);if(e.type==="box")return Da(Hi(n+(i.length>0?`
|
|
216
216
|
`+i.join(`
|
|
217
|
-
`):"")),{title:e.title?Hi(e.title):void 0,style:e.style});let r=this.formatDate(e.date,s),o=r&&
|
|
217
|
+
`):"")),{title:e.title?Hi(e.title):void 0,style:e.style});let r=this.formatDate(e.date,s),o=r&&J.gray(r),a=e.badge??e.level<2,u=this.formatType(e,a,s),l=e.tag?J.gray(e.tag):"",c,f=this.filterAndJoin([u,Hi(n)]),d=this.filterAndJoin(s.columns?[l,o]:[l]),p=(s.columns||0)-_f(f)-_f(d)-2;if(c=p>0&&(s.columns||0)>=80?f+" ".repeat(p)+d:(d?`${J.gray(`[${d}]`)} `:"")+f,c+=Hi(i.length>0?`
|
|
218
218
|
`+i.join(`
|
|
219
219
|
`):""),e.type==="trace"){let D=new Error("Trace: "+e.message);c+=this.formatStack(D.stack||"",D.message)}return a?`
|
|
220
220
|
`+c+`
|
|
221
|
-
`:c}};function Hi(t){return t.replace(/`([^`]+)`/gm,(e,s)=>
|
|
222
|
-
`)}function
|
|
223
|
-
`)}catch(s){Ns.error(s)}}async function
|
|
224
|
-
`)}async function
|
|
225
|
-
`),r&&await n(...await
|
|
221
|
+
`:c}};function Hi(t){return t.replace(/`([^`]+)`/gm,(e,s)=>J.cyan(s)).replace(/\s+_([^_]+)_\s+/gm,(e,s)=>` ${J.underline(s)} `)}function JF(t="white"){return J[t]||J.white}function ZF(t="bgWhite"){return J[`bg${t[0].toUpperCase()}${t.slice(1)}`]||J.bgWhite}function QF(t={}){let e=XF();return process.env.CONSOLA_LEVEL&&(e=Number.parseInt(process.env.CONSOLA_LEVEL)??e),Jc({level:e,defaults:{level:e},stdout:process.stdout,stderr:process.stderr,prompt:(...n)=>Promise.resolve().then(()=>(Af(),Sf)).then(i=>i.prompt(...n)),reporters:t.reporters||[t.fancy??!(Ba||Ta)?new _a:new Cn],...t})}function XF(){return wF?le.debug:Ta?le.warn:le.info}var Ns=QF();var u3=require("node:tty");function tw(t){return Array.isArray(t)?t:t===void 0?[]:[t]}function Ia(t,e=""){let s=[];for(let n of t)for(let[i,r]of n.entries())s[i]=Math.max(s[i]||0,r.length);return t.map(n=>n.map((i,r)=>e+i[r===0?"padStart":"padEnd"](s[r])).join(" ")).join(`
|
|
222
|
+
`)}function Je(t){return typeof t=="function"?t():t}var _t=class extends Error{constructor(e,s){super(e),this.code=s,this.name="CLIError"}},sw=/\d/,nw=["-","_","/","."];function iw(t=""){if(!sw.test(t))return t!==t.toLowerCase()}function If(t,e){let s=e??nw,n=[];if(!t||typeof t!="string")return n;let i="",r,o;for(let a of t){let u=s.includes(a);if(u===!0){n.push(i),i="",r=void 0;continue}let l=iw(a);if(o===!1){if(r===!1&&l===!0){n.push(i),i=a,r=l;continue}if(r===!0&&l===!1&&i.length>1){let c=i.at(-1);n.push(i.slice(0,Math.max(0,i.length-1))),i=c+a,r=l;continue}}i+=a,r=l,o=u}return n.push(i),n}function rw(t){return t?t[0].toUpperCase()+t.slice(1):""}function ow(t){return t?t[0].toLowerCase()+t.slice(1):""}function aw(t,e){return t?(Array.isArray(t)?t:If(t)).map(s=>rw(e?.normalize?s.toLowerCase():s)).join(""):""}function uw(t,e){return ow(aw(t||"",e))}function lw(t,e){return t?(Array.isArray(t)?t:If(t)).map(s=>s.toLowerCase()).join(e??"-"):""}function Ra(t){return t==null?[]:Array.isArray(t)?t:[t]}function cw(t,e,s,n){let i,r=t[e],o=~n.string.indexOf(e)?s==null||s===!0?"":String(s):typeof s=="boolean"?s:~n.boolean.indexOf(e)?s==="false"?!1:s==="true"||(t._.push((i=+s,i*0===0?i:s)),!!s):(i=+s,i*0===0?i:s);t[e]=r==null?o:Array.isArray(r)?r.concat(o):[r,o]}function fw(t=[],e={}){let s,n,i,r,o,a={_:[]},u=0,l=0,c=0,f=t.length,d=e.alias!==void 0,p=e.unknown!==void 0,D=e.default!==void 0;if(e.alias=e.alias||{},e.string=Ra(e.string),e.boolean=Ra(e.boolean),d)for(s in e.alias)for(n=e.alias[s]=Ra(e.alias[s]),u=0;u<n.length;u++)(e.alias[n[u]]=n.concat(s)).splice(u,1);for(u=e.boolean.length;u-- >0;)for(n=e.alias[e.boolean[u]]||[],l=n.length;l-- >0;)e.boolean.push(n[l]);for(u=e.string.length;u-- >0;)for(n=e.alias[e.string[u]]||[],l=n.length;l-- >0;)e.string.push(n[l]);if(D){for(s in e.default)if(r=typeof e.default[s],n=e.alias[s]=e.alias[s]||[],e[r]!==void 0)for(e[r].push(s),u=0;u<n.length;u++)e[r].push(n[u])}let m=p?Object.keys(e.alias):[];for(u=0;u<f;u++){if(i=t[u],i==="--"){a._=a._.concat(t.slice(++u));break}for(l=0;l<i.length&&i.charCodeAt(l)===45;l++);if(l===0)a._.push(i);else if(i.substring(l,l+3)==="no-"){if(r=i.slice(Math.max(0,l+3)),p&&!~m.indexOf(r))return e.unknown(i);a[r]=!1}else{for(c=l+1;c<i.length&&i.charCodeAt(c)!==61;c++);for(r=i.substring(l,c),o=i.slice(Math.max(0,++c))||u+1===f||(""+t[u+1]).charCodeAt(0)===45||t[++u],n=l===2?[r]:r,c=0;c<n.length;c++){if(r=n[c],p&&!~m.indexOf(r))return e.unknown("-".repeat(l)+r);cw(a,r,c+1<n.length||o,e)}}}if(D)for(s in e.default)a[s]===void 0&&(a[s]=e.default[s]);if(d)for(s in a)for(n=e.alias[s]||[];n.length>0;)a[n.shift()]=a[s];return a}function dw(t,e){let s={boolean:[],string:[],mixed:[],alias:{},default:{}},n=Rf(e);for(let a of n)a.type!=="positional"&&(a.type==="string"?s.string.push(a.name):a.type==="boolean"&&s.boolean.push(a.name),a.default!==void 0&&(s.default[a.name]=a.default),a.alias&&(s.alias[a.name]=a.alias));let i=fw(t,s),[...r]=i._,o=new Proxy(i,{get(a,u){return a[u]??a[uw(u)]??a[lw(u)]}});for(let[,a]of n.entries())if(a.type==="positional"){let u=r.shift();if(u!==void 0)o[a.name]=u;else{if(a.default===void 0&&a.required!==!1)throw new _t(`Missing required positional argument: ${a.name.toUpperCase()}`,"EARG");o[a.name]=a.default}}else if(a.required&&o[a.name]===void 0)throw new _t(`Missing required argument: --${a.name}`,"EARG");return o}function Rf(t){let e=[];for(let[s,n]of Object.entries(t||{}))e.push({...n,name:s,alias:tw(n.alias)});return e}async function Nf(t,e){let s=await Je(t.args||{}),n=dw(e.rawArgs,s),i={rawArgs:e.rawArgs,args:n,data:e.data,cmd:t};typeof t.setup=="function"&&await t.setup(i);let r;try{let o=await Je(t.subCommands);if(o&&Object.keys(o).length>0){let a=e.rawArgs.findIndex(l=>!l.startsWith("-")),u=e.rawArgs[a];if(u){if(!o[u])throw new _t(`Unknown command \`${u}\``,"E_UNKNOWN_COMMAND");let l=await Je(o[u]);l&&await Nf(l,{rawArgs:e.rawArgs.slice(a+1)})}else if(!t.run)throw new _t("No command specified.","E_NO_COMMAND")}typeof t.run=="function"&&(r=await t.run(i))}finally{typeof t.cleanup=="function"&&await t.cleanup(i)}return{result:r}}async function Na(t,e,s){let n=await Je(t.subCommands);if(n&&Object.keys(n).length>0){let i=e.findIndex(a=>!a.startsWith("-")),r=e[i],o=await Je(n[r]);if(o)return Na(o,e.slice(i+1),t)}return[t,s]}async function hw(t,e){try{Ns.log(await pw(t,e)+`
|
|
223
|
+
`)}catch(s){Ns.error(s)}}async function pw(t,e){let s=await Je(t.meta||{}),n=Rf(await Je(t.args||{})),i=await Je(e?.meta||{}),r=`${i.name?`${i.name} `:""}`+(s.name||process.argv[1]),o=[],a=[],u=[],l=[];for(let p of n)if(p.type==="positional"){let D=p.name.toUpperCase(),m=p.required!==!1&&p.default===void 0,g=p.default?`="${p.default}"`:"";a.push(["`"+D+g+"`",p.description||"",p.valueHint?`<${p.valueHint}>`:""]),l.push(m?`<${D}>`:`[${D}]`)}else{let D=p.required===!0&&p.default===void 0,m=(p.type==="boolean"&&p.default===!0?[...(p.alias||[]).map(g=>`--no-${g}`),`--no-${p.name}`].join(", "):[...(p.alias||[]).map(g=>`-${g}`),`--${p.name}`].join(", "))+(p.type==="string"&&(p.valueHint||p.default)?`=${p.valueHint?`<${p.valueHint}>`:`"${p.default||""}"`}`:"");o.push(["`"+m+(D?" (required)":"")+"`",p.description||""]),D&&l.push(m)}if(t.subCommands){let p=[],D=await Je(t.subCommands);for(let[m,g]of Object.entries(D)){let F=await Je(g),y=await Je(F?.meta);u.push([`\`${m}\``,y?.description||""]),p.push(m)}l.push(p.join("|"))}let c=[],f=s.version||i.version;c.push(J.gray(`${s.description} (${r+(f?` v${f}`:"")})`),"");let d=o.length>0||a.length>0;return c.push(`${J.underline(J.bold("USAGE"))} \`${r}${d?" [OPTIONS]":""} ${l.join(" ")}\``,""),a.length>0&&(c.push(J.underline(J.bold("ARGUMENTS")),""),c.push(Ia(a," ")),c.push("")),o.length>0&&(c.push(J.underline(J.bold("OPTIONS")),""),c.push(Ia(o," ")),c.push("")),u.length>0&&(c.push(J.underline(J.bold("COMMANDS")),""),c.push(Ia(u," ")),c.push("",`Use \`${r} <command> --help\` for more information about a command.`)),c.filter(p=>typeof p=="string").join(`
|
|
224
|
+
`)}async function Pf(t,e={}){let s=e.rawArgs||process.argv.slice(2),n=e.showUsage||hw;try{if(s.includes("--help")||s.includes("-h"))await n(...await Na(t,s)),process.exit(0);else if(s.length===1&&s[0]==="--version"){let i=typeof t.meta=="function"?await t.meta():await t.meta;if(!i?.version)throw new _t("No version specified","E_NO_VERSION");Ns.log(i.version)}else await Nf(t,{rawArgs:s})}catch(i){let r=i instanceof _t;r||Ns.error(i,`
|
|
225
|
+
`),r&&await n(...await Na(t,s)),Ns.error(i.message),process.exit(1)}}var Zi={name:"diffray",version:"0.5.4",description:"AI-powered code review CLI for git changes",author:"Ilya Strelov <strelov1@gmail.com>",license:"MIT",type:"module",bin:{diffray:"./dist/diffray.cjs"},files:["dist/diffray.cjs","dist/defaults","src/defaults"],scripts:{dev:"npx tsx ./bin/diffray.ts",build:"node build.mjs","link:local":`node -e "const p=require('./package.json');p.bin.diffray='./bin/diffray.ts';require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')" && npm link`,"link:publish":`node -e "const p=require('./package.json');p.bin.diffray='./dist/diffray.cjs';require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')"`,link:"npm link",unlink:"npm unlink",test:"vitest run","test:watch":"vitest","ts-check":"tsc --noEmit",lint:"eslint .","lint:fix":"eslint . --fix",format:"prettier --write .","format:check":"prettier --check .",prepublishOnly:"npm run build && npm run link:publish",prepare:"husky"},repository:{type:"git",url:"git+https://github.com/diffray/diffray.git"},homepage:"https://github.com/diffray/diffray#readme",bugs:{url:"https://github.com/diffray/diffray/issues"},keywords:["code-review","ai","cli","git","diff","llm","claude","cerebras","pull-request"],engines:{node:">=18.0.0"},os:["darwin","linux","win32"],cpu:["x64","arm64"],devDependencies:{"@eslint/js":"^9.39.2","@types/cross-spawn":"^6.0.6","@types/node":"^22.15.21","@typescript-eslint/eslint-plugin":"^8.52.0","@typescript-eslint/parser":"^8.52.0",esbuild:"^0.25.0",eslint:"^9.39.2","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4",husky:"^9.1.0","lint-staged":"^15.5.0",prettier:"^3.7.4",tsx:"^4.19.0",vitest:"^3.1.0"},"lint-staged":{"*.{ts,tsx,js,jsx}":["eslint --fix","prettier --write"],"*.{json,md,yml,yaml}":["prettier --write"]},peerDependencies:{typescript:"^5"},dependencies:{citty:"^0.1.6","cross-spawn":"^7.0.6",diff:"^8.0.2",glob:"^13.0.0",yaml:"^2.8.2",zod:"^3.22.4"}};var vn=class{diff(e,s,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);let r=this.castInput(e,n),o=this.castInput(s,n),a=this.removeEmpty(this.tokenize(r,n)),u=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,u,n,i)}diffWithOptionsObj(e,s,n,i){var r;let o=y=>{if(y=this.postProcess(y,n),i){setTimeout(function(){i(y)},0);return}else return y},a=s.length,u=e.length,l=1,c=a+u;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let f=(r=n.timeout)!==null&&r!==void 0?r:1/0,d=Date.now()+f,p=[{oldPos:-1,lastComponent:void 0}],D=this.extractCommon(p[0],s,e,0,n);if(p[0].oldPos+1>=u&&D+1>=a)return o(this.buildValues(p[0].lastComponent,s,e));let m=-1/0,g=1/0,F=()=>{for(let y=Math.max(m,-l);y<=Math.min(g,l);y+=2){let C,w=p[y-1],E=p[y+1];w&&(p[y-1]=void 0);let v=!1;if(E){let A=E.oldPos-y;v=E&&0<=A&&A<a}let B=w&&w.oldPos+1<u;if(!v&&!B){p[y]=void 0;continue}if(!B||v&&w.oldPos<E.oldPos?C=this.addToPath(E,!0,!1,0,n):C=this.addToPath(w,!1,!0,1,n),D=this.extractCommon(C,s,e,y,n),C.oldPos+1>=u&&D+1>=a)return o(this.buildValues(C.lastComponent,s,e))||!0;p[y]=C,C.oldPos+1>=u&&(g=Math.min(g,y-1)),D+1>=a&&(m=Math.max(m,y+1))}l++};if(i)(function y(){setTimeout(function(){if(l>c||Date.now()>d)return i(void 0);F()||y()},0)})();else for(;l<=c&&Date.now()<=d;){let y=F();if(y)return y}}addToPath(e,s,n,i,r){let o=e.lastComponent;return o&&!r.oneChangePerToken&&o.added===s&&o.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:s,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:s,removed:n,previousComponent:o}}}extractCommon(e,s,n,i,r){let o=s.length,a=n.length,u=e.oldPos,l=u-i,c=0;for(;l+1<o&&u+1<a&&this.equals(n[u+1],s[l+1],r);)l++,u++,c++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!r.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=u,l}equals(e,s,n){return n.comparator?n.comparator(e,s):e===s||!!n.ignoreCase&&e.toLowerCase()===s.toLowerCase()}removeEmpty(e){let s=[];for(let n=0;n<e.length;n++)e[n]&&s.push(e[n]);return s}castInput(e,s){return e}tokenize(e,s){return Array.from(e)}join(e){return e.join("")}postProcess(e,s){return e}get useLongestToken(){return!1}buildValues(e,s,n){let i=[],r;for(;e;)i.push(e),r=e.previousComponent,delete e.previousComponent,e=r;i.reverse();let o=i.length,a=0,u=0,l=0;for(;a<o;a++){let c=i[a];if(c.removed)c.value=this.join(n.slice(l,l+c.count)),l+=c.count;else{if(!c.added&&this.useLongestToken){let f=s.slice(u,u+c.count);f=f.map(function(d,p){let D=n[l+p];return D.length>d.length?D:d}),c.value=this.join(f)}else c.value=this.join(s.slice(u,u+c.count));u+=c.count,c.added||(l+=c.count)}}return i}};var Pa=class extends vn{constructor(){super(...arguments),this.tokenize=gw}equals(e,s,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
226
226
|
`))&&(e=e.trim()),(!n.newlineIsToken||!s.includes(`
|
|
227
227
|
`))&&(s=s.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
228
228
|
`)&&(e=e.slice(0,-1)),s.endsWith(`
|
|
229
|
-
`)&&(s=s.slice(0,-1))),super.equals(e,s,n)}},
|
|
230
|
-
`));let s=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let i=0;i<n.length;i++){let r=n[i];i%2&&!e.newlineIsToken?s[s.length-1]+=r:s.push(r)}return s}function
|
|
231
|
-
`)?y.lines[C]=y.lines[C].slice(0,-1):(y.lines.splice(C+1,0,"\"),C++);return{oldFileName:t,newFileName:e,oldHeader:i,newHeader:r,hunks:d}}}function
|
|
229
|
+
`)&&(s=s.slice(0,-1))),super.equals(e,s,n)}},Dw=new Pa;function Oa(t,e,s){return Dw.diff(t,e,s)}function gw(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
|
|
230
|
+
`));let s=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let i=0;i<n.length;i++){let r=n[i];i%2&&!e.newlineIsToken?s[s.length-1]+=r:s.push(r)}return s}function La(t,e,s,n,i,r,o){let a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context>"u"&&(a.context=4);let u=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){let{callback:c}=a;Oa(s,n,Object.assign(Object.assign({},a),{callback:f=>{let d=l(f);c(d)}}))}else return l(Oa(s,n,a));function l(c){if(!c)return;c.push({value:"",lines:[]});function f(y){return y.map(function(C){return" "+C})}let d=[],p=0,D=0,m=[],g=1,F=1;for(let y=0;y<c.length;y++){let C=c[y],w=C.lines||yw(C.value);if(C.lines=w,C.added||C.removed){if(!p){let E=c[y-1];p=g,D=F,E&&(m=u>0?f(E.lines.slice(-u)):[],p-=m.length,D-=m.length)}for(let E of w)m.push((C.added?"+":"-")+E);C.added?F+=w.length:g+=w.length}else{if(p)if(w.length<=u*2&&y<c.length-2)for(let E of f(w))m.push(E);else{let E=Math.min(w.length,u);for(let B of f(w.slice(0,E)))m.push(B);let v={oldStart:p,oldLines:g-p+E,newStart:D,newLines:F-D+E,lines:m};d.push(v),p=0,D=0,m=[]}g+=w.length,F+=w.length}}for(let y of d)for(let C=0;C<y.lines.length;C++)y.lines[C].endsWith(`
|
|
231
|
+
`)?y.lines[C]=y.lines[C].slice(0,-1):(y.lines.splice(C+1,0,"\"),C++);return{oldFileName:t,newFileName:e,oldHeader:i,newHeader:r,hunks:d}}}function Qi(t){if(Array.isArray(t))return t.map(Qi).join(`
|
|
232
232
|
`);let e=[];t.oldFileName==t.newFileName&&e.push("Index: "+t.oldFileName),e.push("==================================================================="),e.push("--- "+t.oldFileName+(typeof t.oldHeader>"u"?"":" "+t.oldHeader)),e.push("+++ "+t.newFileName+(typeof t.newHeader>"u"?"":" "+t.newHeader));for(let s=0;s<t.hunks.length;s++){let n=t.hunks[s];n.oldLines===0&&(n.oldStart-=1),n.newLines===0&&(n.newStart-=1),e.push("@@ -"+n.oldStart+","+n.oldLines+" +"+n.newStart+","+n.newLines+" @@");for(let i of n.lines)e.push(i)}return e.join(`
|
|
233
233
|
`)+`
|
|
234
|
-
`}function
|
|
234
|
+
`}function Of(t,e,s,n,i,r,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){let{callback:a}=o;La(t,e,s,n,i,r,Object.assign(Object.assign({},o),{callback:u=>{a(u?Qi(u):void 0)}}))}else{let a=La(t,e,s,n,i,r,o);return a?Qi(a):void 0}}function Ps(t,e,s,n,i,r){return Of(t,t,e,s,n,i,r)}function yw(t){let e=t.endsWith(`
|
|
235
235
|
`),s=t.split(`
|
|
236
236
|
`).map(n=>n+`
|
|
237
|
-
`);return e?s.pop():s.push(s.pop().slice(0,-1)),s}var
|
|
238
|
-
`).filter(s=>s&&!s.startsWith("??")).length>0}catch(t){return h.debug(`hasUncommittedChanges failed: ${t}`),!1}}function
|
|
239
|
-
`).filter(e=>e.length>=3).map(e=>({file:e.slice(3),index:e[0]??" ",worktree:e[1]??" "}))}async function
|
|
240
|
-
`),s=0,n=0;for(let i of e)i.startsWith("+")&&!i.startsWith("+++")?s++:i.startsWith("-")&&!i.startsWith("---")&&n++;return{additions:s,deletions:n}}async function
|
|
241
|
-
`).filter(e=>e.length>0).map(e=>{let[s,...n]=e.split(" "),i=n.join(" "),r="modified";return s==="A"?r="added":s==="D"?r="deleted":s?.startsWith("R")&&(r="modified"),{file:i,status:r}}).filter(e=>e.file)}async function
|
|
242
|
-
`).filter(o=>o.startsWith("+")&&!o.startsWith("+++")).length;return{file:t,status:"added",diff:i,additions:r,deletions:0}}catch(s){return h.debug(`createFullFileDiff failed for ${t}: ${s}`),null}}async function
|
|
237
|
+
`);return e?s.pop():s.push(s.pop().slice(0,-1)),s}var qf=require("node:child_process"),An=require("node:fs/promises"),Uf=require("node:path");xn();H();var jf=3e4;async function ce(t,e=process.cwd()){return new Promise((s,n)=>{let i=(0,qf.spawn)("git",t,{cwd:e}),r=[],o=[];i.stdout.on("data",u=>r.push(u)),i.stderr.on("data",u=>o.push(u));let a=setTimeout(()=>{i.kill(),n(new Error(`git ${t[0]} timeout after ${jf/1e3}s`))},jf);i.on("close",u=>{if(clearTimeout(a),u===0)s(Buffer.concat(r).toString("utf-8"));else{let l=Buffer.concat(o).toString("utf-8");n(new Error(`git ${t[0]} failed: ${l||`exit code ${u}`}`))}}),i.on("error",u=>{clearTimeout(a),n(u)})})}async function ja(){try{let e=(await ce(["rev-parse","--abbrev-ref","HEAD"])).trim();return e==="HEAD"?null:e}catch(t){return h.debug(`getCurrentBranch failed: ${t}`),null}}async function Wf(){try{let n=(await ce(["symbolic-ref","refs/remotes/origin/HEAD"])).trim().replace("refs/remotes/origin/","");if(n)return n}catch{}let t=["main","master","develop"];for(let e of t)try{return await ce(["rev-parse","--verify",e]),e}catch{}return null}async function Vf(t){try{return await ce(["rev-parse","--verify",t]),!0}catch{try{return await ce(["rev-parse","--verify",`origin/${t}`]),!0}catch{return!1}}}async function Cw(){return(await ce(["rev-parse","HEAD"])).trim()}async function Ew(t){return(await ce(["rev-parse",t])).trim()}async function qa(t){await ce(["checkout",t]),Yf()}async function zf(t){let e=await Cw(),s=await Ew(t);if(e===s)return{checkoutNeeded:!1,originalRef:null};let i=await ja()||e;return await qa(t),{checkoutNeeded:!0,originalRef:i}}async function Gf(){try{return(await ce(["status","--porcelain"])).trim().split(`
|
|
238
|
+
`).filter(s=>s&&!s.startsWith("??")).length>0}catch(t){return h.debug(`hasUncommittedChanges failed: ${t}`),!1}}function bw(t){return t.trim().split(`
|
|
239
|
+
`).filter(e=>e.length>=3).map(e=>({file:e.slice(3),index:e[0]??" ",worktree:e[1]??" "}))}async function Kf(){return Dt(Ae.GIT_STATUS,async()=>{let t=await ce(["status","--porcelain"]);return bw(t)})}function Yf(){Os(Ae.GIT_STATUS)}async function Hf(){try{return await ce(["rev-parse","--git-dir"]),!0}catch(t){return h.debug(`isGitRepository: not a git repo: ${t}`),!1}}async function vw(){try{return(await Kf()).map(e=>e.file)}catch(t){throw new Error(`Failed to get changed files: ${t}`)}}async function xw(t){try{let e="",s="";try{e=await ce(["show",`HEAD:${t}`])}catch{e=""}try{s=await(0,An.readFile)(t,"utf-8")}catch{s=""}return Ps(t,e,s,"HEAD","Working Directory")}catch(e){throw new Error(`Failed to get diff for ${t}: ${e}`)}}async function Sw(t){try{let s=(await Kf()).find(n=>n.file===t);return s?s.index==="A"||s.index==="?"||s.worktree==="?"?"added":s.index==="D"||s.worktree==="D"?"deleted":"modified":"modified"}catch(e){return h.debug(`getFileStatus failed for ${t}: ${e}`),"modified"}}function Ua(t){let e=t.split(`
|
|
240
|
+
`),s=0,n=0;for(let i of e)i.startsWith("+")&&!i.startsWith("+++")?s++:i.startsWith("-")&&!i.startsWith("---")&&n++;return{additions:s,deletions:n}}async function Jf(){Yf();let t=await vw();return(await Promise.all(t.map(async s=>{try{let[n,i]=await Promise.all([xw(s),Sw(s)]),{additions:r,deletions:o}=Ua(n);return{file:s,status:i,diff:n,additions:r,deletions:o}}catch(n){return h.debug(`getAllDiffs: skipping ${s}: ${n}`),null}}))).filter(s=>s!==null).filter(s=>s.diff.trim().length>0)}function Zf(t){return t.trim().split(`
|
|
241
|
+
`).filter(e=>e.length>0).map(e=>{let[s,...n]=e.split(" "),i=n.join(" "),r="modified";return s==="A"?r="added":s==="D"?r="deleted":s?.startsWith("R")&&(r="modified"),{file:i,status:r}}).filter(e=>e.file)}async function Qf(){try{let t=await ce(["diff","--name-status","HEAD~1","HEAD"]),e=Zf(t);return e.length===0?[]:(await Promise.all(e.map(async({file:n,status:i})=>{try{let r=await ce(["diff","HEAD~1","HEAD","--",n]),{additions:o,deletions:a}=Ua(r),u=r.startsWith("diff --git")?r:Ps(n,"","","HEAD~1","HEAD");return{file:n,status:i,diff:u,additions:o,deletions:a}}catch(r){return h.debug(`getLastCommitDiffs: skipping ${n}: ${r}`),null}}))).filter(n=>n!==null&&n.diff.trim().length>0)}catch(t){throw new Error(`Failed to get last commit diffs: ${t}`)}}async function Xf(t,e="HEAD"){try{return(await ce(["log","--format=%B%n---COMMIT_SEPARATOR---",`${t}..${e}`])).split("---COMMIT_SEPARATOR---").map(n=>n.trim()).filter(n=>n.length>0)}catch(s){return h.debug(`getCommitMessages failed: ${s}`),[]}}async function Wa(t,e="HEAD"){try{let s=await ce(["diff","--name-status",t,e]),n=Zf(s);return n.length===0?[]:(await Promise.all(n.map(async({file:r,status:o})=>{try{let a=await ce(["diff",t,e,"--",r]),{additions:u,deletions:l}=Ua(a),c=a.startsWith("diff --git")?a:Ps(r,"","",t,e);return{file:r,status:o,diff:c,additions:u,deletions:l}}catch(a){return h.debug(`getCommitDiffs: skipping ${r}: ${a}`),null}}))).filter(r=>r!==null&&r.diff.trim().length>0)}catch(s){throw new Error(`Failed to get diffs between ${t} and ${e}: ${s}`)}}function ed(t,e){let s=new Map(t.map(r=>[r.file,r])),n=[],i=[];for(let r of e){let o=s.get(r);o?n.push(o):i.push(r)}return{matched:n,unmatched:i}}async function Aw(t){let e=(0,Uf.resolve)(process.cwd(),t);try{if(!(await(0,An.stat)(e)).isFile())return null;let n=await(0,An.readFile)(e,"utf-8"),i=Ps(t,"",n,"/dev/null",t),r=i.split(`
|
|
242
|
+
`).filter(o=>o.startsWith("+")&&!o.startsWith("+++")).length;return{file:t,status:"added",diff:i,additions:r,deletions:0}}catch(s){return h.debug(`createFullFileDiff failed for ${t}: ${s}`),null}}async function td(t){let e=await Promise.all(t.map(async i=>({file:i,diff:await Aw(i)}))),s=[],n=[];for(let{file:i,diff:r}of e)r?s.push(r):n.push(i);return{diffs:s,notFound:n}}Qe();H();_s();fc();Bi();Qe();async function At(t){let e=typeof t=="string"?{projectPath:t}:t||{},s=e.projectPath||process.cwd(),n=await Ee(s),i=n.extends.length>0?await ND("agents",$i,s,n.extends):await ID("agents",$i,s),r=e.executorOverride||n.executor,o=n.executors[r]||{},a=e.modelOverride;return i.map(u=>{let l=u.stage||"review",c=o[l]||{},f=n.agents[u.name]||{};return{...u,executor:u.executor||r,executorSettings:{...c,...u.executorSettings,...f.model&&{model:f.model},...f.timeout&&{timeout:f.timeout},...a&&{model:a}},enabled:f.enabled??u.enabled}}).filter(u=>u.enabled!==!1)}H();function VD(){return{id:"load-rules",name:"Load Rules",description:"Load matching rules and agents",enabled:!0,order:0,execute:async t=>{let e=Date.now(),[s,n]=await Promise.all([Xt(),t.agents&&t.agents.length>0?Promise.resolve(t.agents):At()]);if(t.ruleFilter&&t.ruleFilter.length>0){let i=new Set(t.ruleFilter);s=s.filter(r=>i.has(r.name))}if(t.excludeRules&&t.excludeRules.length>0){let i=new Set(t.excludeRules);s=s.filter(r=>!i.has(r.name))}if(t.agentFilter&&t.agentFilter.length>0){let i=new Set(t.agentFilter);n=n.filter(r=>i.has(r.name))}if(t.excludeAgents&&t.excludeAgents.length>0){let i=new Set(t.excludeAgents);n=n.filter(r=>!i.has(r.name))}return t.ruleRefs=s,t.agents=n,t.quiet||h.sync(`Loaded ${s.length} rule(s), ${n.length} agent(s)`),{stageId:"load-rules",stageName:"Load Rules",success:!0,duration:Date.now()-e}}}}_s();H();function zD(){return{id:"match-rules",name:"Match Rules",description:"Match rules to files",enabled:!0,order:1,execute:async t=>{let e=Date.now(),s=t.ruleRefs??[],n=t.agents??[],i=await Ac(s,t.diffs,n);if(t.matchedRules=i,!t.quiet){h.sync(`Matched ${i.length} rule(s)`);for(let r of i)h.plain(` ${r.rule.name}: ${r.files.length} file(s) \u2192 ${r.agent.name}`)}return{stageId:"match-rules",stageName:"Match Rules",success:!0,duration:Date.now()-e}}}}var qo=class{items=new Map;register(e){this.items.set(e.name,e)}get(e){return this.items.get(e)}list(){return Array.from(this.items.values())}remove(e){this.items.delete(e)}clear(){this.items.clear()}count(){return this.items.size}};var $c=class extends qo{listEnabled(){return this.list().filter(e=>e.enabled)}enable(e){let s=this.get(e);s&&(s.enabled=!0)}disable(e){let s=this.get(e);s&&(s.enabled=!1)}setExecutor(e,s){let n=this.get(e);n&&(n.executor=s)}countEnabled(){return this.list().filter(e=>e.enabled).length}},mn=new $c;Qe();Ks();H();xn();H();var YD=require("node:fs/promises");_o();var tS=3,GD=1e3;async function KD(t){return new Promise(e=>setTimeout(e,t))}async function HD(t,e,s=tS){let n;for(let i=0;i<s;i++)try{let r=await fetch(t,e);if(r.ok||r.status>=400&&r.status<500&&r.status!==429)return r;if(n=new Error(`HTTP ${r.status}`),i<s-1){let o=GD*Math.pow(2,i);process.env.DEBUG&&h.plain(`\u23F3 Retry ${i+1}/${s-1} after ${o}ms (${r.status})`),await KD(o)}}catch(r){if(n=r instanceof Error?r:new Error(String(r)),i<s-1){let o=GD*Math.pow(2,i);process.env.DEBUG&&h.plain(`\u23F3 Retry ${i+1}/${s-1} after ${o}ms (${n.message})`),await KD(o)}}throw n||new Error("Max retries exceeded")}var sS=`# Output Format
|
|
243
243
|
|
|
244
244
|
Return your findings as a **JSON array** wrapped in \`<json>...</json>\` XML tags:
|
|
245
245
|
|
|
@@ -259,69 +259,64 @@ Return your findings as a **JSON array** wrapped in \`<json>...</json>\` XML tag
|
|
|
259
259
|
</json>
|
|
260
260
|
|
|
261
261
|
Return empty array if no issues found: \`<json>[]</json>\`
|
|
262
|
-
`;async function
|
|
262
|
+
`;async function Uo(){return Dt(Ae.OUTPUT_FORMAT,async()=>{try{let t=$o("prompts","output-format.md");return await(0,YD.readFile)(t,"utf-8")}catch{return sS}})}function Wo(t,e,s){return`${t}
|
|
263
263
|
|
|
264
264
|
# Input:
|
|
265
265
|
${e}
|
|
266
266
|
|
|
267
267
|
${s}`}function Vo(t,e){return`${t}
|
|
268
268
|
|
|
269
|
-
${e}`}function
|
|
270
|
-
`)}function
|
|
271
|
-
`)}function
|
|
272
|
-
\x1B[33m\u26A0 Preliminary issues (may be filtered):\x1B[0m`);for(let n of s)h.plain(
|
|
273
|
-
`);
|
|
274
|
-
`,process.env.DEBUG&&h.plain(`\u{1F4E1} Accumulating non-JSON output: ${
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
`,
|
|
278
|
-
\x1B[33m\u26A0 Preliminary issues (may be filtered):\x1B[0m`);for(let n of s)h.plain($s(n,!0));h.plain("")}}function px(t,e,s){if(s.verbose&&h.plain(`\x1B[90m${e}\x1B[0m`),s.stream&&!s.verbose){if(t.type==="system"){let n=t.tools?.length||0,i=t.model||"unknown";h.plain(`\x1B[90m\u{1F4CB} ${i}, ${n} tools\x1B[0m`)}else if(t.type==="assistant"&&t.message?.content){for(let n of t.message.content)if(n.type==="tool_use")h.plain(`\x1B[36m\u{1F527} ${n.name}\x1B[0m`);else if(n.type==="text"&&n.text){let i=n.text.slice(0,200),r=n.text.length>200?"...":"";h.plain(`\x1B[90m\u{1F4AD} ${i}${r}\x1B[0m`)}}}if(t.type==="result"){if(s.stream&&!s.verbose){let n=t.total_cost_usd?`$${t.total_cost_usd.toFixed(4)}`:"",i=t.duration_ms?`${(t.duration_ms/1e3).toFixed(1)}s`:"";h.plain(`\x1B[90m\u{1F4CA} ${i} ${n}\x1B[0m`)}if(t.subtype==="success"&&t.result)return t.result;if(t.subtype==="error")throw new Error(t.error||"OpenCode CLI returned error")}return null}async function VD(t,e,s,n){if(t.length===0)throw new Error("No command provided to streamOpenCodeCli");Qt();let[i,...r]=t,o=(0,WD.spawn)(i,r,{stdio:["ignore","pipe","pipe"],env:{...process.env,...e},cwd:n.cwd});Zt(o);let a=s*1e3,u=setTimeout(()=>mn(o,2e3),a);return new Promise((l,c)=>{let f="",d="",p="",D=[];o.stderr?.on("data",m=>D.push(m)),o.stdout?.on("data",m=>{p+=m.toString("utf-8");let g=p.split(`
|
|
279
|
-
`);p=g.pop()||"";for(let F of g)if(F.trim())try{let y=JSON.parse(F),C=px(y,F,n);C!==null&&(f=C,n.stream&&n.agentName&&hx(f,n.agentName))}catch{d+=F+`
|
|
280
|
-
`,process.env.DEBUG&&h.plain(`\u{1F4E1} Accumulating non-JSON output: ${F.slice(0,100)}`)}}),o.on("close",m=>{if(clearTimeout(u),p.trim())try{let F=JSON.parse(p);F.type==="result"&&F.subtype==="success"&&F.result&&(f=F.result)}catch{d+=p}let g=Buffer.concat(D).toString("utf-8");if(m===null){c(new Error(`Process killed (timeout after ${s}s or signal)${g?`: ${g}`:""}`));return}if(m!==0){c(new Error(`Exit code ${m}: ${g}`));return}!f.trim()&&d.trim()&&(process.env.DEBUG&&h.plain(`\u26A0 Using raw non-JSON output as result (${d.length} bytes)`),f=d),l(f.trim())}),o.on("error",m=>{clearTimeout(u),c(m)})})}var GD=I.object({model:I.string().optional(),timeout:I.number().positive().optional()}),zD={model:"opus",timeout:120},KD={model:"opus-4.5",timeout:120},YD={model:"opencode/gpt-5-nano",timeout:120},mx={timeout:120};function Yo(t,e){return t.executor.type==="cli"&&t.executor.timeout!==void 0?t.executor.timeout:e||60}function Jo(t,e){return t.executor.type==="cli"&&t.executor.model!==void 0?t.executor.model:e}async function Dx(t,e,s){let n=Date.now(),i=`${e.systemPrompt}
|
|
281
|
-
|
|
282
|
-
${s}`,r=e.input,o=Jo(e,t.model),a=Yo(e,t.timeout),u=t.args||[];o&&(u=[...u,"--model",o]);let l=u.map(p=>p==="--output-format"?"--output-format":p),c=l.indexOf("json");c!==-1&&(l[c]="stream-json"),l.push("--verbose");let f;if(t.systemPromptArg)f=[t.command,...l,t.systemPromptArg,i,r];else{let p=Oi(i,e.input,s);f=t.useStdin?[t.command,...l]:[t.command,...l,p]}let d=await jD(f,t.env||{},a,{stream:e.stream??!1,verbose:e.verbose??!1,agentName:e.agent.name,cwd:e.cwd});return qe(e,!0,d,void 0,Date.now()-n,r)}async function gx(t,e,s){let n=Date.now(),r=`<system>
|
|
269
|
+
${e}`}function ze(t,e,s,n,i,r){return{agent:t.agent.name,executor:t.executor.name,success:e,output:s,error:n,duration:i,prompt:r}}var JD=T.object({model:T.string().optional(),temperature:T.number().min(0).max(2).optional(),maxTokens:T.number().positive().optional()});function nS(t,e){return{name:t.name,description:t.description,type:"llm-api",enabled:!!t.apiKey,async execute(s){let n=Date.now();try{let i=await Uo(),r=Vo(s.input,i);s.verbose&&h.plain(`\u{1F527} API: ${t.name} (model: ${t.model})`);let o=await e(s.systemPrompt,r,t);return s.verbose&&(h.plain(`\u{1F4E5} API raw response (${o.length} chars):`),h.plain(` ${o.slice(0,500)}${o.length>500?"...":""}`)),ze(s,!0,o,void 0,Date.now()-n,r)}catch(i){return ze(s,!1,"",i instanceof Error?i.message:String(i),Date.now()-n)}},getInfo:()=>({name:t.name,description:t.description,type:"llm-api",provider:"custom",model:t.model,apiKey:t.apiKey,baseUrl:t.baseUrl,temperature:t.temperature,maxTokens:t.maxTokens,enabled:!!t.apiKey}),settingsSchema:JD,applySettings:s=>{let n=JD.safeParse(s),i=n.success?n.data:{};return{name:t.name,description:t.description,type:"llm-api",provider:"custom",model:i.model??t.model,apiKey:t.apiKey,baseUrl:t.baseUrl,temperature:i.temperature??t.temperature,maxTokens:i.maxTokens??t.maxTokens,enabled:!!t.apiKey}}}}var zo={model:"llama-3.3-70b",temperature:.7,maxTokens:8192,baseUrl:"https://api.cerebras.ai/v1"};async function iS(t,e,s){if(!s.apiKey)throw new Error("CEREBRAS_API_KEY not set");let n=await HD(`${s.baseUrl}/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s.apiKey}`},body:JSON.stringify({model:s.model,messages:[{role:"system",content:t},{role:"user",content:e}],temperature:s.temperature||.7,max_tokens:s.maxTokens||8192})});if(!n.ok){let r=await n.text();throw new Error(`Cerebras API: ${n.status} - ${r}`)}return(await n.json()).choices?.[0]?.message?.content||""}var ZD=nS({name:"cerebras-api",description:"Execute via Cerebras AI API",model:zo.model,apiKey:process.env.CEREBRAS_API_KEY,baseUrl:zo.baseUrl,temperature:zo.temperature,maxTokens:zo.maxTokens},iS);Ks();var Xg=nt(Mc(),1);H();var Ko=new Set,Mg=!1;function Yo(t){Ko.add(t),t.once("exit",()=>{Ko.delete(t)})}function Ho(t,e=3e3){return t.kill("SIGTERM"),setTimeout(()=>{t.killed||t.kill("SIGKILL")},e)}function BS(){let t=[...Ko];Ko.clear();for(let e of t)e.kill("SIGTERM");setTimeout(()=>{for(let e of t)e.killed||e.kill("SIGKILL")},2e3)}function Jo(){Mg||(Mg=!0,process.on("SIGINT",()=>{BS(),process.exit(130)}))}var zg=nt(Mc(),1);H();function Zo(t,e=1){if(t==null)return e;let s=typeof t=="number"?t:parseInt(String(t).trim(),10);return!isNaN(s)&&s>0?s:e}function TS(t){return t.lineStart!==void 0?Zo(t.lineStart,0):t.line!==void 0?Zo(t.line,0):t.lineNumber!==void 0?Zo(t.lineNumber,0):1}function IS(t,e){let s=t.file||t.path||"",n=TS(t),i=Zo(t.lineEnd,n),r=t.category||t.type||"quality",o=t.shortDescription||t.short||t.message||t.issue||t.title||t.problem||"",a=t.fullDescription||t.description||t.detail||t.details||t.explanation||o,u=t.suggestion||t.fix||t.recommendation||t.remediation||t.solution,l=t.evidence,c;if(typeof t.confidence=="number")c=t.confidence;else if(typeof t.confidence=="string"){let f=parseInt(t.confidence,10);c=isNaN(f)?void 0:f}return{file:s,lineStart:n,lineEnd:i,severity:t.severity||"medium",category:r,shortDescription:o,fullDescription:a,suggestion:u,agent:e??t.agent??"unknown",rule:t.rule,evidence:l,confidence:c}}function RS(t){let e=t.match(/\[[\s\S]*\]/);if(!e)return null;try{let s=JSON.parse(e[0]);return Array.isArray(s)?s:null}catch{return null}}function jg(t){return t.match(/<json>\s*([\s\S]*?)\s*<\/json>/)?.[1]?.trim()??null}function NS(t){try{let e=JSON.parse(t);if(e.type==="result"&&typeof e.result=="string"){let s=e.result,n=jg(s);if(n)return n;let i=s.match(/```json\s*([\s\S]*?)```/);if(i)return i[1]?.trim()??s;let r=s.matchAll(/```(?:\w*)?\s*([\s\S]*?)```/g);for(let o of r){let a=o[1]?.trim();if(a?.startsWith("[")||a?.startsWith("{"))return a}return s}}catch(e){process.env.DEBUG&&console.warn("extractClaudeCliResult JSON parse failed:",e)}return null}function Qo(t,e){try{let s=t,n=NS(t);if(n)s=n;else{let r=jg(t);r&&(s=r)}let i=null;try{let r=JSON.parse(s);i=Array.isArray(r)?r:r.issues??null}catch{i=RS(s)}return Array.isArray(i)?i.map(r=>IS(r,e)).filter(r=>r.file&&(r.shortDescription||r.fullDescription)&&r.lineStart>0):[]}catch{return[]}}var V={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",green:"\x1B[32m",gray:"\x1B[90m"};function PS(t){switch(t){case"critical":return V.red;case"high":return V.yellow;case"medium":return V.blue;case"low":return V.cyan}}function OS(t){switch(t){case"critical":return"\u2717";case"high":return"\u26A0";case"medium":return"\u25CB";case"low":return"\u25C7"}}function LS(t){switch(t){case"security":return"\u{1F512}";case"performance":return"\u26A1";case"bug":return"\u{1F41B}";case"quality":return"\u2728";case"style":return"\u{1F3A8}";case"docs":return"\u{1F4DD}"}}function jc(t){switch(t){case"critical":return 0;case"high":return 1;case"medium":return 2;case"low":return 3}}function qc(t){return[...t].sort((e,s)=>{let n=jc(e.severity),i=jc(s.severity);return n-i})}function Uc(t,e=!1){let s=PS(t.severity),n=OS(t.severity),i=LS(t.category),r=[];return e?r.push(`${n} ${V.bold}${t.file}:${t.lineStart}${V.reset} - ${s}${t.shortDescription}${V.reset}`):(r.push(""),r.push(`${n} ${s}${V.bold}${t.severity.toUpperCase()}${V.reset} ${i} ${V.dim}${t.category}${V.reset}`),r.push(`${V.bold}${t.file}${V.reset}:${V.cyan}${t.lineStart}${t.lineEnd!==t.lineStart?`-${t.lineEnd}`:""}${V.reset}`),r.push(""),r.push(`${V.bold}${t.shortDescription}${V.reset}`),t.fullDescription&&t.fullDescription!==t.shortDescription&&(r.push(""),r.push(`${V.dim}${t.fullDescription}${V.reset}`)),t.suggestion&&(r.push(""),r.push(`${V.green}\u2192 Suggestion:${V.reset}`),r.push(`${V.dim}${t.suggestion}${V.reset}`)),r.push(""),r.push(`${V.gray}Agent: ${t.agent}${V.reset}`),t.rule&&r.push(`${V.gray}Rule: ${t.rule}${V.reset}`),t.confidence!==void 0&&r.push(`${V.gray}Confidence: ${t.confidence}%${V.reset}`),r.push(""),r.push(V.gray+"\u2500".repeat(80)+V.reset)),r.join(`
|
|
270
|
+
`)}function Ug(t){let e=new Map;for(let s of t){let n=e.get(s.file)||[];n.push(s),e.set(s.file,n)}return e}function qg(t){return Math.min(...t.map(e=>jc(e.severity)))}function Wg(t){if(t.length===0)return`${V.green}\u2713 No issues found \u{1F389}${V.reset}`;let e=Ug(t),s=[];s.push(""),s.push(`${V.bold}Found ${t.length} issue(s) in ${e.size} file(s)${V.reset}`),s.push("");let n=Array.from(e.entries()).sort(([,i],[,r])=>qg(i)-qg(r));for(let[i,r]of n){s.push(`${V.bold}${V.cyan}${i}${V.reset} ${V.dim}(${r.length} issue(s))${V.reset}`),s.push("");let o=qc(r);for(let a of o)s.push(Uc(a,!1))}return s.join(`
|
|
271
|
+
`)}function Vg(t,e,s,n,i,r){let o=t.filter(D=>D.severity==="critical").length,a=t.filter(D=>D.severity==="high").length,u=t.filter(D=>D.severity==="medium").length,l=t.filter(D=>D.severity==="low").length,c=qc(t),f=Ug(c),d=Array.from(f.entries()).map(([D,m])=>({file:D,issueCount:m.length,issues:qc(m)})),p={success:e,totalDuration:s,stats:{totalIssues:t.length,critical:o,high:a,medium:u,low:l,filesAnalyzed:r,agentsExecuted:n,agentsSucceeded:i,agentsFailed:n-i},issues:c,files:d};return JSON.stringify(p,null,2)}function MS(t,e){let s=Qo(t,e);if(s.length!==0){h.plain(`
|
|
272
|
+
\x1B[33m\u26A0 Preliminary issues (may be filtered):\x1B[0m`);for(let n of s)h.plain(Uc(n,!0));h.plain("")}}function jS(t,e,s,n){if(s.verbose&&h.plain(`\x1B[90m${e}\x1B[0m`),s.stream&&!s.verbose){if(t.type==="system"){let i=t.tools?.length||0,r=t.model||"unknown";h.plain(`\x1B[90m\u{1F4CB} ${r}, ${i} tools\x1B[0m`)}else if(t.type==="assistant"&&t.message?.content){for(let i of t.message.content)if(i.type==="tool_use")h.plain(`\x1B[36m\u{1F527} ${i.name}\x1B[0m`);else if(i.type==="text"&&i.text){let r=i.text.slice(0,200),o=i.text.length>200?"...":"";h.plain(`\x1B[90m\u{1F4AD} ${r}${o}\x1B[0m`)}}}if(t.type==="result"){if(s.stream&&!s.verbose){let i=t.total_cost_usd?`$${t.total_cost_usd.toFixed(4)}`:"",r=t.duration_ms?`${(t.duration_ms/1e3).toFixed(1)}s`:"";h.plain(`\x1B[90m\u{1F4CA} ${r} ${i}\x1B[0m`)}if(t.subtype==="success"&&t.result)return t.result;if(t.subtype==="error")throw new Error(t.error||`${n} returned error`)}return null}async function yn(t,e,s,n,i){if(t.length===0)throw new Error(`No command provided to ${i}`);Jo();let[r,...o]=t,a=(0,zg.default)(r,o,{stdio:[n.stdinInput?"pipe":"ignore","pipe","pipe"],env:{...process.env,...e},cwd:n.cwd});Yo(a),n.stdinInput&&a.stdin&&(a.stdin.write(n.stdinInput),a.stdin.end());let u=s*1e3,l=setTimeout(()=>Ho(a,2e3),u);return new Promise((c,f)=>{let d="",p="",D="",m=[];a.stderr?.on("data",g=>m.push(g)),a.stdout?.on("data",g=>{D+=g.toString("utf-8");let F=D.split(`
|
|
273
|
+
`);D=F.pop()||"";for(let y of F)if(y.trim())try{let C=JSON.parse(y),w=jS(C,y,n,i);w!==null&&(d=w,n.stream&&n.agentName&&MS(d,n.agentName))}catch{p+=y+`
|
|
274
|
+
`,process.env.DEBUG&&h.plain(`\u{1F4E1} Accumulating non-JSON output: ${y.slice(0,100)}`)}}),a.on("close",g=>{if(clearTimeout(l),D.trim())try{let E=JSON.parse(D);E.type==="result"&&E.subtype==="success"&&E.result&&(d=E.result)}catch{p+=D}let F=Buffer.concat(m).toString("utf-8");if(g===null){f(new Error(`Process killed (timeout after ${s}s or signal)${F?`: ${F}`:""}`));return}if(g!==0){f(new Error(`Exit code ${g}: ${F}`));return}let y=d.trim(),C=p.trim(),w=y;C&&(y?(process.env.DEBUG&&h.plain(`\u{1F4E1} Preserving non-JSON output before result (${C.length} bytes)`),w=`${C}
|
|
275
|
+
${y}`):(process.env.DEBUG&&h.plain(`\u26A0 Using raw non-JSON output as result (${C.length} bytes)`),w=C)),c(w)}),a.on("error",g=>{clearTimeout(l),f(g)})})}async function Gg(t,e,s,n){return yn(t,e,s,n,"Claude CLI")}async function Kg(t,e,s,n){return yn(t,e,s,n,"Cursor Agent CLI")}async function Yg(t,e,s,n){return yn(t,e,s,n,"OpenCode CLI")}var Hg=T.object({model:T.string().optional(),timeout:T.number().positive().optional()}),Jg={model:"opus",timeout:120},Zg={model:"opus-4.5",timeout:120},Qg={model:"opencode/gpt-5-nano",timeout:120},qS={timeout:120};function Xo(t,e){return t.executor.type==="cli"&&t.executor.timeout!==void 0?t.executor.timeout:e||60}function ea(t,e){return t.executor.type==="cli"&&t.executor.model!==void 0?t.executor.model:e}async function US(t,e,s){let n=Date.now(),i=`${e.systemPrompt}
|
|
276
|
+
|
|
277
|
+
${s}`,r=e.input,o=ea(e,t.model),a=Xo(e,t.timeout),u=t.args||[];o&&(u=[...u,"--model",o]);let l=u.map(p=>p==="--output-format"?"--output-format":p),c=l.indexOf("json");if(c!==-1&&(l[c]="stream-json"),l.push("--verbose"),!t.systemPromptArg)throw new Error("systemPromptArg required for streaming executor");let f=[t.command,...l,t.systemPromptArg,i],d=await Gg(f,t.env||{},a,{stream:e.stream??!1,verbose:e.verbose??!1,agentName:e.agent.name,cwd:e.cwd,stdinInput:r});return ze(e,!0,d,void 0,Date.now()-n,r)}async function WS(t,e,s){let n=Date.now(),r=`<system>
|
|
283
278
|
${`${e.systemPrompt}
|
|
284
279
|
|
|
285
280
|
${s}`}
|
|
286
281
|
</system>
|
|
287
282
|
|
|
288
|
-
${e.input}`,o=
|
|
289
|
-
${t.diff}`;return
|
|
283
|
+
${e.input}`,o=ea(e,t.model),a=Xo(e,t.timeout),u=[t.command];u.push("-p","--output-format","stream-json"),o&&u.push("--model",o);let l=await Kg(u,t.env||{},a,{stream:e.stream??!1,verbose:e.verbose??!1,agentName:e.agent.name,cwd:e.cwd,stdinInput:r});return ze(e,!0,l,void 0,Date.now()-n,e.input)}async function VS(t,e,s){let n=Date.now(),i=Wo(e.systemPrompt,e.input,s),r=ea(e,t.model),o=Xo(e,t.timeout),a=[t.command,"run","--format","json"];r&&(a=[...a,"--model",r]);let u=await Yg(a,t.env||{},o,{stream:e.stream??!1,verbose:e.verbose??!1,agentName:e.agent.name,cwd:e.cwd,stdinInput:i});return ze(e,!0,u,void 0,Date.now()-n,e.input)}async function zS(t,e,s){let n=Date.now(),i=Vo(e.input,s),r=e.systemPrompt,o=ea(e,t.model),a=Xo(e,t.timeout),u=t.args||[];o&&(u=[...u,"--model",o]);let l;if(t.systemPromptArg)l=[...u,t.systemPromptArg,r,i];else{let c=Wo(r,e.input,s);l=t.useStdin?[...u]:[...u,c]}return e.verbose&&h.plain(`\u{1F527} CLI: ${t.command} ${l.slice(0,-1).join(" ")} <prompt ${i.length} chars>`),Jo(),new Promise(c=>{let f=(0,Xg.default)(t.command,l,{stdio:[t.useStdin?"pipe":"ignore","pipe","pipe"],env:{...process.env,...t.env},cwd:e.cwd});Yo(f);let d=[],p=[];if(f.stdout?.on("data",g=>d.push(g)),f.stderr?.on("data",g=>p.push(g)),t.useStdin&&f.stdin){let g=t.systemPromptArg?i:Wo(e.systemPrompt,e.input,s);f.stdin.write(g),f.stdin.end()}let D=a*1e3,m=setTimeout(()=>Ho(f,2e3),D);f.on("close",g=>{clearTimeout(m);let F=Buffer.concat(d).toString("utf-8"),y=Buffer.concat(p).toString("utf-8");if(e.verbose&&(h.plain(`\u{1F4E5} CLI raw response (${F.length} chars):`),h.plain(` ${F.slice(0,500)}${F.length>500?"...":""}`),y&&h.plain(` stderr: ${y.slice(0,200)}`)),g===null){c(ze(e,!1,"",`Process killed (timeout after ${a}s or signal)${y?`: ${y}`:""}`,Date.now()-n,i));return}if(g!==0){c(ze(e,!1,"",`Exit code ${g}: ${y}`,Date.now()-n,i));return}c(ze(e,!0,F,void 0,Date.now()-n,i))}),f.on("error",g=>{clearTimeout(m),c(ze(e,!1,"",`Process error: ${g.message}`,Date.now()-n,i))})})}function Pi(t){return{name:t.name,description:t.description,type:"cli",enabled:!0,async execute(e){let s=Date.now();try{let n=await Uo();return t.name==="claude-cli"?await US(t,e,n):t.name==="cursor-agent-cli"?await WS(t,e,n):t.name==="opencode-cli"?await VS(t,e,n):await zS(t,e,n)}catch(n){return ze(e,!1,"",n instanceof Error?n.message:String(n),Date.now()-s)}},getInfo:()=>({name:t.name,description:t.description,type:"cli",command:t.command,args:t.args,env:t.env,timeout:t.timeout,model:t.model,installCommand:t.installCommand,enabled:!0}),settingsSchema:Hg,applySettings:e=>{let s=Hg.safeParse(e),n=s.success?s.data:{};return{name:t.name,description:t.description,type:"cli",command:t.command,args:t.args,env:t.env,timeout:n.timeout??t.timeout,model:n.model??t.model,installCommand:t.installCommand,enabled:!0}}}}var e0=Pi({name:"claude-cli",description:"Execute via Claude Code CLI",command:"claude",args:["-p","--output-format","json","--no-session-persistence"],timeout:Jg.timeout,model:Jg.model,useStdin:!1,systemPromptArg:"--system-prompt",installCommand:"npm install -g @anthropic-ai/claude-code"}),t0=Pi({name:"test-cli",description:"Test stub executor - returns empty array (for testing only)",command:"bash",args:["-c","cat > /dev/null; sleep 1; echo '[]'"],timeout:10,useStdin:!0}),s0=Pi({name:"cursor-agent-cli",description:"Execute via Cursor Agent CLI",command:"cursor-agent",args:[],timeout:Zg.timeout,model:Zg.model,useStdin:!1,installCommand:"curl https://cursor.com/install -fsS | bash"}),n0=Pi({name:"opencode-cli",description:"Execute via OpenCode CLI",command:"opencode",args:["run","--format","json"],timeout:Qg.timeout,model:Qg.model,useStdin:!1,systemPromptArg:void 0,installCommand:"curl https://opencode.ai/install -fsS | bash"}),i0=Pi({name:"codex-cli",description:"Execute via Codex CLI",command:"codex",args:["exec"],timeout:qS.timeout,useStdin:!1,installCommand:"npm install -g @openai/codex"});var Oi=new Map([["cerebras-api",ZD],["claude-cli",e0],["cursor-agent-cli",s0],["opencode-cli",n0],["codex-cli",i0],["test-cli",t0]]);function Fn(t){return Oi.get(t)}function r0(){return[...Oi.values()]}function o0(t){let e=Oi.get(t.name);e&&(e.enabled=t.enabled)}async function a0(t){let e=Oi.get(t.executor.name);if((!e||!e.enabled)&&(process.env.DEBUG&&console.warn(`Executor "${t.executor.name}" not available, using test-cli`),e=Oi.get("test-cli")),!e)throw new Error(`No executor found: ${t.executor.name}`);if(t.modelOverride&&e.applySettings){let s=e.applySettings({model:t.modelOverride});return e.execute({...t,executor:s})}return e.execute(t)}var Ge={async autoDiscover(){},get:Fn,listExecutors(){return r0().map(t=>t.getInfo())},registerExecutor:o0,executeAgent:a0};async function Li(){return await Ge.autoDiscover(),Ge.listExecutors()}H();function Mi(t){return Math.ceil(t.length/4)}function u0(){return"simple (1 token \u2248 4 chars)"}function GS(t){let e=`File: ${t.file}
|
|
284
|
+
${t.diff}`;return Mi(e)}var l0=1e4;function KS(){let t=process.env.DIFFRAY_BATCH_TOKENS,e=t?parseInt(t,10):l0;return{maxTokensPerBatch:isNaN(e)?l0:e}}function c0(t,e,s){let n=s||KS(),i=[],r=Mi(e),o=n.maxTokensPerBatch-r-1e3,a=[],u=0;for(let l of t){let c=GS(l);if(c>o){a.length>0&&(i.push({diffs:a,tokenCount:u+r,batchIndex:i.length}),a=[],u=0),i.push({diffs:[l],tokenCount:c+r,batchIndex:i.length});continue}u+c>o&&a.length>0&&(i.push({diffs:a,tokenCount:u+r,batchIndex:i.length}),a=[],u=0),a.push(l),u+=c}return a.length>0&&i.push({diffs:a,tokenCount:u+r,batchIndex:i.length}),i}function f0(t,e=!1){let s=t.diffs.length,n=t.tokenCount.toLocaleString();if(e){let i=t.diffs.map(r=>` ${r.file}`).join(`
|
|
290
285
|
`);return`Batch ${t.batchIndex+1}: ${s} file(s), ~${n} tokens
|
|
291
286
|
Files:
|
|
292
|
-
${i}`}return`Batch ${t.batchIndex+1}: ${s} file(s), ~${n} tokens`}function Bs(t){if(t<1)throw new Error("Concurrency must be at least 1");let e=[],s=0,n=()=>{s--,e.length>0&&e.shift()?.()};return i=>new Promise((r,o)=>{let a=async()=>{s++;try{let u=await i();r(u)}catch(u){o(u)}finally{n()}};s<t?a():e.push(a)})}
|
|
287
|
+
${i}`}return`Batch ${t.batchIndex+1}: ${s} file(s), ~${n} tokens`}function Bs(t){if(t<1)throw new Error("Concurrency must be at least 1");let e=[],s=0,n=()=>{s--,e.length>0&&e.shift()?.()};return i=>new Promise((r,o)=>{let a=async()=>{s++;try{let u=await i();r(u)}catch(u){o(u)}finally{n()}};s<t?a():e.push(a)})}Qe();H();function d0(t,e){if(e<1)throw new Error("Chunk size must be at least 1");let s=[];for(let n=0;n<t.length;n+=e)s.push(t.slice(n,n+e));return s}function YS(t){let{label:e,batchIndex:s,totalBatches:n,itemCount:i,itemName:r="item"}=t;if(n===1)return i!==void 0?`${e} (${i} ${r}${i!==1?"s":""})...`:`${e}...`;let o=`batch ${s+1}/${n}`;return i!==void 0?`${e} (${o}, ${i} ${r}${i!==1?"s":""})...`:`${e} (${o})...`}function ta(t){let e=t.filter(n=>!!n);if(e.length===0)return;let s=[...new Set(e)];return s.length===1&&e.length>1?`${s[0]} (${e.length} batches)`:s.join("; ")}async function sa(t,e,s,n,i){let r=Date.now(),o=YS(t),a=e?null:new er(o);try{a?.start();let u=await s(),l=Date.now()-r;if(u.success){let c=n?n(u.data,l):`${t.label} (${l}ms)`;a?.succeed(c)}else{let c=i?i(u.error||"Unknown error"):`${t.label}: ${u.error}`;a?.fail(c)}return{success:u.success,data:u.data,error:u.error,duration:l}}catch(u){let l=Date.now()-r,c=u instanceof Error?u.message:String(u),f=i?i(c):`${t.label}: ${c}`;return a?.fail(f),{success:!1,data:void 0,error:c,duration:l}}finally{a?.stop()}}function h0(t){return t.every(e=>e.success)}function p0(t){return t.filter(e=>!e.success)}_s();async function HS(t,e,s){let n=new Map;for(let i of t){let r=e.matchedRules?.filter(D=>D.agent.name===i.name)||[];if(r.length===0)continue;let o=new Map,a=new Map,u=new Set;for(let D of r)for(let m of D.files){u.add(m);let F=D.rule.patterns.find(C=>es(m,C))?.length??0,y=a.get(m)??0;F>y&&(o.set(m,D.rule.name),a.set(m,F))}let l=e.diffs.filter(D=>u.has(D.file)),c=i.systemPrompt,f=r.map(D=>D.rule.prompt).filter(Boolean).join(`
|
|
293
288
|
|
|
294
289
|
`);f&&(c=`${c}
|
|
295
290
|
|
|
296
291
|
${f}`),s&&(c=`${c}
|
|
297
292
|
|
|
298
|
-
${s}`);let d=
|
|
299
|
-
`),
|
|
293
|
+
${s}`);let d=c0(l,c),p=r.map(D=>D.rule.name);n.set(i.name,{batches:d,files:l.length,rules:r.length,ruleNames:p,systemPrompt:c,fileToRule:o})}return n}async function m0(t,e,s,n,i,r,o){let{batches:a,systemPrompt:u,fileToRule:l}=s,c=Mi(u),f=await Promise.all(a.map(d=>JS(d,a,t,e,u,c,l,n,i,r,o)));return ZS(f,t,a)}async function JS(t,e,s,n,i,r,o,a,u,l,c){return u(async()=>{let f=c||s.name;t.batchIndex===0&&l?.startTask(f);let p=["# Repository Context",`Base path: ${a.metadata.repository}`,"All file paths below are relative to this directory.","When using tools to read files, prepend this base path to get absolute paths.",a.metadata.baseRef?`Base ref: ${a.metadata.baseRef}`:null,a.metadata.headRef?`Head ref: ${a.metadata.headRef}`:null].filter(Boolean).join(`
|
|
294
|
+
`),D=t.diffs.map(w=>{let E=o.get(w.file);return E?`- ${w.file}: rule="${E}"`:null}).filter(Boolean),m=D.length>0?`
|
|
300
295
|
|
|
301
296
|
# File-Rule Mappings
|
|
302
297
|
|
|
303
298
|
Each file was matched by a specific rule. Include the rule name in the "rule" field of each issue:
|
|
304
|
-
${
|
|
305
|
-
`)}`:"",
|
|
299
|
+
${D.join(`
|
|
300
|
+
`)}`:"",g=`${p}${m}
|
|
306
301
|
|
|
307
|
-
${t.diffs.map(
|
|
308
|
-
${
|
|
302
|
+
${t.diffs.map(w=>`File: ${w.file}
|
|
303
|
+
${w.diff}`).join(`
|
|
309
304
|
|
|
310
|
-
`)}`;if(a.verbose&&!a.quiet){let
|
|
311
|
-
`),
|
|
305
|
+
`)}`;if(a.verbose&&!a.quiet){let w=t.tokenCount-r,E=t.diffs.map(B=>`File: ${B.file} <diff ${B.diff.length} chars>`).join(`
|
|
306
|
+
`),v=`${i}
|
|
312
307
|
|
|
313
308
|
# Input:
|
|
314
|
-
${
|
|
315
|
-
... (diff truncated due to size) ...`,
|
|
309
|
+
${E}`;h.newline(),h.plain(`Prompt for ${s.name} (batch ${t.batchIndex+1}/${e.length}):`),h.plain(` Tokens: ${t.tokenCount.toLocaleString()} (~${r.toLocaleString()} system + ~${w.toLocaleString()} input)`),h.plain("\u2500".repeat(80)),h.plain(v),h.plain("\u2500".repeat(80)),h.newline()}let F=s.executorSettings&&n.applySettings?n.applySettings(s.executorSettings):n.getInfo(),y={agent:s,executor:F,input:g,systemPrompt:i,verbose:a.verbose,quiet:a.quiet,stream:a.stream,cwd:a.metadata.repository,modelOverride:a.modelOverride},C=async()=>{let w=await Ge.executeAgent(y),E=Qo(w.output,s.name);return{success:w.success,data:E,error:w.error}};if(l){let w=Date.now();try{let E=await C(),v=Date.now()-w;return E.success?l.completeBatch(f):l.failTask(f),{...E,duration:v}}catch(E){let v=Date.now()-w,B=E instanceof Error?E.message:String(E);return l.failTask(f),{success:!1,data:[],error:B,duration:v}}}return sa({label:s.name,batchIndex:t.batchIndex,totalBatches:e.length},a.quiet??!1,C,(w,E)=>e.length>1?`${s.name} (batch ${t.batchIndex+1}/${e.length}, ${E}ms)`:`${s.name} (${E}ms)`,w=>e.length>1?`${s.name} (batch ${t.batchIndex+1}/${e.length}): ${w}`:`${s.name}: ${w}`)})}function ZS(t,e,s){let n=[],i=0;for(let a of t)n.push(...a.data),i+=a.duration||0;let r=t.every(a=>a.success),o=ta(t.map(a=>a.error));return{agent:e.name,executor:e.executor||"unknown",success:r,output:`Processed ${s.length} batch(es), found ${n.length} issue(s)`,duration:i,issues:n,error:o}}function D0(){return{id:"review",name:"Review",description:"Run code review agents",enabled:!0,order:2,execute:async t=>{let e=Date.now();if(!t.config){let $="Pipeline context config not initialized";return h.error($),{stageId:"review",stageName:"Review",success:!1,duration:0,error:$}}let s=t.config,n=await fr(),o=((s.executors[s.executor]||{}).review||{}).concurrency??t.concurrency,a=Bs(o);t.verbose&&!t.quiet&&h.plain(`Token counter: ${u0()}`);let u=mn.listEnabled();if(u.length===0)return t.quiet||h.warn("No enabled Agents found"),{stageId:"review",stageName:"Review",success:!0,duration:Date.now()-e};let l=await HS(u,t,n),c=0;for(let[,$]of l)c+=$.batches.length;let f=u.filter($=>$.stage!=="validation"),d=f.filter($=>l.has($.name)),p=f.filter($=>!l.has($.name));if(!t.quiet){h.sync(`Code Review: ${d.length} agent${d.length!==1?"s":""} (${c} batch${c!==1?"es":""} total)...`);for(let $ of p)h.plain(` \u2022 ${$.name}: skipped (no matching rules)`)}let m=!t.quiet&&!t.stream&&!t.verbose?new Ls:void 0,g=s.workflows?.review;if(m){if(g&&g.length>0)for(let $ of d){let P=l.get($.name);if(P)for(let[M,L]of g.entries()){let te=L.executor||s.executor,Se=L.model,we=`${$.name} (${te}${Se?`/${Se}`:""})`,Ce=`${$.name}-${M}`,G=P.ruleNames.slice(0,3).join(", "),pe=`${P.files} files | ${G}${P.rules>3?"...":""}`;m.addTask(Ce,we,P.batches.length,P.files,P.rules,pe)}}else for(let $ of d){let P=l.get($.name);if(P){let M=P.ruleNames.slice(0,3).join(", "),L=`${P.files} files | ${M}${P.rules>3?"...":""}`;m.addTask($.name,$.name,P.batches.length,P.files,P.rules,L)}}m.start()}let F;try{if(g&&g.length>0){t.quiet||h.info(`Workflow mode: ${d.length} agent${d.length!==1?"s":""} \xD7 ${g.length} run${g.length!==1?"s":""} = ${d.length*g.length} executions`);let $=[];for(let[P,M]of g.entries()){let L=M.executor||s.executor,te=M.model,Se=Ge.get(L);if(!Se){t.quiet||h.error(`Workflow executor not found: ${L}`);continue}t.quiet||h.info(` Workflow run ${P+1}/${g.length}: ${L}${te?` (model: ${te})`:""}`);let we=await Promise.all(d.map(async Ce=>{try{let G=l.get(Ce.name);if(!G)return h.warn(`Batch info not found for agent: ${Ce.name}`),null;let pe={...t,modelOverride:te||t.modelOverride},ue=`${Ce.name}-${P}`,Ke=await m0(Ce,Se,G,pe,a,m,ue);return t.issues.push(...Ke.issues),t.results.push(Ke),Ke}catch(G){let pe=G instanceof Error?G.message:String(G);t.quiet||h.error(`${Ce.name} (workflow: ${L}): ${pe}`);let ue={agent:Ce.name,executor:L,success:!1,output:"",error:pe,duration:0,issues:[]};return t.results.push(ue),ue}}));$.push(...we)}F=$}else F=await Promise.all(d.map(async $=>{try{let P=$.executor||s.executor,M=Ge.get(P);if(!M)return t.quiet||h.warn(`Executor not found: ${P}`),null;let L=l.get($.name);if(!L)return h.warn(`Batch info not found for agent: ${$.name}`),null;!t.quiet&&t.verbose&&L.batches.forEach(Se=>{h.plain(` ${f0(Se,!0)}`)});let te=await m0($,M,L,t,a,m);return t.issues.push(...te.issues),t.results.push(te),te}catch(P){let M=P instanceof Error?P.message:String(P);t.quiet||h.error(`${$.name}: ${M}`);let L={agent:$.name,executor:$.executor||"unknown",success:!1,output:"",error:M,duration:0,issues:[]};return t.results.push(L),L}}))}finally{m?.stop()}let y=F.filter($=>$?.success).length,C=F.filter($=>$&&!$.success),w=C.length,E=Date.now()-e,v=E>=1e3?`${(E/1e3).toFixed(1)}s`:`${E}ms`;if(t.quiet||h.done(`Review complete: ${y}/${d.length} agents (${v})`),w>0&&!t.quiet)for(let $ of C)h.warn(`Agent "${$?.agent}" failed: ${$?.error||"execution failed"} - issues from this agent excluded`);let B=y>0,A;return w>0&&(A=C.map(P=>`${P?.agent||"Unknown"}: ${P?.error||"execution failed"}`).filter(Boolean).join("; ")),{stageId:"review",stageName:"Review",success:B,duration:E,error:A}}}}H();function g0(){return{id:"aggregate-results",name:"Aggregate Results",description:"Collect results",enabled:!0,order:3,execute:async t=>{let e=Date.now(),s=t.results.filter(i=>i.success).length,n=t.results.filter(i=>!i.success).length;return t.quiet||h.sync(`Results: ${s} success, ${n} failed`),{stageId:"aggregate-results",stageName:"Aggregate Results",success:!0,duration:Date.now()-e}}}}H();var QS=80;function y0(){return{id:"confidence-filter",name:"Confidence Filter",description:"Filter issues by confidence threshold",enabled:!0,order:3.5,execute:async t=>{let e=Date.now(),s=t.minConfidence??QS,n=0,i=0,r=0;for(let a of t.results){let u=a.issues.length;n+=u,a.issues=a.issues.filter(l=>l.confidence===void 0?(r++,!0):l.confidence>=s),i+=u-a.issues.length}let o=n-i;return t.issues=t.results.flatMap(a=>a.issues),t.quiet||(n>0&&h.sync(`Confidence filter (>=${s}%): ${o} kept, ${i} filtered out`),r>0&&h.warn(`${r} issue(s) without confidence field bypassed filtering (backward compatibility)`)),{stageId:"confidence-filter",stageName:"Confidence Filter",success:!0,duration:Date.now()-e,output:{totalBefore:n,totalAfter:o,filteredOut:i,minConfidence:s}}}}}H();var XS=.6;function F0(t){let e=t.toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter(s=>s.length>2);return new Set(e)}function eA(t,e){if(t.size===0&&e.size===0)return 1;if(t.size===0||e.size===0)return 0;let s=0;for(let i of t)e.has(i)&&s++;let n=t.size+e.size-s;return s/n}function tA(t,e){if(t.file!==e.file||Math.min(Math.abs(t.lineStart-e.lineStart),Math.abs(t.lineEnd-e.lineEnd))>10)return!1;let n=F0(t.shortDescription),i=F0(e.shortDescription);return eA(n,i)>=XS}function w0(){return{id:"deduplication",name:"Deduplication",description:"Remove duplicate results and issues",enabled:!0,order:4,execute:async t=>{let e=Date.now(),s=t.results.flatMap(c=>c.issues),n=s.length,i=new Set,r=s.filter(c=>{let f=`${c.file}:${c.lineStart}:${c.lineEnd}`;return i.has(f)?!1:(i.add(f),!0)}),o=[];for(let c of r)o.some(d=>tA(d,c))||o.push(c);t.issues=o;let a=n-r.length,u=r.length-o.length,l=a+u;if(l>0&&!t.quiet){let c=[];a>0&&c.push(`${a} by location`),u>0&&c.push(`${u} by similarity`),h.sync(`Removed ${l} duplicate issue(s) (${c.join(", ")})`)}return{stageId:"deduplication",stageName:"Deduplication",success:!0,duration:Date.now()-e}}}}H();xn();Qe();_o();var x0=require("node:fs/promises"),sA=6,C0=50,nA=-40,iA=2e3,E0=`
|
|
310
|
+
... (diff truncated due to size) ...`,ji={FILE_EXACT_MATCH:40,FILE_PARTIAL_MATCH:30,LINE_OVERLAP:30,LINE_NEARBY:15,DESCRIPTION:30},Vc={MINIMUM_SCORE:40,LINE_TOLERANCE:5,LINE_EXTENDED_TOLERANCE:20},b0={name:"validation",description:"Validates issues found by other agents",systemPrompt:`You are a code review validation agent. Your task is to validate issues found by other agents and filter out false positives.
|
|
316
311
|
|
|
317
312
|
You may include your analysis and reasoning, but MUST include a JSON array of valid issues somewhere in your response.
|
|
318
|
-
Be strict but fair. Only filter out clear false positives.`,enabled:!0,order:999,executor:"claude-cli",executorSettings:{model:"opus",timeout:180}};async function
|
|
313
|
+
Be strict but fair. Only filter out clear false positives.`,enabled:!0,order:999,executor:"claude-cli",executorSettings:{model:"opus",timeout:180}};async function rA(t){return Dt(Ae.VALIDATION_PROMPT,async()=>{try{return(await At({projectPath:t})).find(n=>n.name==="validation"||n.stage==="validation")??b0}catch(e){return h.debug?.(`Failed to load validation agent: ${e instanceof Error?e.message:String(e)}`),b0}})}async function oA(){try{let t=$o("prompts","validation-instructions.md");return await(0,x0.readFile)(t,"utf-8")}catch(t){if(t instanceof Error&&"code"in t&&t.code==="ENOENT")h.warn("Validation instructions file not found (defaults/prompts/validation-instructions.md). Validation may produce lower quality results.");else{let s=t instanceof Error?t.message:String(t);h.warn(`Failed to load validation instructions (defaults/prompts/validation-instructions.md): ${s}`)}return""}}function aA(t){return t.map(e=>{let s=[`<issue id="${e.id}">`,`**[${e.severity.toUpperCase()}] ${e.category}** in \`${e.file}:${e.lineStart}-${e.lineEnd}\``,`Agent: ${e.agent}`,"",`**Problem:** ${e.shortDescription}`,"",e.fullDescription];return e.suggestion&&s.push("",`**Suggestion:** ${e.suggestion}`),s.push("</issue>"),s.join(`
|
|
319
314
|
`)}).join(`
|
|
320
315
|
|
|
321
|
-
`)}function
|
|
316
|
+
`)}function Wc(t){return t.replace(/\\/g,"/").replace(/^\.\//,"").toLowerCase()}function uA(t,e,s,n,i=Vc.LINE_TOLERANCE){return t<=n&&s<=e?!0:Math.abs(t-s)<=i||Math.abs(e-n)<=i||Math.abs(t-n)<=i||Math.abs(e-s)<=i}function lA(t,e,s){let n=0;if(!e.file)return 0;let i=s??Wc(t.file),r=Wc(e.file);if(i===r)n+=ji.FILE_EXACT_MATCH;else if(i.endsWith(r)||r.endsWith(i))n+=ji.FILE_PARTIAL_MATCH;else return 0;if(typeof e.lineStart=="number"){let o=e.lineEnd??e.lineStart;uA(t.lineStart,t.lineEnd,e.lineStart,o)?n+=ji.LINE_OVERLAP:Math.abs(t.lineStart-e.lineStart)<=Vc.LINE_EXTENDED_TOLERANCE&&(n+=ji.LINE_NEARBY)}if(e.shortDescription&&t.shortDescription){let a=new Set(t.shortDescription.toLowerCase().split(/\W+/).filter(f=>f.length>=3)),u=new Set(e.shortDescription.toLowerCase().split(/\W+/).filter(f=>f.length>=3)),c=[...a].filter(f=>u.has(f)).length/Math.max(a.size,u.size,1);n+=Math.round(c*ji.DESCRIPTION)}return n}var cA=t=>{let e=t.match(/<json_output>\s*([\s\S]*?)\s*<\/json_output>/);if(!e?.[1])return null;try{let s=JSON.parse(e[1]);if(!s.issues&&!s.filtered_issues)return null;let n=(s.issues||[]).filter(r=>typeof r.id=="number").map(r=>({id:r.id,confidence:typeof r.confidence=="number"?r.confidence:100})),i=(s.filtered_issues||[]).filter(r=>typeof r.id=="number").map(r=>({id:r.id,confidence:typeof r.confidence=="number"?r.confidence:0,reason:r.reason||"No reason provided"}));return{validatedIssues:n,filteredIssues:i}}catch(s){return h.debug?.(`Failed to parse JSON output format: ${s instanceof Error?s.message:String(s)}`),null}},fA=t=>{let e=t.match(/<valid-ids>\s*(\[[\s\S]*?\])\s*<\/valid-ids>/);if(!e?.[1])return null;try{let s=JSON.parse(e[1]);return!Array.isArray(s)||!s.every(i=>typeof i=="number")?null:{validatedIssues:s.map(i=>({id:i,confidence:100})),filteredIssues:[]}}catch(s){return h.debug?.(`Failed to parse legacy IDs format: ${s instanceof Error?s.message:String(s)}`),null}},dA=t=>{let e=t.match(/\[\s*(\d+\s*(?:,\s*\d+\s*)*)\]/);if(!e?.[1])return null;try{let s=JSON.parse(`[${e[1]}]`);if(!Array.isArray(s))return null;let n=s.filter(r=>typeof r=="number");return n.length===0?null:{validatedIssues:n.map(r=>({id:r,confidence:100})),filteredIssues:[]}}catch(s){return h.debug?.(`Failed to parse fallback array format: ${s instanceof Error?s.message:String(s)}`),null}},hA=(t,e)=>{if(!e||e.length===0)return null;let s=t.match(/<json>\s*([\s\S]*?)\s*<\/json>/);if(!s?.[1])return null;try{let n=JSON.parse(s[1]);if(!Array.isArray(n)||n.length===0)return null;let i=new Map;for(let a of e)i.set(a.id,Wc(a.file));let r=new Set;for(let a of n){let u=null,l=0;for(let c of e){if(r.has(c.id))continue;let f=i.get(c.id),d=lA(c,a,f);d>l&&d>=Vc.MINIMUM_SCORE&&(l=d,u=c)}u&&r.add(u.id)}return r.size===0?null:{validatedIssues:Array.from(r).map(a=>({id:a,confidence:100})),filteredIssues:[]}}catch(n){return h.debug?.(`Failed to parse fuzzy match format: ${n instanceof Error?n.message:String(n)}`),null}};function pA(t,e){let s=[cA,fA,dA,hA];for(let n of s){let i=n(t,e);if(i!==null)return i}return{validatedIssues:[],filteredIssues:[]}}function mA(t,e,s){let n=t.executor||s,i=Fn(n);return!i||!i.enabled?(e.quiet||h.warn(`Validation executor '${n}' not found or disabled, skipping validation`),null):t.executorSettings&&i.applySettings?i.applySettings(t.executorSettings):i.getInfo()}function DA(t,e){if(t.length<=e)return t;let s=Math.floor((e-E0.length)/2),n=t.slice(0,s),i=t.slice(-s);return n+E0+i}function gA(t,e,s,n,i){let r=aA(t),o=e.metadata.repository,a=e.metadata.commitMessages?.length?["","## Commit Messages (IMPORTANT: Check these to understand change intent!)","These messages explain WHY the changes were made. Use them to identify INTENTIONAL trade-offs.","",...e.metadata.commitMessages.map((D,m)=>`### Commit ${m+1}:
|
|
322
317
|
${D}`)].join(`
|
|
323
318
|
`):null,u=["# Repository Context",`Base path: ${o}`,"All file paths below are relative to this directory.","When using tools to read files, prepend this base path to get absolute paths.","","## Project Documentation (Check for intentional design decisions!)","- CLAUDE.md: May contain architectural decisions, development patterns, and coding conventions","- README.md: May explain project goals, design philosophy, and key trade-offs","- Code comments: Inline explanations often justify complexity or performance trade-offs","","Before flagging an issue as valid, use the Read tool to check these files for relevant context.",e.metadata.baseRef?`Base ref: ${e.metadata.baseRef}`:null,e.metadata.headRef?`Head ref: ${e.metadata.headRef}`:null,a].filter(Boolean).join(`
|
|
324
|
-
`),l=new Set(t.map(D=>D.file)),c=e.diffs.filter(D=>l.has(D.file)),f=c.length>0?["","## Changed Files (diffs for context)","These are the actual changes being reviewed. Use these to verify issues.","",...c.map(D=>{let m=
|
|
319
|
+
`),l=new Set(t.map(D=>D.file)),c=e.diffs.filter(D=>l.has(D.file)),f=c.length>0?["","## Changed Files (diffs for context)","These are the actual changes being reviewed. Use these to verify issues.","",...c.map(D=>{let m=DA(D.diff,iA);return`File: ${D.file}
|
|
325
320
|
${m}`})].join(`
|
|
326
321
|
`):"",d=`${u}${f}
|
|
327
322
|
|
|
@@ -331,34 +326,34 @@ ${i}
|
|
|
331
326
|
|
|
332
327
|
${r}`,p=s.systemPrompt;return n&&(p=`${p}
|
|
333
328
|
|
|
334
|
-
${n}`),{input:d,systemPrompt:p}}function
|
|
335
|
-
Validation prompt${o?` (batch ${i+1}/${r})`:""}:`),h.plain(` Executor: ${e.name}`),h.plain(` Issues to validate: ${s.length}`),h.plain("\u2500".repeat(80)),h.plain(n.slice(0,2e3)+(n.length>2e3?"...":"")),h.plain("\u2500".repeat(80)),h.newline()}function
|
|
329
|
+
${n}`),{input:d,systemPrompt:p}}function yA(t,e,s,n,i,r){if(!t.verbose||t.quiet)return;let o=r>1;h.plain(`
|
|
330
|
+
Validation prompt${o?` (batch ${i+1}/${r})`:""}:`),h.plain(` Executor: ${e.name}`),h.plain(` Issues to validate: ${s.length}`),h.plain("\u2500".repeat(80)),h.plain(n.slice(0,2e3)+(n.length>2e3?"...":"")),h.plain("\u2500".repeat(80)),h.newline()}function FA(t,e){let s=t instanceof Error?t.message:String(t);return{success:!1,data:[],validatedIssues:[],filteredIssues:[],error:s,duration:e}}function v0(t,e,s,n){let i;return s==="low-confidence"?i=`Low validation confidence (${e}%, threshold: ${n.threshold}%)`:i=`Confidence delta too negative (${n.delta}, original: ${n.originalConfidence}%, validated: ${e}%)`,{id:t,confidence:e,reason:i}}async function wA(t,e){let s=Date.now();try{let n=await t(),i=Date.now()-s;return n.success?e.completeBatch("validation"):e.failTask("validation"),{success:n.success,data:n.data,validatedIssues:n.validatedIssues,filteredIssues:n.filteredIssues,error:n.error,duration:i}}catch(n){let i=Date.now()-s;return e.failTask("validation"),FA(n,i)}}async function CA(t,e,s,n,i){let r=await sa({label:"Validating",batchIndex:n,totalBatches:i,itemCount:s.length,itemName:"issue"},e.quiet??!1,async()=>{let o=await t();return{success:o.success,data:{validIds:o.data,validatedIssues:o.validatedIssues,filteredIssues:o.filteredIssues},error:o.error}},(o,a)=>i>1?`Validated batch ${n+1}/${i} (${o.validIds.length} valid, ${a}ms)`:`Validated ${o.validIds.length} issue(s) (${a}ms)`,o=>i>1?`Validation failed (batch ${n+1}): ${o}`:`Validation failed: ${o}`);return{success:r.success,data:r.data?.validIds??[],validatedIssues:r.data?.validatedIssues??[],filteredIssues:r.data?.filteredIssues??[],error:r.error,duration:r.duration}}async function EA(t,e,s,n,i,r,o,a,u){u&&e===0&&u.startTask("validation");let{input:l,systemPrompt:c}=gA(t,r,n,o,a),f={agent:n,executor:i,input:l,systemPrompt:c,verbose:r.verbose,quiet:r.quiet,cwd:r.metadata.repository,modelOverride:r.modelOverride};yA(r,i,t,l,e,s);let d=async()=>{let p=await Ge.executeAgent(f);if(!p.success)return{success:!1,data:[],validatedIssues:[],filteredIssues:[],error:p.error};let D=pA(p.output,t);return{success:!0,data:D.validatedIssues.map(m=>m.id),validatedIssues:D.validatedIssues,filteredIssues:D.filteredIssues}};return u?wA(d,u):CA(d,r,t,e,s)}function S0(){return{id:"validation",name:"Validation",description:"Validate issues and filter out false positives",enabled:!0,order:5,execute:async t=>{let e=Date.now();if(t.skipValidation)return t.quiet||h.sync("Skipping validation (--skip-validation)"),{stageId:"validation",stageName:"Validation",success:!0,duration:Date.now()-e};let s=t.issues;if(s.length===0)return t.quiet||h.sync("No issues to validate"),{stageId:"validation",stageName:"Validation",success:!0,duration:Date.now()-e};let n=s.map((v,B)=>({...v,id:B+1}));if(!t.config){let v="Pipeline context config not initialized";return h.error(v),{stageId:"validation",stageName:"Validation",success:!1,duration:0,error:v}}let i=t.config,[r,o,a]=await Promise.all([rA(t.metadata.repository),fr(),oA()]),u=i.workflows?.validation,l=i.executor,c=t.modelOverride;if(u&&u.length>0){let v=u[u.length-1];v&&(l=v.executor||i.executor,c=v.model||t.modelOverride),t.quiet||h.info(`Workflow mode: using ${l}${c?` (model: ${c})`:""} for validation`)}let f=l,p=(i.executors?.[f]||{}).validation||{},D=p.batchSize??sA,m=p.concurrency??t.concurrency,g=mA(r,t,f);if(!g)return{stageId:"validation",stageName:"Validation",success:!0,duration:Date.now()-e};let F=c?{...t,modelOverride:c}:t,y=d0(n,D),C=g.type==="llm-api"||g.type==="cli"?g.model:void 0;t.quiet||(h.sync(`Validating ${s.length} issue(s)...`),t.verbose&&h.plain(` Executor: ${g.name}${C?` (model: ${C})`:""}`));let E=!t.quiet&&!t.stream&&!t.verbose?new Ls:void 0;E&&(E.addTask("validation","Validation",y.length,s.length,1,`${s.length} issues`),E.start());try{let v,B=Bs(m);if(v=await Promise.all(y.map((G,pe)=>B(()=>EA(G,pe,y.length,r,g,F,o,a,E)))),E?.stop(),!h0(v)){let G=p0(v),pe=ta(G.map(ue=>ue.error));return{stageId:"validation",stageName:"Validation",success:!1,duration:Date.now()-e,error:pe}}let A=v.flatMap(G=>G.validatedIssues),$=v.flatMap(G=>G.filteredIssues),P=new Set,M=[],L=new Map(n.map(G=>[G.id,G]));for(let G of A){let ue=L.get(G.id)?.confidence??100,Ke=G.confidence-ue;G.confidence<C0?M.push(v0(G.id,G.confidence,"low-confidence",{threshold:C0})):Ke<nA?M.push(v0(G.id,G.confidence,"negative-delta",{delta:Ke,originalConfidence:ue})):P.add(G.id)}let te=[...$,...M];t.issues=n.filter(G=>P.has(G.id));let Se=P.size,we=s.length-Se,Ce=Date.now()-e;if(!t.quiet){let G=M.length,pe=$.length;if(G>0?h.done(`Validation complete: ${Se} valid, ${pe} filtered by validator, ${G} filtered by delta (${Ce}ms)`):h.done(`Validation complete: ${Se} valid, ${we} filtered out (${Ce}ms)`),t.verbose&&te.length>0){h.newline(),h.plain("Filtered issues:");for(let ue of te){let Ke=L.get(ue.id);Ke?h.plain(` [${ue.id}] ${Ke.file}:${Ke.lineStart} \u2014 ${ue.reason}`):h.plain(` [${ue.id}] \u2014 ${ue.reason}`)}}}return{stageId:"validation",stageName:"Validation",success:!0,duration:Ce,output:{validCount:Se,filteredCount:we,filteredIssues:te,deltaFilteredCount:M.length}}}catch(v){E?.stop();let B=v instanceof Error?v.message:String(v);return t.quiet||h.error(`Validation error: ${B}`),{stageId:"validation",stageName:"Validation",success:!1,duration:Date.now()-e,error:B}}}}}function A0(){return[VD(),zD(),D0(),g0(),y0(),w0(),S0()]}Qe();var na=class{agents=[];executors=new Map;stages=[];constructor(e=[],s=[],n){this.agents=[...e].sort((i,r)=>i.order-r.order);for(let i of s)this.executors.set(i.name,i),Ge.registerExecutor(i);for(let i of e)mn.register(i);this.stages=n||A0()}addAgent(e){this.agents.push(e),this.agents.sort((s,n)=>s.order-n.order),mn.register(e)}removeAgent(e){this.agents=this.agents.filter(s=>s.name!==e),mn.remove(e)}getAgents(){return this.agents}getEnabledAgents(){return this.agents.filter(e=>e.enabled)}addExecutor(e){this.executors.set(e.name,e),Ge.registerExecutor(e)}getExecutor(e){return this.executors.get(e)}async execute(e,s={}){let{verbose:n=!1,quiet:i=!1,concurrency:r=3,skipValidation:o=!1,stream:a=!1,baseRef:u,headRef:l,ruleFilter:c,excludeRules:f,agentFilter:d,excludeAgents:p,minConfidence:D,modelOverride:m}=s,g=Date.now(),F=process.cwd(),y=await Ee(F),C=[];u&&l&&(C=await Xf(u,l),n&&C.length>0&&h.plain(`Fetched ${C.length} commit message(s) for context`));let w={diffs:e,results:[],issues:[],metadata:{timestamp:Date.now(),repository:F,baseRef:u,headRef:l,commitMessages:C.length>0?C:void 0},verbose:n,quiet:i,stream:a,concurrency:r,ruleFilter:c,excludeRules:f,agentFilter:d,excludeAgents:p,skipValidation:o,minConfidence:D,modelOverride:m,config:y},E=[];for(let B of this.stages)if(B.enabled)try{let A=await B.execute(w);if(E.push(A),!A.success){h.error(`Stage ${B.name} failed: ${A.error}`);break}}catch(A){let $=A instanceof Error?A.message:String(A);h.error(`Stage ${B.name} failed: ${$}`),E.push({stageId:B.id,stageName:B.name,success:!1,duration:0,error:$});break}let v=Date.now()-g;return{success:E.every(B=>B.success),context:w,totalDuration:v,stages:E}}};H();_s();var k0=require("node:child_process");Qe();H();async function $0(t){let e=t||process.cwd(),s=await Ee(e),n=Xa(),i=In(e),r=await eu(),o=await cr(e);h.plain(`Configuration
|
|
336
331
|
`),h.plain(`Global: ${n}${r?"":" (not found)"}`),h.plain(`Project: ${i}${o?"":" (not found)"}`),h.plain(`
|
|
337
332
|
Merged config:
|
|
338
|
-
`),h.plain(JSON.stringify(s,null,2))}async function
|
|
339
|
-
Edit the file to override global settings.`)}async function
|
|
333
|
+
`),h.plain(JSON.stringify(s,null,2))}async function _0(t){let e=t||process.cwd();if(await cr(e)){h.warn("Project config already exists"),h.plain(`Location: ${In(e)}`);return}let n=await bd(e);h.success("Project config created"),h.plain(`Location: ${n}`),h.plain(`
|
|
334
|
+
Edit the file to override global settings.`)}async function B0(t){let e=process.env.EDITOR||"nano",s;if(t.global)s=Xa(),await eu()||(h.warn("Global config does not exist. Creating with defaults..."),await Ed(Qa()));else{let i=t.projectPath||process.cwd();if(!await cr(i)){h.warn("Project config does not exist. Run `diffray config init` first.");return}s=In(i)}h.info(`Opening ${s} in ${e}...`);let n=(0,k0.spawnSync)(e,[s],{stdio:"inherit"});n.error&&(h.error(`Failed to open editor: ${n.error.message}`),process.exit(1))}var T0={meta:{name:"config",description:"Manage configuration"},subCommands:{show:{meta:{description:"Show merged configuration (defaults + global + project)"},run:async()=>{await $0()}},init:{meta:{description:"Initialize project config (.diffray.json)"},run:async()=>{await _0()}},edit:{meta:{description:"Edit configuration in $EDITOR"},args:{global:{type:"boolean",description:"Edit global config (~/.diffray/config.json)",alias:"g"}},run:async({args:t})=>{await B0({global:t.global})}}}};H();function bA(t){return!t||Object.keys(t).length===0?"-":Object.entries(t).map(([e,s])=>`${e}=${s}`).join(", ")}async function I0(){let t=await At(process.cwd());if(h.robot("Available Agents"),h.newline(),t.length===0){h.plain("No Agents configured");return}for(let e of t){let s=e.enabled?"\u25CF":"\u25CB",n=e.stage||"review",i=Sn(e.path);h.plain(`${s} ${e.name} (${n})`),h.plain(` executor: ${e.executor}`),e.executorSettings&&Object.keys(e.executorSettings).length>0&&h.plain(` settings: ${bA(e.executorSettings)}`),h.plain(` path: ${i}`),h.newline()}}async function R0(t){let s=(await At(process.cwd())).find(n=>n.name===t);if(s||(h.error(`Agent not found: ${t}`),process.exit(1)),h.robot(`Agent: ${s.name}`),h.newline(),h.plain(`Description: ${s.description}`),h.plain(`Enabled: ${s.enabled?"Yes":"No"}`),h.plain(`Order: ${s.order}`),h.plain(`Stage: ${s.stage||"review"}`),h.plain(`Executor: ${s.executor}`),h.plain(`Path: ${Sn(s.path)}`),s.executorSettings&&Object.keys(s.executorSettings).length>0){h.newline(),h.plain("Executor Settings:");for(let[n,i]of Object.entries(s.executorSettings))h.plain(` ${n}: ${i}`)}h.newline(),h.plain("System Prompt:"),h.separator("\u2500"),h.plain(s.systemPrompt||"(no prompt)"),h.separator("\u2500")}var N0={meta:{name:"agents",description:`List agents or show agent details
|
|
340
335
|
|
|
341
336
|
Examples:
|
|
342
337
|
diffray agents # List all agents
|
|
343
338
|
diffray agents validation # Show validation agent details
|
|
344
|
-
diffray agents general # Show general agent details`},args:{name:{type:"positional",description:"Agent name (optional, shows details if provided)",required:!1}},run:async({args:t})=>{t.name?await
|
|
339
|
+
diffray agents general # Show general agent details`},args:{name:{type:"positional",description:"Agent name (optional, shows details if provided)",required:!1}},run:async({args:t})=>{t.name?await R0(t.name):await I0()}};var P0=require("node:child_process");Qe();H();function vA(t){return t.type==="cli"?t.installCommand:void 0}function xA(t){try{return(0,P0.execFileSync)("which",[t],{stdio:"ignore"}),!0}catch{return!1}}function SA(t){return t.type==="llm-api"||t.type==="cli"?t.model:void 0}function AA(t){let e=Fn(t);if(!e?.settingsSchema)return[];let s=e.settingsSchema;return"shape"in s&&typeof s.shape=="object"?Object.keys(s.shape):[]}async function O0(){let t=await Ee(process.cwd()),e=t.executor,s=t.executors[e]||{};h.plain(`Executor: \x1B[36m${e}\x1B[0m`),h.newline(),h.plain("Stages:");let n=["review","validation"];for(let i of n){let r=s[i],o=[];r?.model&&o.push(`model=${r.model}`),r?.timeout&&o.push(`timeout=${r.timeout}`);let a=o.length>0?` (${o.join(", ")})`:"";h.plain(` ${i.padEnd(12)} \u2192 ${e}${a}`)}h.newline()}async function L0(t){let e=await Li(),s=e.find(i=>i.name===t);if(!s){h.error(`Executor not found: ${t}`),h.newline(),h.plain("Available executors:");for(let i of e)h.plain(` \u2022 ${i.name}`);process.exit(1)}if(h.robot(`Executor: ${s.name}`),h.newline(),h.plain(`Type: ${s.type}`),h.plain(`Description: ${s.description}`),s.type==="cli"&&s.command){let i=s.command,r=xA(i);if(h.plain(`Command: ${i} ${r?"\x1B[32m\u2713\x1B[0m":"\x1B[33m\u2717 not installed\x1B[0m"}`),!r){let a=vA(s);a&&h.plain(`Install: ${a}`)}h.plain(`Args: ${s.args?.join(" ")||"(none)"}`);let o=SA(s);o&&h.plain(`Model: ${o}`),h.plain(`Timeout: ${s.timeout||60}s`)}else s.type==="llm-api"&&(h.plain(`Provider: ${s.provider}`),h.plain(`Model: ${s.model}`),h.plain(`Temperature: ${s.temperature??.7}`),h.plain(`Max Tokens: ${s.maxTokens??4096}`));if(s.type==="cli"&&s.env){h.newline(),h.plain("Environment Variables:");for(let[i,r]of Object.entries(s.env)){let o=i.includes("KEY")||i.includes("TOKEN")?String(r).substring(0,8)+"...":r;h.plain(` ${i}: ${o}`)}}let n=AA(t);if(n.length>0){h.newline(),h.plain("Stage Settings (in config.executors.<executor>.<stage>):");for(let i of n)h.plain(` \u2022 ${i}`)}}var M0={meta:{name:"executors",description:`List executors or show executor details
|
|
345
340
|
|
|
346
341
|
Examples:
|
|
347
342
|
diffray executors # List all executors
|
|
348
343
|
diffray executors claude-cli # Show claude-cli executor details
|
|
349
|
-
diffray executors cerebras-api # Show cerebras-api executor details`},args:{name:{type:"positional",description:"Executor name (optional, shows details if provided)",required:!1}},run:async({args:t})=>{t.name?await
|
|
344
|
+
diffray executors cerebras-api # Show cerebras-api executor details`},args:{name:{type:"positional",description:"Executor name (optional, shows details if provided)",required:!1}},run:async({args:t})=>{t.name?await L0(t.name):await O0()}};_s();H();function kA(t){switch(t){case"defaults":return"\u25C6";case"extends":return"\u25C9";case"user":return"\u25C7";case"project":return"\u25CF";default:return"?"}}async function j0(){let t=await Xt();if(t.length===0){h.warn("No rules configured");return}h.robot("Rules"),h.newline();for(let e of t){let s=kA(e.source),n=Sn(e.path);h.plain(`${s} ${e.name}`),h.plain(` agent: ${e.agent}`),h.plain(` patterns: ${e.patterns.join(", ")}`),h.plain(` path: ${n}`),h.newline()}h.plain("\u25C6 defaults \u25C9 extends \u25C7 user \u25CF project")}async function q0(t){let{loadRuleFromRef:e}=await Promise.resolve().then(()=>(_s(),WD)),n=(await Xt()).find(r=>r.name===t);n||(h.error(`Rule not found: ${t}`),process.exit(1));let i=await e(n);i||(h.error(`Failed to load rule content from: ${n.path}`),process.exit(1)),h.robot(`Rule: ${i.name}`),h.newline(),h.plain(`Source: ${n.source}`),h.plain(`Path: ${n.path}`),h.plain(`Description: ${i.description}`),h.plain(`Patterns: ${i.patterns.join(", ")}`),h.plain(`Agent: ${i.agent}`),i.prompt&&(h.newline(),h.plain("Prompt:"),h.separator("\u2500"),h.plain(i.prompt),h.separator("\u2500"))}async function U0(t,e){let n=(await Xt()).find(o=>o.name===t);n||(h.error(`Rule not found: ${t}`),process.exit(1)),h.robot(`Testing rule: ${n.name}`),h.plain(`Patterns: ${n.patterns.join(", ")}`),h.newline();let i=[],r=[];for(let o of e)n.patterns.some(u=>es(o,u))?i.push(o):r.push(o);h.success(`Matched ${i.length} file(s):`);for(let o of i)h.plain(` \u25CF ${o}`);if(r.length>0){h.newline(),h.plain(`Not matched ${r.length} file(s):`);for(let o of r)h.plain(` \u25CB ${o}`)}}var W0={meta:{name:"rules",description:`List rules or show rule details
|
|
350
345
|
|
|
351
346
|
Examples:
|
|
352
347
|
diffray rules # List all rules
|
|
353
348
|
diffray rules code-security # Show rule details
|
|
354
|
-
diffray rules test code-security src/*.ts # Test rule pattern matching`},args:{name:{type:"positional",description:'Rule name or "test" subcommand',required:!1},rest:{type:"positional",description:"For test: <rule-name> <files...>",required:!1}},run:async({args:t})=>{if(t.name==="test"){let e=t._||[],s=e[0],n=e.slice(1);(!s||n.length===0)&&(console.error("Usage: diffray rules test <rule-name> <files...>"),process.exit(1)),await
|
|
349
|
+
diffray rules test code-security src/*.ts # Test rule pattern matching`},args:{name:{type:"positional",description:'Rule name or "test" subcommand',required:!1},rest:{type:"positional",description:"For test: <rule-name> <files...>",required:!1}},run:async({args:t})=>{if(t.name==="test"){let e=t._||[],s=e[0],n=e.slice(1);(!s||n.length===0)&&(console.error("Usage: diffray rules test <rule-name> <files...>"),process.exit(1)),await U0(s,n)}else t.name?await q0(t.name):await j0()}};Qe();H();hc();No();yc();Ec();Mo();async function V0(t={}){let e=t.projectPath||process.cwd(),s;if(t.url?s=[t.url]:s=(await Ee(e)).extends,s.length===0){h.info("No extends configured. Add extends to .diffray.json:"),h.info(' { "extends": ["https://github.com/owner/repo"] }'),h.info("Or install directly: diffray extends install https://github.com/owner/repo");return}h.info(`Installing ${s.length} extension(s)...`),h.info("");let n=Bs(4),i=s.map(l=>n(async()=>{let c=To(l);if(!c)return h.error(`Invalid git URL: ${l}`),h.info(" Expected format: https://github.com/owner/repo or git@host:owner/repo"),h.info(" Optional ref: https://github.com/owner/repo#v1.0"),{status:"error",displayRef:l};let f=Io(c),d=c.ref?`${f}#${c.ref}`:f;if(!t.force&&await Po(l))return h.info(` ${d} - already installed`),{status:"skipped",displayRef:d};try{h.info(` ${d} - cloning...`);let p=mc(c,l),D=await Fc(p),m=await wc(p.localPath);return await Dc(l,{url:c.url,ref:c.ref,resolvedRef:D,downloadedAt:new Date().toISOString(),path:p.localPath,agents:m.agents,rules:m.rules}),h.success(` ${d} - installed (${m.agents.length} agents, ${m.rules.length} rules)`),{status:"success",displayRef:d}}catch(p){let D=p instanceof Error?p.message:String(p);return h.error(` ${d} - failed: ${D}`),{status:"error",displayRef:d,message:D}}})),r=await Promise.all(i),o=r.filter(l=>l.status==="success").length,a=r.filter(l=>l.status==="skipped").length,u=r.filter(l=>l.status==="error").length;if(t.url&&o>0){let l=t.global?"global":"project";await vd(t.url,!!t.global,e),h.success(`Added to ${l} config`)}h.info(""),h.info(`Done: ${o} installed, ${a} skipped, ${u} failed`)}async function z0(){let t=await St(),e=Object.entries(t.packages);if(e.length===0){h.info("No extends installed."),h.info("Run `diffray extends install` to install extends from config.");return}h.info(`Installed extends (${e.length}):`),h.info("");for(let[s,n]of e){let i=n.agents.length,r=n.rules.length,o=n.resolvedRef.slice(0,7);h.info(` ${s}`),h.info(` Commit: ${o}`),h.info(` Agents: ${i>0?n.agents.join(", "):"(none)"}`),h.info(` Rules: ${r>0?n.rules.join(", "):"(none)"}`),h.info(` Downloaded: ${n.downloadedAt}`),h.info("")}}async function G0(t){let e=To(t);if(!e){h.error(`Invalid git URL: ${t}`);return}if(!await Po(t)){h.error(`Extension not installed: ${t}`);return}let n=(await St()).packages[t];if(n){await Cc(n.path),await gc(t);let i=Io(e);h.success(`Removed: ${i}`)}}var K0={meta:{name:"extends",description:`Manage extends (external agents and rules from git)
|
|
355
350
|
|
|
356
351
|
Examples:
|
|
357
352
|
diffray extends install # Install from config
|
|
358
353
|
diffray extends install https://github.com/org/repo # Install specific URL
|
|
359
354
|
diffray extends install --force # Force re-clone
|
|
360
355
|
diffray extends list # List installed
|
|
361
|
-
diffray extends remove https://github.com/org/repo # Remove`},subCommands:{install:{meta:{description:"Install extends from config or specific URL"},args:{url:{type:"positional",description:"Git URL to install (optional, reads from config if not provided)",required:!1},force:{type:"boolean",description:"Force re-download even if already installed",alias:"f"},global:{type:"boolean",description:"Add to global config (~/.diffray/config.json) instead of project",alias:"g"}},run:async({args:t})=>{await
|
|
356
|
+
diffray extends remove https://github.com/org/repo # Remove`},subCommands:{install:{meta:{description:"Install extends from config or specific URL"},args:{url:{type:"positional",description:"Git URL to install (optional, reads from config if not provided)",required:!1},force:{type:"boolean",description:"Force re-download even if already installed",alias:"f"},global:{type:"boolean",description:"Add to global config (~/.diffray/config.json) instead of project",alias:"g"}},run:async({args:t})=>{await V0({force:t.force,url:t.url,global:t.global})}},list:{meta:{description:"List installed extends"},run:async()=>{await z0()}},remove:{meta:{description:"Remove an installed extend"},args:{ref:{type:"positional",description:"Git URL (e.g., https://github.com/owner/repo)",required:!0}},run:async({args:t})=>{if(!t.ref)throw new Error("Extend reference is required");await G0(t.ref)}}}};var ht=require("node:fs/promises"),Y0=require("node:os"),Ts=require("node:path"),H0=require("node:child_process"),J0=require("node:util");H();var $A=(0,J0.promisify)(H0.execFile),_A="diffray.md",BA="diffray-create-rule.md";async function Z0(t){try{return await $A(t,["--version"]),!0}catch{return!1}}var TA=`---
|
|
362
357
|
description: Run AI-powered code review with diffray
|
|
363
358
|
---
|
|
364
359
|
|
|
@@ -435,7 +430,7 @@ After running the command, summarize the results:
|
|
|
435
430
|
3. Key recommendations
|
|
436
431
|
|
|
437
432
|
If issues are found, offer to help fix them.
|
|
438
|
-
`,
|
|
433
|
+
`,IA=`---
|
|
439
434
|
description: Create a new diffray rule interactively
|
|
440
435
|
---
|
|
441
436
|
|
|
@@ -561,16 +556,16 @@ Verified with diffray rules:
|
|
|
561
556
|
|
|
562
557
|
You can test it with: diffray review --rule zod-validation
|
|
563
558
|
\`\`\`
|
|
564
|
-
`,
|
|
565
|
-
${r.name}:`),!await
|
|
566
|
-
${s.name}:`),h.success(` ${i.commandName}: Removed`),e++,n++}catch(o){h.error(` ${i.commandName}: Failed to remove: ${o.message}`)}}}e===0?h.info("No installations found"):(h.newline(),h.success(`Removed ${e} command file(s)`))}async function
|
|
567
|
-
`);let e=await Promise.all(t.map(async s=>{let n=await
|
|
559
|
+
`,ia=[{filename:_A,template:TA,commandName:"/diffray"},{filename:BA,template:IA,commandName:"/diffray-create-rule"}];function zc(){let t=(0,Y0.homedir)();return[{name:"Claude Code",path:(0,Ts.join)(t,".claude","commands"),cliCommand:"claude",installUrl:"https://claude.ai/code"},{name:"Cursor Agent",path:(0,Ts.join)(t,".cursor","commands"),cliCommand:"cursor-agent",installUrl:"https://cursor.com"},{name:"OpenCode",path:(0,Ts.join)(t,".config","opencode","commands"),cliCommand:"opencode",installUrl:"https://opencode.ai"}]}async function ra(t){try{return await(0,ht.access)(t),!0}catch{return!1}}async function Q0(t={}){let e=zc(),n=(await Promise.all(e.map(async r=>({target:r,available:await Z0(r.cliCommand)})))).filter(r=>r.available).map(r=>r.target);if(n.length===0){h.error("No supported CLI tools found"),h.newline(),h.plain("diffray commands require one of the following CLI tools:"),h.newline();for(let r of e)h.plain(` ${r.name} (${r.cliCommand})`),h.plain(` Install: ${r.installUrl}`);h.newline(),h.plain("After installing, run: diffray setup-command");return}let i=0;for(let r of n){if(h.plain(`
|
|
560
|
+
${r.name}:`),!await ra(r.path))try{await(0,ht.mkdir)(r.path,{recursive:!0})}catch(o){h.error(` Failed to create directory: ${o.message}`);continue}for(let o of ia){let a=(0,Ts.join)(r.path,o.filename);if(await ra(a)&&!t.force)try{if(await(0,ht.readFile)(a,"utf-8")===o.template){h.info(` ${o.commandName}: Already installed (up to date)`);continue}h.warn(` ${o.commandName}: Already exists, use --force to overwrite`);continue}catch(u){h.error(` ${o.commandName}: Failed to read: ${u.message}`);continue}try{await(0,ht.writeFile)(a,o.template,"utf-8"),h.success(` ${o.commandName}: Installed`),i++}catch(u){h.error(` ${o.commandName}: Failed to install: ${u.message}`)}}}if(i>0){h.newline();let r=ia.map(o=>o.commandName).join(", ");h.success(`Done! Available commands: ${r}`)}}async function X0(){let t=zc(),e=0;for(let s of t){let n=0;for(let i of ia){let r=(0,Ts.join)(s.path,i.filename);if(await ra(r))try{await(0,ht.unlink)(r),n===0&&h.plain(`
|
|
561
|
+
${s.name}:`),h.success(` ${i.commandName}: Removed`),e++,n++}catch(o){h.error(` ${i.commandName}: Failed to remove: ${o.message}`)}}}e===0?h.info("No installations found"):(h.newline(),h.success(`Removed ${e} command file(s)`))}async function ey(){let t=zc();h.plain(`Installation Status
|
|
562
|
+
`);let e=await Promise.all(t.map(async s=>{let n=await Z0(s.cliCommand),i=await Promise.all(ia.map(async r=>{let o=(0,Ts.join)(s.path,r.filename);return{cmdFile:r,commandPath:o,exists:await ra(o)}}));return{target:s,cliAvailable:n,commandStatuses:i}}));for(let{target:s,cliAvailable:n,commandStatuses:i}of e){if(h.plain(`${s.name}:`),!n){h.plain(` CLI not found (${s.cliCommand})`),h.plain(` Install: ${s.installUrl}`),h.newline();continue}for(let{cmdFile:o,exists:a}of i)a?h.success(` ${o.commandName}: Installed`):h.warn(` ${o.commandName}: Not installed`);i.every(o=>o.exists)||h.plain(" Run: diffray setup-command"),h.newline()}}var Gc={meta:{name:"setup-command",description:`Install /diffray command for Claude Code, Cursor Agent, OpenCode, and other editors
|
|
568
563
|
|
|
569
564
|
Examples:
|
|
570
565
|
diffray setup-command # Install command
|
|
571
566
|
diffray setup-command --force # Overwrite existing
|
|
572
567
|
diffray setup-command status # Show installation status
|
|
573
|
-
diffray setup-command remove # Remove command from all tools`},args:{force:{type:"boolean",description:"Overwrite existing installation",alias:"f"}},subCommands:{status:{meta:{description:"Show installation status"},run:async()=>{await
|
|
568
|
+
diffray setup-command remove # Remove command from all tools`},args:{force:{type:"boolean",description:"Overwrite existing installation",alias:"f"}},subCommands:{status:{meta:{description:"Show installation status"},run:async()=>{await ey()}},remove:{meta:{description:"Remove /diffray command from all tools"},run:async()=>{await X0()}}},run:async({args:t,rawArgs:e})=>{let s=Object.keys(Gc.subCommands||{});e.some(i=>s.includes(i))||await Q0({force:t.force})}};Ks();var Kc=["critical","high","medium","low"],qi=T.string().optional().transform(t=>{if(t)return t.split(",").map(e=>e.trim())}),RA=T.object({confidence:T.string().optional().refine(t=>{if(!t)return!0;let e=parseInt(t,10);return!isNaN(e)&&!t.includes(".")},t=>({message:`Invalid confidence value: "${t}". Must be a number between 0-100.`})).transform(t=>{if(t)return parseInt(t,10)}).refine(t=>t===void 0?!0:t>=0&&t<=100,t=>({message:`Invalid confidence value: ${t}. Must be between 0-100 (got ${t}).`})),severity:T.string().optional().refine(t=>t?t.split(",").map(n=>n.trim()).filter(n=>!Kc.includes(n)).length===0:!0,t=>t?{message:`Invalid severity values: ${t.split(",").map(n=>n.trim()).filter(n=>!Kc.includes(n)).join(", ")}. Must be one of: ${Kc.join(", ")}`}:{message:""}).transform(t=>{if(t)return t.split(",").map(e=>e.trim())}),agent:qi,"exclude-agent":qi,rule:qi,"exclude-rule":qi,files:qi,base:T.string().optional(),head:T.string().optional(),branch:T.string().optional(),executor:T.string().optional(),model:T.string().optional(),stream:T.boolean().optional(),verbose:T.boolean().optional(),json:T.boolean().optional(),"skip-validation":T.boolean().optional(),full:T.boolean().optional()}).refine(t=>!(t.full&&!t.files),{message:"--full requires --files to specify which files to review"}).refine(t=>!(t.full&&t.base),{message:"--full and --base are incompatible. Use --full for whole-file review without git, or --base for git diff comparison."});function ty(t){return RA.parse(t)}Ks();function NA(t){switch(t){case"modified":return"~";case"added":return"+";case"deleted":return"-";case"renamed":return"\u2192";default:return"\xB7"}}async function Yc(t,e){t&&(await qa(t),e||h.info(`Restored to ${t}`))}async function sy(t,e){if(await Gf())return e||(h.warn("Uncommitted changes detected - cannot checkout to head ref"),h.info("CLI tools will only see diff context, not full files")),null;let s=await zf(t);return s.checkoutNeeded?(e||h.info(`Checked out to ${t} for full file access`),s.originalRef):null}async function ny(t){let e=await Jf();return e.length===0?(t||h.info("No uncommitted changes, reviewing last commit..."),e=await Qf(),{diffs:e,sourceLabel:" (last commit)"}):{diffs:e,sourceLabel:" (uncommitted)"}}async function PA(t){let{full:e,filesFilter:s,base:n,head:i,json:r}=t,o=null;if(e){(!s||s.length===0)&&(h.error("--full requires --files"),process.exit(1)),r||h.info(`Full file review: ${s.length} file(s)`);let{diffs:u,notFound:l}=await td(s);if(l.length>0&&!r)for(let c of l)h.warn(`File not found: ${c}`);return u.length===0&&(h.error("No files could be read"),process.exit(1)),{diffs:u,sourceLabel:" (full file)",originalRef:null}}if(s&&s.length>0){let u,l;if(n){let d=i||"HEAD";r||h.info(`Comparing ${n}...${d} for files: ${s.join(", ")}`),o=await sy(d,r),u=await Wa(n,d),l=` (${n}...${d})`}else{let d=await ny(r);u=d.diffs,l=d.sourceLabel}let{matched:c,unmatched:f}=ed(u,s);if(f.length>0&&!r)for(let d of f)h.warn(`No changes found for: ${d}`);return c.length===0?(h.success("No changes to review for specified files"),await Yc(o,r),null):{diffs:c,sourceLabel:l,originalRef:o}}if(n){let u=i||"HEAD";r||h.info(`Comparing ${n}...${u}`),o=await sy(u,r);let l=await Wa(n,u);return l.length===0?(h.success("No changes between commits"),await Yc(o,r),null):{diffs:l,sourceLabel:` (${n}...${u})`,originalRef:o}}let a=await ny(r);return a.diffs.length===0?(h.success("No changes to review"),null):{diffs:a.diffs,sourceLabel:a.sourceLabel,originalRef:null}}function OA(t){let{result:e,filteredDiffs:s,severityFilter:n,json:i}=t,r=e.context.issues,o=r;n&&n.length>0&&(o=r.filter(u=>n.includes(u.severity)));let a=e.context.results.filter(u=>u.success).length;if(i){let u=Vg(o,e.success,e.totalDuration,e.context.results.length,a,s.length);console.log(u);return}if(h.separator(),e.success?h.success(`Pipeline completed successfully in ${e.totalDuration}ms`):h.warn(`Pipeline completed with errors in ${e.totalDuration}ms`),h.chart(`${a}/${e.context.results.length} agents succeeded`),n&&n.length>0){let u=n.join(", ");h.info(`Filtering by severity: ${u}`)}if(o.length>0){let u=o.reduce((c,f)=>(c[f.severity]=(c[f.severity]||0)+1,c),{}),l=[];u.critical&&l.push(`${u.critical} critical`),u.high&&l.push(`${u.high} high`),u.medium&&l.push(`${u.medium} medium`),u.low&&l.push(`${u.low} low`),h.chart(`${o.length} issue(s): ${l.join(", ")}`),h.newline(),console.log(Wg(o))}else if(h.newline(),n&&n.length>0){let u=n.join(", ");h.success(`No ${u} issues found \u{1F389}`)}else h.success("No issues found \u{1F389}");h.newline()}async function LA(t){let{verbose:e=!1,json:s=!1,stream:n=!1,severity:i,base:r,head:o,branch:a,skipValidation:u=!1,agent:l,excludeAgent:c,rule:f,excludeRule:d,executor:p,model:D,confidence:m,files:g,full:F=!1}=t,y=r,C=o;if(a!==void 0&&a!==""){let M=a==="."?await ja():a;M||(s||(h.error("Could not determine current branch (detached HEAD?)"),h.info("Specify branch explicitly: diffray review --branch feature-auth")),process.exit(1));let L=r||await Wf();L||(s||(h.error("Could not detect default branch (main/master/develop)"),h.info("Use --base explicitly: diffray review --branch --base main")),process.exit(1)),a!=="."&&!await Vf(a)&&(s||h.error(`Branch not found: ${a}`),process.exit(1)),M===L?s||h.warn(`Branch "${M}" is the base branch, reviewing uncommitted changes instead`):(y=L,C=M,s||h.info(`Reviewing "${M}" against "${L}"`))}s||h.logo();let w=process.cwd(),E=await Ee(w);await Hf()||(s||h.error("Not a git repository"),process.exit(1)),s||h.chart("Analyzing changes...");let B=await PA({full:F,filesFilter:g,base:y,head:C,json:s});if(!B)return;let{diffs:A,sourceLabel:$,originalRef:P}=B;try{let M=A.filter(se=>!E.excludePatterns.some(pt=>es(se.file,pt)));if(M.length===0){h.success("No changes (all excluded)");return}let L=M.reduce((se,pt)=>se+pt.additions,0),te=M.reduce((se,pt)=>se+pt.deletions,0),Se=L+te,we=M.reduce((se,pt)=>(se[pt.status]=(se[pt.status]||0)+1,se),{});if(!s){let se=[];if(we.modified&&se.push(`${we.modified} modified`),we.added&&se.push(`${we.added} added`),we.deleted&&se.push(`${we.deleted} deleted`),we.renamed&&se.push(`${we.renamed} renamed`),h.file(`${M.length} files${$}: ${se.join(", ")}`),h.plain(` ${Se} changes: +${L} -${te}`),e||M.length<=5){h.newline();for(let Ui of M){let oy=NA(Ui.status);h.plain(` ${oy} ${Ui.file}: +${Ui.additions} -${Ui.deletions}`)}}h.newline(),h.robot("Loading executors and Agents...")}let Ce=await Li(),G=Ce.filter(se=>se.enabled);s||h.success(`Loaded ${G.length} executor(s)`);let pe=await At({projectPath:w,executorOverride:p,modelOverride:D});p&&!s&&h.info(`Using executor: ${p}`),s||(l&&h.info(`Agent filter: ${l.join(", ")}`),c&&h.info(`Excluding agents: ${c.join(", ")}`),f&&h.info(`Rule filter: ${f.join(", ")}`),d&&h.info(`Excluding rules: ${d.join(", ")}`));let ue=pe.filter(se=>se.enabled);s||(h.success(`Loaded ${ue.length} Agent(s)`),h.newline());let ry=await new na(pe,Ce).execute(M,{verbose:e,quiet:s,concurrency:E.concurrency,skipValidation:u,stream:n,baseRef:y,headRef:C,agentFilter:l,excludeAgents:c,ruleFilter:f,excludeRules:d,minConfidence:m,modelOverride:D});OA({result:ry,filteredDiffs:M,severityFilter:i,json:s})}finally{await Yc(P,s)}}var MA={meta:{name:"review",description:`Run code review on current changes
|
|
574
569
|
|
|
575
570
|
Examples:
|
|
576
571
|
diffray review Review uncommitted changes
|
|
@@ -585,4 +580,4 @@ Examples:
|
|
|
585
580
|
diffray review --stream Show thinking and tool usage
|
|
586
581
|
diffray review --executor opencode-cli Use OpenCode executor
|
|
587
582
|
diffray review --executor codex-cli Use Codex executor
|
|
588
|
-
diffray review --model sonnet Override model for all agents`},args:{stream:{type:"boolean",description:"Show streaming output (thinking, tools, preliminary issues)"},verbose:{type:"boolean",description:"Show raw JSON stream"},json:{type:"boolean",description:"Output results in JSON format"},severity:{type:"string",description:"Filter issues by severity (comma-separated: critical,high,medium,low)"},base:{type:"string",description:"Base commit/branch to compare from (e.g., main, HEAD~3)"},head:{type:"string",description:"Head commit/branch to compare to (default: HEAD)"},branch:{type:"string",description:'Review branch vs base (auto-detects main). Use "." for current branch.'},"skip-validation":{type:"boolean",description:"Skip validation stage (show all issues without filtering)"},agent:{type:"string",description:"Run only specific agents (comma-separated: bug-hunter,security-scan)"},"exclude-agent":{type:"string",description:"Exclude specific agents (comma-separated)"},rule:{type:"string",description:"Run only specific rules (comma-separated: code-security,code-bugs)"},"exclude-rule":{type:"string",description:"Exclude specific rules (comma-separated)"},executor:{type:"string",description:"Override executor for all agents (e.g., codex-cli, cursor-agent-cli, claude-cli)"},model:{type:"string",description:"Override model for all agents (e.g., sonnet, opencode/gpt-5-nano, claude-3-5-sonnet)"},confidence:{type:"string",description:"Minimum confidence threshold 0-100 (default: 80). Issues below this are filtered out."},files:{type:"string",description:"Review only specific files (comma-separated paths)"},full:{type:"boolean",description:"Review entire file content without git diff (requires --files)"}},run:async({args:t})=>{try{let e=
|
|
583
|
+
diffray review --model sonnet Override model for all agents`},args:{stream:{type:"boolean",description:"Show streaming output (thinking, tools, preliminary issues)"},verbose:{type:"boolean",description:"Show raw JSON stream"},json:{type:"boolean",description:"Output results in JSON format"},severity:{type:"string",description:"Filter issues by severity (comma-separated: critical,high,medium,low)"},base:{type:"string",description:"Base commit/branch to compare from (e.g., main, HEAD~3)"},head:{type:"string",description:"Head commit/branch to compare to (default: HEAD)"},branch:{type:"string",description:'Review branch vs base (auto-detects main). Use "." for current branch.'},"skip-validation":{type:"boolean",description:"Skip validation stage (show all issues without filtering)"},agent:{type:"string",description:"Run only specific agents (comma-separated: bug-hunter,security-scan)"},"exclude-agent":{type:"string",description:"Exclude specific agents (comma-separated)"},rule:{type:"string",description:"Run only specific rules (comma-separated: code-security,code-bugs)"},"exclude-rule":{type:"string",description:"Exclude specific rules (comma-separated)"},executor:{type:"string",description:"Override executor for all agents (e.g., codex-cli, cursor-agent-cli, claude-cli)"},model:{type:"string",description:"Override model for all agents (e.g., sonnet, opencode/gpt-5-nano, claude-3-5-sonnet)"},confidence:{type:"string",description:"Minimum confidence threshold 0-100 (default: 80). Issues below this are filtered out."},files:{type:"string",description:"Review only specific files (comma-separated paths)"},full:{type:"boolean",description:"Review entire file content without git diff (requires --files)"}},run:async({args:t})=>{try{let e=ty(t);await LA({verbose:e.verbose,json:e.json,stream:e.stream,severity:e.severity,base:e.base,head:e.head,branch:e.branch,skipValidation:e["skip-validation"],agent:e.agent,excludeAgent:e["exclude-agent"],rule:e.rule,excludeRule:e["exclude-rule"],executor:e.executor,confidence:e.confidence,files:e.files,full:e.full})}catch(e){if(e instanceof De){let n=e.errors[0]?.message||"Invalid argument";t.json?console.error(JSON.stringify({error:n})):h.error(n),process.exit(1)}throw e}}},iy={meta:{name:"diffray",version:Zi.version,description:"AI-powered code review CLI"},subCommands:{review:MA,config:T0,agents:N0,executors:M0,rules:W0,extends:K0,"setup-command":Gc}};H();var oa=process.argv.slice(2),jA=["-v","--version","-h","--help"],qA=oa.length===0||oa.some(t=>jA.includes(t));qA&&(h.logo(),(oa.includes("-v")||oa.includes("--version"))&&(h.plain(`v${Zi.version}`),process.exit(0)));Pf(iy);
|