diffray 0.5.0 → 0.5.1

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.
Files changed (2) hide show
  1. package/dist/diffray.cjs +240 -181
  2. package/package.json +1 -1
package/dist/diffray.cjs CHANGED
@@ -1,245 +1,245 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var Lg=Object.create;var Yo=Object.defineProperty;var Mg=Object.getOwnPropertyDescriptor;var jg=Object.getOwnPropertyNames;var qg=Object.getPrototypeOf,Ug=Object.prototype.hasOwnProperty;var M=(t,e)=>()=>(t&&(e=t(t=0)),e);var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),di=(t,e)=>{for(var s in e)Yo(t,s,{get:e[s],enumerable:!0})},Vg=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of jg(e))!Ug.call(t,n)&&n!==s&&Yo(t,n,{get:()=>e[n],enumerable:!(i=Mg(e,n))||i.enumerable});return t};var bt=(t,e,s)=>(s=t!=null?Lg(qg(t)):{},Vg(e||!t||!t.__esModule?Yo(s,"default",{value:t,enumerable:!0}):s,t));var Xc={};di(Xc,{kCancel:()=>Zc,prompt:()=>Qc});function a0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function u0(){if(Tc)return na;Tc=1;let t="\x1B",e=`${t}[`,s="\x07",i={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`},n={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?i.up():"");return o&&(a+=i.left),a}};return na={cursor:i,scroll:n,erase:r,beep:s},na}function l0(){if(Ic)return Mn.exports;Ic=1;let t=process||{},e=t.argv||[],s=t.env||{},i=!(s.NO_COLOR||e.includes("--no-color"))&&(!!s.FORCE_COLOR||e.includes("--color")||t.platform==="win32"||(t.stdout||{}).isTTY&&s.TERM!=="dumb"||!!s.CI),n=(a,u,l=a)=>c=>{let f=""+c,h=f.indexOf(u,a.length);return~h?a+r(f,u,l,h)+u:a+f+u},r=(a,u,l,c)=>{let f="",h=0;do f+=a.substring(h,c)+l,h=c+u.length,c=a.indexOf(u,h);while(~c);return f+a.substring(h)},o=(a=i)=>{let u=a?n:()=>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 Mn.exports=o(),Mn.exports.createColors=o,Mn.exports}function f0({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 zc(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(h0,"")}function Gc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Di(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=zc(t),t.length===0))return 0;t=t.replace(m0()," ");let s=e.ambiguousIsNarrow?1:2,i=0;for(let n of t){let r=n.codePointAt(0);if(!(r<=31||r>=127&&r<=159||r>=768&&r<=879))switch(p0.eastAsianWidth(n)){case"F":case"W":i+=2;break;case"A":i+=s;break;default:i+=1}}return i}function F0(){let t=new Map;for(let[e,s]of Object.entries(Q)){for(let[i,n]of Object.entries(s))Q[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},s[i]=Q[i],t.set(n[0],n[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=Rc(),Q.color.ansi256=Nc(),Q.color.ansi16m=Pc(),Q.bgColor.ansi=Rc(ra),Q.bgColor.ansi256=Nc(ra),Q.bgColor.ansi16m=Pc(ra),Object.defineProperties(Q,{rgbToAnsi256:{value:(e,s,i)=>e===s&&s===i?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(i/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[i]=s;i.length===3&&(i=[...i].map(r=>r+r).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&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,i,n;if(e>=232)s=((e-232)*10+8)/255,i=s,n=s;else{e-=16;let a=e%36;s=Math.floor(e/36)/5,i=Math.floor(a/6)/5,n=a%6/5}let r=Math.max(s,i,n)*2;if(r===0)return 30;let o=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(s));return r===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,s,i)=>Q.ansi256ToAnsi(Q.rgbToAnsi256(e,s,i)),enumerable:!1},hexToAnsi:{value:e=>Q.ansi256ToAnsi(Q.hexToAnsi256(e)),enumerable:!1}}),Q}function Mc(t,e,s){return String(t).normalize().replace(/\r\n/g,`
2
+ "use strict";var Xg=Object.create;var Qo=Object.defineProperty;var e0=Object.getOwnPropertyDescriptor;var t0=Object.getOwnPropertyNames;var s0=Object.getPrototypeOf,i0=Object.prototype.hasOwnProperty;var M=(t,e)=>()=>(t&&(e=t(t=0)),e);var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Di=(t,e)=>{for(var s in e)Qo(t,s,{get:e[s],enumerable:!0})},n0=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of t0(e))!i0.call(t,n)&&n!==s&&Qo(t,n,{get:()=>e[n],enumerable:!(i=e0(e,n))||i.enumerable});return t};var bt=(t,e,s)=>(s=t!=null?Xg(s0(t)):{},n0(e||!t||!t.__esModule?Qo(s,"default",{value:t,enumerable:!0}):s,t));var of={};Di(of,{kCancel:()=>nf,prompt:()=>rf});function w0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function b0(){if(Lc)return ua;Lc=1;let t="\x1B",e=`${t}[`,s="\x07",i={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`},n={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?i.up():"");return o&&(a+=i.left),a}};return ua={cursor:i,scroll:n,erase:r,beep:s},ua}function v0(){if(Mc)return Un.exports;Mc=1;let t=process||{},e=t.argv||[],s=t.env||{},i=!(s.NO_COLOR||e.includes("--no-color"))&&(!!s.FORCE_COLOR||e.includes("--color")||t.platform==="win32"||(t.stdout||{}).isTTY&&s.TERM!=="dumb"||!!s.CI),n=(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=i)=>{let u=a?n:()=>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 Un.exports=o(),Un.exports.createColors=o,Un.exports}function S0({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 Zc(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(A0,"")}function Qc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function gi(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Zc(t),t.length===0))return 0;t=t.replace(B0()," ");let s=e.ambiguousIsNarrow?1:2,i=0;for(let n of t){let r=n.codePointAt(0);if(!(r<=31||r>=127&&r<=159||r>=768&&r<=879))switch(_0.eastAsianWidth(n)){case"F":case"W":i+=2;break;case"A":i+=s;break;default:i+=1}}return i}function R0(){let t=new Map;for(let[e,s]of Object.entries(Q)){for(let[i,n]of Object.entries(s))Q[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},s[i]=Q[i],t.set(n[0],n[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=jc(),Q.color.ansi256=qc(),Q.color.ansi16m=Uc(),Q.bgColor.ansi=jc(la),Q.bgColor.ansi256=qc(la),Q.bgColor.ansi16m=Uc(la),Object.defineProperties(Q,{rgbToAnsi256:{value:(e,s,i)=>e===s&&s===i?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(i/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[i]=s;i.length===3&&(i=[...i].map(r=>r+r).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&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,i,n;if(e>=232)s=((e-232)*10+8)/255,i=s,n=s;else{e-=16;let a=e%36;s=Math.floor(e/36)/5,i=Math.floor(a/6)/5,n=a%6/5}let r=Math.max(s,i,n)*2;if(r===0)return 30;let o=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(s));return r===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,s,i)=>Q.ansi256ToAnsi(Q.rgbToAnsi256(e,s,i)),enumerable:!1},hexToAnsi:{value:e=>Q.ansi256ToAnsi(Q.hexToAnsi256(e)),enumerable:!1}}),Q}function zc(t,e,s){return String(t).normalize().replace(/\r\n/g,`
3
3
  `).split(`
4
- `).map(i=>x0(i,e,s)).join(`
5
- `)}function Hc(t,e){if(typeof t=="string")return qn.aliases.get(t)===e;for(let s of t)if(s!==void 0&&Hc(s,e))return!0;return!1}function A0(t,e){if(t===e)return;let s=t.split(`
4
+ `).map(i=>j0(i,e,s)).join(`
5
+ `)}function sf(t,e){if(typeof t=="string")return Wn.aliases.get(t)===e;for(let s of t)if(s!==void 0&&sf(s,e))return!0;return!1}function U0(t,e){if(t===e)return;let s=t.split(`
6
6
  `),i=e.split(`
7
- `),n=[];for(let r=0;r<Math.max(s.length,i.length);r++)s[r]!==i[r]&&n.push(r);return n}function jn(t,e){let s=t;s.isTTY&&s.setRawMode(e)}function N0(){return de.default.platform!=="win32"?de.default.env.TERM!=="linux":!!de.default.env.CI||!!de.default.env.WT_SESSION||!!de.default.env.TERMINUS_SUBLIME||de.default.env.ConEmuTask==="{cmd::Cmder}"||de.default.env.TERM_PROGRAM==="Terminus-Sublime"||de.default.env.TERM_PROGRAM==="vscode"||de.default.env.TERM==="xterm-256color"||de.default.env.TERM==="alacritty"||de.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}async function Qc(t,e={}){let s=i=>{if(typeof i!="symbol"||i.toString()!=="Symbol(clack:cancel)")return i;switch(e.cancel){case"reject":{let n=new Error("Prompt cancelled.");throw n.name="ConsolaPromptCancelledError",Error.captureStackTrace&&Error.captureStackTrace(n,Qc),n}case"undefined":return;case"null":return null;case"symbol":return Zc;default:case"default":return e.default??e.initial}};if(!e.type||e.type==="text")return await V0({message:t,defaultValue:e.default,placeholder:e.placeholder,initialValue:e.initial}).then(s);if(e.type==="confirm")return await W0({message:t,initialValue:e.initial}).then(s);if(e.type==="select")return await z0({message:t,options:e.options.map(i=>typeof i=="string"?{value:i,label:i}:i),initialValue:e.initial}).then(s);if(e.type==="multiselect")return await G0({message:t,options:e.options.map(i=>typeof i=="string"?{value:i,label:i}:i),required:e.required,initialValues:e.initial}).then(s);throw new Error(`Unknown prompt type: ${e.type}`)}var zx,de,aa,Wc,na,Tc,Ue,Mn,Ic,c0,x,h0,Kc,d0,p0,D0,m0,ra,Rc,Nc,Pc,Q,g0,y0,C0,Un,E0,pa,Yc,b0,Jc,Da,Oc,Lc,w0,oa,v0,x0,S0,qn,jc,k0,_0,Ae,ks,ua,B0,$0,qc,T0,I0,R0,Uc,la,ca,P0,Ve,O0,L0,M0,j0,Z,_s,fa,ha,q0,Vc,U0,Vn,da,V0,W0,z0,G0,Zc,ef=M(()=>{zx=require("node:util"),de=bt(require("node:process"),1),aa=bt(require("node:readline"),1),Wc=require("node:tty");Ue=u0(),Mn={exports:{}};c0=l0(),x=a0(c0);h0=f0();Kc={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(i){var n=i.charCodeAt(0),r=i.length==2?i.charCodeAt(1):0,o=n;return 55296<=n&&n<=56319&&56320<=r&&r<=57343&&(n&=1023,r&=1023,o=n<<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(i){var n=this.eastAsianWidth(i);return n=="F"||n=="W"||n=="A"?2:1};function s(i){return i.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(i){for(var n=s(i),r=0,o=0;o<n.length;o++)r=r+this.characterLength(n[o]);return r},e.slice=function(i,n,r){textLen=e.length(i),n=n||0,r=r||1,n<0&&(n=textLen+n),r<0&&(r=textLen+r);for(var o="",a=0,u=s(i),l=0;l<u.length;l++){var c=u[l],f=e.length(c);if(a>=n-(f==2?1:0))if(a+f<=r)o+=c;else break;a+=f}return o}})(Kc);d0=Kc.exports,p0=Gc(d0),D0=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},m0=Gc(D0);ra=10,Rc=(t=0)=>e=>`\x1B[${e+t}m`,Nc=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Pc=(t=0)=>(e,s,i)=>`\x1B[${38+t};2;${e};${s};${i}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);g0=Object.keys(Q.color),y0=Object.keys(Q.bgColor);[...g0,...y0];C0=F0(),Un=new Set(["\x1B","\x9B"]),E0=39,pa="\x07",Yc="[",b0="]",Jc="m",Da=`${b0}8;;`,Oc=t=>`${Un.values().next().value}${Yc}${t}${Jc}`,Lc=t=>`${Un.values().next().value}${Da}${t}${pa}`,w0=t=>t.split(" ").map(e=>Di(e)),oa=(t,e,s)=>{let i=[...e],n=!1,r=!1,o=Di(zc(t[t.length-1]));for(let[a,u]of i.entries()){let l=Di(u);if(o+l<=s?t[t.length-1]+=u:(t.push(u),o=0),Un.has(u)&&(n=!0,r=i.slice(a+1).join("").startsWith(Da)),n){r?u===pa&&(n=!1,r=!1):u===Jc&&(n=!1);continue}o+=l,o===s&&a<i.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&&!(Di(e[s-1])>0);)s--;return s===e.length?t:e.slice(0,s).join(" ")+e.slice(s).join("")},x0=(t,e,s={})=>{if(s.trim!==!1&&t.trim()==="")return"";let i="",n,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=Di(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 h=e-f,d=1+Math.floor((o[l]-h-1)/e);Math.floor((o[l]-1)/e)<d&&a.push(""),oa(a,c,e);continue}if(f+o[l]>e&&f>0&&o[l]>0){if(s.wordWrap===!1&&f<e){oa(a,c,e);continue}a.push("")}if(f+o[l]>e&&s.wordWrap===!1){oa(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(i+=c,Un.has(c)){let{groups:h}=new RegExp(`(?:\\${Yc}(?<code>\\d+)m|\\${Da}(?<uri>.*)${pa})`).exec(u.slice(l).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);n=d===E0?void 0:d}else h.uri!==void 0&&(r=h.uri.length===0?void 0:h.uri)}let f=C0.codes.get(Number(n));u[l+1]===`
9
- `?(r&&(i+=Lc("")),n&&f&&(i+=Oc(f))):c===`
10
- `&&(n&&f&&(i+=Oc(n)),r&&(i+=Lc(r)))}return i};S0=["up","down","left","right","space","enter","cancel"],qn={actions:new Set(S0),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};globalThis.process.platform.startsWith("win");jc=Symbol("clack:cancel");k0=Object.defineProperty,_0=(t,e,s)=>e in t?k0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Ae=(t,e,s)=>(_0(t,typeof e!="symbol"?e+"":e,s),s),ks=class{constructor(e,s=!0){Ae(this,"input"),Ae(this,"output"),Ae(this,"_abortSignal"),Ae(this,"rl"),Ae(this,"opts"),Ae(this,"_render"),Ae(this,"_track",!1),Ae(this,"_prevFrame",""),Ae(this,"_subscribers",new Map),Ae(this,"_cursor",0),Ae(this,"state","initial"),Ae(this,"error",""),Ae(this,"value");let{input:i=de.stdin,output:n=de.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=i,this.output=n}unsubscribe(){this._subscribers.clear()}setSubscriber(e,s){let i=this._subscribers.get(e)??[];i.push(s),this._subscribers.set(e,i)}on(e,s){this.setSubscriber(e,{cb:s})}once(e,s){this.setSubscriber(e,{cb:s,once:!0})}emit(e,...s){let i=this._subscribers.get(e)??[],n=[];for(let r of i)r.cb(...s),r.once&&n.push(()=>i.splice(i.indexOf(r),1));for(let r of n)r()}prompt(){return new Promise((e,s)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(jc);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let i=new Wc.WriteStream(0);i._write=(n,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(i),this.rl=aa.default.createInterface({input:this.input,output:i,tabSize:2,prompt:"",escapeCodeTimeout:50}),aa.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),jn(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Ue.cursor.show),this.output.off("resize",this.render),jn(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(Ue.cursor.show),this.output.off("resize",this.render),jn(this.input,!1),e(jc)})})}onKeypress(e,s){if(this.state==="error"&&(this.state="active"),s?.name&&(!this._track&&qn.aliases.has(s.name)&&this.emit("cursor",qn.aliases.get(s.name)),qn.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 i=this.opts.validate(this.value);i&&(this.error=i instanceof Error?i.message:i,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Hc([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
- `),jn(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Mc(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
12
- `).length-1;this.output.write(Ue.cursor.move(-999,e*-1))}render(){let e=Mc(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(Ue.cursor.hide);else{let s=A0(this._prevFrame,e);if(this.restoreCursor(),s&&s?.length===1){let i=s[0];this.output.write(Ue.cursor.move(0,i)),this.output.write(Ue.erase.lines(1));let n=e.split(`
7
+ `),n=[];for(let r=0;r<Math.max(s.length,i.length);r++)s[r]!==i[r]&&n.push(r);return n}function Vn(t,e){let s=t;s.isTTY&&s.setRawMode(e)}function H0(){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 rf(t,e={}){let s=i=>{if(typeof i!="symbol"||i.toString()!=="Symbol(clack:cancel)")return i;switch(e.cancel){case"reject":{let n=new Error("Prompt cancelled.");throw n.name="ConsolaPromptCancelledError",Error.captureStackTrace&&Error.captureStackTrace(n,rf),n}case"undefined":return;case"null":return null;case"symbol":return nf;default:case"default":return e.default??e.initial}};if(!e.type||e.type==="text")return await ny({message:t,defaultValue:e.default,placeholder:e.placeholder,initialValue:e.initial}).then(s);if(e.type==="confirm")return await ry({message:t,initialValue:e.initial}).then(s);if(e.type==="select")return await oy({message:t,options:e.options.map(i=>typeof i=="string"?{value:i,label:i}:i),initialValue:e.initial}).then(s);if(e.type==="multiselect")return await ay({message:t,options:e.options.map(i=>typeof i=="string"?{value:i,label:i}:i),required:e.required,initialValues:e.initial}).then(s);throw new Error(`Unknown prompt type: ${e.type}`)}var uS,he,fa,Hc,ua,Lc,Ue,Un,Mc,x0,x,A0,Xc,k0,_0,$0,B0,la,jc,qc,Uc,Q,T0,I0,N0,zn,P0,ya,ef,O0,tf,Fa,Vc,Wc,L0,ca,M0,j0,q0,Wn,Gc,V0,W0,Ae,$s,da,z0,G0,Kc,K0,Y0,J0,Yc,ha,pa,Z0,Ve,Q0,X0,ey,ty,Z,Bs,Da,ma,sy,Jc,iy,Gn,ga,ny,ry,oy,ay,nf,af=M(()=>{uS=require("node:util"),he=bt(require("node:process"),1),fa=bt(require("node:readline"),1),Hc=require("node:tty");Ue=b0(),Un={exports:{}};x0=v0(),x=w0(x0);A0=S0();Xc={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(i){var n=i.charCodeAt(0),r=i.length==2?i.charCodeAt(1):0,o=n;return 55296<=n&&n<=56319&&56320<=r&&r<=57343&&(n&=1023,r&=1023,o=n<<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(i){var n=this.eastAsianWidth(i);return n=="F"||n=="W"||n=="A"?2:1};function s(i){return i.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(i){for(var n=s(i),r=0,o=0;o<n.length;o++)r=r+this.characterLength(n[o]);return r},e.slice=function(i,n,r){textLen=e.length(i),n=n||0,r=r||1,n<0&&(n=textLen+n),r<0&&(r=textLen+r);for(var o="",a=0,u=s(i),l=0;l<u.length;l++){var c=u[l],f=e.length(c);if(a>=n-(f==2?1:0))if(a+f<=r)o+=c;else break;a+=f}return o}})(Xc);k0=Xc.exports,_0=Qc(k0),$0=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},B0=Qc($0);la=10,jc=(t=0)=>e=>`\x1B[${e+t}m`,qc=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Uc=(t=0)=>(e,s,i)=>`\x1B[${38+t};2;${e};${s};${i}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);T0=Object.keys(Q.color),I0=Object.keys(Q.bgColor);[...T0,...I0];N0=R0(),zn=new Set(["\x1B","\x9B"]),P0=39,ya="\x07",ef="[",O0="]",tf="m",Fa=`${O0}8;;`,Vc=t=>`${zn.values().next().value}${ef}${t}${tf}`,Wc=t=>`${zn.values().next().value}${Fa}${t}${ya}`,L0=t=>t.split(" ").map(e=>gi(e)),ca=(t,e,s)=>{let i=[...e],n=!1,r=!1,o=gi(Zc(t[t.length-1]));for(let[a,u]of i.entries()){let l=gi(u);if(o+l<=s?t[t.length-1]+=u:(t.push(u),o=0),zn.has(u)&&(n=!0,r=i.slice(a+1).join("").startsWith(Fa)),n){r?u===ya&&(n=!1,r=!1):u===tf&&(n=!1);continue}o+=l,o===s&&a<i.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},M0=t=>{let e=t.split(" "),s=e.length;for(;s>0&&!(gi(e[s-1])>0);)s--;return s===e.length?t:e.slice(0,s).join(" ")+e.slice(s).join("")},j0=(t,e,s={})=>{if(s.trim!==!1&&t.trim()==="")return"";let i="",n,r,o=L0(t),a=[""];for(let[l,c]of t.split(" ").entries()){s.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=gi(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(""),ca(a,c,e);continue}if(f+o[l]>e&&f>0&&o[l]>0){if(s.wordWrap===!1&&f<e){ca(a,c,e);continue}a.push("")}if(f+o[l]>e&&s.wordWrap===!1){ca(a,c,e);continue}a[a.length-1]+=c}s.trim!==!1&&(a=a.map(l=>M0(l)));let u=[...a.join(`
8
+ `)];for(let[l,c]of u.entries()){if(i+=c,zn.has(c)){let{groups:d}=new RegExp(`(?:\\${ef}(?<code>\\d+)m|\\${Fa}(?<uri>.*)${ya})`).exec(u.slice(l).join(""))||{groups:{}};if(d.code!==void 0){let p=Number.parseFloat(d.code);n=p===P0?void 0:p}else d.uri!==void 0&&(r=d.uri.length===0?void 0:d.uri)}let f=N0.codes.get(Number(n));u[l+1]===`
9
+ `?(r&&(i+=Wc("")),n&&f&&(i+=Vc(f))):c===`
10
+ `&&(n&&f&&(i+=Vc(n)),r&&(i+=Wc(r)))}return i};q0=["up","down","left","right","space","enter","cancel"],Wn={actions:new Set(q0),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};globalThis.process.platform.startsWith("win");Gc=Symbol("clack:cancel");V0=Object.defineProperty,W0=(t,e,s)=>e in t?V0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Ae=(t,e,s)=>(W0(t,typeof e!="symbol"?e+"":e,s),s),$s=class{constructor(e,s=!0){Ae(this,"input"),Ae(this,"output"),Ae(this,"_abortSignal"),Ae(this,"rl"),Ae(this,"opts"),Ae(this,"_render"),Ae(this,"_track",!1),Ae(this,"_prevFrame",""),Ae(this,"_subscribers",new Map),Ae(this,"_cursor",0),Ae(this,"state","initial"),Ae(this,"error",""),Ae(this,"value");let{input:i=he.stdin,output:n=he.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=i,this.output=n}unsubscribe(){this._subscribers.clear()}setSubscriber(e,s){let i=this._subscribers.get(e)??[];i.push(s),this._subscribers.set(e,i)}on(e,s){this.setSubscriber(e,{cb:s})}once(e,s){this.setSubscriber(e,{cb:s,once:!0})}emit(e,...s){let i=this._subscribers.get(e)??[],n=[];for(let r of i)r.cb(...s),r.once&&n.push(()=>i.splice(i.indexOf(r),1));for(let r of n)r()}prompt(){return new Promise((e,s)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(Gc);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let i=new Hc.WriteStream(0);i._write=(n,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(i),this.rl=fa.default.createInterface({input:this.input,output:i,tabSize:2,prompt:"",escapeCodeTimeout:50}),fa.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),Vn(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Ue.cursor.show),this.output.off("resize",this.render),Vn(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(Ue.cursor.show),this.output.off("resize",this.render),Vn(this.input,!1),e(Gc)})})}onKeypress(e,s){if(this.state==="error"&&(this.state="active"),s?.name&&(!this._track&&Wn.aliases.has(s.name)&&this.emit("cursor",Wn.aliases.get(s.name)),Wn.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 i=this.opts.validate(this.value);i&&(this.error=i instanceof Error?i.message:i,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}sf([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
+ `),Vn(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=zc(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
12
+ `).length-1;this.output.write(Ue.cursor.move(-999,e*-1))}render(){let e=zc(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(Ue.cursor.hide);else{let s=U0(this._prevFrame,e);if(this.restoreCursor(),s&&s?.length===1){let i=s[0];this.output.write(Ue.cursor.move(0,i)),this.output.write(Ue.erase.lines(1));let n=e.split(`
13
13
  `);this.output.write(n[i]),this._prevFrame=e,this.output.write(Ue.cursor.move(0,n.length-i-1));return}if(s&&s?.length>1){let i=s[0];this.output.write(Ue.cursor.move(0,i)),this.output.write(Ue.erase.down());let n=e.split(`
14
14
  `).slice(i);this.output.write(n.join(`
15
- `)),this._prevFrame=e;return}this.output.write(Ue.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},ua=class extends ks{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(Ue.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},B0=Object.defineProperty,$0=(t,e,s)=>e in t?B0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,qc=(t,e,s)=>($0(t,typeof e!="symbol"?e+"":e,s),s),T0=class extends ks{constructor(t){super(t,!1),qc(this,"options"),qc(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]}},I0=Object.defineProperty,R0=(t,e,s)=>e in t?I0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Uc=(t,e,s)=>(R0(t,typeof e!="symbol"?e+"":e,s),s),la=class extends ks{constructor(e){super(e,!1),Uc(this,"options"),Uc(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}},ca=class extends ks{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,...i]=this.value.slice(this.cursor);return`${e}${x.inverse(s)}${i.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};P0=N0(),Ve=(t,e)=>P0?t:e,O0=Ve("\u276F",">"),L0=Ve("\u25A0","x"),M0=Ve("\u25B2","x"),j0=Ve("\u2714","\u221A"),Z=Ve(""),_s=Ve(""),fa=Ve("\u25CF",">"),ha=Ve("\u25CB"," "),q0=Ve("\u25FB","[\u2022]"),Vc=Ve("\u25FC","[+]"),U0=Ve("\u25FB","[ ]"),Vn=t=>{switch(t){case"initial":case"active":return x.cyan(O0);case"cancel":return x.red(L0);case"error":return x.yellow(M0);case"submit":return x.green(j0)}},da=t=>{let{cursor:e,options:s,style:i}=t,n=t.maxItems??Number.POSITIVE_INFINITY,r=Math.max(process.stdout.rows-4,0),o=Math.min(r,Math.max(n,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,h)=>{let d=f===0&&u,m=f===h.length-1&&l;return d||m?x.dim("..."):i(c,f+a===e)})},V0=t=>new ca({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${x.gray(Z)}
16
- ${Vn(this.state)} ${t.message}
15
+ `)),this._prevFrame=e;return}this.output.write(Ue.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},da=class extends $s{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(Ue.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},z0=Object.defineProperty,G0=(t,e,s)=>e in t?z0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Kc=(t,e,s)=>(G0(t,typeof e!="symbol"?e+"":e,s),s),K0=class extends $s{constructor(t){super(t,!1),Kc(this,"options"),Kc(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]}},Y0=Object.defineProperty,J0=(t,e,s)=>e in t?Y0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Yc=(t,e,s)=>(J0(t,typeof e!="symbol"?e+"":e,s),s),ha=class extends $s{constructor(e){super(e,!1),Yc(this,"options"),Yc(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}},pa=class extends $s{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,...i]=this.value.slice(this.cursor);return`${e}${x.inverse(s)}${i.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};Z0=H0(),Ve=(t,e)=>Z0?t:e,Q0=Ve("\u276F",">"),X0=Ve("\u25A0","x"),ey=Ve("\u25B2","x"),ty=Ve("\u2714","\u221A"),Z=Ve(""),Bs=Ve(""),Da=Ve("\u25CF",">"),ma=Ve("\u25CB"," "),sy=Ve("\u25FB","[\u2022]"),Jc=Ve("\u25FC","[+]"),iy=Ve("\u25FB","[ ]"),Gn=t=>{switch(t){case"initial":case"active":return x.cyan(Q0);case"cancel":return x.red(X0);case"error":return x.yellow(ey);case"submit":return x.green(ty)}},ga=t=>{let{cursor:e,options:s,style:i}=t,n=t.maxItems??Number.POSITIVE_INFINITY,r=Math.max(process.stdout.rows-4,0),o=Math.min(r,Math.max(n,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,m=f===d.length-1&&l;return p||m?x.dim("..."):i(c,f+a===e)})},ny=t=>new pa({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${x.gray(Z)}
16
+ ${Gn(this.state)} ${t.message}
17
17
  `,s=t.placeholder?x.inverse(t.placeholder[0])+x.dim(t.placeholder.slice(1)):x.inverse(x.hidden("_")),i=this.value?this.valueWithCursor:s;switch(this.state){case"error":return`${e.trim()}
18
18
  ${x.yellow(Z)} ${i}
19
- ${x.yellow(_s)} ${x.yellow(this.error)}
19
+ ${x.yellow(Bs)} ${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)} ${i}
22
- ${x.cyan(_s)}
23
- `}}}).prompt(),W0=t=>{let e=t.active??"Yes",s=t.inactive??"No";return new ua({active:e,inactive:s,initialValue:t.initialValue??!0,render(){let i=`${x.gray(Z)}
24
- ${Vn(this.state)} ${t.message}
22
+ ${x.cyan(Bs)}
23
+ `}}}).prompt(),ry=t=>{let e=t.active??"Yes",s=t.inactive??"No";return new da({active:e,inactive:s,initialValue:t.initialValue??!0,render(){let i=`${x.gray(Z)}
24
+ ${Gn(this.state)} ${t.message}
25
25
  `,n=this.value?e:s;switch(this.state){case"submit":return`${i}${x.gray(Z)} ${x.dim(n)}`;case"cancel":return`${i}${x.gray(Z)} ${x.strikethrough(x.dim(n))}
26
- ${x.gray(Z)}`;default:return`${i}${x.cyan(Z)} ${this.value?`${x.green(fa)} ${e}`:`${x.dim(ha)} ${x.dim(e)}`} ${x.dim("/")} ${this.value?`${x.dim(ha)} ${x.dim(s)}`:`${x.green(fa)} ${s}`}
27
- ${x.cyan(_s)}
28
- `}}}).prompt()},z0=t=>{let e=(s,i)=>{let n=s.label??String(s.value);switch(i){case"selected":return`${x.dim(n)}`;case"active":return`${x.green(fa)} ${n} ${s.hint?x.dim(`(${s.hint})`):""}`;case"cancelled":return`${x.strikethrough(x.dim(n))}`;default:return`${x.dim(ha)} ${x.dim(n)}`}};return new la({options:t.options,initialValue:t.initialValue,render(){let s=`${x.gray(Z)}
29
- ${Vn(this.state)} ${t.message}
26
+ ${x.gray(Z)}`;default:return`${i}${x.cyan(Z)} ${this.value?`${x.green(Da)} ${e}`:`${x.dim(ma)} ${x.dim(e)}`} ${x.dim("/")} ${this.value?`${x.dim(ma)} ${x.dim(s)}`:`${x.green(Da)} ${s}`}
27
+ ${x.cyan(Bs)}
28
+ `}}}).prompt()},oy=t=>{let e=(s,i)=>{let n=s.label??String(s.value);switch(i){case"selected":return`${x.dim(n)}`;case"active":return`${x.green(Da)} ${n} ${s.hint?x.dim(`(${s.hint})`):""}`;case"cancelled":return`${x.strikethrough(x.dim(n))}`;default:return`${x.dim(ma)} ${x.dim(n)}`}};return new ha({options:t.options,initialValue:t.initialValue,render(){let s=`${x.gray(Z)}
29
+ ${Gn(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)} ${da({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(i,n)=>e(i,n?"active":"inactive")}).join(`
31
+ ${x.gray(Z)}`;default:return`${s}${x.cyan(Z)} ${ga({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(i,n)=>e(i,n?"active":"inactive")}).join(`
32
32
  ${x.cyan(Z)} `)}
33
- ${x.cyan(_s)}
34
- `}}}).prompt()},G0=t=>{let e=(s,i)=>{let n=s.label??String(s.value);return i==="active"?`${x.cyan(q0)} ${n} ${s.hint?x.dim(`(${s.hint})`):""}`:i==="selected"?`${x.green(Vc)} ${x.dim(n)}`:i==="cancelled"?`${x.strikethrough(x.dim(n))}`:i==="active-selected"?`${x.green(Vc)} ${n} ${s.hint?x.dim(`(${s.hint})`):""}`:i==="submitted"?`${x.dim(n)}`:`${x.dim(U0)} ${x.dim(n)}`};return new T0({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.
33
+ ${x.cyan(Bs)}
34
+ `}}}).prompt()},ay=t=>{let e=(s,i)=>{let n=s.label??String(s.value);return i==="active"?`${x.cyan(sy)} ${n} ${s.hint?x.dim(`(${s.hint})`):""}`:i==="selected"?`${x.green(Jc)} ${x.dim(n)}`:i==="cancelled"?`${x.strikethrough(x.dim(n))}`:i==="active-selected"?`${x.green(Jc)} ${n} ${s.hint?x.dim(`(${s.hint})`):""}`:i==="submitted"?`${x.dim(n)}`:`${x.dim(iy)} ${x.dim(n)}`};return new K0({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
- ${Vn(this.state)} ${t.message}
36
+ ${Gn(this.state)} ${t.message}
37
37
  `,i=(n,r)=>{let o=this.value.includes(n.value);return r&&o?e(n,"active-selected"):o?e(n,"selected"):e(n,r?"active":"inactive")};switch(this.state){case"submit":return`${s}${x.gray(Z)} ${this.options.filter(({value:n})=>this.value.includes(n)).map(n=>e(n,"submitted")).join(x.dim(", "))||x.dim("none")}`;case"cancel":{let n=this.options.filter(({value:r})=>this.value.includes(r)).map(r=>e(r,"cancelled")).join(x.dim(", "));return`${s}${x.gray(Z)} ${n.trim()?`${n}
38
38
  ${x.gray(Z)}`:""}`}case"error":{let n=this.error.split(`
39
- `).map((r,o)=>o===0?`${x.yellow(_s)} ${x.yellow(r)}`:` ${r}`).join(`
40
- `);return`${s+x.yellow(Z)} ${da({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:i}).join(`
39
+ `).map((r,o)=>o===0?`${x.yellow(Bs)} ${x.yellow(r)}`:` ${r}`).join(`
40
+ `);return`${s+x.yellow(Z)} ${ga({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:i}).join(`
41
41
  ${x.yellow(Z)} `)}
42
42
  ${n}
43
- `}default:return`${s}${x.cyan(Z)} ${da({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:i}).join(`
43
+ `}default:return`${s}${x.cyan(Z)} ${ga({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:i}).join(`
44
44
  ${x.cyan(Z)} `)}
45
- ${x.cyan(_s)}
46
- `}}}).prompt()};`${x.gray(Z)}`;Zc=Symbol.for("cancel")});async function ct(t,e){let s=Sa.get(t);if(s!==void 0)return s.value;let i=await e();return Sa.set(t,{value:i,timestamp:Date.now()}),i}function Ts(t){Sa.delete(t)}var Sa,we,yi=M(()=>{"use strict";Sa=new Map;we={CONFIG:"config",INSTRUCTIONS:"instructions",OUTPUT_FORMAT:"prompt:output-format",VALIDATION_PROMPT:"prompt:validation",GIT_STATUS:"git:status"}});function df(){process.stdout.write("\x1B[?25h")}function Fi(t){if(!t)return"-";if(t.startsWith("embedded:"))return t;let e=(0,hf.homedir)(),s=process.cwd();return t.startsWith(e)?"~"+t.slice(e.length):t.startsWith(s)?"."+t.slice(s.length):t}var hf,B,Yn,p,Jn,Zy,Is,Y=M(()=>{"use strict";hf=require("node:os"),B={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"},Yn=new Set;process.on("SIGINT",()=>{for(let t of Yn)t.stop();df(),console.log(`
47
- ${B.yellow}!${B.reset} Interrupted - shutting down gracefully`),process.exit(130)});process.on("SIGTERM",()=>{for(let t of Yn)t.stop();df(),console.log(`
48
- ${B.yellow}!${B.reset} Terminated - shutting down gracefully`),process.exit(143)});p={success:t=>{console.log(`${B.green}\u2713${B.reset} ${t}`)},error:(t,e)=>{let s=e?`${t} ${e}`:t;console.error(`${B.red}\u2717${B.reset} ${s}`)},warn:(t,e)=>{let s=e?`${t} ${e}`:t;console.warn(`${B.yellow}!${B.reset} ${s}`)},info:t=>{console.log(`${B.blue}\u25CB${B.reset} ${t}`)},debug:t=>{process.env.DEBUG&&console.log(`${B.gray}\xB7${B.reset} ${t}`)},plain:t=>{console.log(t)},load:t=>console.log(`${B.cyan}\u25B8${B.reset} ${t}`),match:t=>console.log(`${B.magenta}\u25C6${B.reset} ${t}`),execute:t=>console.log(`${B.blue}\u203A${B.reset} ${t}`),agent:t=>console.log(`${B.cyan}\u25C9${B.reset} ${t}`),done:t=>console.log(`${B.green}\u2713${B.reset} ${t}`),analyze:t=>console.log(`${B.blue}\u25CB${B.reset} ${t}`),run:t=>console.log(`${B.green}\u25B6${B.reset} ${t}`),stats:t=>console.log(` ${t}`),rocket:t=>console.log(`${B.magenta}\u25B2${B.reset} ${t}`),robot:t=>console.log(`${B.cyan}\u25C9${B.reset} ${t}`),chart:t=>console.log(`${B.blue}\u25A0${B.reset} ${t}`),file:t=>console.log(`${B.gray}\u25C7${B.reset} ${t}`),sync:t=>console.log(`${B.cyan}\u21BB${B.reset} ${t}`),lightning:t=>console.log(`${B.yellow}\u26A1${B.reset} ${t}`),sparkles:t=>console.log(`${B.magenta}\u2726${B.reset} ${t}`),logo:()=>{console.log(`
45
+ ${x.cyan(Bs)}
46
+ `}}}).prompt()};`${x.gray(Z)}`;nf=Symbol.for("cancel")});async function ft(t,e){let s=$a.get(t);if(s!==void 0)return s.value;let i=await e();return $a.set(t,{value:i,timestamp:Date.now()}),i}function Rs(t){$a.delete(t)}var $a,be,Ci=M(()=>{"use strict";$a=new Map;be={CONFIG:"config",INSTRUCTIONS:"instructions",OUTPUT_FORMAT:"prompt:output-format",VALIDATION_PROMPT:"prompt:validation",GIT_STATUS:"git:status"}});function Ff(){process.stdout.write("\x1B[?25h")}function Ei(t){if(!t)return"-";if(t.startsWith("embedded:"))return t;let e=(0,yf.homedir)(),s=process.cwd();return t.startsWith(e)?"~"+t.slice(e.length):t.startsWith(s)?"."+t.slice(s.length):t}var yf,$,Zn,h,Qn,dF,Ns,Y=M(()=>{"use strict";yf=require("node:os"),$={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"},Zn=new Set;process.on("SIGINT",()=>{for(let t of Zn)t.stop();Ff(),console.log(`
47
+ ${$.yellow}!${$.reset} Interrupted - shutting down gracefully`),process.exit(130)});process.on("SIGTERM",()=>{for(let t of Zn)t.stop();Ff(),console.log(`
48
+ ${$.yellow}!${$.reset} Terminated - shutting down gracefully`),process.exit(143)});h={success:t=>{console.log(`${$.green}\u2713${$.reset} ${t}`)},error:(t,e)=>{let s=e?`${t} ${e}`:t;console.error(`${$.red}\u2717${$.reset} ${s}`)},warn:(t,e)=>{let s=e?`${t} ${e}`:t;console.warn(`${$.yellow}!${$.reset} ${s}`)},info:t=>{console.log(`${$.blue}\u25CB${$.reset} ${t}`)},debug:t=>{process.env.DEBUG&&console.log(`${$.gray}\xB7${$.reset} ${t}`)},plain:t=>{console.log(t)},load:t=>console.log(`${$.cyan}\u25B8${$.reset} ${t}`),match:t=>console.log(`${$.magenta}\u25C6${$.reset} ${t}`),execute:t=>console.log(`${$.blue}\u203A${$.reset} ${t}`),agent:t=>console.log(`${$.cyan}\u25C9${$.reset} ${t}`),done:t=>console.log(`${$.green}\u2713${$.reset} ${t}`),analyze:t=>console.log(`${$.blue}\u25CB${$.reset} ${t}`),run:t=>console.log(`${$.green}\u25B6${$.reset} ${t}`),stats:t=>console.log(` ${t}`),rocket:t=>console.log(`${$.magenta}\u25B2${$.reset} ${t}`),robot:t=>console.log(`${$.cyan}\u25C9${$.reset} ${t}`),chart:t=>console.log(`${$.blue}\u25A0${$.reset} ${t}`),file:t=>console.log(`${$.gray}\u25C7${$.reset} ${t}`),sync:t=>console.log(`${$.cyan}\u21BB${$.reset} ${t}`),lightning:t=>console.log(`${$.yellow}\u26A1${$.reset} ${t}`),sparkles:t=>console.log(`${$.magenta}\u2726${$.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 ${B.bold}Multi-agent code review${B.reset}
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 ${$.bold}Multi-agent code review${$.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()};Jn=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,Yn.add(this),this.frameIndex=0,process.stdout.write("\x1B[?25l"),this.intervalId=setInterval(()=>{let e=this.frames[this.frameIndex];process.stdout.write(`\r${B.cyan}${e}${B.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(`${B.green}\u2713${B.reset} ${s}`)}fail(e){this.stop();let s=e||this.message;console.log(`${B.red}\u2717${B.reset} ${s}`)}warn(e){this.stop();let s=e||this.message;console.log(`${B.yellow}!${B.reset} ${s}`)}stop(){this.isSpinning&&(Yn.delete(this),this.isSpinning=!1,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),process.stdout.write("\r\x1B[K"),process.stdout.write("\x1B[?25h"))}},Zy=10,Is=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,i,n,r,o){let a={id:e,label:s,status:"pending",detail:o,totalBatches:i,completedBatches:0,fileCount:n,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*Zy*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,i=this.getEstimatedTotal(e),n=s/i,r=e.completedBatches/Math.max(1,e.totalBatches);return Math.min(.95,Math.max(n,r))}calculateETA(e){if(e.status!=="running"||!e.startTime)return null;let s=Date.now()-e.startTime,i=this.getEstimatedTotal(e),n=Math.max(0,i-s);return n>1e3?n:null}formatProgressBar(e,s=12){let i=Math.round(e*s),n=s-i;return"\u2588".repeat(i)+"\u2591".repeat(n)}render(){this.linesWritten>0&&process.stdout.write(`\x1B[${this.linesWritten}A`);let e=[],s=this.taskOrder.length;for(let i=0;i<this.taskOrder.length;i++){let n=this.taskOrder[i],r=this.tasks.get(n);if(!r)continue;let o=this.formatTaskLine(r,i+1,s);e.push(o)}for(let i of e)process.stdout.write(`\x1B[K${i}
56
- `);this.linesWritten=e.length}formatTaskLine(e,s,i){let n=`[${s}/${i}]`.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=B.gray,u="\u25CB";break;case"running":a=B.cyan,u=this.frames[this.frameIndex]??"\u280B";break;case"done":a=B.green,u="\u2713";break;case"error":a=B.red,u="\u2717";break}let l=this.calculateProgress(e),c=this.formatProgressBar(l),f=`${a}${c}${B.reset} ${u}`,h="";if(e.status==="running"){let m=this.calculateETA(e);m!==null&&(h=`~${Math.ceil(m/1e3)}s`)}else e.duration!==void 0&&(h=`${(e.duration/1e3).toFixed(1)}s`);let d=e.detail?`${B.dim}| ${e.detail}${B.reset}`:"";return` ${B.dim}${n}${B.reset} ${o} ${f} ${h.padEnd(6)} ${d}`}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 V,Ba,_,et,bi=M(()=>{(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function s(n){throw new Error}t.assertNever=s,t.arrayToEnum=n=>{let r={};for(let o of n)r[o]=o;return r},t.getValidEnumValues=n=>{let r=t.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),o={};for(let a of r)o[a]=n[a];return t.objectValues(o)},t.objectValues=n=>t.objectKeys(n).map(function(r){return n[r]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let r=[];for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&r.push(o);return r},t.find=(n,r)=>{for(let o of n)if(r(o))return o},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function i(n,r=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(r)}t.joinValues=i,t.jsonStringifyReplacer=(n,r)=>typeof r=="bigint"?r.toString():r})(V||(V={}));(function(t){t.mergeShapes=(e,s)=>({...e,...s})})(Ba||(Ba={}));_=V.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 _.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 w,rF,pe,Hn=M(()=>{bi();w=V.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"]),rF=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=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};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},i={_errors:[]},n=r=>{for(let o of r.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)i._errors.push(s(o));else{let a=i,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 n(this),i}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,V.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){let s={},i=[];for(let n of this.issues)if(n.path.length>0){let r=n.path[0];s[r]=s[r]||[],s[r].push(e(n))}else i.push(e(n));return{formErrors:i,fieldErrors:s}}get formErrors(){return this.flatten()}};pe.create=t=>new pe(t)});var oF,ft,$a=M(()=>{Hn();bi();oF=(t,e)=>{let s;switch(t.code){case w.invalid_type:t.received===_.undefined?s="Required":s=`Expected ${t.expected}, received ${t.received}`;break;case w.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,V.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:s=`Unrecognized key(s) in object: ${V.joinValues(t.keys,", ")}`;break;case w.invalid_union:s="Invalid input";break;case w.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${V.joinValues(t.options)}`;break;case w.invalid_enum_value:s=`Invalid enum value. Expected ${V.joinValues(t.options)}, received '${t.received}'`;break;case w.invalid_arguments:s="Invalid function arguments";break;case w.invalid_return_type:s="Invalid function return type";break;case w.invalid_date:s="Invalid date";break;case w.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}"`:V.assertNever(t.validation):t.validation!=="regex"?s=`Invalid ${t.validation}`:s="Invalid";break;case w.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 w.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 w.custom:s="Invalid input";break;case w.invalid_intersection_types:s="Intersection results could not be merged";break;case w.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case w.not_finite:s="Number must be finite";break;default:s=e.defaultError,V.assertNever(t)}return{message:s}},ft=oF});function aF(t){Bf=t}function Rs(){return Bf}var Bf,Zn=M(()=>{$a();Bf=ft});function A(t,e){let s=Rs(),i=wi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,s,s===ft?void 0:ft].filter(n=>!!n)});t.common.issues.push(i)}var wi,uF,ce,N,Zt,De,Qn,Xn,St,Ns,Ta=M(()=>{Zn();$a();wi=t=>{let{data:e,path:s,errorMaps:i,issueData:n}=t,r=[...s,...n.path||[]],o={...n,path:r};if(n.message!==void 0)return{...n,path:r,message:n.message};let a="",u=i.filter(l=>!!l).slice().reverse();for(let l of u)a=l(o,{data:e,defaultError:a}).message;return{...n,path:r,message:a}},uF=[];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 i=[];for(let n of s){if(n.status==="aborted")return N;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,s){let i=[];for(let n of s){let r=await n.key,o=await n.value;i.push({key:r,value:o})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,s){let i={};for(let n of s){let{key:r,value:o}=n;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"||n.alwaysSet)&&(i[r.value]=o.value)}return{status:e.value,value:i}}},N=Object.freeze({status:"aborted"}),Zt=t=>({status:"dirty",value:t}),De=t=>({status:"valid",value:t}),Qn=t=>t.status==="aborted",Xn=t=>t.status==="dirty",St=t=>t.status==="valid",Ns=t=>typeof Promise<"u"&&t instanceof Promise});var $f=M(()=>{});var $,Tf=M(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})($||($={}))});function L(t){if(!t)return{};let{errorMap:e,invalid_type_error:s,required_error:i,description:n}=t;if(e&&(s||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(o,a)=>{let{message:u}=t;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??i??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:u??s??a.defaultError}},description:n}}function Pf(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 xF(t){return new RegExp(`^${Pf(t)}$`)}function Of(t){let e=`${Nf}T${Pf(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 SF(t,e){return!!((e==="v4"||!e)&&yF.test(t)||(e==="v6"||!e)&&CF.test(t))}function AF(t,e){if(!pF.test(t))return!1;try{let[s]=t.split(".");if(!s)return!1;let i=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),n=JSON.parse(atob(i));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function kF(t,e){return!!((e==="v4"||!e)&&FF.test(t)||(e==="v6"||!e)&&EF.test(t))}function _F(t,e){let s=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=s>i?s:i,r=Number.parseInt(t.toFixed(n).replace(".","")),o=Number.parseInt(e.toFixed(n).replace(".",""));return r%o/10**n}function Ps(t){if(t instanceof ve){let e={};for(let s in t.shape){let i=t.shape[s];e[s]=Te.create(Ps(i))}return new ve({...t._def,shape:()=>e})}else return t instanceof pt?new pt({...t._def,type:Ps(t.element)}):t instanceof Te?Te.create(Ps(t.unwrap())):t instanceof st?st.create(Ps(t.unwrap())):t instanceof tt?tt.create(t.items.map(e=>Ps(e))):t}function Ra(t,e){let s=et(t),i=et(e);if(t===e)return{valid:!0,data:t};if(s===_.object&&i===_.object){let n=V.objectKeys(e),r=V.objectKeys(t).filter(a=>n.indexOf(a)!==-1),o={...t,...e};for(let a of r){let u=Ra(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(s===_.array&&i===_.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let r=0;r<t.length;r++){let o=t[r],a=e[r],u=Ra(o,a);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return s===_.date&&i===_.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function Lf(t,e){return new us({values:t,typeName:P.ZodEnum,...L(e)})}function Rf(t,e){let s=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof s=="string"?{message:s}:s}function Mf(t,e={},s){return t?kt.create().superRefine((i,n)=>{let r=t(i);if(r instanceof Promise)return r.then(o=>{if(!o){let a=Rf(e,i),u=a.fatal??s??!0;n.addIssue({code:"custom",...a,fatal:u})}});if(!r){let o=Rf(e,i),a=o.fatal??s??!0;n.addIssue({code:"custom",...o,fatal:a})}}):kt.create()}var Ie,If,q,lF,cF,fF,hF,dF,pF,DF,mF,gF,Ia,yF,FF,CF,EF,bF,wF,Nf,vF,At,Qt,Xt,es,ts,Os,ss,is,kt,dt,ze,Ls,pt,ve,ns,ht,er,rs,tt,tr,Ms,js,sr,os,as,us,ls,_t,Re,Te,st,cs,fs,qs,BF,vi,xi,hs,$F,P,TF,jf,qf,IF,RF,Uf,NF,PF,OF,LF,MF,jF,qF,UF,VF,WF,zF,GF,KF,YF,JF,HF,ZF,QF,XF,eC,tC,sC,iC,nC,rC,oC,aC,uC,lC,cC,fC,hC,dC,pC,Vf=M(()=>{Hn();Zn();Tf();Ta();bi();Ie=class{constructor(e,s,i,n){this._cachedPath=[],this.parent=e,this.data=s,this._path=i,this._key=n}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}},If=(t,e)=>{if(St(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}}};q=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(Ns(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 i=this.safeParse(e,s);if(i.success)return i.data;throw i.error}safeParse(e,s){let i={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:et(e)},n=this._parseSync({data:e,path:i.path,parent:i});return If(i,n)}"~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 i=this._parseSync({data:e,path:[],parent:s});return St(i)?{value:i.value}:{issues:s.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(i=>St(i)?{value:i.value}:{issues:s.common.issues})}async parseAsync(e,s){let i=await this.safeParseAsync(e,s);if(i.success)return i.data;throw i.error}async safeParseAsync(e,s){let i={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:et(e)},n=this._parse({data:e,path:i.path,parent:i}),r=await(Ns(n)?n:Promise.resolve(n));return If(i,r)}refine(e,s){let i=n=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(n):s;return this._refinement((n,r)=>{let o=e(n),a=()=>r.addIssue({code:w.custom,...i(n)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,s){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof s=="function"?s(i,n):s),!1))}_refinement(e){return new Re({schema:this,typeName:P.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 Te.create(this,this._def)}nullable(){return st.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return pt.create(this)}promise(){return _t.create(this,this._def)}or(e){return ns.create([this,e],this._def)}and(e){return rs.create(this,e,this._def)}transform(e){return new Re({...L(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let s=typeof e=="function"?e:()=>e;return new cs({...L(this._def),innerType:this,defaultValue:s,typeName:P.ZodDefault})}brand(){return new vi({typeName:P.ZodBranded,type:this,...L(this._def)})}catch(e){let s=typeof e=="function"?e:()=>e;return new fs({...L(this._def),innerType:this,catchValue:s,typeName:P.ZodCatch})}describe(e){let s=this.constructor;return new s({...this._def,description:e})}pipe(e){return xi.create(this,e)}readonly(){return hs.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},lF=/^c[^\s-]{8,}$/i,cF=/^[0-9a-z]+$/,fF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,hF=/^[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,dF=/^[a-z0-9_-]{21}$/i,pF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,DF=/^[-+]?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)?)??$/,mF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",yF=/^(?:(?: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])$/,FF=/^(?:(?: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])$/,CF=/^(([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]))$/,EF=/^(([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])$/,bF=/^([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}(=)?))?$/,Nf="((\\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(`^${Nf}$`);At=class t extends q{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){let r=this._getOrReturnCtx(e);return A(r,{code:w.invalid_type,expected:_.string,received:r.parsedType}),N}let i=new ce,n;for(let r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),A(n,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),i.dirty());else if(r.kind==="max")e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),A(n,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),i.dirty());else if(r.kind==="length"){let o=e.data.length>r.value,a=e.data.length<r.value;(o||a)&&(n=this._getOrReturnCtx(e,n),o?A(n,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):a&&A(n,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),i.dirty())}else if(r.kind==="email")mF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"email",code:w.invalid_string,message:r.message}),i.dirty());else if(r.kind==="emoji")Ia||(Ia=new RegExp(gF,"u")),Ia.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"emoji",code:w.invalid_string,message:r.message}),i.dirty());else if(r.kind==="uuid")hF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"uuid",code:w.invalid_string,message:r.message}),i.dirty());else if(r.kind==="nanoid")dF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"nanoid",code:w.invalid_string,message:r.message}),i.dirty());else if(r.kind==="cuid")lF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"cuid",code:w.invalid_string,message:r.message}),i.dirty());else if(r.kind==="cuid2")cF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"cuid2",code:w.invalid_string,message:r.message}),i.dirty());else if(r.kind==="ulid")fF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"ulid",code:w.invalid_string,message:r.message}),i.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),A(n,{validation:"url",code:w.invalid_string,message:r.message}),i.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"regex",code:w.invalid_string,message:r.message}),i.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),A(n,{code:w.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),i.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)||(n=this._getOrReturnCtx(e,n),A(n,{code:w.invalid_string,validation:{startsWith:r.value},message:r.message}),i.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),A(n,{code:w.invalid_string,validation:{endsWith:r.value},message:r.message}),i.dirty()):r.kind==="datetime"?Of(r).test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{code:w.invalid_string,validation:"datetime",message:r.message}),i.dirty()):r.kind==="date"?vF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{code:w.invalid_string,validation:"date",message:r.message}),i.dirty()):r.kind==="time"?xF(r).test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{code:w.invalid_string,validation:"time",message:r.message}),i.dirty()):r.kind==="duration"?DF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"duration",code:w.invalid_string,message:r.message}),i.dirty()):r.kind==="ip"?SF(e.data,r.version)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"ip",code:w.invalid_string,message:r.message}),i.dirty()):r.kind==="jwt"?AF(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"jwt",code:w.invalid_string,message:r.message}),i.dirty()):r.kind==="cidr"?kF(e.data,r.version)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"cidr",code:w.invalid_string,message:r.message}),i.dirty()):r.kind==="base64"?bF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"base64",code:w.invalid_string,message:r.message}),i.dirty()):r.kind==="base64url"?wF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"base64url",code:w.invalid_string,message:r.message}),i.dirty()):V.assertNever(r);return{status:i.value,value:e.data}}_regex(e,s,i){return this.refinement(n=>e.test(n),{validation:s,code:w.invalid_string,...$.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...$.errToObj(e)})}url(e){return this._addCheck({kind:"url",...$.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...$.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...$.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...$.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...$.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...$.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...$.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...$.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...$.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...$.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...$.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...$.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,...$.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,...$.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...$.errToObj(e)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...$.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s?.position,...$.errToObj(s?.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...$.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...$.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...$.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...$.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...$.errToObj(s)})}nonempty(e){return this.min(1,$.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}};At.create=t=>new At({checks:[],typeName:P.ZodString,coerce:t?.coerce??!1,...L(t)});Qt=class t extends q{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 A(r,{code:w.invalid_type,expected:_.number,received:r.parsedType}),N}let i,n=new ce;for(let r of this._def.checks)r.kind==="int"?V.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{code:w.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(i=this._getOrReturnCtx(e,i),A(i,{code:w.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(i=this._getOrReturnCtx(e,i),A(i,{code:w.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="multipleOf"?_F(e.data,r.value)!==0&&(i=this._getOrReturnCtx(e,i),A(i,{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{code:w.not_finite,message:r.message}),n.dirty()):V.assertNever(r);return{status:n.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,$.toString(s))}gt(e,s){return this.setLimit("min",e,!1,$.toString(s))}lte(e,s){return this.setLimit("max",e,!0,$.toString(s))}lt(e,s){return this.setLimit("max",e,!1,$.toString(s))}setLimit(e,s,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:i,message:$.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:$.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:$.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:$.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.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"&&V.isInteger(e.value))}get isFinite(){let e=null,s=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(s===null||i.value>s)&&(s=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(s)&&Number.isFinite(e)}};Qt.create=t=>new Qt({checks:[],typeName:P.ZodNumber,coerce:t?.coerce||!1,...L(t)});Xt=class t extends q{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 i,n=new ce;for(let r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(i=this._getOrReturnCtx(e,i),A(i,{code:w.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(i=this._getOrReturnCtx(e,i),A(i,{code:w.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),A(i,{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):V.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let s=this._getOrReturnCtx(e);return A(s,{code:w.invalid_type,expected:_.bigint,received:s.parsedType}),N}gte(e,s){return this.setLimit("min",e,!0,$.toString(s))}gt(e,s){return this.setLimit("min",e,!1,$.toString(s))}lte(e,s){return this.setLimit("max",e,!0,$.toString(s))}lt(e,s){return this.setLimit("max",e,!1,$.toString(s))}setLimit(e,s,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:i,message:$.toString(n)}]})}_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:$.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:$.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}};Xt.create=t=>new Xt({checks:[],typeName:P.ZodBigInt,coerce:t?.coerce??!1,...L(t)});es=class extends q{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.boolean){let i=this._getOrReturnCtx(e);return A(i,{code:w.invalid_type,expected:_.boolean,received:i.parsedType}),N}return De(e.data)}};es.create=t=>new es({typeName:P.ZodBoolean,coerce:t?.coerce||!1,...L(t)});ts=class t extends q{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){let r=this._getOrReturnCtx(e);return A(r,{code:w.invalid_type,expected:_.date,received:r.parsedType}),N}if(Number.isNaN(e.data.getTime())){let r=this._getOrReturnCtx(e);return A(r,{code:w.invalid_date}),N}let i=new ce,n;for(let r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),A(n,{code:w.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),i.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),A(n,{code:w.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),i.dirty()):V.assertNever(r);return{status:i.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:$.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:$.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}};ts.create=t=>new ts({checks:[],coerce:t?.coerce||!1,typeName:P.ZodDate,...L(t)});Os=class extends q{_parse(e){if(this._getType(e)!==_.symbol){let i=this._getOrReturnCtx(e);return A(i,{code:w.invalid_type,expected:_.symbol,received:i.parsedType}),N}return De(e.data)}};Os.create=t=>new Os({typeName:P.ZodSymbol,...L(t)});ss=class extends q{_parse(e){if(this._getType(e)!==_.undefined){let i=this._getOrReturnCtx(e);return A(i,{code:w.invalid_type,expected:_.undefined,received:i.parsedType}),N}return De(e.data)}};ss.create=t=>new ss({typeName:P.ZodUndefined,...L(t)});is=class extends q{_parse(e){if(this._getType(e)!==_.null){let i=this._getOrReturnCtx(e);return A(i,{code:w.invalid_type,expected:_.null,received:i.parsedType}),N}return De(e.data)}};is.create=t=>new is({typeName:P.ZodNull,...L(t)});kt=class extends q{constructor(){super(...arguments),this._any=!0}_parse(e){return De(e.data)}};kt.create=t=>new kt({typeName:P.ZodAny,...L(t)});dt=class extends q{constructor(){super(...arguments),this._unknown=!0}_parse(e){return De(e.data)}};dt.create=t=>new dt({typeName:P.ZodUnknown,...L(t)});ze=class extends q{_parse(e){let s=this._getOrReturnCtx(e);return A(s,{code:w.invalid_type,expected:_.never,received:s.parsedType}),N}};ze.create=t=>new ze({typeName:P.ZodNever,...L(t)});Ls=class extends q{_parse(e){if(this._getType(e)!==_.undefined){let i=this._getOrReturnCtx(e);return A(i,{code:w.invalid_type,expected:_.void,received:i.parsedType}),N}return De(e.data)}};Ls.create=t=>new Ls({typeName:P.ZodVoid,...L(t)});pt=class t extends q{_parse(e){let{ctx:s,status:i}=this._processInputParams(e),n=this._def;if(s.parsedType!==_.array)return A(s,{code:w.invalid_type,expected:_.array,received:s.parsedType}),N;if(n.exactLength!==null){let o=s.data.length>n.exactLength.value,a=s.data.length<n.exactLength.value;(o||a)&&(A(s,{code:o?w.too_big:w.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&s.data.length<n.minLength.value&&(A(s,{code:w.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&s.data.length>n.maxLength.value&&(A(s,{code:w.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),s.common.async)return Promise.all([...s.data].map((o,a)=>n.type._parseAsync(new Ie(s,o,s.path,a)))).then(o=>ce.mergeArray(i,o));let r=[...s.data].map((o,a)=>n.type._parseSync(new Ie(s,o,s.path,a)));return ce.mergeArray(i,r)}get element(){return this._def.type}min(e,s){return new t({...this._def,minLength:{value:e,message:$.toString(s)}})}max(e,s){return new t({...this._def,maxLength:{value:e,message:$.toString(s)}})}length(e,s){return new t({...this._def,exactLength:{value:e,message:$.toString(s)}})}nonempty(e){return this.min(1,e)}};pt.create=(t,e)=>new pt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...L(e)});ve=class t extends q{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=V.objectKeys(e);return this._cached={shape:e,keys:s},this._cached}_parse(e){if(this._getType(e)!==_.object){let l=this._getOrReturnCtx(e);return A(l,{code:w.invalid_type,expected:_.object,received:l.parsedType}),N}let{status:i,ctx:n}=this._processInputParams(e),{shape:r,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof ze&&this._def.unknownKeys==="strip"))for(let l in n.data)o.includes(l)||a.push(l);let u=[];for(let l of o){let c=r[l],f=n.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Ie(n,f,n.path,l)),alwaysSet:l in n.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:n.data[c]}});else if(l==="strict")a.length>0&&(A(n,{code:w.unrecognized_keys,keys:a}),i.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=n.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Ie(n,f,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let f=await c.key,h=await c.value;l.push({key:f,value:h,alwaysSet:c.alwaysSet})}return l}).then(l=>ce.mergeObjectSync(i,l)):ce.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(e){return $.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,i)=>{let n=this._def.errorMap?.(s,i).message??i.defaultError;return s.code==="unrecognized_keys"?{message:$.errToObj(e).message??n}:{message:n}}}:{}})}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:P.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let s={};for(let i of V.objectKeys(e))e[i]&&this.shape[i]&&(s[i]=this.shape[i]);return new t({...this._def,shape:()=>s})}omit(e){let s={};for(let i of V.objectKeys(this.shape))e[i]||(s[i]=this.shape[i]);return new t({...this._def,shape:()=>s})}deepPartial(){return Ps(this)}partial(e){let s={};for(let i of V.objectKeys(this.shape)){let n=this.shape[i];e&&!e[i]?s[i]=n:s[i]=n.optional()}return new t({...this._def,shape:()=>s})}required(e){let s={};for(let i of V.objectKeys(this.shape))if(e&&!e[i])s[i]=this.shape[i];else{let r=this.shape[i];for(;r instanceof Te;)r=r._def.innerType;s[i]=r}return new t({...this._def,shape:()=>s})}keyof(){return Lf(V.objectKeys(this.shape))}};ve.create=(t,e)=>new ve({shape:()=>t,unknownKeys:"strip",catchall:ze.create(),typeName:P.ZodObject,...L(e)});ve.strictCreate=(t,e)=>new ve({shape:()=>t,unknownKeys:"strict",catchall:ze.create(),typeName:P.ZodObject,...L(e)});ve.lazycreate=(t,e)=>new ve({shape:t,unknownKeys:"strip",catchall:ze.create(),typeName:P.ZodObject,...L(e)});ns=class extends q{_parse(e){let{ctx:s}=this._processInputParams(e),i=this._def.options;function n(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 A(s,{code:w.invalid_union,unionErrors:o}),N}if(s.common.async)return Promise.all(i.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(n);{let r,o=[];for(let u of i){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 A(s,{code:w.invalid_union,unionErrors:a}),N}}get options(){return this._def.options}};ns.create=(t,e)=>new ns({options:t,typeName:P.ZodUnion,...L(e)});ht=t=>t instanceof os?ht(t.schema):t instanceof Re?ht(t.innerType()):t instanceof as?[t.value]:t instanceof us?t.options:t instanceof ls?V.objectValues(t.enum):t instanceof cs?ht(t._def.innerType):t instanceof ss?[void 0]:t instanceof is?[null]:t instanceof Te?[void 0,...ht(t.unwrap())]:t instanceof st?[null,...ht(t.unwrap())]:t instanceof vi||t instanceof hs?ht(t.unwrap()):t instanceof fs?ht(t._def.innerType):[],er=class t extends q{_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==_.object)return A(s,{code:w.invalid_type,expected:_.object,received:s.parsedType}),N;let i=this.discriminator,n=s.data[i],r=this.optionsMap.get(n);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}):(A(s,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),N)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,s,i){let n=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(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,r)}}return new t({typeName:P.ZodDiscriminatedUnion,discriminator:e,options:s,optionsMap:n,...L(i)})}};rs=class extends q{_parse(e){let{status:s,ctx:i}=this._processInputParams(e),n=(r,o)=>{if(Qn(r)||Qn(o))return N;let a=Ra(r.value,o.value);return a.valid?((Xn(r)||Xn(o))&&s.dirty(),{status:s.value,value:a.data}):(A(i,{code:w.invalid_intersection_types}),N)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([r,o])=>n(r,o)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};rs.create=(t,e,s)=>new rs({left:t,right:e,typeName:P.ZodIntersection,...L(s)});tt=class t extends q{_parse(e){let{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.array)return A(i,{code:w.invalid_type,expected:_.array,received:i.parsedType}),N;if(i.data.length<this._def.items.length)return A(i,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N;!this._def.rest&&i.data.length>this._def.items.length&&(A(i,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let r=[...i.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new Ie(i,o,i.path,a)):null}).filter(o=>!!o);return i.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:P.ZodTuple,rest:null,...L(e)})};tr=class t extends q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.object)return A(i,{code:w.invalid_type,expected:_.object,received:i.parsedType}),N;let n=[],r=this._def.keyType,o=this._def.valueType;for(let a in i.data)n.push({key:r._parse(new Ie(i,a,i.path,a)),value:o._parse(new Ie(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?ce.mergeObjectAsync(s,n):ce.mergeObjectSync(s,n)}get element(){return this._def.valueType}static create(e,s,i){return s instanceof q?new t({keyType:e,valueType:s,typeName:P.ZodRecord,...L(i)}):new t({keyType:At.create(),valueType:e,typeName:P.ZodRecord,...L(s)})}},Ms=class extends q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.map)return A(i,{code:w.invalid_type,expected:_.map,received:i.parsedType}),N;let n=this._def.keyType,r=this._def.valueType,o=[...i.data.entries()].map(([a,u],l)=>({key:n._parse(new Ie(i,a,i.path,[l,"key"])),value:r._parse(new Ie(i,u,i.path,[l,"value"]))}));if(i.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}}}};Ms.create=(t,e,s)=>new Ms({valueType:e,keyType:t,typeName:P.ZodMap,...L(s)});js=class t extends q{_parse(e){let{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.set)return A(i,{code:w.invalid_type,expected:_.set,received:i.parsedType}),N;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(A(i,{code:w.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),s.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(A(i,{code:w.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.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=[...i.data.values()].map((u,l)=>r._parse(new Ie(i,u,i.path,l)));return i.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,s){return new t({...this._def,minSize:{value:e,message:$.toString(s)}})}max(e,s){return new t({...this._def,maxSize:{value:e,message:$.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}};js.create=(t,e)=>new js({valueType:t,minSize:null,maxSize:null,typeName:P.ZodSet,...L(e)});sr=class t extends q{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==_.function)return A(s,{code:w.invalid_type,expected:_.function,received:s.parsedType}),N;function i(a,u){return wi({data:a,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Rs(),ft].filter(l=>!!l),issueData:{code:w.invalid_arguments,argumentsError:u}})}function n(a,u){return wi({data:a,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Rs(),ft].filter(l=>!!l),issueData:{code:w.invalid_return_type,returnTypeError:u}})}let r={errorMap:s.common.contextualErrorMap},o=s.data;if(this._def.returns instanceof _t){let a=this;return De(async function(...u){let l=new pe([]),c=await a._def.args.parseAsync(u,r).catch(d=>{throw l.addIssue(i(u,d)),l}),f=await Reflect.apply(o,this,c);return await a._def.returns._def.type.parseAsync(f,r).catch(d=>{throw l.addIssue(n(f,d)),l})})}else{let a=this;return De(function(...u){let l=a._def.args.safeParse(u,r);if(!l.success)throw new pe([i(u,l.error)]);let c=Reflect.apply(o,this,l.data),f=a._def.returns.safeParse(c,r);if(!f.success)throw new pe([n(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(dt.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,i){return new t({args:e||tt.create([]).rest(dt.create()),returns:s||dt.create(),typeName:P.ZodFunction,...L(i)})}},os=class extends q{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})}};os.create=(t,e)=>new os({getter:t,typeName:P.ZodLazy,...L(e)});as=class extends q{_parse(e){if(e.data!==this._def.value){let s=this._getOrReturnCtx(e);return A(s,{received:s.data,code:w.invalid_literal,expected:this._def.value}),N}return{status:"valid",value:e.data}}get value(){return this._def.value}};as.create=(t,e)=>new as({value:t,typeName:P.ZodLiteral,...L(e)});us=class t extends q{_parse(e){if(typeof e.data!="string"){let s=this._getOrReturnCtx(e),i=this._def.values;return A(s,{expected:V.joinValues(i),received:s.parsedType,code:w.invalid_type}),N}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let s=this._getOrReturnCtx(e),i=this._def.values;return A(s,{received:s.data,code:w.invalid_enum_value,options:i}),N}return De(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(i=>!e.includes(i)),{...this._def,...s})}};us.create=Lf;ls=class extends q{_parse(e){let s=V.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==_.string&&i.parsedType!==_.number){let n=V.objectValues(s);return A(i,{expected:V.joinValues(n),received:i.parsedType,code:w.invalid_type}),N}if(this._cache||(this._cache=new Set(V.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=V.objectValues(s);return A(i,{received:i.data,code:w.invalid_enum_value,options:n}),N}return De(e.data)}get enum(){return this._def.values}};ls.create=(t,e)=>new ls({values:t,typeName:P.ZodNativeEnum,...L(e)});_t=class extends q{unwrap(){return this._def.type}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==_.promise&&s.common.async===!1)return A(s,{code:w.invalid_type,expected:_.promise,received:s.parsedType}),N;let i=s.parsedType===_.promise?s.data:Promise.resolve(s.data);return De(i.then(n=>this._def.type.parseAsync(n,{path:s.path,errorMap:s.common.contextualErrorMap})))}};_t.create=(t,e)=>new _t({type:t,typeName:P.ZodPromise,...L(e)});Re=class extends q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:s,ctx:i}=this._processInputParams(e),n=this._def.effect||null,r={addIssue:o=>{A(i,o),o.fatal?s.abort():s.dirty()},get path(){return i.path}};if(r.addIssue=r.addIssue.bind(r),n.type==="preprocess"){let o=n.transform(i.data,r);if(i.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:i.path,parent:i});return u.status==="aborted"?N:u.status==="dirty"?Zt(u.value):s.value==="dirty"?Zt(u.value):u});{if(s.value==="aborted")return N;let a=this._def.schema._parseSync({data:o,path:i.path,parent:i});return a.status==="aborted"?N:a.status==="dirty"?Zt(a.value):s.value==="dirty"?Zt(a.value):a}}if(n.type==="refinement"){let o=a=>{let u=n.refinement(a,r);if(i.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(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});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:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?N:(a.status==="dirty"&&s.dirty(),o(a.value).then(()=>({status:s.value,value:a.value}))))}if(n.type==="transform")if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!St(o))return N;let a=n.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:i.data,path:i.path,parent:i}).then(o=>St(o)?Promise.resolve(n.transform(o.value,r)).then(a=>({status:s.value,value:a})):N);V.assertNever(n)}};Re.create=(t,e,s)=>new Re({schema:t,typeName:P.ZodEffects,effect:e,...L(s)});Re.createWithPreprocess=(t,e,s)=>new Re({schema:e,effect:{type:"preprocess",transform:t},typeName:P.ZodEffects,...L(s)});Te=class extends q{_parse(e){return this._getType(e)===_.undefined?De(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Te.create=(t,e)=>new Te({innerType:t,typeName:P.ZodOptional,...L(e)});st=class extends q{_parse(e){return this._getType(e)===_.null?De(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};st.create=(t,e)=>new st({innerType:t,typeName:P.ZodNullable,...L(e)});cs=class extends q{_parse(e){let{ctx:s}=this._processInputParams(e),i=s.data;return s.parsedType===_.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};cs.create=(t,e)=>new cs({innerType:t,typeName:P.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});fs=class extends q{_parse(e){let{ctx:s}=this._processInputParams(e),i={...s,common:{...s.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ns(n)?n.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new pe(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new pe(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};fs.create=(t,e)=>new fs({innerType:t,typeName:P.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});qs=class extends q{_parse(e){if(this._getType(e)!==_.nan){let i=this._getOrReturnCtx(e);return A(i,{code:w.invalid_type,expected:_.nan,received:i.parsedType}),N}return{status:"valid",value:e.data}}};qs.create=t=>new qs({typeName:P.ZodNaN,...L(t)});BF=Symbol("zod_brand"),vi=class extends q{_parse(e){let{ctx:s}=this._processInputParams(e),i=s.data;return this._def.type._parse({data:i,path:s.path,parent:s})}unwrap(){return this._def.type}},xi=class t extends q{_parse(e){let{status:s,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?N:r.status==="dirty"?(s.dirty(),Zt(r.value)):this._def.out._parseAsync({data:r.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?N:n.status==="dirty"?(s.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,s){return new t({in:e,out:s,typeName:P.ZodPipeline})}},hs=class extends q{_parse(e){let s=this._def.innerType._parse(e),i=n=>(St(n)&&(n.value=Object.freeze(n.value)),n);return Ns(s)?s.then(n=>i(n)):i(s)}unwrap(){return this._def.innerType}};hs.create=(t,e)=>new hs({innerType:t,typeName:P.ZodReadonly,...L(e)});$F={object:ve.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"})(P||(P={}));TF=(t,e={message:`Input not instance of ${t.name}`})=>Mf(s=>s instanceof t,e),jf=At.create,qf=Qt.create,IF=qs.create,RF=Xt.create,Uf=es.create,NF=ts.create,PF=Os.create,OF=ss.create,LF=is.create,MF=kt.create,jF=dt.create,qF=ze.create,UF=Ls.create,VF=pt.create,WF=ve.create,zF=ve.strictCreate,GF=ns.create,KF=er.create,YF=rs.create,JF=tt.create,HF=tr.create,ZF=Ms.create,QF=js.create,XF=sr.create,eC=os.create,tC=as.create,sC=us.create,iC=ls.create,nC=_t.create,rC=Re.create,oC=Te.create,aC=st.create,uC=Re.createWithPreprocess,lC=xi.create,cC=()=>jf().optional(),fC=()=>qf().optional(),hC=()=>Uf().optional(),dC={string:(t=>At.create({...t,coerce:!0})),number:(t=>Qt.create({...t,coerce:!0})),boolean:(t=>es.create({...t,coerce:!0})),bigint:(t=>Xt.create({...t,coerce:!0})),date:(t=>ts.create({...t,coerce:!0}))},pC=N});var I={};di(I,{BRAND:()=>BF,DIRTY:()=>Zt,EMPTY_PATH:()=>uF,INVALID:()=>N,NEVER:()=>pC,OK:()=>De,ParseStatus:()=>ce,Schema:()=>q,ZodAny:()=>kt,ZodArray:()=>pt,ZodBigInt:()=>Xt,ZodBoolean:()=>es,ZodBranded:()=>vi,ZodCatch:()=>fs,ZodDate:()=>ts,ZodDefault:()=>cs,ZodDiscriminatedUnion:()=>er,ZodEffects:()=>Re,ZodEnum:()=>us,ZodError:()=>pe,ZodFirstPartyTypeKind:()=>P,ZodFunction:()=>sr,ZodIntersection:()=>rs,ZodIssueCode:()=>w,ZodLazy:()=>os,ZodLiteral:()=>as,ZodMap:()=>Ms,ZodNaN:()=>qs,ZodNativeEnum:()=>ls,ZodNever:()=>ze,ZodNull:()=>is,ZodNullable:()=>st,ZodNumber:()=>Qt,ZodObject:()=>ve,ZodOptional:()=>Te,ZodParsedType:()=>_,ZodPipeline:()=>xi,ZodPromise:()=>_t,ZodReadonly:()=>hs,ZodRecord:()=>tr,ZodSchema:()=>q,ZodSet:()=>js,ZodString:()=>At,ZodSymbol:()=>Os,ZodTransformer:()=>Re,ZodTuple:()=>tt,ZodType:()=>q,ZodUndefined:()=>ss,ZodUnion:()=>ns,ZodUnknown:()=>dt,ZodVoid:()=>Ls,addIssueToContext:()=>A,any:()=>MF,array:()=>VF,bigint:()=>RF,boolean:()=>Uf,coerce:()=>dC,custom:()=>Mf,date:()=>NF,datetimeRegex:()=>Of,defaultErrorMap:()=>ft,discriminatedUnion:()=>KF,effect:()=>rC,enum:()=>sC,function:()=>XF,getErrorMap:()=>Rs,getParsedType:()=>et,instanceof:()=>TF,intersection:()=>YF,isAborted:()=>Qn,isAsync:()=>Ns,isDirty:()=>Xn,isValid:()=>St,late:()=>$F,lazy:()=>eC,literal:()=>tC,makeIssue:()=>wi,map:()=>ZF,nan:()=>IF,nativeEnum:()=>iC,never:()=>qF,null:()=>LF,nullable:()=>aC,number:()=>qf,object:()=>WF,objectUtil:()=>Ba,oboolean:()=>hC,onumber:()=>fC,optional:()=>oC,ostring:()=>cC,pipeline:()=>lC,preprocess:()=>uC,promise:()=>nC,quotelessJson:()=>rF,record:()=>HF,set:()=>QF,setErrorMap:()=>aF,strictObject:()=>zF,string:()=>jf,symbol:()=>PF,transformer:()=>rC,tuple:()=>JF,undefined:()=>OF,union:()=>GF,unknown:()=>jF,util:()=>V,void:()=>UF});var Na=M(()=>{Zn();Ta();$f();bi();Vf();Hn()});var Us=M(()=>{Na();Na()});function Oa(){return Pa.parse({})}async function Ai(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 Gf(t){if(!await Ai(t))return null;let s=await(0,ke.readFile)(t,"utf-8");try{return JSON.parse(s)}catch(i){let n=i instanceof SyntaxError?i.message:String(i);throw new Error(`Invalid JSON in config file ${t}: ${n}`)}}function Kf(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?yC(t.executors,e.executors):t.executors,agents:e.agents?Yf(t.agents,e.agents):t.agents,rules:e.rules?Yf(t.rules,e.rules):t.rules,output:e.output?{...t.output,...e.output}:t.output}}async function Fe(t){let e=t?`${we.CONFIG}:${t}`:we.CONFIG;return ct(e,async()=>{let s=Oa(),i=await Gf(Si);if(i&&(s=Pa.parse(Kf(s,i))),t){let n=(0,Bt.join)(t,nr),r=await Gf(n);r&&(s=Pa.parse(Kf(s,r)))}return s})}async function Hf(t){try{await(0,ke.mkdir)(ir,{recursive:!0}),await(0,ke.writeFile)(Si,JSON.stringify(t,null,2)),Ts(we.CONFIG)}catch(e){throw new Error(`Failed to save global config: ${e}`)}}async function Zf(t){let e=(0,Bt.join)(t,nr);return await Ai(e)||(await(0,ke.writeFile)(e,JSON.stringify({agents:{},rules:{}},null,2)),Ts(we.CONFIG)),e}function yC(t,e){let s={...t};for(let[i,n]of Object.entries(e))s[i]={...s[i],...n,review:n.review?{...s[i]?.review,...n.review}:s[i]?.review,validation:n.validation?{...s[i]?.validation,...n.validation}:s[i]?.validation};return s}function Yf(t,e){let s={...t};for(let[i,n]of Object.entries(e))s[i]={...s[i],...n};return s}function La(){return Si}function ki(t){return(0,Bt.join)(t,nr)}async function Ma(){return Ai(Si)}async function rr(t){return Ai(ki(t))}async function or(){return ct(we.INSTRUCTIONS,async()=>{try{return await Ai(zf)?await(0,ke.readFile)(zf,"utf-8"):""}catch{return""}})}async function Qf(t,e,s){let i=e?Si:(0,Bt.join)(s||process.cwd(),nr),n={};try{let o=await(0,ke.readFile)(i,"utf-8");n=JSON.parse(o)}catch{}Array.isArray(n.extends)||(n.extends=[]);let r=n.extends;r.includes(t)||r.push(t),e&&await(0,ke.mkdir)(ir,{recursive:!0}),await(0,ke.writeFile)(i,JSON.stringify(n,null,2)),Ts(we.CONFIG)}var Bt,Jf,ke,Wf,DC,mC,gC,Pa,ir,Si,zf,nr,Ge=M(()=>{"use strict";Us();Bt=require("path"),Jf=require("os"),ke=require("node:fs/promises");yi();Wf=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()}),DC=I.object({review:Wf.optional(),validation:Wf.optional()}),mC=I.object({enabled:I.boolean().optional(),model:I.string().optional(),timeout:I.number().positive().optional()}),gC=I.object({enabled:I.boolean().optional(),agent:I.string().optional()}),Pa=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(),DC).default({}),agents:I.record(I.string(),mC).default({}),rules:I.record(I.string(),gC).default({}),output:I.object({colorize:I.boolean().default(!0),verbose:I.boolean().default(!1),format:I.enum(["terminal","markdown","json"]).default("terminal")}).default({})}),ir=(0,Bt.join)((0,Jf.homedir)(),".diffray"),Si=(0,Bt.join)(ir,"config.json"),zf=(0,Bt.join)(ir,"instructions.md"),nr=".diffray.json"});var ja,Xf,FC,eh=M(()=>{ja=(t,e,s)=>{let i=t instanceof RegExp?Xf(t,s):t,n=e instanceof RegExp?Xf(e,s):e,r=i!==null&&n!=null&&FC(i,n,s);return r&&{start:r[0],end:r[1],pre:s.slice(0,r[0]),body:s.slice(r[0]+i.length,r[1]),post:s.slice(r[1]+n.length)}},Xf=(t,e)=>{let s=e.match(t);return s?s[0]:null},FC=(t,e,s)=>{let i,n,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(i=[],r=s.length;c>=0&&!a;){if(c===u)i.push(c),u=s.indexOf(t,c+1);else if(i.length===1){let f=i.pop();f!==void 0&&(a=[f,l])}else n=i.pop(),n!==void 0&&n<r&&(r=n,o=l),l=s.indexOf(e,c+1);c=u<l&&u>=0?u:l}i.length&&o!==void 0&&(a=[r,o])}return a}});function qa(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function BC(t){return t.replace(xC,th).replace(SC,sh).replace(AC,Ua).replace(kC,ih).replace(_C,nh)}function $C(t){return t.replace(CC,"\\").replace(EC,"{").replace(bC,"}").replace(wC,",").replace(vC,".")}function rh(t){if(!t)return[""];let e=[],s=ja("{","}",t);if(!s)return t.split(",");let{pre:i,body:n,post:r}=s,o=i.split(",");o[o.length-1]+="{"+n+"}";let a=rh(r);return r.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function oh(t){return t?(t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),_i(BC(t),!0).map($C)):[]}function TC(t){return"{"+t+"}"}function IC(t){return/^-?0\d/.test(t)}function RC(t,e){return t<=e}function NC(t,e){return t>=e}function _i(t,e){let s=[],i=ja("{","}",t);if(!i)return[t];let n=i.pre,r=i.post.length?_i(i.post,!1):[""];if(/\$$/.test(i.pre))for(let o=0;o<r.length;o++){let a=n+"{"+i.body+"}"+r[o];s.push(a)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),u=o||a,l=i.body.indexOf(",")>=0;if(!u&&!l)return i.post.match(/,(?!,).*\}/)?(t=i.pre+"{"+i.body+Ua+i.post,_i(t)):[t];let c;if(u)c=i.body.split(/\.\./);else if(c=rh(i.body),c.length===1&&c[0]!==void 0&&(c=_i(c[0],!1).map(TC),c.length===1))return r.map(h=>i.pre+c[0]+h);let f;if(u&&c[0]!==void 0&&c[1]!==void 0){let h=qa(c[0]),d=qa(c[1]),m=Math.max(c[0].length,c[1].length),D=c.length===3&&c[2]!==void 0?Math.abs(qa(c[2])):1,g=RC;d<h&&(D*=-1,g=NC);let y=c.some(IC);f=[];for(let C=h;g(C,d);C+=D){let E;if(a)E=String.fromCharCode(C),E==="\\"&&(E="");else if(E=String(C),y){let v=m-E.length;if(v>0){let S=new Array(v+1).join("0");C<0?E="-"+S+E.slice(1):E=S+E}}f.push(E)}}else{f=[];for(let h=0;h<c.length;h++)f.push.apply(f,_i(c[h],!1))}for(let h=0;h<f.length;h++)for(let d=0;d<r.length;d++){let m=n+f[h]+r[d];(!e||u||m)&&s.push(m)}}return s}var th,sh,Ua,ih,nh,CC,EC,bC,wC,vC,xC,SC,AC,kC,_C,ah=M(()=>{eh();th="\0SLASH"+Math.random()+"\0",sh="\0OPEN"+Math.random()+"\0",Ua="\0CLOSE"+Math.random()+"\0",ih="\0COMMA"+Math.random()+"\0",nh="\0PERIOD"+Math.random()+"\0",CC=new RegExp(th,"g"),EC=new RegExp(sh,"g"),bC=new RegExp(Ua,"g"),wC=new RegExp(ih,"g"),vC=new RegExp(nh,"g"),xC=/\\\\/g,SC=/\\{/g,AC=/\\}/g,kC=/\\,/g,_C=/\\./g});var Bi,uh=M(()=>{Bi=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")}});var PC,$i,OC,lh,ch,fh=M(()=>{PC={"[: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]},$i=t=>t.replace(/[[\]\\-]/g,"\\$&"),OC=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),lh=t=>t.join(""),ch=(t,e)=>{let s=e;if(t.charAt(s)!=="[")throw new Error("not in a brace expression");let i=[],n=[],r=s+1,o=!1,a=!1,u=!1,l=!1,c=s,f="";e:for(;r<t.length;){let D=t.charAt(r);if((D==="!"||D==="^")&&r===s+1){l=!0,r++;continue}if(D==="]"&&o&&!u){c=r+1;break}if(o=!0,D==="\\"&&!u){u=!0,r++;continue}if(D==="["&&!u){for(let[g,[F,y,C]]of Object.entries(PC))if(t.startsWith(g,r)){if(f)return["$.",!1,t.length-s,!0];r+=g.length,C?n.push(F):i.push(F),a=a||y;continue e}}if(u=!1,f){D>f?i.push($i(f)+"-"+$i(D)):D===f&&i.push($i(D)),f="",r++;continue}if(t.startsWith("-]",r+1)){i.push($i(D+"-")),r+=2;continue}if(t.startsWith("-",r+1)){f=D,r+=2;continue}i.push($i(D)),r++}if(c<r)return["",!1,0,!1];if(!i.length&&!n.length)return["$.",!1,t.length-s,!0];if(n.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!l){let D=i[0].length===2?i[0].slice(-1):i[0];return[OC(D),!1,c-s,!1]}let h="["+(l?"^":"")+lh(i)+"]",d="["+(l?"":"^")+lh(n)+"]";return[i.length&&n.length?"("+h+"|"+d+")":i.length?h:d,a,c-s,!0]}});var Ne,ar=M(()=>{Ne=(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 LC,hh,MC,ur,jC,qC,UC,VC,Va,dh,ph,Vs,Wa=M(()=>{fh();ar();LC=new Set(["!","?","+","*","@"]),hh=t=>LC.has(t),MC="(?!(?:^|/)\\.\\.?(?:$|/))",ur="(?!\\.)",jC=new Set(["[","."]),qC=new Set(["..","."]),UC=new Set("().*{}+?[]^$\\!"),VC=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Va="[^/]",dh=Va+"*?",ph=Va+"+?",Vs=class t{type;#e;#s;#r=!1;#n=[];#o;#C;#g;#c=!1;#a;#h;#f=!1;constructor(e,s,i={}){this.type=e,e&&(this.#s=!0),this.#o=s,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?i: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.#n.length:0}get hasMagic(){if(this.#s!==void 0)return this.#s;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#s=!0;return this.#s}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#h=this.#n.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,i=s.#o;for(;i;){for(let n=s.#C+1;!i.type&&n<i.#n.length;n++)for(let r of e.#n){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(i.#n[n])}s=i,i=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.#n.push(s)}}toJSON(){let e=this.type===null?this.#n.slice().map(s=>typeof s=="string"?s:s.toJSON()):[this.type,...this.#n.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 i=e.#n[s];if(!(i instanceof t&&i.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.#n.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 i of this.#n)s.copyIn(i);return s}static#i(e,s,i,n){let r=!1,o=!1,a=-1,u=!1;if(s.type===null){let d=i,m="";for(;d<e.length;){let D=e.charAt(d++);if(r||D==="\\"){r=!r,m+=D;continue}if(o){d===a+1?(D==="^"||D==="!")&&(u=!0):D==="]"&&!(d===a+2&&u)&&(o=!1),m+=D;continue}else if(D==="["){o=!0,a=d,u=!1,m+=D;continue}if(!n.noext&&hh(D)&&e.charAt(d)==="("){s.push(m),m="";let g=new t(D,s);d=t.#i(e,g,d,n),s.push(g);continue}m+=D}return s.push(m),d}let l=i+1,c=new t(null,s),f=[],h="";for(;l<e.length;){let d=e.charAt(l++);if(r||d==="\\"){r=!r,h+=d;continue}if(o){l===a+1?(d==="^"||d==="!")&&(u=!0):d==="]"&&!(l===a+2&&u)&&(o=!1),h+=d;continue}else if(d==="["){o=!0,a=l,u=!1,h+=d;continue}if(hh(d)&&e.charAt(l)==="("){c.push(h),h="";let m=new t(d,c);c.push(m),l=t.#i(e,m,l,n);continue}if(d==="|"){c.push(h),h="",f.push(c),c=new t(null,s);continue}if(d===")")return h===""&&s.#n.length===0&&(s.#f=!0),c.push(h),h="",s.push(...f,c),l;h+=d}return s.type=null,s.#s=void 0,s.#n=[e.substring(i-1)],l}static fromGlob(e,s={}){let i=new t(null,void 0,s);return t.#i(e,i,0,s),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[s,i,n,r]=this.toRegExpSource();if(!(n||this.#s||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;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.#n.some(d=>typeof d!="string"),l=this.#n.map(d=>{let[m,D,g,F]=typeof d=="string"?t.#E(d,this.#s,u):d.toRegExpSource(e);return this.#s=this.#s||g,this.#r=this.#r||F,m}).join(""),c="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&qC.has(this.#n[0]))){let m=jC,D=s&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),g=!s&&!e&&m.has(l.charAt(0));c=D?MC:g?ur:""}let f="";return this.isEnd()&&this.#e.#c&&this.#o?.type==="!"&&(f="(?:$|\\/)"),[c+l+f,Ne(l),this.#s=!!this.#s,this.#r]}let i=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#d(s);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let u=this.toString();return this.#n=[u],this.type=null,this.#s=void 0,[u,Ne(this.toString()),!1,!1]}let o=!i||e||s||!ur?"":this.#d(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";if(this.type==="!"&&this.#f)a=(this.isStart()&&!s?ur:"")+ph;else{let u=this.type==="!"?"))"+(this.isStart()&&!s&&!e?ur:"")+dh+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=n+r+u}return[a,Ne(r),this.#s=!!this.#s,this.#r]}#d(e){return this.#n.map(s=>{if(typeof s=="string")throw new Error("string type in extglob ast??");let[i,n,r,o]=s.toRegExpSource(e);return this.#r=this.#r||o,i}).filter(s=>!(this.isStart()&&this.isEnd())||!!s).join("|")}static#E(e,s,i=!1){let n=!1,r="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(n){n=!1,r+=(UC.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?r+="\\\\":n=!0;continue}if(u==="["){let[l,c,f,h]=ch(e,a);if(f){r+=l,o=o||c,a+=f-1,s=s||h;continue}}if(u==="*"){r+=i&&e==="*"?ph:dh,s=!0;continue}if(u==="?"){r+=Va,s=!0;continue}r+=VC(u)}return[r,Ne(e),!!s,o]}}});var ds,za=M(()=>{ds=(t,{windowsPathsNoEscape:e=!1,magicalBraces:s=!1}={})=>s?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&")});var Ce,WC,zC,GC,KC,YC,JC,HC,ZC,QC,XC,eE,tE,sE,iE,nE,rE,oE,aE,gh,yh,Fh,Dh,uE,fe,lE,cE,fE,hE,dE,Pe,pE,Ch,DE,mE,mh,gE,_e,$t=M(()=>{ah();uh();Wa();za();ar();Wa();za();ar();Ce=(t,e,s={})=>(Bi(e),!s.nocomment&&e.charAt(0)==="#"?!1:new _e(e,s).match(t)),WC=/^\*+([^+@!?\*\[\(]*)$/,zC=t=>e=>!e.startsWith(".")&&e.endsWith(t),GC=t=>e=>e.endsWith(t),KC=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),YC=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),JC=/^\*+\.\*+$/,HC=t=>!t.startsWith(".")&&t.includes("."),ZC=t=>t!=="."&&t!==".."&&t.includes("."),QC=/^\.\*+$/,XC=t=>t!=="."&&t!==".."&&t.startsWith("."),eE=/^\*+$/,tE=t=>t.length!==0&&!t.startsWith("."),sE=t=>t.length!==0&&t!=="."&&t!=="..",iE=/^\?+([^+@!?\*\[\(]*)?$/,nE=([t,e=""])=>{let s=gh([t]);return e?(e=e.toLowerCase(),i=>s(i)&&i.toLowerCase().endsWith(e)):s},rE=([t,e=""])=>{let s=yh([t]);return e?(e=e.toLowerCase(),i=>s(i)&&i.toLowerCase().endsWith(e)):s},oE=([t,e=""])=>{let s=yh([t]);return e?i=>s(i)&&i.endsWith(e):s},aE=([t,e=""])=>{let s=gh([t]);return e?i=>s(i)&&i.endsWith(e):s},gh=([t])=>{let e=t.length;return s=>s.length===e&&!s.startsWith(".")},yh=([t])=>{let e=t.length;return s=>s.length===e&&s!=="."&&s!==".."},Fh=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Dh={win32:{sep:"\\"},posix:{sep:"/"}},uE=Fh==="win32"?Dh.win32.sep:Dh.posix.sep;Ce.sep=uE;fe=Symbol("globstar **");Ce.GLOBSTAR=fe;lE="[^/]",cE=lE+"*?",fE="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",hE="(?:(?!(?:\\/|^)\\.).)*?",dE=(t,e={})=>s=>Ce(s,t,e);Ce.filter=dE;Pe=(t,e={})=>Object.assign({},t,e),pE=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Ce;let e=Ce;return Object.assign((i,n,r={})=>e(i,n,Pe(t,r)),{Minimatch:class extends e.Minimatch{constructor(n,r={}){super(n,Pe(t,r))}static defaults(n){return e.defaults(Pe(t,n)).Minimatch}},AST:class extends e.AST{constructor(n,r,o={}){super(n,r,Pe(t,o))}static fromGlob(n,r={}){return e.AST.fromGlob(n,Pe(t,r))}},unescape:(i,n={})=>e.unescape(i,Pe(t,n)),escape:(i,n={})=>e.escape(i,Pe(t,n)),filter:(i,n={})=>e.filter(i,Pe(t,n)),defaults:i=>e.defaults(Pe(t,i)),makeRe:(i,n={})=>e.makeRe(i,Pe(t,n)),braceExpand:(i,n={})=>e.braceExpand(i,Pe(t,n)),match:(i,n,r={})=>e.match(i,n,Pe(t,r)),sep:e.sep,GLOBSTAR:fe})};Ce.defaults=pE;Ch=(t,e={})=>(Bi(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:oh(t));Ce.braceExpand=Ch;DE=(t,e={})=>new _e(t,e).makeRe();Ce.makeRe=DE;mE=(t,e,s={})=>{let i=new _e(e,s);return t=t.filter(n=>i.match(n)),i.options.nonull&&!t.length&&t.push(e),t};Ce.match=mE;mh=/[?*]|[+@!]\(.*?\)|\[|\]/,gE=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={}){Bi(e),s=s||{},this.options=s,this.pattern=e,this.platform=s.platform||Fh,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 i=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let n=this.globParts.map((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=r[0]===""&&r[1]===""&&(r[2]==="?"||!mh.test(r[2]))&&!mh.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,n),this.set=n.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 i=0;i<e.length;i++)for(let n=0;n<e[i].length;n++)e[i][n]==="**"&&(e[i][n]="*");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 i=-1;for(;(i=s.indexOf("**",i+1))!==-1;){let n=i;for(;s[n+1]==="**";)n++;n!==i&&s.splice(i,n-i)}return s})}levelOneOptimize(e){return e.map(s=>(s=s.reduce((i,n)=>{let r=i[i.length-1];return n==="**"&&r==="**"?i:n===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(i.pop(),i):(i.push(n),i)},[]),s.length===0?[""]:s))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let s=!1;do{if(s=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===""&&e[0]===""||(r==="."||r==="")&&(s=!0,e.splice(n,1),n--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(s=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let n=e[i-1];n&&n!=="."&&n!==".."&&n!=="**"&&(s=!0,e.splice(i-1,2),i-=2)}}while(s);return e.length===0?[""]:e}firstPhasePreProcess(e){let s=!1;do{s=!1;for(let i of e){let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let o=n;for(;i[o+1]==="**";)o++;o>n&&i.splice(n+1,o-n);let a=i[n+1],u=i[n+2],l=i[n+3];if(a!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;s=!0,i.splice(n,1);let c=i.slice(0);c[n]="**",e.push(c),n--}if(!this.preserveMultipleSlashes){for(let o=1;o<i.length-1;o++){let a=i[o];o===1&&a===""&&i[0]===""||(a==="."||a==="")&&(s=!0,i.splice(o,1),o--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(s=!0,i.pop())}let r=0;for(;(r=i.indexOf("..",r+1))!==-1;){let o=i[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){s=!0;let u=r===1&&i[r+1]==="**"?["."]:[];i.splice(r-1,2,...u),i.length===0&&i.push(""),r-=2}}}}while(s);return e}secondPhasePreProcess(e){for(let s=0;s<e.length-1;s++)for(let i=s+1;i<e.length;i++){let n=this.partsMatch(e[s],e[i],!this.preserveMultipleSlashes);if(n){e[s]=[],e[i]=n;break}}return e.filter(s=>s.length)}partsMatch(e,s,i=!1){let n=0,r=0,o=[],a="";for(;n<e.length&&r<s.length;)if(e[n]===s[r])o.push(a==="b"?s[r]:e[n]),n++,r++;else if(i&&e[n]==="**"&&s[r]===e[n+1])o.push(e[n]),n++;else if(i&&s[r]==="**"&&e[n]===s[r+1])o.push(s[r]),r++;else if(e[n]==="*"&&s[r]&&(this.options.dot||!s[r].startsWith("."))&&s[r]!=="**"){if(a==="b")return!1;a="a",o.push(e[n]),n++,r++}else if(s[r]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(a==="a")return!1;a="b",o.push(s[r]),n++,r++}else return!1;return e.length===s.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,s=!1,i=0;for(let n=0;n<e.length&&e.charAt(n)==="!";n++)s=!s,i++;i&&(this.pattern=e.slice(i)),this.negate=s}matchOne(e,s,i=!1){let n=this.options;if(this.isWindows){let D=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),g=!D&&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:D?0:void 0,E=y?3:F?0:void 0;if(typeof C=="number"&&typeof E=="number"){let[v,S]=[e[C],s[E]];v.toLowerCase()===S.toLowerCase()&&(s[E]=v,E>C?s=s.slice(E):C>E&&(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 h=o,d=a+1;if(d===l){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!n.dot&&e[o].charAt(0)===".")return!1;return!0}for(;h<u;){var m=e[h];if(this.debug(`
57
- globstar while`,e,h,s,d,m),this.matchOne(e.slice(h),s.slice(d),i))return this.debug("globstar found match!",h,u,m),!0;if(m==="."||m===".."||!n.dot&&m.charAt(0)==="."){this.debug("dot detected!",e,h,s,d);break}this.debug("globstar swallow a segment, and continue"),h++}return!!(i&&(this.debug(`
58
- >>> no match, partial?`,e,h,s,d),h===u))}let D;if(typeof c=="string"?(D=f===c,this.debug("string match",c,f,D)):(D=c.test(f),this.debug("pattern match",c,f,D)),!D)return!1}if(o===u&&a===l)return!0;if(o===u)return i;if(a===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Ch(this.pattern,this.options)}parse(e){Bi(e);let s=this.options;if(e==="**")return fe;if(e==="")return"";let i,n=null;(i=e.match(eE))?n=s.dot?sE:tE:(i=e.match(WC))?n=(s.nocase?s.dot?YC:KC:s.dot?GC:zC)(i[1]):(i=e.match(iE))?n=(s.nocase?s.dot?rE:nE:s.dot?oE:aE)(i):(i=e.match(JC))?n=s.dot?ZC:HC:(i=e.match(QC))&&(n=XC);let r=Vs.fromGlob(e,this.options).toMMPattern();return n&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:n}),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,i=s.noglobstar?cE:s.dot?fE:hE,n=new Set(s.nocase?["i"]:[]),r=e.map(u=>{let l=u.map(f=>{if(f instanceof RegExp)for(let h of f.flags.split(""))n.add(h);return typeof f=="string"?gE(f):f===fe?fe:f._src});l.forEach((f,h)=>{let d=l[h+1],m=l[h-1];f!==fe||m===fe||(m===void 0?d!==void 0&&d!==fe?l[h+1]="(?:\\/|"+i+"\\/)?"+d:l[h]=i:d===void 0?l[h-1]=m+"(?:\\/|\\/"+i+")?":d!==fe&&(l[h-1]=m+"(?:\\/|\\/"+i+"\\/)"+d,l[h+1]=fe))});let c=l.filter(f=>f!==fe);if(this.partial&&c.length>=1){let f=[];for(let h=1;h<=c.length;h++)f.push(c.slice(0,h).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,[...n].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 i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let n=this.slashSplit(e);this.debug(this.pattern,"split",n);let r=this.set;this.debug(this.pattern,"set",r);let o=n[n.length-1];if(!o)for(let a=n.length-2;!o&&a>=0;a--)o=n[a];for(let a=0;a<r.length;a++){let u=r[a],l=n;if(i.matchBase&&u.length===1&&(l=[o]),this.matchOne(l,u,s))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return Ce.defaults(e).Minimatch}};Ce.AST=Vs;Ce.Minimatch=_e;Ce.escape=ds;Ce.unescape=Ne});var yE,bh,Ga,wh,lr,Eh,FE,wA,Tt,vh,Ws,Ka,ps,xh=M(()=>{yE=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,bh=new Set,Ga=typeof process=="object"&&process?process:{},wh=(t,e,s,i)=>{typeof Ga.emitWarning=="function"?Ga.emitWarning(t,e,s,i):console.error(`[${s}] ${e}: ${t}`)},lr=globalThis.AbortController,Eh=globalThis.AbortSignal;if(typeof lr>"u"){Eh=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,n){this._onabort.push(n)}},lr=class{constructor(){e()}signal=new Eh;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let n of this.signal._onabort)n(i);this.signal.onabort?.(i)}}};let t=Ga.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,wh("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))}}FE=t=>!bh.has(t),wA=Symbol("type"),Tt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),vh=t=>Tt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ws:null:null,Ws=class extends Array{constructor(e){super(e),this.fill(0)}},Ka=class t{heap;length;static#e=!1;static create(e){let s=vh(e);if(!s)return[];t.#e=!0;let i=new t(e,s);return t.#e=!1,i}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]}},ps=class t{#e;#s;#r;#n;#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;#h;#f;#u;#i;#d;#E;#F;#p;#k;#D;#v;#x;#m;#y;#b;#S;#t;#R;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#m,autopurgeTimers:e.#y,sizes:e.#v,keyMap:e.#f,keyList:e.#u,valList:e.#i,next:e.#d,prev:e.#E,get head(){return e.#F},get tail(){return e.#p},free:e.#k,isBackgroundFetch:s=>e.#l(s),backgroundFetch:(s,i,n,r)=>e.#U(s,i,n,r),moveToTail:s=>e.#P(s),indexes:s=>e.#B(s),rindexes:s=>e.#$(s),isStale:s=>e.#w(s)}}get max(){return this.#e}get maxSize(){return this.#s}get calculatedSize(){return this.#h}get size(){return this.#a}get fetchMethod(){return this.#C}get memoMethod(){return this.#g}get dispose(){return this.#r}get onInsert(){return this.#n}get disposeAfter(){return this.#o}constructor(e){let{max:s=0,ttl:i,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:d,maxSize:m=0,maxEntrySize:D=0,sizeCalculation:g,fetchMethod:F,memoMethod:y,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:S,ignoreFetchAbort:T,perf:b}=e;if(b!==void 0&&typeof b?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#c=b??yE,s!==0&&!Tt(s))throw new TypeError("max option must be a nonnegative integer");let R=s?vh(s):Array;if(!R)throw new Error("invalid max value: "+s);if(this.#e=s,this.#s=m,this.maxEntrySize=D||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.#i=new Array(s).fill(void 0),this.#d=new R(s),this.#E=new R(s),this.#F=0,this.#p=0,this.#k=Ka.create(s),this.#a=0,this.#h=0,typeof l=="function"&&(this.#r=l),typeof c=="function"&&(this.#n=c),typeof f=="function"?(this.#o=f,this.#D=[]):(this.#o=void 0,this.#D=void 0),this.#b=!!this.#r,this.#R=!!this.#n,this.#t=!!this.#o,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!S,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(this.#s!==0&&!Tt(this.#s))throw new TypeError("maxSize must be a positive integer if specified");if(!Tt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#W()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Tt(n)||n===0?n:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!Tt(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 O="LRU_CACHE_UNBOUNDED";FE(O)&&(bh.add(O),wh("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,t))}}getRemainingTTL(e){return this.#f.has(e)?1/0:0}#T(){let e=new Ws(this.#e),s=new Ws(this.#e);this.#m=e,this.#x=s;let i=this.ttlAutopurge?new Array(this.#e):void 0;this.#y=i,this.#L=(o,a,u=this.#c.now())=>{if(s[o]=a!==0?u:0,e[o]=a,i?.[o]&&(clearTimeout(i[o]),i[o]=void 0),a!==0&&i){let l=setTimeout(()=>{this.#w(o)&&this.#_(this.#u[o],"expire")},a+1);l.unref&&l.unref(),i[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=n||r();let c=o.now-l;o.remainingTTL=u-c}};let n=0,r=()=>{let o=this.#c.now();if(this.ttlResolution>0){n=o;let a=setTimeout(()=>n=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=(n||r())-l;return u-c},this.#w=o=>{let a=s[o],u=e[o];return!!u&&!!a&&(n||r())-a>u}}#A=()=>{};#I=()=>{};#L=()=>{};#w=()=>!1;#W(){let e=new Ws(this.#e);this.#h=0,this.#v=e,this.#O=s=>{this.#h-=e[s],e[s]=0},this.#M=(s,i,n,r)=>{if(this.#l(i))return 0;if(!Tt(n))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(n=r(i,s),!Tt(n))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 n},this.#N=(s,i,n)=>{if(e[s]=i,this.#s){let r=this.#s-e[s];for(;this.#h>r;)this.#q(!0)}this.#h+=e[s],n&&(n.entrySize=i,n.totalCalculatedSize=this.#h)}}#O=e=>{};#N=(e,s,i)=>{};#M=(e,s,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#B({allowStale:e=this.allowStale}={}){if(this.#a)for(let s=this.#p;!(!this.#j(s)||((e||!this.#w(s))&&(yield s),s===this.#F));)s=this.#E[s]}*#$({allowStale:e=this.allowStale}={}){if(this.#a)for(let s=this.#F;!(!this.#j(s)||((e||!this.#w(s))&&(yield s),s===this.#p));)s=this.#d[s]}#j(e){return e!==void 0&&this.#f.get(this.#u[e])===e}*entries(){for(let e of this.#B())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*rentries(){for(let e of this.#$())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*keys(){for(let e of this.#B()){let s=this.#u[e];s!==void 0&&!this.#l(this.#i[e])&&(yield s)}}*rkeys(){for(let e of this.#$()){let s=this.#u[e];s!==void 0&&!this.#l(this.#i[e])&&(yield s)}}*values(){for(let e of this.#B())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#$())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,s={}){for(let i of this.#B()){let n=this.#i[i],r=this.#l(n)?n.__staleWhileFetching:n;if(r!==void 0&&e(r,this.#u[i],this))return this.get(this.#u[i],s)}}forEach(e,s=this){for(let i of this.#B()){let n=this.#i[i],r=this.#l(n)?n.__staleWhileFetching:n;r!==void 0&&e.call(s,r,this.#u[i],this)}}rforEach(e,s=this){for(let i of this.#$()){let n=this.#i[i],r=this.#l(n)?n.__staleWhileFetching:n;r!==void 0&&e.call(s,r,this.#u[i],this)}}purgeStale(){let e=!1;for(let s of this.#$({allowStale:!0}))this.#w(s)&&(this.#_(this.#u[s],"expire"),e=!0);return e}info(e){let s=this.#f.get(e);if(s===void 0)return;let i=this.#i[s],n=this.#l(i)?i.__staleWhileFetching:i;if(n===void 0)return;let r={value:n};if(this.#m&&this.#x){let o=this.#m[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.#B({allowStale:!0})){let i=this.#u[s],n=this.#i[s],r=this.#l(n)?n.__staleWhileFetching:n;if(r===void 0||i===void 0)continue;let o={value:r};if(this.#m&&this.#x){o.ttl=this.#m[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([i,o])}return e}load(e){this.clear();for(let[s,i]of e){if(i.start){let n=Date.now()-i.start;i.start=this.#c.now()-n}this.set(s,i.value,i)}}set(e,s,i={}){if(s===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=this.#M(e,s,i.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.#i[f]=s,this.#f.set(e,f),this.#d[this.#p]=f,this.#E[f]=this.#p,this.#p=f,this.#a++,this.#N(f,c,u),u&&(u.set="add"),l=!1,this.#R&&this.#n?.(s,e,"add");else{this.#P(f);let h=this.#i[f];if(s!==h){if(this.#S&&this.#l(h)){h.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=h;d!==void 0&&!o&&(this.#b&&this.#r?.(d,e,"set"),this.#t&&this.#D?.push([d,e,"set"]))}else o||(this.#b&&this.#r?.(h,e,"set"),this.#t&&this.#D?.push([h,e,"set"]));if(this.#O(f),this.#N(f,c,u),this.#i[f]=s,u){u.set="replace";let d=h&&this.#l(h)?h.__staleWhileFetching:h;d!==void 0&&(u.oldValue=d)}}else u&&(u.set="update");this.#R&&this.onInsert?.(s,e,s===h?"update":"replace")}if(n!==0&&!this.#m&&this.#T(),this.#m&&(l||this.#L(f,n,r),u&&this.#I(u,f)),!o&&this.#t&&this.#D){let h=this.#D,d;for(;d=h?.shift();)this.#o?.(...d)}return this}pop(){try{for(;this.#a;){let e=this.#i[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.#D){let e=this.#D,s;for(;s=e?.shift();)this.#o?.(...s)}}}#q(e){let s=this.#F,i=this.#u[s],n=this.#i[s];return this.#S&&this.#l(n)?n.__abortController.abort(new Error("evicted")):(this.#b||this.#t)&&(this.#b&&this.#r?.(n,i,"evict"),this.#t&&this.#D?.push([n,i,"evict"])),this.#O(s),this.#y?.[s]&&(clearTimeout(this.#y[s]),this.#y[s]=void 0),e&&(this.#u[s]=void 0,this.#i[s]=void 0,this.#k.push(s)),this.#a===1?(this.#F=this.#p=0,this.#k.length=0):this.#F=this.#d[s],this.#f.delete(i),this.#a--,s}has(e,s={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=s,r=this.#f.get(e);if(r!==void 0){let o=this.#i[r];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#w(r))n&&(n.has="stale",this.#I(n,r));else return i&&this.#A(r),n&&(n.has="hit",this.#I(n,r)),!0}else n&&(n.has="miss");return!1}peek(e,s={}){let{allowStale:i=this.allowStale}=s,n=this.#f.get(e);if(n===void 0||!i&&this.#w(n))return;let r=this.#i[n];return this.#l(r)?r.__staleWhileFetching:r}#U(e,s,i,n){let r=s===void 0?void 0:this.#i[s];if(this.#l(r))return r;let o=new lr,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:n},l=(D,g=!1)=>{let{aborted:F}=o.signal,y=i.ignoreFetchAbort&&D!==void 0;if(i.status&&(F&&!g?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),F&&!y&&!g)return f(o.signal.reason);let C=d,E=this.#i[s];return(E===d||y&&g&&E===void 0)&&(D===void 0?C.__staleWhileFetching!==void 0?this.#i[s]=C.__staleWhileFetching:this.#_(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,D,u.options))),D},c=D=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=D),f(D)),f=D=>{let{aborted:g}=o.signal,F=g&&i.allowStaleOnFetchAbort,y=F||i.allowStaleOnFetchRejection,C=y||i.noDeleteOnFetchRejection,E=d;if(this.#i[s]===d&&(!C||E.__staleWhileFetching===void 0?this.#_(e,"fetch"):F||(this.#i[s]=E.__staleWhileFetching)),y)return i.status&&E.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),E.__staleWhileFetching;if(E.__returned===E)throw D},h=(D,g)=>{let F=this.#C?.(e,r,u);F&&F instanceof Promise&&F.then(y=>D(y===void 0?void 0:y),g),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(D(void 0),i.allowStaleOnFetchAbort&&(D=y=>l(y,!0)))})};i.status&&(i.status.fetchDispatched=!0);let d=new Promise(h).then(l,c),m=Object.assign(d,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return s===void 0?(this.set(e,m,{...u.options,status:void 0}),s=this.#f.get(e)):this.#i[s]=m,m}#l(e){if(!this.#S)return!1;let s=e;return!!s&&s instanceof Promise&&s.hasOwnProperty("__staleWhileFetching")&&s.__abortController instanceof lr}async fetch(e,s={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=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:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:D,forceRefresh:g=!1,status:F,signal:y}=s;if(!this.#S)return F&&(F.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:F});let C={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:m,ignoreFetchAbort:d,status:F,signal:y},E=this.#f.get(e);if(E===void 0){F&&(F.fetch="miss");let v=this.#U(e,E,C,D);return v.__returned=v}else{let v=this.#i[E];if(this.#l(v)){let O=i&&v.__staleWhileFetching!==void 0;return F&&(F.fetch="inflight",O&&(F.returnedStale=!0)),O?v.__staleWhileFetching:v.__returned=v}let S=this.#w(E);if(!g&&!S)return F&&(F.fetch="hit"),this.#P(E),n&&this.#A(E),F&&this.#I(F,E),v;let T=this.#U(e,E,C,D),R=T.__staleWhileFetching!==void 0&&i;return F&&(F.fetch=S?"stale":"refresh",R&&S&&(F.returnedStale=!0)),R?T.__staleWhileFetching:T.__returned=T}}async forceFetch(e,s={}){let i=await this.fetch(e,s);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,s={}){let i=this.#g;if(!i)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:r,...o}=s,a=this.get(e,o);if(!r&&a!==void 0)return a;let u=i(e,a,{options:o,context:n});return this.set(e,u,o),u}get(e,s={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=s,a=this.#f.get(e);if(a!==void 0){let u=this.#i[a],l=this.#l(u);return o&&this.#I(o,a),this.#w(a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),i?u.__staleWhileFetching:void 0):(r||this.#_(e,"expire"),o&&i&&(o.returnedStale=!0),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(this.#P(a),n&&this.#A(a),u))}else o&&(o.get="miss")}#V(e,s){this.#E[s]=e,this.#d[e]=s}#P(e){e!==this.#p&&(e===this.#F?this.#F=this.#d[e]:this.#V(this.#E[e],this.#d[e]),this.#V(this.#p,e),this.#p=e)}delete(e){return this.#_(e,"delete")}#_(e,s){let i=!1;if(this.#a!==0){let n=this.#f.get(e);if(n!==void 0)if(this.#y?.[n]&&(clearTimeout(this.#y?.[n]),this.#y[n]=void 0),i=!0,this.#a===1)this.#z(s);else{this.#O(n);let r=this.#i[n];if(this.#l(r)?r.__abortController.abort(new Error("deleted")):(this.#b||this.#t)&&(this.#b&&this.#r?.(r,e,s),this.#t&&this.#D?.push([r,e,s])),this.#f.delete(e),this.#u[n]=void 0,this.#i[n]=void 0,n===this.#p)this.#p=this.#E[n];else if(n===this.#F)this.#F=this.#d[n];else{let o=this.#E[n];this.#d[o]=this.#d[n];let a=this.#d[n];this.#E[a]=this.#E[n]}this.#a--,this.#k.push(n)}}if(this.#t&&this.#D?.length){let n=this.#D,r;for(;r=n?.shift();)this.#o?.(...r)}return i}clear(){return this.#z("delete")}#z(e){for(let s of this.#$({allowStale:!0})){let i=this.#i[s];if(this.#l(i))i.__abortController.abort(new Error("deleted"));else{let n=this.#u[s];this.#b&&this.#r?.(i,n,e),this.#t&&this.#D?.push([i,n,e])}}if(this.#f.clear(),this.#i.fill(void 0),this.#u.fill(void 0),this.#m&&this.#x){this.#m.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.#h=0,this.#a=0,this.#t&&this.#D){let s=this.#D,i;for(;i=s?.shift();)this.#o?.(...i)}}}});var mr,eu,Bh,Sh,CE,EE,bE,Dt,mt,It,cr,Ti,fr,Ah,hr,kh,Ke,zs,ne,Ii,Gs,re,Ee,oe,Ya,dr,me,X,Ja,Ha,_h,Za,it,Qa,pr,Ri,Ds,Be,Ni,wE,vE,xE,SE,Dr,Xa,AE,kE,Rt,tu=M(()=>{mr=require("node:events"),eu=bt(require("node:stream"),1),Bh=require("node:string_decoder"),Sh=typeof process=="object"&&process?process:{stdout:null,stderr:null},CE=t=>!!t&&typeof t=="object"&&(t instanceof Rt||t instanceof eu.default||EE(t)||bE(t)),EE=t=>!!t&&typeof t=="object"&&t instanceof mr.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==eu.default.Writable.prototype.pipe,bE=t=>!!t&&typeof t=="object"&&t instanceof mr.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",Dt=Symbol("EOF"),mt=Symbol("maybeEmitEnd"),It=Symbol("emittedEnd"),cr=Symbol("emittingEnd"),Ti=Symbol("emittedError"),fr=Symbol("closed"),Ah=Symbol("read"),hr=Symbol("flush"),kh=Symbol("flushChunk"),Ke=Symbol("encoding"),zs=Symbol("decoder"),ne=Symbol("flowing"),Ii=Symbol("paused"),Gs=Symbol("resume"),re=Symbol("buffer"),Ee=Symbol("pipes"),oe=Symbol("bufferLength"),Ya=Symbol("bufferPush"),dr=Symbol("bufferShift"),me=Symbol("objectMode"),X=Symbol("destroyed"),Ja=Symbol("error"),Ha=Symbol("emitData"),_h=Symbol("emitEnd"),Za=Symbol("emitEnd2"),it=Symbol("async"),Qa=Symbol("abort"),pr=Symbol("aborted"),Ri=Symbol("signal"),Ds=Symbol("dataListeners"),Be=Symbol("discarded"),Ni=t=>Promise.resolve().then(t),wE=t=>t(),vE=t=>t==="end"||t==="finish"||t==="prefinish",xE=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,SE=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Dr=class{src;dest;opts;ondrain;constructor(e,s,i){this.src=e,this.dest=s,this.opts=i,this.ondrain=()=>e[Gs](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Xa=class extends Dr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,s,i){super(e,s,i),this.proxyErrors=n=>s.emit("error",n),e.on("error",this.proxyErrors)}},AE=t=>!!t.objectMode,kE=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Rt=class extends mr.EventEmitter{[ne]=!1;[Ii]=!1;[Ee]=[];[re]=[];[me];[Ke];[it];[zs];[Dt]=!1;[It]=!1;[cr]=!1;[fr]=!1;[Ti]=null;[oe]=0;[X]=!1;[Ri];[pr]=!1;[Ds]=0;[Be]=!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");AE(s)?(this[me]=!0,this[Ke]=null):kE(s)?(this[Ke]=s.encoding,this[me]=!1):(this[me]=!1,this[Ke]=null),this[it]=!!s.async,this[zs]=this[Ke]?new Bh.StringDecoder(this[Ke]):null,s&&s.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[re]}),s&&s.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Ee]});let{signal:i}=s;i&&(this[Ri]=i,i.aborted?this[Qa]():i.addEventListener("abort",()=>this[Qa]()))}get bufferLength(){return this[oe]}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[me]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[it]}set async(e){this[it]=this[it]||!!e}[Qa](){this[pr]=!0,this.emit("abort",this[Ri]?.reason),this.destroy(this[Ri]?.reason)}get aborted(){return this[pr]}set aborted(e){}write(e,s,i){if(this[pr])return!1;if(this[Dt])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"&&(i=s,s="utf8"),s||(s="utf8");let n=this[it]?Ni:wE;if(!this[me]&&!Buffer.isBuffer(e)){if(SE(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(xE(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[me]?(this[ne]&&this[oe]!==0&&this[hr](!0),this[ne]?this.emit("data",e):this[Ya](e),this[oe]!==0&&this.emit("readable"),i&&n(i),this[ne]):e.length?(typeof e=="string"&&!(s===this[Ke]&&!this[zs]?.lastNeed)&&(e=Buffer.from(e,s)),Buffer.isBuffer(e)&&this[Ke]&&(e=this[zs].write(e)),this[ne]&&this[oe]!==0&&this[hr](!0),this[ne]?this.emit("data",e):this[Ya](e),this[oe]!==0&&this.emit("readable"),i&&n(i),this[ne]):(this[oe]!==0&&this.emit("readable"),i&&n(i),this[ne])}read(e){if(this[X])return null;if(this[Be]=!1,this[oe]===0||e===0||e&&e>this[oe])return this[mt](),null;this[me]&&(e=null),this[re].length>1&&!this[me]&&(this[re]=[this[Ke]?this[re].join(""):Buffer.concat(this[re],this[oe])]);let s=this[Ah](e||null,this[re][0]);return this[mt](),s}[Ah](e,s){if(this[me])this[dr]();else{let i=s;e===i.length||e===null?this[dr]():typeof i=="string"?(this[re][0]=i.slice(e),s=i.slice(0,e),this[oe]-=e):(this[re][0]=i.subarray(e),s=i.subarray(0,e),this[oe]-=e)}return this.emit("data",s),!this[re].length&&!this[Dt]&&this.emit("drain"),s}end(e,s,i){return typeof e=="function"&&(i=e,e=void 0),typeof s=="function"&&(i=s,s="utf8"),e!==void 0&&this.write(e,s),i&&this.once("end",i),this[Dt]=!0,this.writable=!1,(this[ne]||!this[Ii])&&this[mt](),this}[Gs](){this[X]||(!this[Ds]&&!this[Ee].length&&(this[Be]=!0),this[Ii]=!1,this[ne]=!0,this.emit("resume"),this[re].length?this[hr]():this[Dt]?this[mt]():this.emit("drain"))}resume(){return this[Gs]()}pause(){this[ne]=!1,this[Ii]=!0,this[Be]=!1}get destroyed(){return this[X]}get flowing(){return this[ne]}get paused(){return this[Ii]}[Ya](e){this[me]?this[oe]+=1:this[oe]+=e.length,this[re].push(e)}[dr](){return this[me]?this[oe]-=1:this[oe]-=this[re][0].length,this[re].shift()}[hr](e=!1){do;while(this[kh](this[dr]())&&this[re].length);!e&&!this[re].length&&!this[Dt]&&this.emit("drain")}[kh](e){return this.emit("data",e),this[ne]}pipe(e,s){if(this[X])return e;this[Be]=!1;let i=this[It];return s=s||{},e===Sh.stdout||e===Sh.stderr?s.end=!1:s.end=s.end!==!1,s.proxyErrors=!!s.proxyErrors,i?s.end&&e.end():(this[Ee].push(s.proxyErrors?new Xa(this,e,s):new Dr(this,e,s)),this[it]?Ni(()=>this[Gs]()):this[Gs]()),e}unpipe(e){let s=this[Ee].find(i=>i.dest===e);s&&(this[Ee].length===1?(this[ne]&&this[Ds]===0&&(this[ne]=!1),this[Ee]=[]):this[Ee].splice(this[Ee].indexOf(s),1),s.unpipe())}addListener(e,s){return this.on(e,s)}on(e,s){let i=super.on(e,s);if(e==="data")this[Be]=!1,this[Ds]++,!this[Ee].length&&!this[ne]&&this[Gs]();else if(e==="readable"&&this[oe]!==0)super.emit("readable");else if(vE(e)&&this[It])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Ti]){let n=s;this[it]?Ni(()=>n.call(this,this[Ti])):n.call(this,this[Ti])}return i}removeListener(e,s){return this.off(e,s)}off(e,s){let i=super.off(e,s);return e==="data"&&(this[Ds]=this.listeners("data").length,this[Ds]===0&&!this[Be]&&!this[Ee].length&&(this[ne]=!1)),i}removeAllListeners(e){let s=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Ds]=0,!this[Be]&&!this[Ee].length&&(this[ne]=!1)),s}get emittedEnd(){return this[It]}[mt](){!this[cr]&&!this[It]&&!this[X]&&this[re].length===0&&this[Dt]&&(this[cr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[fr]&&this.emit("close"),this[cr]=!1)}emit(e,...s){let i=s[0];if(e!=="error"&&e!=="close"&&e!==X&&this[X])return!1;if(e==="data")return!this[me]&&!i?!1:this[it]?(Ni(()=>this[Ha](i)),!0):this[Ha](i);if(e==="end")return this[_h]();if(e==="close"){if(this[fr]=!0,!this[It]&&!this[X])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(e==="error"){this[Ti]=i,super.emit(Ja,i);let r=!this[Ri]||this.listeners("error").length?super.emit("error",i):!1;return this[mt](),r}else if(e==="resume"){let r=super.emit("resume");return this[mt](),r}else if(e==="finish"||e==="prefinish"){let r=super.emit(e);return this.removeAllListeners(e),r}let n=super.emit(e,...s);return this[mt](),n}[Ha](e){for(let i of this[Ee])i.dest.write(e)===!1&&this.pause();let s=this[Be]?!1:super.emit("data",e);return this[mt](),s}[_h](){return this[It]?!1:(this[It]=!0,this.readable=!1,this[it]?(Ni(()=>this[Za]()),!0):this[Za]())}[Za](){if(this[zs]){let s=this[zs].end();if(s){for(let i of this[Ee])i.dest.write(s);this[Be]||super.emit("data",s)}}for(let s of this[Ee])s.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[me]||(e.dataLength=0);let s=this.promise();return this.on("data",i=>{e.push(i),this[me]||(e.dataLength+=i.length)}),await s,e}async concat(){if(this[me])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(X,()=>s(new Error("stream destroyed"))),this.on("error",i=>s(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Be]=!1;let e=!1,s=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return s();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[Dt])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[Dt]})},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,h)=>{o=h,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[Be]=!1;let e=!1,s=()=>(this.pause(),this.off(Ja,s),this.off(X,s),this.off("end",s),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return s();let n=this.read();return n===null?s():{done:!1,value:n}};return this.once("end",s),this.once(Ja,s),this.once(X,s),{next:i,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[Be]=!0,this[re].length=0,this[oe]=0;let s=this;return typeof s.close=="function"&&!this[fr]&&s.close(),e?this.emit("error",e):this.emit(X),this}static get isStream(){return CE}}});var Ks,Nh,rt,_E,Nt,BE,Oi,Ph,Oh,$E,TE,Le,Lh,Mh,nt,jh,qh,ms,Uh,Oe,Pi,su,$h,Li,Ye,gr,Fr,Th,IE,iu,Ih,Mi,Rh,yr,Cr,nu,Vh,ge,Er,br,wr,Ys,Js,ji,kA,Wh,zh=M(()=>{xh();Ks=require("node:path"),Nh=require("node:url"),rt=require("fs"),_E=bt(require("node:fs"),1),Nt=require("node:fs/promises");tu();BE=rt.realpathSync.native,Oi={lstatSync:rt.lstatSync,readdir:rt.readdir,readdirSync:rt.readdirSync,readlinkSync:rt.readlinkSync,realpathSync:BE,promises:{lstat:Nt.lstat,readdir:Nt.readdir,readlink:Nt.readlink,realpath:Nt.realpath}},Ph=t=>!t||t===Oi||t===_E?Oi:{...Oi,...t,promises:{...Oi.promises,...t.promises||{}}},Oh=/^\\\\\?\\([a-z]:)\\?$/i,$E=t=>t.replace(/\//g,"\\").replace(Oh,"$1\\"),TE=/[\\\/]/,Le=0,Lh=1,Mh=2,nt=4,jh=6,qh=8,ms=10,Uh=12,Oe=15,Pi=~Oe,su=16,$h=32,Li=64,Ye=128,gr=256,Fr=512,Th=Li|Ye|Fr,IE=1023,iu=t=>t.isFile()?qh:t.isDirectory()?nt:t.isSymbolicLink()?ms:t.isCharacterDevice()?Mh:t.isBlockDevice()?jh:t.isSocket()?Uh:t.isFIFO()?Lh:Le,Ih=new ps({max:2**12}),Mi=t=>{let e=Ih.get(t);if(e)return e;let s=t.normalize("NFKD");return Ih.set(t,s),s},Rh=new ps({max:2**12}),yr=t=>{let e=Rh.get(t);if(e)return e;let s=Mi(t.toLowerCase());return Rh.set(t,s),s},Cr=class extends ps{constructor(){super({max:256})}},nu=class extends ps{constructor(e=16*1024){super({maxSize:e,sizeCalculation:s=>s.length+1})}},Vh=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}#n;get nlink(){return this.#n}#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}#h;get size(){return this.#h}#f;get blocks(){return this.#f}#u;get atimeMs(){return this.#u}#i;get mtimeMs(){return this.#i}#d;get ctimeMs(){return this.#d}#E;get birthtimeMs(){return this.#E}#F;get atime(){return this.#F}#p;get mtime(){return this.#p}#k;get ctime(){return this.#k}#D;get birthtime(){return this.#D}#v;#x;#m;#y;#b;#S;#t;#R;#T;#A;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,s=Le,i,n,r,o,a){this.name=e,this.#v=r?yr(e):Mi(e),this.#t=s&IE,this.nocase=r,this.roots=n,this.root=i||this,this.#R=o,this.#m=a.fullpath,this.#b=a.relative,this.#S=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=Ph(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),n=e.substring(s.length).split(this.splitSep);return s?this.getRoot(s).#I(n):this.#I(n)}#I(e){let s=this;for(let i of e)s=s.child(i);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&=~su,s}child(e,s){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),n=this.nocase?yr(e):Mi(e);for(let u of i)if(u.#v===n)return u;let r=this.parent?this.sep:"",o=this.#m?this.#m+r+e:void 0,a=this.newChild(e,Le,{...s,parent:this,fullpath:o});return this.canReaddir()||(a.#t|=Ye),i.push(a),a}relative(){if(this.isCWD)return"";if(this.#b!==void 0)return this.#b;let e=this.name,s=this.parent;if(!s)return this.#b=this.name;let i=s.relative();return i+(!i||!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 i=s.relativePosix();return i+(!i||!s.parent?"":"/")+e}fullpath(){if(this.#m!==void 0)return this.#m;let e=this.name,s=this.parent;if(!s)return this.#m=this.name;let n=s.fullpath()+(s.parent?this.sep:"")+e;return this.#m=n}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let n=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(n)?this.#y=`//?/${n}`:this.#y=n}let e=this.parent,s=e.fullpathPosix(),i=s+(!s||!e.parent?"":"/")+this.name;return this.#y=i}isUnknown(){return(this.#t&Oe)===Le}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)===qh}isDirectory(){return(this.#t&Oe)===nt}isCharacterDevice(){return(this.#t&Oe)===Mh}isBlockDevice(){return(this.#t&Oe)===jh}isFIFO(){return(this.#t&Oe)===Lh}isSocket(){return(this.#t&Oe)===Uh}isSymbolicLink(){return(this.#t&ms)===ms}lstatCached(){return this.#t&$h?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!==Le&&e!==ms||this.#t&gr||this.#t&Ye)}calledReaddir(){return!!(this.#t&su)}isENOENT(){return!!(this.#t&Ye)}isNamed(e){return this.nocase?this.#v===yr(e):this.#v===Mi(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()),i=(await this.parent.realpath())?.resolve(s);if(i)return this.#T=i}catch(s){this.#$(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()),i=this.parent.realpathSync()?.resolve(s);if(i)return this.#T=i}catch(s){this.#$(s.code);return}}#L(e){this.#t|=su;for(let s=e.provisional;s<e.length;s++){let i=e[s];i&&i.#w()}}#w(){this.#t&Ye||(this.#t=(this.#t|Ye)&Pi,this.#W())}#W(){let e=this.children();e.provisional=0;for(let s of e)s.#w()}#O(){this.#t|=Fr,this.#N()}#N(){if(this.#t&Li)return;let e=this.#t;(e&Oe)===nt&&(e&=Pi),this.#t=e|Li,this.#W()}#M(e=""){e==="ENOTDIR"||e==="EPERM"?this.#N():e==="ENOENT"?this.#w():this.children().provisional=0}#B(e=""){e==="ENOTDIR"?this.parent.#N():e==="ENOENT"&&this.#w()}#$(e=""){let s=this.#t;s|=gr,e==="ENOENT"&&(s|=Ye),(e==="EINVAL"||e==="UNKNOWN")&&(s&=Pi),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 i=iu(e),n=this.newChild(e.name,i,{parent:this}),r=n.#t&Oe;return r!==nt&&r!==ms&&r!==Le&&(n.#t|=Li),s.unshift(n),s.provisional++,n}#U(e,s){for(let i=s.provisional;i<s.length;i++){let n=s[i];if((this.nocase?yr(e.name):Mi(e.name))===n.#v)return this.#l(e,n,i,s)}}#l(e,s,i,n){let r=s.name;return s.#t=s.#t&Pi|iu(e),r!==e.name&&(s.name=e.name),i!==n.provisional&&(i===n.length-1?n.pop():n.splice(i,1),n.unshift(s)),n.provisional++,s}async lstat(){if((this.#t&Ye)===0)try{return this.#V(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#B(e.code)}}lstatSync(){if((this.#t&Ye)===0)try{return this.#V(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#B(e.code)}}#V(e){let{atime:s,atimeMs:i,birthtime:n,birthtimeMs:r,blksize:o,blocks:a,ctime:u,ctimeMs:l,dev:c,gid:f,ino:h,mode:d,mtime:m,mtimeMs:D,nlink:g,rdev:F,size:y,uid:C}=e;this.#F=s,this.#u=i,this.#D=n,this.#E=r,this.#c=o,this.#f=a,this.#k=u,this.#d=l,this.#s=c,this.#C=f,this.#a=h,this.#r=d,this.#p=m,this.#i=D,this.#n=g,this.#g=F,this.#h=y,this.#o=C;let E=iu(e);this.#t=this.#t&Pi|E|$h,E!==Le&&E!==nt&&E!==ms&&(this.#t|=Li)}#P=[];#_=!1;#z(e){this.#_=!1;let s=this.#P.slice();this.#P.length=0,s.forEach(i=>i(null,e))}readdirCB(e,s=!1){if(!this.canReaddir()){s?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let r=i.slice(0,i.provisional);s?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#P.push(e),this.#_)return;this.#_=!0;let n=this.fullpath();this.#e.readdir(n,{withFileTypes:!0},(r,o)=>{if(r)this.#M(r.code),i.provisional=0;else{for(let a of o)this.#j(a,i);this.#L(i)}this.#z(i.slice(0,i.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 i=()=>{};this.#G=new Promise(n=>i=n);try{for(let n of await this.#e.promises.readdir(s,{withFileTypes:!0}))this.#j(n,e);this.#L(e)}catch(n){this.#M(n.code),e.provisional=0}this.#G=void 0,i()}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 i of this.#e.readdirSync(s,{withFileTypes:!0}))this.#j(i,e);this.#L(e)}catch(i){this.#M(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#t&Th)return!1;let e=Oe&this.#t;return e===Le||e===nt||e===ms}shouldWalk(e,s){return(this.#t&nt)===nt&&!(this.#t&Th)&&!e.has(this)&&(!s||s(this))}async realpath(){if(this.#A)return this.#A;if(!((Fr|gr|Ye)&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(!((Fr|gr|Ye)&this.#t))try{let e=this.#e.realpathSync(this.fullpath());return this.#A=this.resolve(e)}catch{this.#O()}}[Vh](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let s=new Set([]),i=[],n=this;for(;n&&n.parent;)s.add(n),n.#b=i.join(this.sep),n.#S=i.join("/"),n=n.parent,i.push("..");for(n=e;n&&n.parent&&!s.has(n);)n.#b=void 0,n.#S=void 0,n=n.parent}},Er=class t extends ge{sep="\\";splitSep=TE;constructor(e,s=Le,i,n,r,o,a){super(e,s,i,n,r,o,a)}newChild(e,s=Le,i={}){return new t(e,s,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return Ks.win32.parse(e).root}getRoot(e){if(e=$E(e.toUpperCase()),e===this.root.name)return this.root;for(let[s,i]of Object.entries(this.roots))if(this.sameRoot(e,s))return this.roots[e]=i;return this.roots[e]=new Ys(e,this).root}sameRoot(e,s=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Oh,"$1\\"),e===s}},br=class t extends ge{splitSep="/";sep="/";constructor(e,s=Le,i,n,r,o,a){super(e,s,i,n,r,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,s=Le,i={}){return new t(e,s,this.root,this.roots,this.nocase,this.childrenCache(),i)}},wr=class{root;rootPath;roots;cwd;#e;#s;#r;nocase;#n;constructor(e=process.cwd(),s,i,{nocase:n,childrenCacheSize:r=16*1024,fs:o=Oi}={}){this.#n=Ph(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,Nh.fileURLToPath)(e));let a=s.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new Cr,this.#s=new Cr,this.#r=new nu(r);let u=a.substring(this.rootPath.length).split(i);if(u.length===1&&!u[0]&&u.pop(),n===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=n,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let l=this.root,c=u.length-1,f=s.sep,h=this.rootPath,d=!1;for(let m of u){let D=c--;l=l.child(m,{relative:new Array(D).fill("..").join(f),relativePosix:new Array(D).fill("..").join("/"),fullpath:h+=(d?"":f)+m}),d=!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 i=this.#e.get(s);if(i!==void 0)return i;let n=this.cwd.resolve(s).fullpath();return this.#e.set(s,n),n}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 i=this.#s.get(s);if(i!==void 0)return i;let n=this.cwd.resolve(s).fullpathPosix();return this.#s.set(s,n),n}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:i}=s;if(e.canReaddir()){let n=await e.readdir();return i?n:n.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:i=!0}=s;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(n=>n.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 i=await e.readlink();return s?i:i?.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 i=e.readlinkSync();return s?i:i?.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 i=await e.realpath();return s?i:i?.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 i=e.realpathSync();return s?i:i?.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:i=!0,follow:n=!1,filter:r,walkFilter:o}=s,a=[];(!r||r(e))&&a.push(i?e:e.fullpath());let u=new Set,l=(f,h)=>{u.add(f),f.readdirCB((d,m)=>{if(d)return h(d);let D=m.length;if(!D)return h();let g=()=>{--D===0&&h()};for(let F of m)(!r||r(F))&&a.push(i?F:F.fullpath()),n&&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,h)=>{l(c,d=>{if(d)return h(d);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:i=!0,follow:n=!1,filter:r,walkFilter:o}=s,a=[];(!r||r(e))&&a.push(i?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(i?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(n&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(u,o)&&u.add(h)}}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:i=!0,follow:n=!1,filter:r,walkFilter:o}=s;(!r||r(e))&&(yield i?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 i?c:c.fullpath());let f=c;if(c.isSymbolicLink()){if(!(n&&(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:i=!0,follow:n=!1,filter:r,walkFilter:o}=s,a=new Rt({objectMode:!0});(!r||r(e))&&a.write(i?e:e.fullpath());let u=new Set,l=[e],c=0,f=()=>{let h=!1;for(;!h;){let d=l.shift();if(!d){c===0&&a.end();return}c++,u.add(d);let m=(g,F,y=!1)=>{if(g)return a.emit("error",g);if(n&&!y){let C=[];for(let E of F)E.isSymbolicLink()&&C.push(E.realpath().then(v=>v?.isUnknown()?v.lstat():v));if(C.length){Promise.all(C).then(()=>m(null,F,!0));return}}for(let C of F)C&&(!r||r(C))&&(a.write(i?C:C.fullpath())||(h=!0));c--;for(let C of F){let E=C.realpathCached()||C;E.shouldWalk(u,o)&&l.push(E)}h&&!a.flowing?a.once("drain",f):D||f()},D=!0;d.readdirCB(m,!0),D=!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:i=!0,follow:n=!1,filter:r,walkFilter:o}=s,a=new Rt({objectMode:!0}),u=new Set;(!r||r(e))&&a.write(i?e:e.fullpath());let l=[e],c=0,f=()=>{let h=!1;for(;!h;){let d=l.shift();if(!d){c===0&&a.end();return}c++,u.add(d);let m=d.readdirSync();for(let D of m)(!r||r(D))&&(a.write(i?D:D.fullpath())||(h=!0));c--;for(let D of m){let g=D;if(D.isSymbolicLink()){if(!(n&&(g=D.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(u,o)&&l.push(g)}}h&&!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[Vh](s)}},Ys=class extends wr{sep="\\";constructor(e=process.cwd(),s={}){let{nocase:i=!0}=s;super(e,Ks.win32,"\\",{...s,nocase:i}),this.nocase=i;for(let n=this.cwd;n;n=n.parent)n.nocase=this.nocase}parseRootPath(e){return Ks.win32.parse(e).root.toUpperCase()}newRoot(e){return new Er(this.rootPath,nt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Js=class extends wr{sep="/";constructor(e=process.cwd(),s={}){let{nocase:i=!1}=s;super(e,Ks.posix,"/",{...s,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new br(this.rootPath,nt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},ji=class extends Js{constructor(e=process.cwd(),s={}){let{nocase:i=!0}=s;super(e,{...s,nocase:i})}},kA=process.platform==="win32"?Er:br,Wh=process.platform==="win32"?Ys:process.platform==="darwin"?ji:Js});var RE,NE,Hs,ru=M(()=>{$t();RE=t=>t.length>=1,NE=t=>t.length>=1,Hs=class t{#e;#s;#r;length;#n;#o;#C;#g;#c;#a;#h=!0;constructor(e,s,i,n){if(!RE(e))throw new TypeError("empty pattern list");if(!NE(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,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#s=s,this.#r=i,this.#n=n,this.#r===0){if(this.isUNC()){let[r,o,a,u,...l]=this.#e,[c,f,h,d,...m]=this.#s;l[0]===""&&(l.shift(),m.shift());let D=[r,o,a,u,""].join("/"),g=[c,f,h,d,""].join("/");this.#e=[D,...l],this.#s=[g,...m],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.#n),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.#n==="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.#n==="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.#h)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#h?!1:(this.#h=!1,!0)}}});var PE,gs,ou=M(()=>{$t();ru();PE=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",gs=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:s,nocase:i,noext:n,noglobstar:r,platform:o=PE}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:s,nocase:i,noext:n,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 i=0;i<s.set.length;i++){let n=s.set[i],r=s.globParts[i];if(!n||!r)throw new Error("invalid pattern object");for(;n[0]==="."&&r[0]===".";)n.shift(),r.shift();let o=new Hs(n,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(),i=`${s}/`,n=e.relative()||".",r=`${n}/`;for(let o of this.relative)if(o.match(n)||o.match(r))return!0;for(let o of this.absolute)if(o.match(s)||o.match(i))return!0;return!1}childrenIgnored(e){let s=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let n of this.relativeChildren)if(n.match(i))return!0;for(let n of this.absoluteChildren)if(n.match(s))return!0;return!1}}});var au,uu,lu,qi,Gh=M(()=>{$t();au=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 i=e.fullpath(),n=this.store.get(i);n?n.add(s.globString()):this.store.set(i,new Set([s.globString()]))}},uu=class{store=new Map;add(e,s,i){let n=(s?2:0)|(i?1:0),r=this.store.get(e);this.store.set(e,r===void 0?n:n&r)}entries(){return[...this.store.entries()].map(([e,s])=>[e,!!(s&2),!!(s&1)])}},lu=class{store=new Map;add(e,s){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(n=>n.globString()===s.globString())||i.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())}},qi=class t{hasWalkedCache;matches=new uu;subwalks=new lu;patterns;follow;dot;opts;constructor(e,s){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=s?s.copy():new au}processPatterns(e,s){this.patterns=s;let i=s.map(n=>[e,n]);for(let[n,r]of i){this.hasWalkedCache.storeWalked(n,r);let o=r.root(),a=r.isAbsolute()&&this.opts.absolute!==!1;if(o){n=n.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=r.rest();if(f)r=f;else{this.matches.add(n,!0,!1);continue}}if(n.isENOENT())continue;let u,l,c=!1;for(;typeof(u=r.pattern())=="string"&&(l=r.rest());)n=n.resolve(u),r=l,c=!0;if(u=r.pattern(),l=r.rest(),c){if(this.hasWalkedCache.hasWalked(n,r))continue;this.hasWalkedCache.storeWalked(n,r)}if(typeof u=="string"){let f=u===".."||u===""||u===".";this.matches.add(n.resolve(u),a,f);continue}else if(u===fe){(!n.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(n,r);let f=l?.pattern(),h=l?.rest();if(!l||(f===""||f===".")&&!h)this.matches.add(n,a,f===""||f===".");else if(f===".."){let d=n.parent||n;h?this.hasWalkedCache.hasWalked(d,h)||this.subwalks.add(d,h):this.matches.add(d,a,!0)}}else u instanceof RegExp&&this.subwalks.add(n,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,s){let i=this.subwalks.get(e),n=this.child();for(let r of s)for(let o of i){let a=o.isAbsolute(),u=o.pattern(),l=o.rest();u===fe?n.testGlobstar(r,o,l,a):u instanceof RegExp?n.testRegExp(r,u,l,a):n.testString(r,u,l,a)}return n}testGlobstar(e,s,i,n){if((this.dot||!e.name.startsWith("."))&&(s.hasMore()||this.matches.add(e,n,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,s):e.isSymbolicLink()&&(i&&s.checkFollowGlobstar()?this.subwalks.add(e,i):s.markFollowGlobstar()&&this.subwalks.add(e,s)))),i){let r=i.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(e,r,i.rest(),n);else if(r===".."){let o=e.parent||e;this.subwalks.add(o,i)}else r instanceof RegExp&&this.testRegExp(e,r,i.rest(),n)}}testRegExp(e,s,i,n){s.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}testString(e,s,i,n){e.isNamed(s)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}}});var OE,vr,Ui,Vi,Kh=M(()=>{tu();ou();Gh();OE=(t,e)=>typeof t=="string"?new gs([t],e):Array.isArray(t)?new gs(t,e):t,vr=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#s;#r;signal;maxDepth;includeChildMatches;constructor(e,s,i){if(this.patterns=e,this.path=s,this.opts=i,this.#r=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#s=OE(i.ignore??[],i),!this.includeChildMatches&&typeof this.#s.add!="function")){let n="cannot ignore child matches, ignore lacks add() method.";throw new Error(n)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(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 i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}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.#n(e)?e:void 0}matchCheckSync(e,s){if(s&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}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.#n(e))return;if(!this.includeChildMatches&&this.#s?.add){let r=`${e.relativePosix()}/**`;this.#s.add(r)}let i=this.opts.absolute===void 0?s:this.opts.absolute;this.seen.add(e);let n=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let r=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(r+n)}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+n:"."+n)}}async match(e,s,i){let n=await this.matchCheck(e,i);n&&this.matchFinish(n,s)}matchSync(e,s,i){let n=this.matchCheckSync(e,i);n&&this.matchFinish(n,s)}walkCB(e,s,i){this.signal?.aborted&&i(),this.walkCB2(e,s,new qi(this.opts),i)}walkCB2(e,s,i,n){if(this.#o(e))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2(e,s,i,n));return}i.processPatterns(e,s);let r=1,o=()=>{--r===0&&n()};for(let[a,u,l]of i.matches.entries())this.#n(a)||(r++,this.match(a,u,l).then(()=>o()));for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,i,o):a.readdirCB((l,c)=>this.walkCB3(a,c,i,o),!0)}o()}walkCB3(e,s,i,n){i=i.filterEntries(e,s);let r=1,o=()=>{--r===0&&n()};for(let[a,u,l]of i.matches.entries())this.#n(a)||(r++,this.match(a,u,l).then(()=>o()));for(let[a,u]of i.subwalks.entries())r++,this.walkCB2(a,u,i.child(),o);o()}walkCBSync(e,s,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,s,new qi(this.opts),i)}walkCB2Sync(e,s,i,n){if(this.#o(e))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2Sync(e,s,i,n));return}i.processPatterns(e,s);let r=1,o=()=>{--r===0&&n()};for(let[a,u,l]of i.matches.entries())this.#n(a)||this.matchSync(a,u,l);for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let u=a.readdirSync();this.walkCB3Sync(a,u,i,o)}o()}walkCB3Sync(e,s,i,n){i=i.filterEntries(e,s);let r=1,o=()=>{--r===0&&n()};for(let[a,u,l]of i.matches.entries())this.#n(a)||this.matchSync(a,u,l);for(let[a,u]of i.subwalks.entries())r++,this.walkCB2Sync(a,u,i.child(),o);o()}},Ui=class extends vr{matches=new Set;constructor(e,s,i){super(e,s,i)}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}},Vi=class extends vr{results;constructor(e,s,i){super(e,s,i),this.results=new Rt({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 Yh,LE,Me,cu=M(()=>{$t();Yh=require("node:url");zh();ru();Kh();LE=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Me=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,Yh.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||LE,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"?Ys:s.platform==="darwin"?ji:s.platform?Js:Wh;this.scurry=new u(this.cwd,{nocase:s.nocase,fs:s.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={...s,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,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,n)),[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 Hs(u,c,0,this.platform)})}async walk(){return[...await new Ui(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 Ui(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 Vi(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 Vi(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 xr,fu=M(()=>{$t();xr=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let s of t)if(new _e(s,e).hasMagic())return!0;return!1}});var td={};di(td,{Glob:()=>Me,Ignore:()=>gs,escape:()=>ds,glob:()=>gt,globIterate:()=>pu,globIterateSync:()=>zi,globStream:()=>hu,globStreamSync:()=>Wi,globSync:()=>du,hasMagic:()=>xr,iterate:()=>Xh,iterateSync:()=>Qh,stream:()=>Zh,streamSync:()=>Hh,sync:()=>ed,unescape:()=>Ne});function Wi(t,e={}){return new Me(t,e).streamSync()}function hu(t,e={}){return new Me(t,e).stream()}function du(t,e={}){return new Me(t,e).walkSync()}async function Jh(t,e={}){return new Me(t,e).walk()}function zi(t,e={}){return new Me(t,e).iterateSync()}function pu(t,e={}){return new Me(t,e).iterate()}var Hh,Zh,Qh,Xh,ed,gt,Sr=M(()=>{$t();cu();fu();$t();cu();fu();ou();Hh=Wi,Zh=Object.assign(hu,{sync:Wi}),Qh=zi,Xh=Object.assign(pu,{sync:zi}),ed=Object.assign(du,{stream:Wi,iterate:zi}),gt=Object.assign(Jh,{glob:Jh,globSync:du,sync:ed,globStream:hu,stream:Zh,globStreamSync:Wi,streamSync:Hh,globIterate:pu,iterate:Xh,globIterateSync:zi,iterateSync:Qh,Glob:Me,hasMagic:xr,escape:ds,unescape:Ne});gt.glob=gt});var W=k(he=>{"use strict";var Du=Symbol.for("yaml.alias"),sd=Symbol.for("yaml.document"),Ar=Symbol.for("yaml.map"),id=Symbol.for("yaml.pair"),mu=Symbol.for("yaml.scalar"),kr=Symbol.for("yaml.seq"),yt=Symbol.for("yaml.node.type"),ME=t=>!!t&&typeof t=="object"&&t[yt]===Du,jE=t=>!!t&&typeof t=="object"&&t[yt]===sd,qE=t=>!!t&&typeof t=="object"&&t[yt]===Ar,UE=t=>!!t&&typeof t=="object"&&t[yt]===id,nd=t=>!!t&&typeof t=="object"&&t[yt]===mu,VE=t=>!!t&&typeof t=="object"&&t[yt]===kr;function rd(t){if(t&&typeof t=="object")switch(t[yt]){case Ar:case kr:return!0}return!1}function WE(t){if(t&&typeof t=="object")switch(t[yt]){case Du:case Ar:case mu:case kr:return!0}return!1}var zE=t=>(nd(t)||rd(t))&&!!t.anchor;he.ALIAS=Du;he.DOC=sd;he.MAP=Ar;he.NODE_TYPE=yt;he.PAIR=id;he.SCALAR=mu;he.SEQ=kr;he.hasAnchor=zE;he.isAlias=ME;he.isCollection=rd;he.isDocument=jE;he.isMap=qE;he.isNode=WE;he.isPair=UE;he.isScalar=nd;he.isSeq=VE});var Gi=k(gu=>{"use strict";var se=W(),xe=Symbol("break visit"),od=Symbol("skip children"),ot=Symbol("remove node");function _r(t,e){let s=ad(e);se.isDocument(t)?Zs(null,t.contents,s,Object.freeze([t]))===ot&&(t.contents=null):Zs(null,t,s,Object.freeze([]))}_r.BREAK=xe;_r.SKIP=od;_r.REMOVE=ot;function Zs(t,e,s,i){let n=ud(t,e,s,i);if(se.isNode(n)||se.isPair(n))return ld(t,i,n),Zs(t,n,s,i);if(typeof n!="symbol"){if(se.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let o=Zs(r,e.items[r],s,i);if(typeof o=="number")r=o-1;else{if(o===xe)return xe;o===ot&&(e.items.splice(r,1),r-=1)}}}else if(se.isPair(e)){i=Object.freeze(i.concat(e));let r=Zs("key",e.key,s,i);if(r===xe)return xe;r===ot&&(e.key=null);let o=Zs("value",e.value,s,i);if(o===xe)return xe;o===ot&&(e.value=null)}}return n}async function Br(t,e){let s=ad(e);se.isDocument(t)?await Qs(null,t.contents,s,Object.freeze([t]))===ot&&(t.contents=null):await Qs(null,t,s,Object.freeze([]))}Br.BREAK=xe;Br.SKIP=od;Br.REMOVE=ot;async function Qs(t,e,s,i){let n=await ud(t,e,s,i);if(se.isNode(n)||se.isPair(n))return ld(t,i,n),Qs(t,n,s,i);if(typeof n!="symbol"){if(se.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let o=await Qs(r,e.items[r],s,i);if(typeof o=="number")r=o-1;else{if(o===xe)return xe;o===ot&&(e.items.splice(r,1),r-=1)}}}else if(se.isPair(e)){i=Object.freeze(i.concat(e));let r=await Qs("key",e.key,s,i);if(r===xe)return xe;r===ot&&(e.key=null);let o=await Qs("value",e.value,s,i);if(o===xe)return xe;o===ot&&(e.value=null)}}return n}function ad(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 ud(t,e,s,i){if(typeof s=="function")return s(t,e,i);if(se.isMap(e))return s.Map?.(t,e,i);if(se.isSeq(e))return s.Seq?.(t,e,i);if(se.isPair(e))return s.Pair?.(t,e,i);if(se.isScalar(e))return s.Scalar?.(t,e,i);if(se.isAlias(e))return s.Alias?.(t,e,i)}function ld(t,e,s){let i=e[e.length-1];if(se.isCollection(i))i.items[t]=s;else if(se.isPair(i))t==="key"?i.key=s:i.value=s;else if(se.isDocument(i))i.contents=s;else{let n=se.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}gu.visit=_r;gu.visitAsync=Br});var yu=k(fd=>{"use strict";var cd=W(),GE=Gi(),KE={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},YE=t=>t.replace(/[!,[\]{}]/g,e=>KE[e]),Ki=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 i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[r,o]=i;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;let[r]=i;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 ${n}`,!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[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||s(`The ${e} tag has no suffix`);let r=this.tags[i];if(r)try{return r+decodeURIComponent(n)}catch(o){return s(String(o)),null}return i==="!"?e:(s(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[s,i]of Object.entries(this.tags))if(e.startsWith(i))return s+YE(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&cd.isNode(e.contents)){let r={};GE.visit(e.contents,(o,a)=>{cd.isNode(a)&&a.tag&&(r[a.tag]=!0)}),n=Object.keys(r)}else n=[];for(let[r,o]of i)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||n.some(a=>a.startsWith(o)))&&s.push(`%TAG ${r} ${o}`);return s.join(`
59
- `)}};Ki.defaultYaml={explicit:!1,version:"1.2"};Ki.defaultTags={"!!":"tag:yaml.org,2002:"};fd.Directives=Ki});var $r=k(Yi=>{"use strict";var hd=W(),JE=Gi();function HE(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 dd(t){let e=new Set;return JE.visit(t,{Value(s,i){i.anchor&&e.add(i.anchor)}}),e}function pd(t,e){for(let s=1;;++s){let i=`${t}${s}`;if(!e.has(i))return i}}function ZE(t,e){let s=[],i=new Map,n=null;return{onAnchor:r=>{s.push(r),n??(n=dd(t));let o=pd(e,n);return n.add(o),o},setAnchors:()=>{for(let r of s){let o=i.get(r);if(typeof o=="object"&&o.anchor&&(hd.isScalar(o.node)||hd.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:i}}Yi.anchorIsValid=HE;Yi.anchorNames=dd;Yi.createNodeAnchors=ZE;Yi.findNewAnchor=pd});var Fu=k(Dd=>{"use strict";function Ji(t,e,s,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let o=i[n],a=Ji(t,i,String(n),o);a===void 0?delete i[n]:a!==o&&(i[n]=a)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),o=Ji(t,i,n,r);o===void 0?i.delete(n):o!==r&&i.set(n,o)}else if(i instanceof Set)for(let n of Array.from(i)){let r=Ji(t,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let o=Ji(t,i,n,r);o===void 0?delete i[n]:o!==r&&(i[n]=o)}return t.call(e,s,i)}Dd.applyReviver=Ji});var Pt=k(gd=>{"use strict";var QE=W();function md(t,e,s){if(Array.isArray(t))return t.map((i,n)=>md(i,String(n),s));if(t&&typeof t.toJSON=="function"){if(!s||!QE.hasAnchor(t))return t.toJSON(e,s);let i={aliasCount:0,count:1,res:void 0};s.anchors.set(t,i),s.onCreate=r=>{i.res=r,delete s.onCreate};let n=t.toJSON(e,s);return s.onCreate&&s.onCreate(n),n}return typeof t=="bigint"&&!s?.keep?Number(t):t}gd.toJS=md});var Tr=k(Fd=>{"use strict";var XE=Fu(),yd=W(),eb=Pt(),Cu=class{constructor(e){Object.defineProperty(this,yd.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:i,onAnchor:n,reviver:r}={}){if(!yd.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 i=="number"?i:100},a=eb.toJS(this,"",o);if(typeof n=="function")for(let{count:u,res:l}of o.anchors.values())n(l,u);return typeof r=="function"?XE.applyReviver(r,{"":a},"",a):a}};Fd.NodeBase=Cu});var Hi=k(Cd=>{"use strict";var tb=$r(),sb=Gi(),Xs=W(),ib=Tr(),nb=Pt(),Eu=class extends ib.NodeBase{constructor(e){super(Xs.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,s){let i;s?.aliasResolveCache?i=s.aliasResolveCache:(i=[],sb.visit(e,{Node:(r,o)=>{(Xs.isAlias(o)||Xs.hasAnchor(o))&&i.push(o)}}),s&&(s.aliasResolveCache=i));let n;for(let r of i){if(r===this)break;r.anchor===this.source&&(n=r)}return n}toJSON(e,s){if(!s)return{source:this.source};let{anchors:i,doc:n,maxAliasCount:r}=s,o=this.resolve(n,s);if(!o){let u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let a=i.get(o);if(a||(nb.toJS(o,null,s),a=i.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=Ir(n,o,i)),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,i){let n=`*${this.source}`;if(e){if(tb.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`${n} `}return n}};function Ir(t,e,s){if(Xs.isAlias(e)){let i=e.resolve(t),n=s&&i&&s.get(i);return n?n.count*n.aliasCount:0}else if(Xs.isCollection(e)){let i=0;for(let n of e.items){let r=Ir(t,n,s);r>i&&(i=r)}return i}else if(Xs.isPair(e)){let i=Ir(t,e.key,s),n=Ir(t,e.value,s);return Math.max(i,n)}return 1}Cd.Alias=Eu});var ee=k(bu=>{"use strict";var rb=W(),ob=Tr(),ab=Pt(),ub=t=>!t||typeof t!="function"&&typeof t!="object",Ot=class extends ob.NodeBase{constructor(e){super(rb.SCALAR),this.value=e}toJSON(e,s){return s?.keep?this.value:ab.toJS(this.value,e,s)}toString(){return String(this.value)}};Ot.BLOCK_FOLDED="BLOCK_FOLDED";Ot.BLOCK_LITERAL="BLOCK_LITERAL";Ot.PLAIN="PLAIN";Ot.QUOTE_DOUBLE="QUOTE_DOUBLE";Ot.QUOTE_SINGLE="QUOTE_SINGLE";bu.Scalar=Ot;bu.isScalarValue=ub});var Zi=k(bd=>{"use strict";var lb=Hi(),ys=W(),Ed=ee(),cb="tag:yaml.org,2002:";function fb(t,e,s){if(e){let i=s.filter(r=>r.tag===e),n=i.find(r=>!r.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return s.find(i=>i.identify?.(t)&&!i.format)}function hb(t,e,s){if(ys.isDocument(t)&&(t=t.contents),ys.isNode(t))return t;if(ys.isPair(t)){let f=s.schema[ys.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:i,onAnchor:n,onTagObj:r,schema:o,sourceObjects:a}=s,u;if(i&&t&&typeof t=="object"){if(u=a.get(t),u)return u.anchor??(u.anchor=n(t)),new lb.Alias(u.anchor);u={anchor:null,node:null},a.set(t,u)}e?.startsWith("!!")&&(e=cb+e.slice(2));let l=fb(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new Ed.Scalar(t);return u&&(u.node=f),f}l=t instanceof Map?o[ys.MAP]:Symbol.iterator in Object(t)?o[ys.SEQ]:o[ys.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 Ed.Scalar(t);return e?c.tag=e:l.default||(c.tag=l.tag),u&&(u.node=c),c}bd.createNode=hb});var Nr=k(Rr=>{"use strict";var db=Zi(),at=W(),pb=Tr();function wu(t,e,s){let i=s;for(let n=e.length-1;n>=0;--n){let r=e[n];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=i,i=o}else i=new Map([[r,i]])}return db.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var wd=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,vu=class extends pb.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(i=>at.isNode(i)||at.isPair(i)?i.clone(e):i),this.range&&(s.range=this.range.slice()),s}addIn(e,s){if(wd(e))this.add(s);else{let[i,...n]=e,r=this.get(i,!0);if(at.isCollection(r))r.addIn(n,s);else if(r===void 0&&this.schema)this.set(i,wu(this.schema,n,s));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[s,...i]=e;if(i.length===0)return this.delete(s);let n=this.get(s,!0);if(at.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}getIn(e,s){let[i,...n]=e,r=this.get(i,!0);return n.length===0?!s&&at.isScalar(r)?r.value:r:at.isCollection(r)?r.getIn(n,s):void 0}hasAllNullValues(e){return this.items.every(s=>{if(!at.isPair(s))return!1;let i=s.value;return i==null||e&&at.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[s,...i]=e;if(i.length===0)return this.has(s);let n=this.get(s,!0);return at.isCollection(n)?n.hasIn(i):!1}setIn(e,s){let[i,...n]=e;if(n.length===0)this.set(i,s);else{let r=this.get(i,!0);if(at.isCollection(r))r.setIn(n,s);else if(r===void 0&&this.schema)this.set(i,wu(this.schema,n,s));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};Rr.Collection=vu;Rr.collectionFromPath=wu;Rr.isEmptyPath=wd});var Qi=k(Pr=>{"use strict";var Db=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function xu(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var mb=(t,e,s)=>t.endsWith(`
60
- `)?xu(s,e):s.includes(`
55
+ `)},separator:(t="=",e=80)=>{console.log(t.repeat(e))},newline:()=>console.log()};Qn=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,Zn.add(this),this.frameIndex=0,process.stdout.write("\x1B[?25l"),this.intervalId=setInterval(()=>{let e=this.frames[this.frameIndex];process.stdout.write(`\r${$.cyan}${e}${$.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(`${$.green}\u2713${$.reset} ${s}`)}fail(e){this.stop();let s=e||this.message;console.log(`${$.red}\u2717${$.reset} ${s}`)}warn(e){this.stop();let s=e||this.message;console.log(`${$.yellow}!${$.reset} ${s}`)}stop(){this.isSpinning&&(Zn.delete(this),this.isSpinning=!1,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),process.stdout.write("\r\x1B[K"),process.stdout.write("\x1B[?25h"))}},dF=10,Ns=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,i,n,r,o){let a={id:e,label:s,status:"pending",detail:o,totalBatches:i,completedBatches:0,fileCount:n,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*dF*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,i=this.getEstimatedTotal(e),n=s/i,r=e.completedBatches/Math.max(1,e.totalBatches);return Math.min(.95,Math.max(n,r))}calculateETA(e){if(e.status!=="running"||!e.startTime)return null;let s=Date.now()-e.startTime,i=this.getEstimatedTotal(e),n=Math.max(0,i-s);return n>1e3?n:null}formatProgressBar(e,s=12){let i=Math.round(e*s),n=s-i;return"\u2588".repeat(i)+"\u2591".repeat(n)}render(){this.linesWritten>0&&process.stdout.write(`\x1B[${this.linesWritten}A`);let e=[],s=this.taskOrder.length;for(let i=0;i<this.taskOrder.length;i++){let n=this.taskOrder[i],r=this.tasks.get(n);if(!r)continue;let o=this.formatTaskLine(r,i+1,s);e.push(o)}for(let i of e)process.stdout.write(`\x1B[K${i}
56
+ `);this.linesWritten=e.length}formatTaskLine(e,s,i){let n=`[${s}/${i}]`.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 m=this.calculateETA(e);m!==null&&(d=`~${Math.ceil(m/1e3)}s`)}else e.duration!==void 0&&(d=`${(e.duration/1e3).toFixed(1)}s`);let p=e.detail?`${$.dim}| ${e.detail}${$.reset}`:"";return` ${$.dim}${n}${$.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 V,Ra,_,et,vi=M(()=>{(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function s(n){throw new Error}t.assertNever=s,t.arrayToEnum=n=>{let r={};for(let o of n)r[o]=o;return r},t.getValidEnumValues=n=>{let r=t.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),o={};for(let a of r)o[a]=n[a];return t.objectValues(o)},t.objectValues=n=>t.objectKeys(n).map(function(r){return n[r]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let r=[];for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&r.push(o);return r},t.find=(n,r)=>{for(let o of n)if(r(o))return o},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function i(n,r=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(r)}t.joinValues=i,t.jsonStringifyReplacer=(n,r)=>typeof r=="bigint"?r.toString():r})(V||(V={}));(function(t){t.mergeShapes=(e,s)=>({...e,...s})})(Ra||(Ra={}));_=V.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 _.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,CF,pe,Xn=M(()=>{vi();b=V.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"]),CF=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=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};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},i={_errors:[]},n=r=>{for(let o of r.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)i._errors.push(s(o));else{let a=i,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 n(this),i}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,V.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){let s={},i=[];for(let n of this.issues)if(n.path.length>0){let r=n.path[0];s[r]=s[r]||[],s[r].push(e(n))}else i.push(e(n));return{formErrors:i,fieldErrors:s}}get formErrors(){return this.flatten()}};pe.create=t=>new pe(t)});var EF,dt,Na=M(()=>{Xn();vi();EF=(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,V.jsonStringifyReplacer)}`;break;case b.unrecognized_keys:s=`Unrecognized key(s) in object: ${V.joinValues(t.keys,", ")}`;break;case b.invalid_union:s="Invalid input";break;case b.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${V.joinValues(t.options)}`;break;case b.invalid_enum_value:s=`Invalid enum value. Expected ${V.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}"`:V.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,V.assertNever(t)}return{message:s}},dt=EF});function wF(t){Pf=t}function Ps(){return Pf}var Pf,er=M(()=>{Na();Pf=dt});function A(t,e){let s=Ps(),i=xi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,s,s===dt?void 0:dt].filter(n=>!!n)});t.common.issues.push(i)}var xi,bF,ce,N,Qt,De,tr,sr,At,Os,Pa=M(()=>{er();Na();xi=t=>{let{data:e,path:s,errorMaps:i,issueData:n}=t,r=[...s,...n.path||[]],o={...n,path:r};if(n.message!==void 0)return{...n,path:r,message:n.message};let a="",u=i.filter(l=>!!l).slice().reverse();for(let l of u)a=l(o,{data:e,defaultError:a}).message;return{...n,path:r,message:a}},bF=[];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 i=[];for(let n of s){if(n.status==="aborted")return N;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,s){let i=[];for(let n of s){let r=await n.key,o=await n.value;i.push({key:r,value:o})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,s){let i={};for(let n of s){let{key:r,value:o}=n;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"||n.alwaysSet)&&(i[r.value]=o.value)}return{status:e.value,value:i}}},N=Object.freeze({status:"aborted"}),Qt=t=>({status:"dirty",value:t}),De=t=>({status:"valid",value:t}),tr=t=>t.status==="aborted",sr=t=>t.status==="dirty",At=t=>t.status==="valid",Os=t=>typeof Promise<"u"&&t instanceof Promise});var Of=M(()=>{});var B,Lf=M(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(B||(B={}))});function L(t){if(!t)return{};let{errorMap:e,invalid_type_error:s,required_error:i,description:n}=t;if(e&&(s||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(o,a)=>{let{message:u}=t;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??i??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:u??s??a.defaultError}},description:n}}function Uf(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 jF(t){return new RegExp(`^${Uf(t)}$`)}function Vf(t){let e=`${qf}T${Uf(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 qF(t,e){return!!((e==="v4"||!e)&&IF.test(t)||(e==="v6"||!e)&&NF.test(t))}function UF(t,e){if(!_F.test(t))return!1;try{let[s]=t.split(".");if(!s)return!1;let i=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),n=JSON.parse(atob(i));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function VF(t,e){return!!((e==="v4"||!e)&&RF.test(t)||(e==="v6"||!e)&&PF.test(t))}function WF(t,e){let s=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=s>i?s:i,r=Number.parseInt(t.toFixed(n).replace(".","")),o=Number.parseInt(e.toFixed(n).replace(".",""));return r%o/10**n}function Ls(t){if(t instanceof ve){let e={};for(let s in t.shape){let i=t.shape[s];e[s]=Te.create(Ls(i))}return new ve({...t._def,shape:()=>e})}else return t instanceof Dt?new Dt({...t._def,type:Ls(t.element)}):t instanceof Te?Te.create(Ls(t.unwrap())):t instanceof st?st.create(Ls(t.unwrap())):t instanceof tt?tt.create(t.items.map(e=>Ls(e))):t}function La(t,e){let s=et(t),i=et(e);if(t===e)return{valid:!0,data:t};if(s===_.object&&i===_.object){let n=V.objectKeys(e),r=V.objectKeys(t).filter(a=>n.indexOf(a)!==-1),o={...t,...e};for(let a of r){let u=La(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(s===_.array&&i===_.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let r=0;r<t.length;r++){let o=t[r],a=e[r],u=La(o,a);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return s===_.date&&i===_.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function Wf(t,e){return new ls({values:t,typeName:P.ZodEnum,...L(e)})}function jf(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((i,n)=>{let r=t(i);if(r instanceof Promise)return r.then(o=>{if(!o){let a=jf(e,i),u=a.fatal??s??!0;n.addIssue({code:"custom",...a,fatal:u})}});if(!r){let o=jf(e,i),a=o.fatal??s??!0;n.addIssue({code:"custom",...o,fatal:a})}}):_t.create()}var Ie,Mf,q,vF,xF,SF,AF,kF,_F,$F,BF,TF,Oa,IF,RF,NF,PF,OF,LF,qf,MF,kt,Xt,es,ts,ss,Ms,is,ns,_t,pt,ze,js,Dt,ve,rs,ht,ir,os,tt,nr,qs,Us,rr,as,us,ls,cs,$t,Re,Te,st,fs,ds,Vs,zF,Si,Ai,hs,GF,P,KF,Gf,Kf,YF,JF,Yf,HF,ZF,QF,XF,eC,tC,sC,iC,nC,rC,oC,aC,uC,lC,cC,fC,dC,hC,pC,DC,mC,gC,yC,FC,CC,EC,wC,bC,vC,xC,SC,AC,kC,_C,Jf=M(()=>{Xn();er();Lf();Pa();vi();Ie=class{constructor(e,s,i,n){this._cachedPath=[],this.parent=e,this.data=s,this._path=i,this._key=n}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}},Mf=(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}}};q=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(Os(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 i=this.safeParse(e,s);if(i.success)return i.data;throw i.error}safeParse(e,s){let i={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:et(e)},n=this._parseSync({data:e,path:i.path,parent:i});return Mf(i,n)}"~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 i=this._parseSync({data:e,path:[],parent:s});return At(i)?{value:i.value}:{issues:s.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(i=>At(i)?{value:i.value}:{issues:s.common.issues})}async parseAsync(e,s){let i=await this.safeParseAsync(e,s);if(i.success)return i.data;throw i.error}async safeParseAsync(e,s){let i={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:et(e)},n=this._parse({data:e,path:i.path,parent:i}),r=await(Os(n)?n:Promise.resolve(n));return Mf(i,r)}refine(e,s){let i=n=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(n):s;return this._refinement((n,r)=>{let o=e(n),a=()=>r.addIssue({code:b.custom,...i(n)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,s){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof s=="function"?s(i,n):s),!1))}_refinement(e){return new Re({schema:this,typeName:P.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 Te.create(this,this._def)}nullable(){return st.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Dt.create(this)}promise(){return $t.create(this,this._def)}or(e){return rs.create([this,e],this._def)}and(e){return os.create(this,e,this._def)}transform(e){return new Re({...L(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let s=typeof e=="function"?e:()=>e;return new fs({...L(this._def),innerType:this,defaultValue:s,typeName:P.ZodDefault})}brand(){return new Si({typeName:P.ZodBranded,type:this,...L(this._def)})}catch(e){let s=typeof e=="function"?e:()=>e;return new ds({...L(this._def),innerType:this,catchValue:s,typeName:P.ZodCatch})}describe(e){let s=this.constructor;return new s({...this._def,description:e})}pipe(e){return Ai.create(this,e)}readonly(){return hs.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},vF=/^c[^\s-]{8,}$/i,xF=/^[0-9a-z]+$/,SF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,AF=/^[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,kF=/^[a-z0-9_-]{21}$/i,_F=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$F=/^[-+]?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)?)??$/,BF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,TF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",IF=/^(?:(?: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])$/,RF=/^(?:(?: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])$/,NF=/^(([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]))$/,PF=/^(([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])$/,OF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,LF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qf="((\\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])))",MF=new RegExp(`^${qf}$`);kt=class t extends q{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){let r=this._getOrReturnCtx(e);return A(r,{code:b.invalid_type,expected:_.string,received:r.parsedType}),N}let i=new ce,n;for(let r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),A(n,{code:b.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),i.dirty());else if(r.kind==="max")e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),A(n,{code:b.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),i.dirty());else if(r.kind==="length"){let o=e.data.length>r.value,a=e.data.length<r.value;(o||a)&&(n=this._getOrReturnCtx(e,n),o?A(n,{code:b.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):a&&A(n,{code:b.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),i.dirty())}else if(r.kind==="email")BF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"email",code:b.invalid_string,message:r.message}),i.dirty());else if(r.kind==="emoji")Oa||(Oa=new RegExp(TF,"u")),Oa.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"emoji",code:b.invalid_string,message:r.message}),i.dirty());else if(r.kind==="uuid")AF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"uuid",code:b.invalid_string,message:r.message}),i.dirty());else if(r.kind==="nanoid")kF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"nanoid",code:b.invalid_string,message:r.message}),i.dirty());else if(r.kind==="cuid")vF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"cuid",code:b.invalid_string,message:r.message}),i.dirty());else if(r.kind==="cuid2")xF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"cuid2",code:b.invalid_string,message:r.message}),i.dirty());else if(r.kind==="ulid")SF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"ulid",code:b.invalid_string,message:r.message}),i.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),A(n,{validation:"url",code:b.invalid_string,message:r.message}),i.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"regex",code:b.invalid_string,message:r.message}),i.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),A(n,{code:b.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),i.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)||(n=this._getOrReturnCtx(e,n),A(n,{code:b.invalid_string,validation:{startsWith:r.value},message:r.message}),i.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),A(n,{code:b.invalid_string,validation:{endsWith:r.value},message:r.message}),i.dirty()):r.kind==="datetime"?Vf(r).test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{code:b.invalid_string,validation:"datetime",message:r.message}),i.dirty()):r.kind==="date"?MF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{code:b.invalid_string,validation:"date",message:r.message}),i.dirty()):r.kind==="time"?jF(r).test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{code:b.invalid_string,validation:"time",message:r.message}),i.dirty()):r.kind==="duration"?$F.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"duration",code:b.invalid_string,message:r.message}),i.dirty()):r.kind==="ip"?qF(e.data,r.version)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"ip",code:b.invalid_string,message:r.message}),i.dirty()):r.kind==="jwt"?UF(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"jwt",code:b.invalid_string,message:r.message}),i.dirty()):r.kind==="cidr"?VF(e.data,r.version)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"cidr",code:b.invalid_string,message:r.message}),i.dirty()):r.kind==="base64"?OF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"base64",code:b.invalid_string,message:r.message}),i.dirty()):r.kind==="base64url"?LF.test(e.data)||(n=this._getOrReturnCtx(e,n),A(n,{validation:"base64url",code:b.invalid_string,message:r.message}),i.dirty()):V.assertNever(r);return{status:i.value,value:e.data}}_regex(e,s,i){return this.refinement(n=>e.test(n),{validation:s,code:b.invalid_string,...B.errToObj(i)})}_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:P.ZodString,coerce:t?.coerce??!1,...L(t)});Xt=class t extends q{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 A(r,{code:b.invalid_type,expected:_.number,received:r.parsedType}),N}let i,n=new ce;for(let r of this._def.checks)r.kind==="int"?V.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{code:b.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(i=this._getOrReturnCtx(e,i),A(i,{code:b.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(i=this._getOrReturnCtx(e,i),A(i,{code:b.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="multipleOf"?WF(e.data,r.value)!==0&&(i=this._getOrReturnCtx(e,i),A(i,{code:b.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),A(i,{code:b.not_finite,message:r.message}),n.dirty()):V.assertNever(r);return{status:n.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,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:i,message:B.toString(n)}]})}_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"&&V.isInteger(e.value))}get isFinite(){let e=null,s=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(s===null||i.value>s)&&(s=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(s)&&Number.isFinite(e)}};Xt.create=t=>new Xt({checks:[],typeName:P.ZodNumber,coerce:t?.coerce||!1,...L(t)});es=class t extends q{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 i,n=new ce;for(let r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(i=this._getOrReturnCtx(e,i),A(i,{code:b.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(i=this._getOrReturnCtx(e,i),A(i,{code:b.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),A(i,{code:b.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):V.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let s=this._getOrReturnCtx(e);return A(s,{code:b.invalid_type,expected:_.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,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:i,message:B.toString(n)}]})}_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}};es.create=t=>new es({checks:[],typeName:P.ZodBigInt,coerce:t?.coerce??!1,...L(t)});ts=class extends q{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.boolean){let i=this._getOrReturnCtx(e);return A(i,{code:b.invalid_type,expected:_.boolean,received:i.parsedType}),N}return De(e.data)}};ts.create=t=>new ts({typeName:P.ZodBoolean,coerce:t?.coerce||!1,...L(t)});ss=class t extends q{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){let r=this._getOrReturnCtx(e);return A(r,{code:b.invalid_type,expected:_.date,received:r.parsedType}),N}if(Number.isNaN(e.data.getTime())){let r=this._getOrReturnCtx(e);return A(r,{code:b.invalid_date}),N}let i=new ce,n;for(let r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),A(n,{code:b.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),i.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),A(n,{code:b.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),i.dirty()):V.assertNever(r);return{status:i.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}};ss.create=t=>new ss({checks:[],coerce:t?.coerce||!1,typeName:P.ZodDate,...L(t)});Ms=class extends q{_parse(e){if(this._getType(e)!==_.symbol){let i=this._getOrReturnCtx(e);return A(i,{code:b.invalid_type,expected:_.symbol,received:i.parsedType}),N}return De(e.data)}};Ms.create=t=>new Ms({typeName:P.ZodSymbol,...L(t)});is=class extends q{_parse(e){if(this._getType(e)!==_.undefined){let i=this._getOrReturnCtx(e);return A(i,{code:b.invalid_type,expected:_.undefined,received:i.parsedType}),N}return De(e.data)}};is.create=t=>new is({typeName:P.ZodUndefined,...L(t)});ns=class extends q{_parse(e){if(this._getType(e)!==_.null){let i=this._getOrReturnCtx(e);return A(i,{code:b.invalid_type,expected:_.null,received:i.parsedType}),N}return De(e.data)}};ns.create=t=>new ns({typeName:P.ZodNull,...L(t)});_t=class extends q{constructor(){super(...arguments),this._any=!0}_parse(e){return De(e.data)}};_t.create=t=>new _t({typeName:P.ZodAny,...L(t)});pt=class extends q{constructor(){super(...arguments),this._unknown=!0}_parse(e){return De(e.data)}};pt.create=t=>new pt({typeName:P.ZodUnknown,...L(t)});ze=class extends q{_parse(e){let s=this._getOrReturnCtx(e);return A(s,{code:b.invalid_type,expected:_.never,received:s.parsedType}),N}};ze.create=t=>new ze({typeName:P.ZodNever,...L(t)});js=class extends q{_parse(e){if(this._getType(e)!==_.undefined){let i=this._getOrReturnCtx(e);return A(i,{code:b.invalid_type,expected:_.void,received:i.parsedType}),N}return De(e.data)}};js.create=t=>new js({typeName:P.ZodVoid,...L(t)});Dt=class t extends q{_parse(e){let{ctx:s,status:i}=this._processInputParams(e),n=this._def;if(s.parsedType!==_.array)return A(s,{code:b.invalid_type,expected:_.array,received:s.parsedType}),N;if(n.exactLength!==null){let o=s.data.length>n.exactLength.value,a=s.data.length<n.exactLength.value;(o||a)&&(A(s,{code:o?b.too_big:b.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&s.data.length<n.minLength.value&&(A(s,{code:b.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&s.data.length>n.maxLength.value&&(A(s,{code:b.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),s.common.async)return Promise.all([...s.data].map((o,a)=>n.type._parseAsync(new Ie(s,o,s.path,a)))).then(o=>ce.mergeArray(i,o));let r=[...s.data].map((o,a)=>n.type._parseSync(new Ie(s,o,s.path,a)));return ce.mergeArray(i,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)}};Dt.create=(t,e)=>new Dt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...L(e)});ve=class t extends q{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=V.objectKeys(e);return this._cached={shape:e,keys:s},this._cached}_parse(e){if(this._getType(e)!==_.object){let l=this._getOrReturnCtx(e);return A(l,{code:b.invalid_type,expected:_.object,received:l.parsedType}),N}let{status:i,ctx:n}=this._processInputParams(e),{shape:r,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof ze&&this._def.unknownKeys==="strip"))for(let l in n.data)o.includes(l)||a.push(l);let u=[];for(let l of o){let c=r[l],f=n.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Ie(n,f,n.path,l)),alwaysSet:l in n.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:n.data[c]}});else if(l==="strict")a.length>0&&(A(n,{code:b.unrecognized_keys,keys:a}),i.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=n.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Ie(n,f,n.path,c)),alwaysSet:c in n.data})}}return n.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(i,l)):ce.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(e){return B.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,i)=>{let n=this._def.errorMap?.(s,i).message??i.defaultError;return s.code==="unrecognized_keys"?{message:B.errToObj(e).message??n}:{message:n}}}:{}})}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:P.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let s={};for(let i of V.objectKeys(e))e[i]&&this.shape[i]&&(s[i]=this.shape[i]);return new t({...this._def,shape:()=>s})}omit(e){let s={};for(let i of V.objectKeys(this.shape))e[i]||(s[i]=this.shape[i]);return new t({...this._def,shape:()=>s})}deepPartial(){return Ls(this)}partial(e){let s={};for(let i of V.objectKeys(this.shape)){let n=this.shape[i];e&&!e[i]?s[i]=n:s[i]=n.optional()}return new t({...this._def,shape:()=>s})}required(e){let s={};for(let i of V.objectKeys(this.shape))if(e&&!e[i])s[i]=this.shape[i];else{let r=this.shape[i];for(;r instanceof Te;)r=r._def.innerType;s[i]=r}return new t({...this._def,shape:()=>s})}keyof(){return Wf(V.objectKeys(this.shape))}};ve.create=(t,e)=>new ve({shape:()=>t,unknownKeys:"strip",catchall:ze.create(),typeName:P.ZodObject,...L(e)});ve.strictCreate=(t,e)=>new ve({shape:()=>t,unknownKeys:"strict",catchall:ze.create(),typeName:P.ZodObject,...L(e)});ve.lazycreate=(t,e)=>new ve({shape:t,unknownKeys:"strip",catchall:ze.create(),typeName:P.ZodObject,...L(e)});rs=class extends q{_parse(e){let{ctx:s}=this._processInputParams(e),i=this._def.options;function n(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 A(s,{code:b.invalid_union,unionErrors:o}),N}if(s.common.async)return Promise.all(i.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(n);{let r,o=[];for(let u of i){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 A(s,{code:b.invalid_union,unionErrors:a}),N}}get options(){return this._def.options}};rs.create=(t,e)=>new rs({options:t,typeName:P.ZodUnion,...L(e)});ht=t=>t instanceof as?ht(t.schema):t instanceof Re?ht(t.innerType()):t instanceof us?[t.value]:t instanceof ls?t.options:t instanceof cs?V.objectValues(t.enum):t instanceof fs?ht(t._def.innerType):t instanceof is?[void 0]:t instanceof ns?[null]:t instanceof Te?[void 0,...ht(t.unwrap())]:t instanceof st?[null,...ht(t.unwrap())]:t instanceof Si||t instanceof hs?ht(t.unwrap()):t instanceof ds?ht(t._def.innerType):[],ir=class t extends q{_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==_.object)return A(s,{code:b.invalid_type,expected:_.object,received:s.parsedType}),N;let i=this.discriminator,n=s.data[i],r=this.optionsMap.get(n);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}):(A(s,{code:b.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),N)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,s,i){let n=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(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,r)}}return new t({typeName:P.ZodDiscriminatedUnion,discriminator:e,options:s,optionsMap:n,...L(i)})}};os=class extends q{_parse(e){let{status:s,ctx:i}=this._processInputParams(e),n=(r,o)=>{if(tr(r)||tr(o))return N;let a=La(r.value,o.value);return a.valid?((sr(r)||sr(o))&&s.dirty(),{status:s.value,value:a.data}):(A(i,{code:b.invalid_intersection_types}),N)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([r,o])=>n(r,o)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};os.create=(t,e,s)=>new os({left:t,right:e,typeName:P.ZodIntersection,...L(s)});tt=class t extends q{_parse(e){let{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.array)return A(i,{code:b.invalid_type,expected:_.array,received:i.parsedType}),N;if(i.data.length<this._def.items.length)return A(i,{code:b.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N;!this._def.rest&&i.data.length>this._def.items.length&&(A(i,{code:b.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let r=[...i.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new Ie(i,o,i.path,a)):null}).filter(o=>!!o);return i.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:P.ZodTuple,rest:null,...L(e)})};nr=class t extends q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.object)return A(i,{code:b.invalid_type,expected:_.object,received:i.parsedType}),N;let n=[],r=this._def.keyType,o=this._def.valueType;for(let a in i.data)n.push({key:r._parse(new Ie(i,a,i.path,a)),value:o._parse(new Ie(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?ce.mergeObjectAsync(s,n):ce.mergeObjectSync(s,n)}get element(){return this._def.valueType}static create(e,s,i){return s instanceof q?new t({keyType:e,valueType:s,typeName:P.ZodRecord,...L(i)}):new t({keyType:kt.create(),valueType:e,typeName:P.ZodRecord,...L(s)})}},qs=class extends q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.map)return A(i,{code:b.invalid_type,expected:_.map,received:i.parsedType}),N;let n=this._def.keyType,r=this._def.valueType,o=[...i.data.entries()].map(([a,u],l)=>({key:n._parse(new Ie(i,a,i.path,[l,"key"])),value:r._parse(new Ie(i,u,i.path,[l,"value"]))}));if(i.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}}}};qs.create=(t,e,s)=>new qs({valueType:e,keyType:t,typeName:P.ZodMap,...L(s)});Us=class t extends q{_parse(e){let{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.set)return A(i,{code:b.invalid_type,expected:_.set,received:i.parsedType}),N;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(A(i,{code:b.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),s.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(A(i,{code:b.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.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=[...i.data.values()].map((u,l)=>r._parse(new Ie(i,u,i.path,l)));return i.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)}};Us.create=(t,e)=>new Us({valueType:t,minSize:null,maxSize:null,typeName:P.ZodSet,...L(e)});rr=class t extends q{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==_.function)return A(s,{code:b.invalid_type,expected:_.function,received:s.parsedType}),N;function i(a,u){return xi({data:a,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Ps(),dt].filter(l=>!!l),issueData:{code:b.invalid_arguments,argumentsError:u}})}function n(a,u){return xi({data:a,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Ps(),dt].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 $t){let a=this;return De(async function(...u){let l=new pe([]),c=await a._def.args.parseAsync(u,r).catch(p=>{throw l.addIssue(i(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(n(f,p)),l})})}else{let a=this;return De(function(...u){let l=a._def.args.safeParse(u,r);if(!l.success)throw new pe([i(u,l.error)]);let c=Reflect.apply(o,this,l.data),f=a._def.returns.safeParse(c,r);if(!f.success)throw new pe([n(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,i){return new t({args:e||tt.create([]).rest(pt.create()),returns:s||pt.create(),typeName:P.ZodFunction,...L(i)})}},as=class extends q{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})}};as.create=(t,e)=>new as({getter:t,typeName:P.ZodLazy,...L(e)});us=class extends q{_parse(e){if(e.data!==this._def.value){let s=this._getOrReturnCtx(e);return A(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}};us.create=(t,e)=>new us({value:t,typeName:P.ZodLiteral,...L(e)});ls=class t extends q{_parse(e){if(typeof e.data!="string"){let s=this._getOrReturnCtx(e),i=this._def.values;return A(s,{expected:V.joinValues(i),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),i=this._def.values;return A(s,{received:s.data,code:b.invalid_enum_value,options:i}),N}return De(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(i=>!e.includes(i)),{...this._def,...s})}};ls.create=Wf;cs=class extends q{_parse(e){let s=V.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==_.string&&i.parsedType!==_.number){let n=V.objectValues(s);return A(i,{expected:V.joinValues(n),received:i.parsedType,code:b.invalid_type}),N}if(this._cache||(this._cache=new Set(V.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=V.objectValues(s);return A(i,{received:i.data,code:b.invalid_enum_value,options:n}),N}return De(e.data)}get enum(){return this._def.values}};cs.create=(t,e)=>new cs({values:t,typeName:P.ZodNativeEnum,...L(e)});$t=class extends q{unwrap(){return this._def.type}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==_.promise&&s.common.async===!1)return A(s,{code:b.invalid_type,expected:_.promise,received:s.parsedType}),N;let i=s.parsedType===_.promise?s.data:Promise.resolve(s.data);return De(i.then(n=>this._def.type.parseAsync(n,{path:s.path,errorMap:s.common.contextualErrorMap})))}};$t.create=(t,e)=>new $t({type:t,typeName:P.ZodPromise,...L(e)});Re=class extends q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:s,ctx:i}=this._processInputParams(e),n=this._def.effect||null,r={addIssue:o=>{A(i,o),o.fatal?s.abort():s.dirty()},get path(){return i.path}};if(r.addIssue=r.addIssue.bind(r),n.type==="preprocess"){let o=n.transform(i.data,r);if(i.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:i.path,parent:i});return u.status==="aborted"?N:u.status==="dirty"?Qt(u.value):s.value==="dirty"?Qt(u.value):u});{if(s.value==="aborted")return N;let a=this._def.schema._parseSync({data:o,path:i.path,parent:i});return a.status==="aborted"?N:a.status==="dirty"?Qt(a.value):s.value==="dirty"?Qt(a.value):a}}if(n.type==="refinement"){let o=a=>{let u=n.refinement(a,r);if(i.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(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});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:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?N:(a.status==="dirty"&&s.dirty(),o(a.value).then(()=>({status:s.value,value:a.value}))))}if(n.type==="transform")if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!At(o))return N;let a=n.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:i.data,path:i.path,parent:i}).then(o=>At(o)?Promise.resolve(n.transform(o.value,r)).then(a=>({status:s.value,value:a})):N);V.assertNever(n)}};Re.create=(t,e,s)=>new Re({schema:t,typeName:P.ZodEffects,effect:e,...L(s)});Re.createWithPreprocess=(t,e,s)=>new Re({schema:e,effect:{type:"preprocess",transform:t},typeName:P.ZodEffects,...L(s)});Te=class extends q{_parse(e){return this._getType(e)===_.undefined?De(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Te.create=(t,e)=>new Te({innerType:t,typeName:P.ZodOptional,...L(e)});st=class extends q{_parse(e){return this._getType(e)===_.null?De(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};st.create=(t,e)=>new st({innerType:t,typeName:P.ZodNullable,...L(e)});fs=class extends q{_parse(e){let{ctx:s}=this._processInputParams(e),i=s.data;return s.parsedType===_.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};fs.create=(t,e)=>new fs({innerType:t,typeName:P.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});ds=class extends q{_parse(e){let{ctx:s}=this._processInputParams(e),i={...s,common:{...s.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Os(n)?n.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new pe(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new pe(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};ds.create=(t,e)=>new ds({innerType:t,typeName:P.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});Vs=class extends q{_parse(e){if(this._getType(e)!==_.nan){let i=this._getOrReturnCtx(e);return A(i,{code:b.invalid_type,expected:_.nan,received:i.parsedType}),N}return{status:"valid",value:e.data}}};Vs.create=t=>new Vs({typeName:P.ZodNaN,...L(t)});zF=Symbol("zod_brand"),Si=class extends q{_parse(e){let{ctx:s}=this._processInputParams(e),i=s.data;return this._def.type._parse({data:i,path:s.path,parent:s})}unwrap(){return this._def.type}},Ai=class t extends q{_parse(e){let{status:s,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?N:r.status==="dirty"?(s.dirty(),Qt(r.value)):this._def.out._parseAsync({data:r.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?N:n.status==="dirty"?(s.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,s){return new t({in:e,out:s,typeName:P.ZodPipeline})}},hs=class extends q{_parse(e){let s=this._def.innerType._parse(e),i=n=>(At(n)&&(n.value=Object.freeze(n.value)),n);return Os(s)?s.then(n=>i(n)):i(s)}unwrap(){return this._def.innerType}};hs.create=(t,e)=>new hs({innerType:t,typeName:P.ZodReadonly,...L(e)});GF={object:ve.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"})(P||(P={}));KF=(t,e={message:`Input not instance of ${t.name}`})=>zf(s=>s instanceof t,e),Gf=kt.create,Kf=Xt.create,YF=Vs.create,JF=es.create,Yf=ts.create,HF=ss.create,ZF=Ms.create,QF=is.create,XF=ns.create,eC=_t.create,tC=pt.create,sC=ze.create,iC=js.create,nC=Dt.create,rC=ve.create,oC=ve.strictCreate,aC=rs.create,uC=ir.create,lC=os.create,cC=tt.create,fC=nr.create,dC=qs.create,hC=Us.create,pC=rr.create,DC=as.create,mC=us.create,gC=ls.create,yC=cs.create,FC=$t.create,CC=Re.create,EC=Te.create,wC=st.create,bC=Re.createWithPreprocess,vC=Ai.create,xC=()=>Gf().optional(),SC=()=>Kf().optional(),AC=()=>Yf().optional(),kC={string:(t=>kt.create({...t,coerce:!0})),number:(t=>Xt.create({...t,coerce:!0})),boolean:(t=>ts.create({...t,coerce:!0})),bigint:(t=>es.create({...t,coerce:!0})),date:(t=>ss.create({...t,coerce:!0}))},_C=N});var I={};Di(I,{BRAND:()=>zF,DIRTY:()=>Qt,EMPTY_PATH:()=>bF,INVALID:()=>N,NEVER:()=>_C,OK:()=>De,ParseStatus:()=>ce,Schema:()=>q,ZodAny:()=>_t,ZodArray:()=>Dt,ZodBigInt:()=>es,ZodBoolean:()=>ts,ZodBranded:()=>Si,ZodCatch:()=>ds,ZodDate:()=>ss,ZodDefault:()=>fs,ZodDiscriminatedUnion:()=>ir,ZodEffects:()=>Re,ZodEnum:()=>ls,ZodError:()=>pe,ZodFirstPartyTypeKind:()=>P,ZodFunction:()=>rr,ZodIntersection:()=>os,ZodIssueCode:()=>b,ZodLazy:()=>as,ZodLiteral:()=>us,ZodMap:()=>qs,ZodNaN:()=>Vs,ZodNativeEnum:()=>cs,ZodNever:()=>ze,ZodNull:()=>ns,ZodNullable:()=>st,ZodNumber:()=>Xt,ZodObject:()=>ve,ZodOptional:()=>Te,ZodParsedType:()=>_,ZodPipeline:()=>Ai,ZodPromise:()=>$t,ZodReadonly:()=>hs,ZodRecord:()=>nr,ZodSchema:()=>q,ZodSet:()=>Us,ZodString:()=>kt,ZodSymbol:()=>Ms,ZodTransformer:()=>Re,ZodTuple:()=>tt,ZodType:()=>q,ZodUndefined:()=>is,ZodUnion:()=>rs,ZodUnknown:()=>pt,ZodVoid:()=>js,addIssueToContext:()=>A,any:()=>eC,array:()=>nC,bigint:()=>JF,boolean:()=>Yf,coerce:()=>kC,custom:()=>zf,date:()=>HF,datetimeRegex:()=>Vf,defaultErrorMap:()=>dt,discriminatedUnion:()=>uC,effect:()=>CC,enum:()=>gC,function:()=>pC,getErrorMap:()=>Ps,getParsedType:()=>et,instanceof:()=>KF,intersection:()=>lC,isAborted:()=>tr,isAsync:()=>Os,isDirty:()=>sr,isValid:()=>At,late:()=>GF,lazy:()=>DC,literal:()=>mC,makeIssue:()=>xi,map:()=>dC,nan:()=>YF,nativeEnum:()=>yC,never:()=>sC,null:()=>XF,nullable:()=>wC,number:()=>Kf,object:()=>rC,objectUtil:()=>Ra,oboolean:()=>AC,onumber:()=>SC,optional:()=>EC,ostring:()=>xC,pipeline:()=>vC,preprocess:()=>bC,promise:()=>FC,quotelessJson:()=>CF,record:()=>fC,set:()=>hC,setErrorMap:()=>wF,strictObject:()=>oC,string:()=>Gf,symbol:()=>ZF,transformer:()=>CC,tuple:()=>cC,undefined:()=>QF,union:()=>aC,unknown:()=>tC,util:()=>V,void:()=>iC});var Ma=M(()=>{er();Pa();Of();vi();Jf();Xn()});var Ws=M(()=>{Ma();Ma()});function qa(){return ja.parse({})}async function _i(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 Qf(t){if(!await _i(t))return null;let s=await(0,ke.readFile)(t,"utf-8");try{return JSON.parse(s)}catch(i){let n=i instanceof SyntaxError?i.message:String(i);throw new Error(`Invalid JSON in config file ${t}: ${n}`)}}function Xf(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?IC(t.executors,e.executors):t.executors,agents:e.agents?ed(t.agents,e.agents):t.agents,rules:e.rules?ed(t.rules,e.rules):t.rules,output:e.output?{...t.output,...e.output}:t.output}}async function Fe(t){let e=t?`${be.CONFIG}:${t}`:be.CONFIG;return ft(e,async()=>{let s=qa(),i=await Qf(ki);if(i&&(s=ja.parse(Xf(s,i))),t){let n=(0,Bt.join)(t,ar),r=await Qf(n);r&&(s=ja.parse(Xf(s,r)))}return s})}async function sd(t){try{await(0,ke.mkdir)(or,{recursive:!0}),await(0,ke.writeFile)(ki,JSON.stringify(t,null,2)),Rs(be.CONFIG)}catch(e){throw new Error(`Failed to save global config: ${e}`)}}async function id(t){let e=(0,Bt.join)(t,ar);return await _i(e)||(await(0,ke.writeFile)(e,JSON.stringify({agents:{},rules:{}},null,2)),Rs(be.CONFIG)),e}function IC(t,e){let s={...t};for(let[i,n]of Object.entries(e))s[i]={...s[i],...n,review:n.review?{...s[i]?.review,...n.review}:s[i]?.review,validation:n.validation?{...s[i]?.validation,...n.validation}:s[i]?.validation};return s}function ed(t,e){let s={...t};for(let[i,n]of Object.entries(e))s[i]={...s[i],...n};return s}function Ua(){return ki}function $i(t){return(0,Bt.join)(t,ar)}async function Va(){return _i(ki)}async function ur(t){return _i($i(t))}async function lr(){return ft(be.INSTRUCTIONS,async()=>{try{return await _i(Zf)?await(0,ke.readFile)(Zf,"utf-8"):""}catch{return""}})}async function nd(t,e,s){let i=e?ki:(0,Bt.join)(s||process.cwd(),ar),n={};try{let o=await(0,ke.readFile)(i,"utf-8");n=JSON.parse(o)}catch{}Array.isArray(n.extends)||(n.extends=[]);let r=n.extends;r.includes(t)||r.push(t),e&&await(0,ke.mkdir)(or,{recursive:!0}),await(0,ke.writeFile)(i,JSON.stringify(n,null,2)),Rs(be.CONFIG)}var Bt,td,ke,Hf,$C,BC,TC,ja,or,ki,Zf,ar,Ge=M(()=>{"use strict";Ws();Bt=require("path"),td=require("os"),ke=require("node:fs/promises");Ci();Hf=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()}),$C=I.object({review:Hf.optional(),validation:Hf.optional()}),BC=I.object({enabled:I.boolean().optional(),model:I.string().optional(),timeout:I.number().positive().optional()}),TC=I.object({enabled:I.boolean().optional(),agent:I.string().optional()}),ja=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(),$C).default({}),agents:I.record(I.string(),BC).default({}),rules:I.record(I.string(),TC).default({}),output:I.object({colorize:I.boolean().default(!0),verbose:I.boolean().default(!1),format:I.enum(["terminal","markdown","json"]).default("terminal")}).default({})}),or=(0,Bt.join)((0,td.homedir)(),".diffray"),ki=(0,Bt.join)(or,"config.json"),Zf=(0,Bt.join)(or,"instructions.md"),ar=".diffray.json"});var Wa,rd,RC,od=M(()=>{Wa=(t,e,s)=>{let i=t instanceof RegExp?rd(t,s):t,n=e instanceof RegExp?rd(e,s):e,r=i!==null&&n!=null&&RC(i,n,s);return r&&{start:r[0],end:r[1],pre:s.slice(0,r[0]),body:s.slice(r[0]+i.length,r[1]),post:s.slice(r[1]+n.length)}},rd=(t,e)=>{let s=e.match(t);return s?s[0]:null},RC=(t,e,s)=>{let i,n,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(i=[],r=s.length;c>=0&&!a;){if(c===u)i.push(c),u=s.indexOf(t,c+1);else if(i.length===1){let f=i.pop();f!==void 0&&(a=[f,l])}else n=i.pop(),n!==void 0&&n<r&&(r=n,o=l),l=s.indexOf(e,c+1);c=u<l&&u>=0?u:l}i.length&&o!==void 0&&(a=[r,o])}return a}});function za(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function zC(t){return t.replace(jC,ad).replace(qC,ud).replace(UC,Ga).replace(VC,ld).replace(WC,cd)}function GC(t){return t.replace(NC,"\\").replace(PC,"{").replace(OC,"}").replace(LC,",").replace(MC,".")}function fd(t){if(!t)return[""];let e=[],s=Wa("{","}",t);if(!s)return t.split(",");let{pre:i,body:n,post:r}=s,o=i.split(",");o[o.length-1]+="{"+n+"}";let a=fd(r);return r.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function dd(t){return t?(t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),Bi(zC(t),!0).map(GC)):[]}function KC(t){return"{"+t+"}"}function YC(t){return/^-?0\d/.test(t)}function JC(t,e){return t<=e}function HC(t,e){return t>=e}function Bi(t,e){let s=[],i=Wa("{","}",t);if(!i)return[t];let n=i.pre,r=i.post.length?Bi(i.post,!1):[""];if(/\$$/.test(i.pre))for(let o=0;o<r.length;o++){let a=n+"{"+i.body+"}"+r[o];s.push(a)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),u=o||a,l=i.body.indexOf(",")>=0;if(!u&&!l)return i.post.match(/,(?!,).*\}/)?(t=i.pre+"{"+i.body+Ga+i.post,Bi(t)):[t];let c;if(u)c=i.body.split(/\.\./);else if(c=fd(i.body),c.length===1&&c[0]!==void 0&&(c=Bi(c[0],!1).map(KC),c.length===1))return r.map(d=>i.pre+c[0]+d);let f;if(u&&c[0]!==void 0&&c[1]!==void 0){let d=za(c[0]),p=za(c[1]),m=Math.max(c[0].length,c[1].length),D=c.length===3&&c[2]!==void 0?Math.abs(za(c[2])):1,g=JC;p<d&&(D*=-1,g=HC);let y=c.some(YC);f=[];for(let C=d;g(C,p);C+=D){let E;if(a)E=String.fromCharCode(C),E==="\\"&&(E="");else if(E=String(C),y){let v=m-E.length;if(v>0){let S=new Array(v+1).join("0");C<0?E="-"+S+E.slice(1):E=S+E}}f.push(E)}}else{f=[];for(let d=0;d<c.length;d++)f.push.apply(f,Bi(c[d],!1))}for(let d=0;d<f.length;d++)for(let p=0;p<r.length;p++){let m=n+f[d]+r[p];(!e||u||m)&&s.push(m)}}return s}var ad,ud,Ga,ld,cd,NC,PC,OC,LC,MC,jC,qC,UC,VC,WC,hd=M(()=>{od();ad="\0SLASH"+Math.random()+"\0",ud="\0OPEN"+Math.random()+"\0",Ga="\0CLOSE"+Math.random()+"\0",ld="\0COMMA"+Math.random()+"\0",cd="\0PERIOD"+Math.random()+"\0",NC=new RegExp(ad,"g"),PC=new RegExp(ud,"g"),OC=new RegExp(Ga,"g"),LC=new RegExp(ld,"g"),MC=new RegExp(cd,"g"),jC=/\\\\/g,qC=/\\{/g,UC=/\\}/g,VC=/\\,/g,WC=/\\./g});var Ti,pd=M(()=>{Ti=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")}});var ZC,Ii,QC,Dd,md,gd=M(()=>{ZC={"[: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]},Ii=t=>t.replace(/[[\]\\-]/g,"\\$&"),QC=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Dd=t=>t.join(""),md=(t,e)=>{let s=e;if(t.charAt(s)!=="[")throw new Error("not in a brace expression");let i=[],n=[],r=s+1,o=!1,a=!1,u=!1,l=!1,c=s,f="";e:for(;r<t.length;){let D=t.charAt(r);if((D==="!"||D==="^")&&r===s+1){l=!0,r++;continue}if(D==="]"&&o&&!u){c=r+1;break}if(o=!0,D==="\\"&&!u){u=!0,r++;continue}if(D==="["&&!u){for(let[g,[F,y,C]]of Object.entries(ZC))if(t.startsWith(g,r)){if(f)return["$.",!1,t.length-s,!0];r+=g.length,C?n.push(F):i.push(F),a=a||y;continue e}}if(u=!1,f){D>f?i.push(Ii(f)+"-"+Ii(D)):D===f&&i.push(Ii(D)),f="",r++;continue}if(t.startsWith("-]",r+1)){i.push(Ii(D+"-")),r+=2;continue}if(t.startsWith("-",r+1)){f=D,r+=2;continue}i.push(Ii(D)),r++}if(c<r)return["",!1,0,!1];if(!i.length&&!n.length)return["$.",!1,t.length-s,!0];if(n.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!l){let D=i[0].length===2?i[0].slice(-1):i[0];return[QC(D),!1,c-s,!1]}let d="["+(l?"^":"")+Dd(i)+"]",p="["+(l?"":"^")+Dd(n)+"]";return[i.length&&n.length?"("+d+"|"+p+")":i.length?d:p,a,c-s,!0]}});var Ne,cr=M(()=>{Ne=(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 XC,yd,eE,fr,tE,sE,iE,nE,Ka,Fd,Cd,zs,Ya=M(()=>{gd();cr();XC=new Set(["!","?","+","*","@"]),yd=t=>XC.has(t),eE="(?!(?:^|/)\\.\\.?(?:$|/))",fr="(?!\\.)",tE=new Set(["[","."]),sE=new Set(["..","."]),iE=new Set("().*{}+?[]^$\\!"),nE=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ka="[^/]",Fd=Ka+"*?",Cd=Ka+"+?",zs=class t{type;#e;#s;#r=!1;#n=[];#o;#C;#g;#c=!1;#a;#d;#f=!1;constructor(e,s,i={}){this.type=e,e&&(this.#s=!0),this.#o=s,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?i: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.#n.length:0}get hasMagic(){if(this.#s!==void 0)return this.#s;for(let e of this.#n)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.#n.map(e=>String(e)).join("|")+")":this.#d=this.#n.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,i=s.#o;for(;i;){for(let n=s.#C+1;!i.type&&n<i.#n.length;n++)for(let r of e.#n){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(i.#n[n])}s=i,i=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.#n.push(s)}}toJSON(){let e=this.type===null?this.#n.slice().map(s=>typeof s=="string"?s:s.toJSON()):[this.type,...this.#n.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 i=e.#n[s];if(!(i instanceof t&&i.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.#n.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 i of this.#n)s.copyIn(i);return s}static#i(e,s,i,n){let r=!1,o=!1,a=-1,u=!1;if(s.type===null){let p=i,m="";for(;p<e.length;){let D=e.charAt(p++);if(r||D==="\\"){r=!r,m+=D;continue}if(o){p===a+1?(D==="^"||D==="!")&&(u=!0):D==="]"&&!(p===a+2&&u)&&(o=!1),m+=D;continue}else if(D==="["){o=!0,a=p,u=!1,m+=D;continue}if(!n.noext&&yd(D)&&e.charAt(p)==="("){s.push(m),m="";let g=new t(D,s);p=t.#i(e,g,p,n),s.push(g);continue}m+=D}return s.push(m),p}let l=i+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(yd(p)&&e.charAt(l)==="("){c.push(d),d="";let m=new t(p,c);c.push(m),l=t.#i(e,m,l,n);continue}if(p==="|"){c.push(d),d="",f.push(c),c=new t(null,s);continue}if(p===")")return d===""&&s.#n.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.#n=[e.substring(i-1)],l}static fromGlob(e,s={}){let i=new t(null,void 0,s);return t.#i(e,i,0,s),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[s,i,n,r]=this.toRegExpSource();if(!(n||this.#s||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;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.#n.some(p=>typeof p!="string"),l=this.#n.map(p=>{let[m,D,g,F]=typeof p=="string"?t.#E(p,this.#s,u):p.toRegExpSource(e);return this.#s=this.#s||g,this.#r=this.#r||F,m}).join(""),c="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&sE.has(this.#n[0]))){let m=tE,D=s&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),g=!s&&!e&&m.has(l.charAt(0));c=D?eE:g?fr:""}let f="";return this.isEnd()&&this.#e.#c&&this.#o?.type==="!"&&(f="(?:$|\\/)"),[c+l+f,Ne(l),this.#s=!!this.#s,this.#r]}let i=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#h(s);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let u=this.toString();return this.#n=[u],this.type=null,this.#s=void 0,[u,Ne(this.toString()),!1,!1]}let o=!i||e||s||!fr?"":this.#h(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";if(this.type==="!"&&this.#f)a=(this.isStart()&&!s?fr:"")+Cd;else{let u=this.type==="!"?"))"+(this.isStart()&&!s&&!e?fr:"")+Fd+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=n+r+u}return[a,Ne(r),this.#s=!!this.#s,this.#r]}#h(e){return this.#n.map(s=>{if(typeof s=="string")throw new Error("string type in extglob ast??");let[i,n,r,o]=s.toRegExpSource(e);return this.#r=this.#r||o,i}).filter(s=>!(this.isStart()&&this.isEnd())||!!s).join("|")}static#E(e,s,i=!1){let n=!1,r="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(n){n=!1,r+=(iE.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?r+="\\\\":n=!0;continue}if(u==="["){let[l,c,f,d]=md(e,a);if(f){r+=l,o=o||c,a+=f-1,s=s||d;continue}}if(u==="*"){r+=i&&e==="*"?Cd:Fd,s=!0;continue}if(u==="?"){r+=Ka,s=!0;continue}r+=nE(u)}return[r,Ne(e),!!s,o]}}});var ps,Ja=M(()=>{ps=(t,{windowsPathsNoEscape:e=!1,magicalBraces:s=!1}={})=>s?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&")});var Ce,rE,oE,aE,uE,lE,cE,fE,dE,hE,pE,DE,mE,gE,yE,FE,CE,EE,wE,bd,vd,xd,Ed,bE,fe,vE,xE,SE,AE,kE,Pe,_E,Sd,$E,BE,wd,TE,_e,Tt=M(()=>{hd();pd();Ya();Ja();cr();Ya();Ja();cr();Ce=(t,e,s={})=>(Ti(e),!s.nocomment&&e.charAt(0)==="#"?!1:new _e(e,s).match(t)),rE=/^\*+([^+@!?\*\[\(]*)$/,oE=t=>e=>!e.startsWith(".")&&e.endsWith(t),aE=t=>e=>e.endsWith(t),uE=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),lE=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),cE=/^\*+\.\*+$/,fE=t=>!t.startsWith(".")&&t.includes("."),dE=t=>t!=="."&&t!==".."&&t.includes("."),hE=/^\.\*+$/,pE=t=>t!=="."&&t!==".."&&t.startsWith("."),DE=/^\*+$/,mE=t=>t.length!==0&&!t.startsWith("."),gE=t=>t.length!==0&&t!=="."&&t!=="..",yE=/^\?+([^+@!?\*\[\(]*)?$/,FE=([t,e=""])=>{let s=bd([t]);return e?(e=e.toLowerCase(),i=>s(i)&&i.toLowerCase().endsWith(e)):s},CE=([t,e=""])=>{let s=vd([t]);return e?(e=e.toLowerCase(),i=>s(i)&&i.toLowerCase().endsWith(e)):s},EE=([t,e=""])=>{let s=vd([t]);return e?i=>s(i)&&i.endsWith(e):s},wE=([t,e=""])=>{let s=bd([t]);return e?i=>s(i)&&i.endsWith(e):s},bd=([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!==".."},xd=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ed={win32:{sep:"\\"},posix:{sep:"/"}},bE=xd==="win32"?Ed.win32.sep:Ed.posix.sep;Ce.sep=bE;fe=Symbol("globstar **");Ce.GLOBSTAR=fe;vE="[^/]",xE=vE+"*?",SE="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",AE="(?:(?!(?:\\/|^)\\.).)*?",kE=(t,e={})=>s=>Ce(s,t,e);Ce.filter=kE;Pe=(t,e={})=>Object.assign({},t,e),_E=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Ce;let e=Ce;return Object.assign((i,n,r={})=>e(i,n,Pe(t,r)),{Minimatch:class extends e.Minimatch{constructor(n,r={}){super(n,Pe(t,r))}static defaults(n){return e.defaults(Pe(t,n)).Minimatch}},AST:class extends e.AST{constructor(n,r,o={}){super(n,r,Pe(t,o))}static fromGlob(n,r={}){return e.AST.fromGlob(n,Pe(t,r))}},unescape:(i,n={})=>e.unescape(i,Pe(t,n)),escape:(i,n={})=>e.escape(i,Pe(t,n)),filter:(i,n={})=>e.filter(i,Pe(t,n)),defaults:i=>e.defaults(Pe(t,i)),makeRe:(i,n={})=>e.makeRe(i,Pe(t,n)),braceExpand:(i,n={})=>e.braceExpand(i,Pe(t,n)),match:(i,n,r={})=>e.match(i,n,Pe(t,r)),sep:e.sep,GLOBSTAR:fe})};Ce.defaults=_E;Sd=(t,e={})=>(Ti(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:dd(t));Ce.braceExpand=Sd;$E=(t,e={})=>new _e(t,e).makeRe();Ce.makeRe=$E;BE=(t,e,s={})=>{let i=new _e(e,s);return t=t.filter(n=>i.match(n)),i.options.nonull&&!t.length&&t.push(e),t};Ce.match=BE;wd=/[?*]|[+@!]\(.*?\)|\[|\]/,TE=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={}){Ti(e),s=s||{},this.options=s,this.pattern=e,this.platform=s.platform||xd,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 i=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let n=this.globParts.map((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=r[0]===""&&r[1]===""&&(r[2]==="?"||!wd.test(r[2]))&&!wd.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,n),this.set=n.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 i=0;i<e.length;i++)for(let n=0;n<e[i].length;n++)e[i][n]==="**"&&(e[i][n]="*");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 i=-1;for(;(i=s.indexOf("**",i+1))!==-1;){let n=i;for(;s[n+1]==="**";)n++;n!==i&&s.splice(i,n-i)}return s})}levelOneOptimize(e){return e.map(s=>(s=s.reduce((i,n)=>{let r=i[i.length-1];return n==="**"&&r==="**"?i:n===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(i.pop(),i):(i.push(n),i)},[]),s.length===0?[""]:s))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let s=!1;do{if(s=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===""&&e[0]===""||(r==="."||r==="")&&(s=!0,e.splice(n,1),n--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(s=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let n=e[i-1];n&&n!=="."&&n!==".."&&n!=="**"&&(s=!0,e.splice(i-1,2),i-=2)}}while(s);return e.length===0?[""]:e}firstPhasePreProcess(e){let s=!1;do{s=!1;for(let i of e){let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let o=n;for(;i[o+1]==="**";)o++;o>n&&i.splice(n+1,o-n);let a=i[n+1],u=i[n+2],l=i[n+3];if(a!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;s=!0,i.splice(n,1);let c=i.slice(0);c[n]="**",e.push(c),n--}if(!this.preserveMultipleSlashes){for(let o=1;o<i.length-1;o++){let a=i[o];o===1&&a===""&&i[0]===""||(a==="."||a==="")&&(s=!0,i.splice(o,1),o--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(s=!0,i.pop())}let r=0;for(;(r=i.indexOf("..",r+1))!==-1;){let o=i[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){s=!0;let u=r===1&&i[r+1]==="**"?["."]:[];i.splice(r-1,2,...u),i.length===0&&i.push(""),r-=2}}}}while(s);return e}secondPhasePreProcess(e){for(let s=0;s<e.length-1;s++)for(let i=s+1;i<e.length;i++){let n=this.partsMatch(e[s],e[i],!this.preserveMultipleSlashes);if(n){e[s]=[],e[i]=n;break}}return e.filter(s=>s.length)}partsMatch(e,s,i=!1){let n=0,r=0,o=[],a="";for(;n<e.length&&r<s.length;)if(e[n]===s[r])o.push(a==="b"?s[r]:e[n]),n++,r++;else if(i&&e[n]==="**"&&s[r]===e[n+1])o.push(e[n]),n++;else if(i&&s[r]==="**"&&e[n]===s[r+1])o.push(s[r]),r++;else if(e[n]==="*"&&s[r]&&(this.options.dot||!s[r].startsWith("."))&&s[r]!=="**"){if(a==="b")return!1;a="a",o.push(e[n]),n++,r++}else if(s[r]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(a==="a")return!1;a="b",o.push(s[r]),n++,r++}else return!1;return e.length===s.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,s=!1,i=0;for(let n=0;n<e.length&&e.charAt(n)==="!";n++)s=!s,i++;i&&(this.pattern=e.slice(i)),this.negate=s}matchOne(e,s,i=!1){let n=this.options;if(this.isWindows){let D=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),g=!D&&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:D?0:void 0,E=y?3:F?0:void 0;if(typeof C=="number"&&typeof E=="number"){let[v,S]=[e[C],s[E]];v.toLowerCase()===S.toLowerCase()&&(s[E]=v,E>C?s=s.slice(E):C>E&&(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]===".."||!n.dot&&e[o].charAt(0)===".")return!1;return!0}for(;d<u;){var m=e[d];if(this.debug(`
57
+ globstar while`,e,d,s,p,m),this.matchOne(e.slice(d),s.slice(p),i))return this.debug("globstar found match!",d,u,m),!0;if(m==="."||m===".."||!n.dot&&m.charAt(0)==="."){this.debug("dot detected!",e,d,s,p);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(i&&(this.debug(`
58
+ >>> no match, partial?`,e,d,s,p),d===u))}let D;if(typeof c=="string"?(D=f===c,this.debug("string match",c,f,D)):(D=c.test(f),this.debug("pattern match",c,f,D)),!D)return!1}if(o===u&&a===l)return!0;if(o===u)return i;if(a===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Sd(this.pattern,this.options)}parse(e){Ti(e);let s=this.options;if(e==="**")return fe;if(e==="")return"";let i,n=null;(i=e.match(DE))?n=s.dot?gE:mE:(i=e.match(rE))?n=(s.nocase?s.dot?lE:uE:s.dot?aE:oE)(i[1]):(i=e.match(yE))?n=(s.nocase?s.dot?CE:FE:s.dot?EE:wE)(i):(i=e.match(cE))?n=s.dot?dE:fE:(i=e.match(hE))&&(n=pE);let r=zs.fromGlob(e,this.options).toMMPattern();return n&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:n}),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,i=s.noglobstar?xE:s.dot?SE:AE,n=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(""))n.add(d);return typeof f=="string"?TE(f):f===fe?fe:f._src});l.forEach((f,d)=>{let p=l[d+1],m=l[d-1];f!==fe||m===fe||(m===void 0?p!==void 0&&p!==fe?l[d+1]="(?:\\/|"+i+"\\/)?"+p:l[d]=i:p===void 0?l[d-1]=m+"(?:\\/|\\/"+i+")?":p!==fe&&(l[d-1]=m+"(?:\\/|\\/"+i+"\\/)"+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,[...n].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 i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let n=this.slashSplit(e);this.debug(this.pattern,"split",n);let r=this.set;this.debug(this.pattern,"set",r);let o=n[n.length-1];if(!o)for(let a=n.length-2;!o&&a>=0;a--)o=n[a];for(let a=0;a<r.length;a++){let u=r[a],l=n;if(i.matchBase&&u.length===1&&(l=[o]),this.matchOne(l,u,s))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return Ce.defaults(e).Minimatch}};Ce.AST=zs;Ce.Minimatch=_e;Ce.escape=ps;Ce.unescape=Ne});var IE,kd,Ha,_d,dr,Ad,RE,jA,It,$d,Gs,Za,Ds,Bd=M(()=>{IE=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,kd=new Set,Ha=typeof process=="object"&&process?process:{},_d=(t,e,s,i)=>{typeof Ha.emitWarning=="function"?Ha.emitWarning(t,e,s,i):console.error(`[${s}] ${e}: ${t}`)},dr=globalThis.AbortController,Ad=globalThis.AbortSignal;if(typeof dr>"u"){Ad=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,n){this._onabort.push(n)}},dr=class{constructor(){e()}signal=new Ad;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let n of this.signal._onabort)n(i);this.signal.onabort?.(i)}}};let t=Ha.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))}}RE=t=>!kd.has(t),jA=Symbol("type"),It=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),$d=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?Gs:null:null,Gs=class extends Array{constructor(e){super(e),this.fill(0)}},Za=class t{heap;length;static#e=!1;static create(e){let s=$d(e);if(!s)return[];t.#e=!0;let i=new t(e,s);return t.#e=!1,i}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]}},Ds=class t{#e;#s;#r;#n;#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;#i;#h;#E;#F;#p;#k;#D;#v;#x;#m;#y;#w;#S;#t;#R;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#m,autopurgeTimers:e.#y,sizes:e.#v,keyMap:e.#f,keyList:e.#u,valList:e.#i,next:e.#h,prev:e.#E,get head(){return e.#F},get tail(){return e.#p},free:e.#k,isBackgroundFetch:s=>e.#l(s),backgroundFetch:(s,i,n,r)=>e.#U(s,i,n,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.#C}get memoMethod(){return this.#g}get dispose(){return this.#r}get onInsert(){return this.#n}get disposeAfter(){return this.#o}constructor(e){let{max:s=0,ttl:i,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:p,maxSize:m=0,maxEntrySize:D=0,sizeCalculation:g,fetchMethod:F,memoMethod:y,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:S,ignoreFetchAbort:T,perf:w}=e;if(w!==void 0&&typeof w?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#c=w??IE,s!==0&&!It(s))throw new TypeError("max option must be a nonnegative integer");let R=s?$d(s):Array;if(!R)throw new Error("invalid max value: "+s);if(this.#e=s,this.#s=m,this.maxEntrySize=D||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.#i=new Array(s).fill(void 0),this.#h=new R(s),this.#E=new R(s),this.#F=0,this.#p=0,this.#k=Za.create(s),this.#a=0,this.#d=0,typeof l=="function"&&(this.#r=l),typeof c=="function"&&(this.#n=c),typeof f=="function"?(this.#o=f,this.#D=[]):(this.#o=void 0,this.#D=void 0),this.#w=!!this.#r,this.#R=!!this.#n,this.#t=!!this.#o,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!S,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.#W()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=It(n)||n===0?n:1,this.ttlAutopurge=!!r,this.ttl=i||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 O="LRU_CACHE_UNBOUNDED";RE(O)&&(kd.add(O),_d("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,t))}}getRemainingTTL(e){return this.#f.has(e)?1/0:0}#T(){let e=new Gs(this.#e),s=new Gs(this.#e);this.#m=e,this.#x=s;let i=this.ttlAutopurge?new Array(this.#e):void 0;this.#y=i,this.#L=(o,a,u=this.#c.now())=>{if(s[o]=a!==0?u:0,e[o]=a,i?.[o]&&(clearTimeout(i[o]),i[o]=void 0),a!==0&&i){let l=setTimeout(()=>{this.#b(o)&&this.#_(this.#u[o],"expire")},a+1);l.unref&&l.unref(),i[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=n||r();let c=o.now-l;o.remainingTTL=u-c}};let n=0,r=()=>{let o=this.#c.now();if(this.ttlResolution>0){n=o;let a=setTimeout(()=>n=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=(n||r())-l;return u-c},this.#b=o=>{let a=s[o],u=e[o];return!!u&&!!a&&(n||r())-a>u}}#A=()=>{};#I=()=>{};#L=()=>{};#b=()=>!1;#W(){let e=new Gs(this.#e);this.#d=0,this.#v=e,this.#O=s=>{this.#d-=e[s],e[s]=0},this.#M=(s,i,n,r)=>{if(this.#l(i))return 0;if(!It(n))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(n=r(i,s),!It(n))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 n},this.#N=(s,i,n)=>{if(e[s]=i,this.#s){let r=this.#s-e[s];for(;this.#d>r;)this.#q(!0)}this.#d+=e[s],n&&(n.entrySize=i,n.totalCalculatedSize=this.#d)}}#O=e=>{};#N=(e,s,i)=>{};#M=(e,s,i,n)=>{if(i||n)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.#E[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.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*rentries(){for(let e of this.#B())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*keys(){for(let e of this.#$()){let s=this.#u[e];s!==void 0&&!this.#l(this.#i[e])&&(yield s)}}*rkeys(){for(let e of this.#B()){let s=this.#u[e];s!==void 0&&!this.#l(this.#i[e])&&(yield s)}}*values(){for(let e of this.#$())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#B())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,s={}){for(let i of this.#$()){let n=this.#i[i],r=this.#l(n)?n.__staleWhileFetching:n;if(r!==void 0&&e(r,this.#u[i],this))return this.get(this.#u[i],s)}}forEach(e,s=this){for(let i of this.#$()){let n=this.#i[i],r=this.#l(n)?n.__staleWhileFetching:n;r!==void 0&&e.call(s,r,this.#u[i],this)}}rforEach(e,s=this){for(let i of this.#B()){let n=this.#i[i],r=this.#l(n)?n.__staleWhileFetching:n;r!==void 0&&e.call(s,r,this.#u[i],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 i=this.#i[s],n=this.#l(i)?i.__staleWhileFetching:i;if(n===void 0)return;let r={value:n};if(this.#m&&this.#x){let o=this.#m[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 i=this.#u[s],n=this.#i[s],r=this.#l(n)?n.__staleWhileFetching:n;if(r===void 0||i===void 0)continue;let o={value:r};if(this.#m&&this.#x){o.ttl=this.#m[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([i,o])}return e}load(e){this.clear();for(let[s,i]of e){if(i.start){let n=Date.now()-i.start;i.start=this.#c.now()-n}this.set(s,i.value,i)}}set(e,s,i={}){if(s===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=this.#M(e,s,i.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.#i[f]=s,this.#f.set(e,f),this.#h[this.#p]=f,this.#E[f]=this.#p,this.#p=f,this.#a++,this.#N(f,c,u),u&&(u.set="add"),l=!1,this.#R&&this.#n?.(s,e,"add");else{this.#P(f);let d=this.#i[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.#w&&this.#r?.(p,e,"set"),this.#t&&this.#D?.push([p,e,"set"]))}else o||(this.#w&&this.#r?.(d,e,"set"),this.#t&&this.#D?.push([d,e,"set"]));if(this.#O(f),this.#N(f,c,u),this.#i[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(n!==0&&!this.#m&&this.#T(),this.#m&&(l||this.#L(f,n,r),u&&this.#I(u,f)),!o&&this.#t&&this.#D){let d=this.#D,p;for(;p=d?.shift();)this.#o?.(...p)}return this}pop(){try{for(;this.#a;){let e=this.#i[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.#D){let e=this.#D,s;for(;s=e?.shift();)this.#o?.(...s)}}}#q(e){let s=this.#F,i=this.#u[s],n=this.#i[s];return this.#S&&this.#l(n)?n.__abortController.abort(new Error("evicted")):(this.#w||this.#t)&&(this.#w&&this.#r?.(n,i,"evict"),this.#t&&this.#D?.push([n,i,"evict"])),this.#O(s),this.#y?.[s]&&(clearTimeout(this.#y[s]),this.#y[s]=void 0),e&&(this.#u[s]=void 0,this.#i[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(i),this.#a--,s}has(e,s={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=s,r=this.#f.get(e);if(r!==void 0){let o=this.#i[r];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(r))n&&(n.has="stale",this.#I(n,r));else return i&&this.#A(r),n&&(n.has="hit",this.#I(n,r)),!0}else n&&(n.has="miss");return!1}peek(e,s={}){let{allowStale:i=this.allowStale}=s,n=this.#f.get(e);if(n===void 0||!i&&this.#b(n))return;let r=this.#i[n];return this.#l(r)?r.__staleWhileFetching:r}#U(e,s,i,n){let r=s===void 0?void 0:this.#i[s];if(this.#l(r))return r;let o=new dr,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:n},l=(D,g=!1)=>{let{aborted:F}=o.signal,y=i.ignoreFetchAbort&&D!==void 0;if(i.status&&(F&&!g?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),F&&!y&&!g)return f(o.signal.reason);let C=p,E=this.#i[s];return(E===p||y&&g&&E===void 0)&&(D===void 0?C.__staleWhileFetching!==void 0?this.#i[s]=C.__staleWhileFetching:this.#_(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,D,u.options))),D},c=D=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=D),f(D)),f=D=>{let{aborted:g}=o.signal,F=g&&i.allowStaleOnFetchAbort,y=F||i.allowStaleOnFetchRejection,C=y||i.noDeleteOnFetchRejection,E=p;if(this.#i[s]===p&&(!C||E.__staleWhileFetching===void 0?this.#_(e,"fetch"):F||(this.#i[s]=E.__staleWhileFetching)),y)return i.status&&E.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),E.__staleWhileFetching;if(E.__returned===E)throw D},d=(D,g)=>{let F=this.#C?.(e,r,u);F&&F instanceof Promise&&F.then(y=>D(y===void 0?void 0:y),g),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(D(void 0),i.allowStaleOnFetchAbort&&(D=y=>l(y,!0)))})};i.status&&(i.status.fetchDispatched=!0);let p=new Promise(d).then(l,c),m=Object.assign(p,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return s===void 0?(this.set(e,m,{...u.options,status:void 0}),s=this.#f.get(e)):this.#i[s]=m,m}#l(e){if(!this.#S)return!1;let s=e;return!!s&&s instanceof Promise&&s.hasOwnProperty("__staleWhileFetching")&&s.__abortController instanceof dr}async fetch(e,s={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=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:m=this.allowStaleOnFetchAbort,context:D,forceRefresh:g=!1,status:F,signal:y}=s;if(!this.#S)return F&&(F.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:F});let C={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:p,status:F,signal:y},E=this.#f.get(e);if(E===void 0){F&&(F.fetch="miss");let v=this.#U(e,E,C,D);return v.__returned=v}else{let v=this.#i[E];if(this.#l(v)){let O=i&&v.__staleWhileFetching!==void 0;return F&&(F.fetch="inflight",O&&(F.returnedStale=!0)),O?v.__staleWhileFetching:v.__returned=v}let S=this.#b(E);if(!g&&!S)return F&&(F.fetch="hit"),this.#P(E),n&&this.#A(E),F&&this.#I(F,E),v;let T=this.#U(e,E,C,D),R=T.__staleWhileFetching!==void 0&&i;return F&&(F.fetch=S?"stale":"refresh",R&&S&&(F.returnedStale=!0)),R?T.__staleWhileFetching:T.__returned=T}}async forceFetch(e,s={}){let i=await this.fetch(e,s);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,s={}){let i=this.#g;if(!i)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:r,...o}=s,a=this.get(e,o);if(!r&&a!==void 0)return a;let u=i(e,a,{options:o,context:n});return this.set(e,u,o),u}get(e,s={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=s,a=this.#f.get(e);if(a!==void 0){let u=this.#i[a],l=this.#l(u);return o&&this.#I(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),i?u.__staleWhileFetching:void 0):(r||this.#_(e,"expire"),o&&i&&(o.returnedStale=!0),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(this.#P(a),n&&this.#A(a),u))}else o&&(o.get="miss")}#V(e,s){this.#E[s]=e,this.#h[e]=s}#P(e){e!==this.#p&&(e===this.#F?this.#F=this.#h[e]:this.#V(this.#E[e],this.#h[e]),this.#V(this.#p,e),this.#p=e)}delete(e){return this.#_(e,"delete")}#_(e,s){let i=!1;if(this.#a!==0){let n=this.#f.get(e);if(n!==void 0)if(this.#y?.[n]&&(clearTimeout(this.#y?.[n]),this.#y[n]=void 0),i=!0,this.#a===1)this.#z(s);else{this.#O(n);let r=this.#i[n];if(this.#l(r)?r.__abortController.abort(new Error("deleted")):(this.#w||this.#t)&&(this.#w&&this.#r?.(r,e,s),this.#t&&this.#D?.push([r,e,s])),this.#f.delete(e),this.#u[n]=void 0,this.#i[n]=void 0,n===this.#p)this.#p=this.#E[n];else if(n===this.#F)this.#F=this.#h[n];else{let o=this.#E[n];this.#h[o]=this.#h[n];let a=this.#h[n];this.#E[a]=this.#E[n]}this.#a--,this.#k.push(n)}}if(this.#t&&this.#D?.length){let n=this.#D,r;for(;r=n?.shift();)this.#o?.(...r)}return i}clear(){return this.#z("delete")}#z(e){for(let s of this.#B({allowStale:!0})){let i=this.#i[s];if(this.#l(i))i.__abortController.abort(new Error("deleted"));else{let n=this.#u[s];this.#w&&this.#r?.(i,n,e),this.#t&&this.#D?.push([i,n,e])}}if(this.#f.clear(),this.#i.fill(void 0),this.#u.fill(void 0),this.#m&&this.#x){this.#m.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.#D){let s=this.#D,i;for(;i=s?.shift();)this.#o?.(...i)}}}});var Fr,nu,Pd,Td,NE,PE,OE,mt,gt,Rt,hr,Ri,pr,Id,Dr,Rd,Ke,Ks,ne,Ni,Ys,re,Ee,oe,Qa,mr,me,X,Xa,eu,Nd,tu,it,su,gr,Pi,ms,$e,Oi,LE,ME,jE,qE,yr,iu,UE,VE,Nt,ru=M(()=>{Fr=require("node:events"),nu=bt(require("node:stream"),1),Pd=require("node:string_decoder"),Td=typeof process=="object"&&process?process:{stdout:null,stderr:null},NE=t=>!!t&&typeof t=="object"&&(t instanceof Nt||t instanceof nu.default||PE(t)||OE(t)),PE=t=>!!t&&typeof t=="object"&&t instanceof Fr.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==nu.default.Writable.prototype.pipe,OE=t=>!!t&&typeof t=="object"&&t instanceof Fr.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",mt=Symbol("EOF"),gt=Symbol("maybeEmitEnd"),Rt=Symbol("emittedEnd"),hr=Symbol("emittingEnd"),Ri=Symbol("emittedError"),pr=Symbol("closed"),Id=Symbol("read"),Dr=Symbol("flush"),Rd=Symbol("flushChunk"),Ke=Symbol("encoding"),Ks=Symbol("decoder"),ne=Symbol("flowing"),Ni=Symbol("paused"),Ys=Symbol("resume"),re=Symbol("buffer"),Ee=Symbol("pipes"),oe=Symbol("bufferLength"),Qa=Symbol("bufferPush"),mr=Symbol("bufferShift"),me=Symbol("objectMode"),X=Symbol("destroyed"),Xa=Symbol("error"),eu=Symbol("emitData"),Nd=Symbol("emitEnd"),tu=Symbol("emitEnd2"),it=Symbol("async"),su=Symbol("abort"),gr=Symbol("aborted"),Pi=Symbol("signal"),ms=Symbol("dataListeners"),$e=Symbol("discarded"),Oi=t=>Promise.resolve().then(t),LE=t=>t(),ME=t=>t==="end"||t==="finish"||t==="prefinish",jE=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,qE=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),yr=class{src;dest;opts;ondrain;constructor(e,s,i){this.src=e,this.dest=s,this.opts=i,this.ondrain=()=>e[Ys](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},iu=class extends yr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,s,i){super(e,s,i),this.proxyErrors=n=>s.emit("error",n),e.on("error",this.proxyErrors)}},UE=t=>!!t.objectMode,VE=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Nt=class extends Fr.EventEmitter{[ne]=!1;[Ni]=!1;[Ee]=[];[re]=[];[me];[Ke];[it];[Ks];[mt]=!1;[Rt]=!1;[hr]=!1;[pr]=!1;[Ri]=null;[oe]=0;[X]=!1;[Pi];[gr]=!1;[ms]=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");UE(s)?(this[me]=!0,this[Ke]=null):VE(s)?(this[Ke]=s.encoding,this[me]=!1):(this[me]=!1,this[Ke]=null),this[it]=!!s.async,this[Ks]=this[Ke]?new Pd.StringDecoder(this[Ke]):null,s&&s.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[re]}),s&&s.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Ee]});let{signal:i}=s;i&&(this[Pi]=i,i.aborted?this[su]():i.addEventListener("abort",()=>this[su]()))}get bufferLength(){return this[oe]}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[me]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[it]}set async(e){this[it]=this[it]||!!e}[su](){this[gr]=!0,this.emit("abort",this[Pi]?.reason),this.destroy(this[Pi]?.reason)}get aborted(){return this[gr]}set aborted(e){}write(e,s,i){if(this[gr])return!1;if(this[mt])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"&&(i=s,s="utf8"),s||(s="utf8");let n=this[it]?Oi:LE;if(!this[me]&&!Buffer.isBuffer(e)){if(qE(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(jE(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[me]?(this[ne]&&this[oe]!==0&&this[Dr](!0),this[ne]?this.emit("data",e):this[Qa](e),this[oe]!==0&&this.emit("readable"),i&&n(i),this[ne]):e.length?(typeof e=="string"&&!(s===this[Ke]&&!this[Ks]?.lastNeed)&&(e=Buffer.from(e,s)),Buffer.isBuffer(e)&&this[Ke]&&(e=this[Ks].write(e)),this[ne]&&this[oe]!==0&&this[Dr](!0),this[ne]?this.emit("data",e):this[Qa](e),this[oe]!==0&&this.emit("readable"),i&&n(i),this[ne]):(this[oe]!==0&&this.emit("readable"),i&&n(i),this[ne])}read(e){if(this[X])return null;if(this[$e]=!1,this[oe]===0||e===0||e&&e>this[oe])return this[gt](),null;this[me]&&(e=null),this[re].length>1&&!this[me]&&(this[re]=[this[Ke]?this[re].join(""):Buffer.concat(this[re],this[oe])]);let s=this[Id](e||null,this[re][0]);return this[gt](),s}[Id](e,s){if(this[me])this[mr]();else{let i=s;e===i.length||e===null?this[mr]():typeof i=="string"?(this[re][0]=i.slice(e),s=i.slice(0,e),this[oe]-=e):(this[re][0]=i.subarray(e),s=i.subarray(0,e),this[oe]-=e)}return this.emit("data",s),!this[re].length&&!this[mt]&&this.emit("drain"),s}end(e,s,i){return typeof e=="function"&&(i=e,e=void 0),typeof s=="function"&&(i=s,s="utf8"),e!==void 0&&this.write(e,s),i&&this.once("end",i),this[mt]=!0,this.writable=!1,(this[ne]||!this[Ni])&&this[gt](),this}[Ys](){this[X]||(!this[ms]&&!this[Ee].length&&(this[$e]=!0),this[Ni]=!1,this[ne]=!0,this.emit("resume"),this[re].length?this[Dr]():this[mt]?this[gt]():this.emit("drain"))}resume(){return this[Ys]()}pause(){this[ne]=!1,this[Ni]=!0,this[$e]=!1}get destroyed(){return this[X]}get flowing(){return this[ne]}get paused(){return this[Ni]}[Qa](e){this[me]?this[oe]+=1:this[oe]+=e.length,this[re].push(e)}[mr](){return this[me]?this[oe]-=1:this[oe]-=this[re][0].length,this[re].shift()}[Dr](e=!1){do;while(this[Rd](this[mr]())&&this[re].length);!e&&!this[re].length&&!this[mt]&&this.emit("drain")}[Rd](e){return this.emit("data",e),this[ne]}pipe(e,s){if(this[X])return e;this[$e]=!1;let i=this[Rt];return s=s||{},e===Td.stdout||e===Td.stderr?s.end=!1:s.end=s.end!==!1,s.proxyErrors=!!s.proxyErrors,i?s.end&&e.end():(this[Ee].push(s.proxyErrors?new iu(this,e,s):new yr(this,e,s)),this[it]?Oi(()=>this[Ys]()):this[Ys]()),e}unpipe(e){let s=this[Ee].find(i=>i.dest===e);s&&(this[Ee].length===1?(this[ne]&&this[ms]===0&&(this[ne]=!1),this[Ee]=[]):this[Ee].splice(this[Ee].indexOf(s),1),s.unpipe())}addListener(e,s){return this.on(e,s)}on(e,s){let i=super.on(e,s);if(e==="data")this[$e]=!1,this[ms]++,!this[Ee].length&&!this[ne]&&this[Ys]();else if(e==="readable"&&this[oe]!==0)super.emit("readable");else if(ME(e)&&this[Rt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Ri]){let n=s;this[it]?Oi(()=>n.call(this,this[Ri])):n.call(this,this[Ri])}return i}removeListener(e,s){return this.off(e,s)}off(e,s){let i=super.off(e,s);return e==="data"&&(this[ms]=this.listeners("data").length,this[ms]===0&&!this[$e]&&!this[Ee].length&&(this[ne]=!1)),i}removeAllListeners(e){let s=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[ms]=0,!this[$e]&&!this[Ee].length&&(this[ne]=!1)),s}get emittedEnd(){return this[Rt]}[gt](){!this[hr]&&!this[Rt]&&!this[X]&&this[re].length===0&&this[mt]&&(this[hr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[pr]&&this.emit("close"),this[hr]=!1)}emit(e,...s){let i=s[0];if(e!=="error"&&e!=="close"&&e!==X&&this[X])return!1;if(e==="data")return!this[me]&&!i?!1:this[it]?(Oi(()=>this[eu](i)),!0):this[eu](i);if(e==="end")return this[Nd]();if(e==="close"){if(this[pr]=!0,!this[Rt]&&!this[X])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(e==="error"){this[Ri]=i,super.emit(Xa,i);let r=!this[Pi]||this.listeners("error").length?super.emit("error",i):!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 n=super.emit(e,...s);return this[gt](),n}[eu](e){for(let i of this[Ee])i.dest.write(e)===!1&&this.pause();let s=this[$e]?!1:super.emit("data",e);return this[gt](),s}[Nd](){return this[Rt]?!1:(this[Rt]=!0,this.readable=!1,this[it]?(Oi(()=>this[tu]()),!0):this[tu]())}[tu](){if(this[Ks]){let s=this[Ks].end();if(s){for(let i of this[Ee])i.dest.write(s);this[$e]||super.emit("data",s)}}for(let s of this[Ee])s.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[me]||(e.dataLength=0);let s=this.promise();return this.on("data",i=>{e.push(i),this[me]||(e.dataLength+=i.length)}),await s,e}async concat(){if(this[me])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(X,()=>s(new Error("stream destroyed"))),this.on("error",i=>s(i)),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 n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[mt])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[mt]})},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[$e]=!1;let e=!1,s=()=>(this.pause(),this.off(Xa,s),this.off(X,s),this.off("end",s),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return s();let n=this.read();return n===null?s():{done:!1,value:n}};return this.once("end",s),this.once(Xa,s),this.once(X,s),{next:i,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[$e]=!0,this[re].length=0,this[oe]=0;let s=this;return typeof s.close=="function"&&!this[pr]&&s.close(),e?this.emit("error",e):this.emit(X),this}static get isStream(){return NE}}});var Js,qd,rt,WE,Pt,zE,Mi,Ud,Vd,GE,KE,Le,Wd,zd,nt,Gd,Kd,gs,Yd,Oe,Li,ou,Od,ji,Ye,Cr,wr,Ld,YE,au,Md,qi,jd,Er,br,uu,Jd,ge,vr,xr,Sr,Hs,Zs,Ui,zA,Hd,Zd=M(()=>{Bd();Js=require("node:path"),qd=require("node:url"),rt=require("fs"),WE=bt(require("node:fs"),1),Pt=require("node:fs/promises");ru();zE=rt.realpathSync.native,Mi={lstatSync:rt.lstatSync,readdir:rt.readdir,readdirSync:rt.readdirSync,readlinkSync:rt.readlinkSync,realpathSync:zE,promises:{lstat:Pt.lstat,readdir:Pt.readdir,readlink:Pt.readlink,realpath:Pt.realpath}},Ud=t=>!t||t===Mi||t===WE?Mi:{...Mi,...t,promises:{...Mi.promises,...t.promises||{}}},Vd=/^\\\\\?\\([a-z]:)\\?$/i,GE=t=>t.replace(/\//g,"\\").replace(Vd,"$1\\"),KE=/[\\\/]/,Le=0,Wd=1,zd=2,nt=4,Gd=6,Kd=8,gs=10,Yd=12,Oe=15,Li=~Oe,ou=16,Od=32,ji=64,Ye=128,Cr=256,wr=512,Ld=ji|Ye|wr,YE=1023,au=t=>t.isFile()?Kd:t.isDirectory()?nt:t.isSymbolicLink()?gs:t.isCharacterDevice()?zd:t.isBlockDevice()?Gd:t.isSocket()?Yd:t.isFIFO()?Wd:Le,Md=new Ds({max:2**12}),qi=t=>{let e=Md.get(t);if(e)return e;let s=t.normalize("NFKD");return Md.set(t,s),s},jd=new Ds({max:2**12}),Er=t=>{let e=jd.get(t);if(e)return e;let s=qi(t.toLowerCase());return jd.set(t,s),s},br=class extends Ds{constructor(){super({max:256})}},uu=class extends Ds{constructor(e=16*1024){super({maxSize:e,sizeCalculation:s=>s.length+1})}},Jd=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}#n;get nlink(){return this.#n}#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}#i;get mtimeMs(){return this.#i}#h;get ctimeMs(){return this.#h}#E;get birthtimeMs(){return this.#E}#F;get atime(){return this.#F}#p;get mtime(){return this.#p}#k;get ctime(){return this.#k}#D;get birthtime(){return this.#D}#v;#x;#m;#y;#w;#S;#t;#R;#T;#A;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,s=Le,i,n,r,o,a){this.name=e,this.#v=r?Er(e):qi(e),this.#t=s&YE,this.nocase=r,this.roots=n,this.root=i||this,this.#R=o,this.#m=a.fullpath,this.#w=a.relative,this.#S=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=Ud(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),n=e.substring(s.length).split(this.splitSep);return s?this.getRoot(s).#I(n):this.#I(n)}#I(e){let s=this;for(let i of e)s=s.child(i);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&=~ou,s}child(e,s){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),n=this.nocase?Er(e):qi(e);for(let u of i)if(u.#v===n)return u;let r=this.parent?this.sep:"",o=this.#m?this.#m+r+e:void 0,a=this.newChild(e,Le,{...s,parent:this,fullpath:o});return this.canReaddir()||(a.#t|=Ye),i.push(a),a}relative(){if(this.isCWD)return"";if(this.#w!==void 0)return this.#w;let e=this.name,s=this.parent;if(!s)return this.#w=this.name;let i=s.relative();return i+(!i||!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 i=s.relativePosix();return i+(!i||!s.parent?"":"/")+e}fullpath(){if(this.#m!==void 0)return this.#m;let e=this.name,s=this.parent;if(!s)return this.#m=this.name;let n=s.fullpath()+(s.parent?this.sep:"")+e;return this.#m=n}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let n=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(n)?this.#y=`//?/${n}`:this.#y=n}let e=this.parent,s=e.fullpathPosix(),i=s+(!s||!e.parent?"":"/")+this.name;return this.#y=i}isUnknown(){return(this.#t&Oe)===Le}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)===Kd}isDirectory(){return(this.#t&Oe)===nt}isCharacterDevice(){return(this.#t&Oe)===zd}isBlockDevice(){return(this.#t&Oe)===Gd}isFIFO(){return(this.#t&Oe)===Wd}isSocket(){return(this.#t&Oe)===Yd}isSymbolicLink(){return(this.#t&gs)===gs}lstatCached(){return this.#t&Od?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!==Le&&e!==gs||this.#t&Cr||this.#t&Ye)}calledReaddir(){return!!(this.#t&ou)}isENOENT(){return!!(this.#t&Ye)}isNamed(e){return this.nocase?this.#v===Er(e):this.#v===qi(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()),i=(await this.parent.realpath())?.resolve(s);if(i)return this.#T=i}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()),i=this.parent.realpathSync()?.resolve(s);if(i)return this.#T=i}catch(s){this.#B(s.code);return}}#L(e){this.#t|=ou;for(let s=e.provisional;s<e.length;s++){let i=e[s];i&&i.#b()}}#b(){this.#t&Ye||(this.#t=(this.#t|Ye)&Li,this.#W())}#W(){let e=this.children();e.provisional=0;for(let s of e)s.#b()}#O(){this.#t|=wr,this.#N()}#N(){if(this.#t&ji)return;let e=this.#t;(e&Oe)===nt&&(e&=Li),this.#t=e|ji,this.#W()}#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|=Cr,e==="ENOENT"&&(s|=Ye),(e==="EINVAL"||e==="UNKNOWN")&&(s&=Li),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 i=au(e),n=this.newChild(e.name,i,{parent:this}),r=n.#t&Oe;return r!==nt&&r!==gs&&r!==Le&&(n.#t|=ji),s.unshift(n),s.provisional++,n}#U(e,s){for(let i=s.provisional;i<s.length;i++){let n=s[i];if((this.nocase?Er(e.name):qi(e.name))===n.#v)return this.#l(e,n,i,s)}}#l(e,s,i,n){let r=s.name;return s.#t=s.#t&Li|au(e),r!==e.name&&(s.name=e.name),i!==n.provisional&&(i===n.length-1?n.pop():n.splice(i,1),n.unshift(s)),n.provisional++,s}async lstat(){if((this.#t&Ye)===0)try{return this.#V(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#$(e.code)}}lstatSync(){if((this.#t&Ye)===0)try{return this.#V(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#$(e.code)}}#V(e){let{atime:s,atimeMs:i,birthtime:n,birthtimeMs:r,blksize:o,blocks:a,ctime:u,ctimeMs:l,dev:c,gid:f,ino:d,mode:p,mtime:m,mtimeMs:D,nlink:g,rdev:F,size:y,uid:C}=e;this.#F=s,this.#u=i,this.#D=n,this.#E=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=m,this.#i=D,this.#n=g,this.#g=F,this.#d=y,this.#o=C;let E=au(e);this.#t=this.#t&Li|E|Od,E!==Le&&E!==nt&&E!==gs&&(this.#t|=ji)}#P=[];#_=!1;#z(e){this.#_=!1;let s=this.#P.slice();this.#P.length=0,s.forEach(i=>i(null,e))}readdirCB(e,s=!1){if(!this.canReaddir()){s?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let r=i.slice(0,i.provisional);s?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#P.push(e),this.#_)return;this.#_=!0;let n=this.fullpath();this.#e.readdir(n,{withFileTypes:!0},(r,o)=>{if(r)this.#M(r.code),i.provisional=0;else{for(let a of o)this.#j(a,i);this.#L(i)}this.#z(i.slice(0,i.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 i=()=>{};this.#G=new Promise(n=>i=n);try{for(let n of await this.#e.promises.readdir(s,{withFileTypes:!0}))this.#j(n,e);this.#L(e)}catch(n){this.#M(n.code),e.provisional=0}this.#G=void 0,i()}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 i of this.#e.readdirSync(s,{withFileTypes:!0}))this.#j(i,e);this.#L(e)}catch(i){this.#M(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#t&Ld)return!1;let e=Oe&this.#t;return e===Le||e===nt||e===gs}shouldWalk(e,s){return(this.#t&nt)===nt&&!(this.#t&Ld)&&!e.has(this)&&(!s||s(this))}async realpath(){if(this.#A)return this.#A;if(!((wr|Cr|Ye)&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(!((wr|Cr|Ye)&this.#t))try{let e=this.#e.realpathSync(this.fullpath());return this.#A=this.resolve(e)}catch{this.#O()}}[Jd](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let s=new Set([]),i=[],n=this;for(;n&&n.parent;)s.add(n),n.#w=i.join(this.sep),n.#S=i.join("/"),n=n.parent,i.push("..");for(n=e;n&&n.parent&&!s.has(n);)n.#w=void 0,n.#S=void 0,n=n.parent}},vr=class t extends ge{sep="\\";splitSep=KE;constructor(e,s=Le,i,n,r,o,a){super(e,s,i,n,r,o,a)}newChild(e,s=Le,i={}){return new t(e,s,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return Js.win32.parse(e).root}getRoot(e){if(e=GE(e.toUpperCase()),e===this.root.name)return this.root;for(let[s,i]of Object.entries(this.roots))if(this.sameRoot(e,s))return this.roots[e]=i;return this.roots[e]=new Hs(e,this).root}sameRoot(e,s=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Vd,"$1\\"),e===s}},xr=class t extends ge{splitSep="/";sep="/";constructor(e,s=Le,i,n,r,o,a){super(e,s,i,n,r,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,s=Le,i={}){return new t(e,s,this.root,this.roots,this.nocase,this.childrenCache(),i)}},Sr=class{root;rootPath;roots;cwd;#e;#s;#r;nocase;#n;constructor(e=process.cwd(),s,i,{nocase:n,childrenCacheSize:r=16*1024,fs:o=Mi}={}){this.#n=Ud(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,qd.fileURLToPath)(e));let a=s.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new br,this.#s=new br,this.#r=new uu(r);let u=a.substring(this.rootPath.length).split(i);if(u.length===1&&!u[0]&&u.pop(),n===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=n,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let l=this.root,c=u.length-1,f=s.sep,d=this.rootPath,p=!1;for(let m of u){let D=c--;l=l.child(m,{relative:new Array(D).fill("..").join(f),relativePosix:new Array(D).fill("..").join("/"),fullpath:d+=(p?"":f)+m}),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 i=this.#e.get(s);if(i!==void 0)return i;let n=this.cwd.resolve(s).fullpath();return this.#e.set(s,n),n}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 i=this.#s.get(s);if(i!==void 0)return i;let n=this.cwd.resolve(s).fullpathPosix();return this.#s.set(s,n),n}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:i}=s;if(e.canReaddir()){let n=await e.readdir();return i?n:n.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:i=!0}=s;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(n=>n.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 i=await e.readlink();return s?i:i?.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 i=e.readlinkSync();return s?i:i?.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 i=await e.realpath();return s?i:i?.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 i=e.realpathSync();return s?i:i?.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:i=!0,follow:n=!1,filter:r,walkFilter:o}=s,a=[];(!r||r(e))&&a.push(i?e:e.fullpath());let u=new Set,l=(f,d)=>{u.add(f),f.readdirCB((p,m)=>{if(p)return d(p);let D=m.length;if(!D)return d();let g=()=>{--D===0&&d()};for(let F of m)(!r||r(F))&&a.push(i?F:F.fullpath()),n&&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:i=!0,follow:n=!1,filter:r,walkFilter:o}=s,a=[];(!r||r(e))&&a.push(i?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(i?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(n&&(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:i=!0,follow:n=!1,filter:r,walkFilter:o}=s;(!r||r(e))&&(yield i?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 i?c:c.fullpath());let f=c;if(c.isSymbolicLink()){if(!(n&&(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:i=!0,follow:n=!1,filter:r,walkFilter:o}=s,a=new Nt({objectMode:!0});(!r||r(e))&&a.write(i?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 m=(g,F,y=!1)=>{if(g)return a.emit("error",g);if(n&&!y){let C=[];for(let E of F)E.isSymbolicLink()&&C.push(E.realpath().then(v=>v?.isUnknown()?v.lstat():v));if(C.length){Promise.all(C).then(()=>m(null,F,!0));return}}for(let C of F)C&&(!r||r(C))&&(a.write(i?C:C.fullpath())||(d=!0));c--;for(let C of F){let E=C.realpathCached()||C;E.shouldWalk(u,o)&&l.push(E)}d&&!a.flowing?a.once("drain",f):D||f()},D=!0;p.readdirCB(m,!0),D=!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:i=!0,follow:n=!1,filter:r,walkFilter:o}=s,a=new Nt({objectMode:!0}),u=new Set;(!r||r(e))&&a.write(i?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 m=p.readdirSync();for(let D of m)(!r||r(D))&&(a.write(i?D:D.fullpath())||(d=!0));c--;for(let D of m){let g=D;if(D.isSymbolicLink()){if(!(n&&(g=D.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[Jd](s)}},Hs=class extends Sr{sep="\\";constructor(e=process.cwd(),s={}){let{nocase:i=!0}=s;super(e,Js.win32,"\\",{...s,nocase:i}),this.nocase=i;for(let n=this.cwd;n;n=n.parent)n.nocase=this.nocase}parseRootPath(e){return Js.win32.parse(e).root.toUpperCase()}newRoot(e){return new vr(this.rootPath,nt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Zs=class extends Sr{sep="/";constructor(e=process.cwd(),s={}){let{nocase:i=!1}=s;super(e,Js.posix,"/",{...s,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new xr(this.rootPath,nt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Ui=class extends Zs{constructor(e=process.cwd(),s={}){let{nocase:i=!0}=s;super(e,{...s,nocase:i})}},zA=process.platform==="win32"?vr:xr,Hd=process.platform==="win32"?Hs:process.platform==="darwin"?Ui:Zs});var JE,HE,Qs,lu=M(()=>{Tt();JE=t=>t.length>=1,HE=t=>t.length>=1,Qs=class t{#e;#s;#r;length;#n;#o;#C;#g;#c;#a;#d=!0;constructor(e,s,i,n){if(!JE(e))throw new TypeError("empty pattern list");if(!HE(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,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#s=s,this.#r=i,this.#n=n,this.#r===0){if(this.isUNC()){let[r,o,a,u,...l]=this.#e,[c,f,d,p,...m]=this.#s;l[0]===""&&(l.shift(),m.shift());let D=[r,o,a,u,""].join("/"),g=[c,f,d,p,""].join("/");this.#e=[D,...l],this.#s=[g,...m],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.#n),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.#n==="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.#n==="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 ZE,ys,cu=M(()=>{Tt();lu();ZE=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ys=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:s,nocase:i,noext:n,noglobstar:r,platform:o=ZE}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:s,nocase:i,noext:n,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 i=0;i<s.set.length;i++){let n=s.set[i],r=s.globParts[i];if(!n||!r)throw new Error("invalid pattern object");for(;n[0]==="."&&r[0]===".";)n.shift(),r.shift();let o=new Qs(n,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(),i=`${s}/`,n=e.relative()||".",r=`${n}/`;for(let o of this.relative)if(o.match(n)||o.match(r))return!0;for(let o of this.absolute)if(o.match(s)||o.match(i))return!0;return!1}childrenIgnored(e){let s=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let n of this.relativeChildren)if(n.match(i))return!0;for(let n of this.absoluteChildren)if(n.match(s))return!0;return!1}}});var fu,du,hu,Vi,Qd=M(()=>{Tt();fu=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 i=e.fullpath(),n=this.store.get(i);n?n.add(s.globString()):this.store.set(i,new Set([s.globString()]))}},du=class{store=new Map;add(e,s,i){let n=(s?2:0)|(i?1:0),r=this.store.get(e);this.store.set(e,r===void 0?n:n&r)}entries(){return[...this.store.entries()].map(([e,s])=>[e,!!(s&2),!!(s&1)])}},hu=class{store=new Map;add(e,s){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(n=>n.globString()===s.globString())||i.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())}},Vi=class t{hasWalkedCache;matches=new du;subwalks=new hu;patterns;follow;dot;opts;constructor(e,s){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=s?s.copy():new fu}processPatterns(e,s){this.patterns=s;let i=s.map(n=>[e,n]);for(let[n,r]of i){this.hasWalkedCache.storeWalked(n,r);let o=r.root(),a=r.isAbsolute()&&this.opts.absolute!==!1;if(o){n=n.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=r.rest();if(f)r=f;else{this.matches.add(n,!0,!1);continue}}if(n.isENOENT())continue;let u,l,c=!1;for(;typeof(u=r.pattern())=="string"&&(l=r.rest());)n=n.resolve(u),r=l,c=!0;if(u=r.pattern(),l=r.rest(),c){if(this.hasWalkedCache.hasWalked(n,r))continue;this.hasWalkedCache.storeWalked(n,r)}if(typeof u=="string"){let f=u===".."||u===""||u===".";this.matches.add(n.resolve(u),a,f);continue}else if(u===fe){(!n.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(n,r);let f=l?.pattern(),d=l?.rest();if(!l||(f===""||f===".")&&!d)this.matches.add(n,a,f===""||f===".");else if(f===".."){let p=n.parent||n;d?this.hasWalkedCache.hasWalked(p,d)||this.subwalks.add(p,d):this.matches.add(p,a,!0)}}else u instanceof RegExp&&this.subwalks.add(n,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,s){let i=this.subwalks.get(e),n=this.child();for(let r of s)for(let o of i){let a=o.isAbsolute(),u=o.pattern(),l=o.rest();u===fe?n.testGlobstar(r,o,l,a):u instanceof RegExp?n.testRegExp(r,u,l,a):n.testString(r,u,l,a)}return n}testGlobstar(e,s,i,n){if((this.dot||!e.name.startsWith("."))&&(s.hasMore()||this.matches.add(e,n,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,s):e.isSymbolicLink()&&(i&&s.checkFollowGlobstar()?this.subwalks.add(e,i):s.markFollowGlobstar()&&this.subwalks.add(e,s)))),i){let r=i.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(e,r,i.rest(),n);else if(r===".."){let o=e.parent||e;this.subwalks.add(o,i)}else r instanceof RegExp&&this.testRegExp(e,r,i.rest(),n)}}testRegExp(e,s,i,n){s.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}testString(e,s,i,n){e.isNamed(s)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}}});var QE,Ar,Wi,zi,Xd=M(()=>{ru();cu();Qd();QE=(t,e)=>typeof t=="string"?new ys([t],e):Array.isArray(t)?new ys(t,e):t,Ar=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#s;#r;signal;maxDepth;includeChildMatches;constructor(e,s,i){if(this.patterns=e,this.path=s,this.opts=i,this.#r=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#s=QE(i.ignore??[],i),!this.includeChildMatches&&typeof this.#s.add!="function")){let n="cannot ignore child matches, ignore lacks add() method.";throw new Error(n)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(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 i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}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.#n(e)?e:void 0}matchCheckSync(e,s){if(s&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}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.#n(e))return;if(!this.includeChildMatches&&this.#s?.add){let r=`${e.relativePosix()}/**`;this.#s.add(r)}let i=this.opts.absolute===void 0?s:this.opts.absolute;this.seen.add(e);let n=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let r=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(r+n)}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+n:"."+n)}}async match(e,s,i){let n=await this.matchCheck(e,i);n&&this.matchFinish(n,s)}matchSync(e,s,i){let n=this.matchCheckSync(e,i);n&&this.matchFinish(n,s)}walkCB(e,s,i){this.signal?.aborted&&i(),this.walkCB2(e,s,new Vi(this.opts),i)}walkCB2(e,s,i,n){if(this.#o(e))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2(e,s,i,n));return}i.processPatterns(e,s);let r=1,o=()=>{--r===0&&n()};for(let[a,u,l]of i.matches.entries())this.#n(a)||(r++,this.match(a,u,l).then(()=>o()));for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,i,o):a.readdirCB((l,c)=>this.walkCB3(a,c,i,o),!0)}o()}walkCB3(e,s,i,n){i=i.filterEntries(e,s);let r=1,o=()=>{--r===0&&n()};for(let[a,u,l]of i.matches.entries())this.#n(a)||(r++,this.match(a,u,l).then(()=>o()));for(let[a,u]of i.subwalks.entries())r++,this.walkCB2(a,u,i.child(),o);o()}walkCBSync(e,s,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,s,new Vi(this.opts),i)}walkCB2Sync(e,s,i,n){if(this.#o(e))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2Sync(e,s,i,n));return}i.processPatterns(e,s);let r=1,o=()=>{--r===0&&n()};for(let[a,u,l]of i.matches.entries())this.#n(a)||this.matchSync(a,u,l);for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let u=a.readdirSync();this.walkCB3Sync(a,u,i,o)}o()}walkCB3Sync(e,s,i,n){i=i.filterEntries(e,s);let r=1,o=()=>{--r===0&&n()};for(let[a,u,l]of i.matches.entries())this.#n(a)||this.matchSync(a,u,l);for(let[a,u]of i.subwalks.entries())r++,this.walkCB2Sync(a,u,i.child(),o);o()}},Wi=class extends Ar{matches=new Set;constructor(e,s,i){super(e,s,i)}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}},zi=class extends Ar{results;constructor(e,s,i){super(e,s,i),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 eh,XE,Me,pu=M(()=>{Tt();eh=require("node:url");Zd();lu();Xd();XE=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Me=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,eh.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||XE,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"?Hs:s.platform==="darwin"?Ui:s.platform?Zs:Hd;this.scurry=new u(this.cwd,{nocase:s.nocase,fs:s.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={...s,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,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,n)),[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 Qs(u,c,0,this.platform)})}async walk(){return[...await new Wi(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 Wi(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 zi(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 zi(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 kr,Du=M(()=>{Tt();kr=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let s of t)if(new _e(s,e).hasMagic())return!0;return!1}});var ah={};Di(ah,{Glob:()=>Me,Ignore:()=>ys,escape:()=>ps,glob:()=>yt,globIterate:()=>yu,globIterateSync:()=>Ki,globStream:()=>mu,globStreamSync:()=>Gi,globSync:()=>gu,hasMagic:()=>kr,iterate:()=>rh,iterateSync:()=>nh,stream:()=>ih,streamSync:()=>sh,sync:()=>oh,unescape:()=>Ne});function Gi(t,e={}){return new Me(t,e).streamSync()}function mu(t,e={}){return new Me(t,e).stream()}function gu(t,e={}){return new Me(t,e).walkSync()}async function th(t,e={}){return new Me(t,e).walk()}function Ki(t,e={}){return new Me(t,e).iterateSync()}function yu(t,e={}){return new Me(t,e).iterate()}var sh,ih,nh,rh,oh,yt,_r=M(()=>{Tt();pu();Du();Tt();pu();Du();cu();sh=Gi,ih=Object.assign(mu,{sync:Gi}),nh=Ki,rh=Object.assign(yu,{sync:Ki}),oh=Object.assign(gu,{stream:Gi,iterate:Ki}),yt=Object.assign(th,{glob:th,globSync:gu,sync:oh,globStream:mu,stream:ih,globStreamSync:Gi,streamSync:sh,globIterate:yu,iterate:rh,globIterateSync:Ki,iterateSync:nh,Glob:Me,hasMagic:kr,escape:ps,unescape:Ne});yt.glob=yt});var W=k(de=>{"use strict";var Fu=Symbol.for("yaml.alias"),uh=Symbol.for("yaml.document"),$r=Symbol.for("yaml.map"),lh=Symbol.for("yaml.pair"),Cu=Symbol.for("yaml.scalar"),Br=Symbol.for("yaml.seq"),Ft=Symbol.for("yaml.node.type"),ew=t=>!!t&&typeof t=="object"&&t[Ft]===Fu,tw=t=>!!t&&typeof t=="object"&&t[Ft]===uh,sw=t=>!!t&&typeof t=="object"&&t[Ft]===$r,iw=t=>!!t&&typeof t=="object"&&t[Ft]===lh,ch=t=>!!t&&typeof t=="object"&&t[Ft]===Cu,nw=t=>!!t&&typeof t=="object"&&t[Ft]===Br;function fh(t){if(t&&typeof t=="object")switch(t[Ft]){case $r:case Br:return!0}return!1}function rw(t){if(t&&typeof t=="object")switch(t[Ft]){case Fu:case $r:case Cu:case Br:return!0}return!1}var ow=t=>(ch(t)||fh(t))&&!!t.anchor;de.ALIAS=Fu;de.DOC=uh;de.MAP=$r;de.NODE_TYPE=Ft;de.PAIR=lh;de.SCALAR=Cu;de.SEQ=Br;de.hasAnchor=ow;de.isAlias=ew;de.isCollection=fh;de.isDocument=tw;de.isMap=sw;de.isNode=rw;de.isPair=iw;de.isScalar=ch;de.isSeq=nw});var Yi=k(Eu=>{"use strict";var se=W(),xe=Symbol("break visit"),dh=Symbol("skip children"),ot=Symbol("remove node");function Tr(t,e){let s=hh(e);se.isDocument(t)?Xs(null,t.contents,s,Object.freeze([t]))===ot&&(t.contents=null):Xs(null,t,s,Object.freeze([]))}Tr.BREAK=xe;Tr.SKIP=dh;Tr.REMOVE=ot;function Xs(t,e,s,i){let n=ph(t,e,s,i);if(se.isNode(n)||se.isPair(n))return Dh(t,i,n),Xs(t,n,s,i);if(typeof n!="symbol"){if(se.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let o=Xs(r,e.items[r],s,i);if(typeof o=="number")r=o-1;else{if(o===xe)return xe;o===ot&&(e.items.splice(r,1),r-=1)}}}else if(se.isPair(e)){i=Object.freeze(i.concat(e));let r=Xs("key",e.key,s,i);if(r===xe)return xe;r===ot&&(e.key=null);let o=Xs("value",e.value,s,i);if(o===xe)return xe;o===ot&&(e.value=null)}}return n}async function Ir(t,e){let s=hh(e);se.isDocument(t)?await ei(null,t.contents,s,Object.freeze([t]))===ot&&(t.contents=null):await ei(null,t,s,Object.freeze([]))}Ir.BREAK=xe;Ir.SKIP=dh;Ir.REMOVE=ot;async function ei(t,e,s,i){let n=await ph(t,e,s,i);if(se.isNode(n)||se.isPair(n))return Dh(t,i,n),ei(t,n,s,i);if(typeof n!="symbol"){if(se.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let o=await ei(r,e.items[r],s,i);if(typeof o=="number")r=o-1;else{if(o===xe)return xe;o===ot&&(e.items.splice(r,1),r-=1)}}}else if(se.isPair(e)){i=Object.freeze(i.concat(e));let r=await ei("key",e.key,s,i);if(r===xe)return xe;r===ot&&(e.key=null);let o=await ei("value",e.value,s,i);if(o===xe)return xe;o===ot&&(e.value=null)}}return n}function hh(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 ph(t,e,s,i){if(typeof s=="function")return s(t,e,i);if(se.isMap(e))return s.Map?.(t,e,i);if(se.isSeq(e))return s.Seq?.(t,e,i);if(se.isPair(e))return s.Pair?.(t,e,i);if(se.isScalar(e))return s.Scalar?.(t,e,i);if(se.isAlias(e))return s.Alias?.(t,e,i)}function Dh(t,e,s){let i=e[e.length-1];if(se.isCollection(i))i.items[t]=s;else if(se.isPair(i))t==="key"?i.key=s:i.value=s;else if(se.isDocument(i))i.contents=s;else{let n=se.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}Eu.visit=Tr;Eu.visitAsync=Ir});var wu=k(gh=>{"use strict";var mh=W(),aw=Yi(),uw={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},lw=t=>t.replace(/[!,[\]{}]/g,e=>uw[e]),Ji=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 i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[r,o]=i;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;let[r]=i;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 ${n}`,!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[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||s(`The ${e} tag has no suffix`);let r=this.tags[i];if(r)try{return r+decodeURIComponent(n)}catch(o){return s(String(o)),null}return i==="!"?e:(s(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[s,i]of Object.entries(this.tags))if(e.startsWith(i))return s+lw(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&mh.isNode(e.contents)){let r={};aw.visit(e.contents,(o,a)=>{mh.isNode(a)&&a.tag&&(r[a.tag]=!0)}),n=Object.keys(r)}else n=[];for(let[r,o]of i)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||n.some(a=>a.startsWith(o)))&&s.push(`%TAG ${r} ${o}`);return s.join(`
59
+ `)}};Ji.defaultYaml={explicit:!1,version:"1.2"};Ji.defaultTags={"!!":"tag:yaml.org,2002:"};gh.Directives=Ji});var Rr=k(Hi=>{"use strict";var yh=W(),cw=Yi();function fw(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 Fh(t){let e=new Set;return cw.visit(t,{Value(s,i){i.anchor&&e.add(i.anchor)}}),e}function Ch(t,e){for(let s=1;;++s){let i=`${t}${s}`;if(!e.has(i))return i}}function dw(t,e){let s=[],i=new Map,n=null;return{onAnchor:r=>{s.push(r),n??(n=Fh(t));let o=Ch(e,n);return n.add(o),o},setAnchors:()=>{for(let r of s){let o=i.get(r);if(typeof o=="object"&&o.anchor&&(yh.isScalar(o.node)||yh.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:i}}Hi.anchorIsValid=fw;Hi.anchorNames=Fh;Hi.createNodeAnchors=dw;Hi.findNewAnchor=Ch});var bu=k(Eh=>{"use strict";function Zi(t,e,s,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let o=i[n],a=Zi(t,i,String(n),o);a===void 0?delete i[n]:a!==o&&(i[n]=a)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),o=Zi(t,i,n,r);o===void 0?i.delete(n):o!==r&&i.set(n,o)}else if(i instanceof Set)for(let n of Array.from(i)){let r=Zi(t,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let o=Zi(t,i,n,r);o===void 0?delete i[n]:o!==r&&(i[n]=o)}return t.call(e,s,i)}Eh.applyReviver=Zi});var Ot=k(bh=>{"use strict";var hw=W();function wh(t,e,s){if(Array.isArray(t))return t.map((i,n)=>wh(i,String(n),s));if(t&&typeof t.toJSON=="function"){if(!s||!hw.hasAnchor(t))return t.toJSON(e,s);let i={aliasCount:0,count:1,res:void 0};s.anchors.set(t,i),s.onCreate=r=>{i.res=r,delete s.onCreate};let n=t.toJSON(e,s);return s.onCreate&&s.onCreate(n),n}return typeof t=="bigint"&&!s?.keep?Number(t):t}bh.toJS=wh});var Nr=k(xh=>{"use strict";var pw=bu(),vh=W(),Dw=Ot(),vu=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:i,onAnchor:n,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 i=="number"?i:100},a=Dw.toJS(this,"",o);if(typeof n=="function")for(let{count:u,res:l}of o.anchors.values())n(l,u);return typeof r=="function"?pw.applyReviver(r,{"":a},"",a):a}};xh.NodeBase=vu});var Qi=k(Sh=>{"use strict";var mw=Rr(),gw=Yi(),ti=W(),yw=Nr(),Fw=Ot(),xu=class extends yw.NodeBase{constructor(e){super(ti.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,s){let i;s?.aliasResolveCache?i=s.aliasResolveCache:(i=[],gw.visit(e,{Node:(r,o)=>{(ti.isAlias(o)||ti.hasAnchor(o))&&i.push(o)}}),s&&(s.aliasResolveCache=i));let n;for(let r of i){if(r===this)break;r.anchor===this.source&&(n=r)}return n}toJSON(e,s){if(!s)return{source:this.source};let{anchors:i,doc:n,maxAliasCount:r}=s,o=this.resolve(n,s);if(!o){let u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let a=i.get(o);if(a||(Fw.toJS(o,null,s),a=i.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=Pr(n,o,i)),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,i){let n=`*${this.source}`;if(e){if(mw.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`${n} `}return n}};function Pr(t,e,s){if(ti.isAlias(e)){let i=e.resolve(t),n=s&&i&&s.get(i);return n?n.count*n.aliasCount:0}else if(ti.isCollection(e)){let i=0;for(let n of e.items){let r=Pr(t,n,s);r>i&&(i=r)}return i}else if(ti.isPair(e)){let i=Pr(t,e.key,s),n=Pr(t,e.value,s);return Math.max(i,n)}return 1}Sh.Alias=xu});var ee=k(Su=>{"use strict";var Cw=W(),Ew=Nr(),ww=Ot(),bw=t=>!t||typeof t!="function"&&typeof t!="object",Lt=class extends Ew.NodeBase{constructor(e){super(Cw.SCALAR),this.value=e}toJSON(e,s){return s?.keep?this.value:ww.toJS(this.value,e,s)}toString(){return String(this.value)}};Lt.BLOCK_FOLDED="BLOCK_FOLDED";Lt.BLOCK_LITERAL="BLOCK_LITERAL";Lt.PLAIN="PLAIN";Lt.QUOTE_DOUBLE="QUOTE_DOUBLE";Lt.QUOTE_SINGLE="QUOTE_SINGLE";Su.Scalar=Lt;Su.isScalarValue=bw});var Xi=k(kh=>{"use strict";var vw=Qi(),Fs=W(),Ah=ee(),xw="tag:yaml.org,2002:";function Sw(t,e,s){if(e){let i=s.filter(r=>r.tag===e),n=i.find(r=>!r.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return s.find(i=>i.identify?.(t)&&!i.format)}function Aw(t,e,s){if(Fs.isDocument(t)&&(t=t.contents),Fs.isNode(t))return t;if(Fs.isPair(t)){let f=s.schema[Fs.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:i,onAnchor:n,onTagObj:r,schema:o,sourceObjects:a}=s,u;if(i&&t&&typeof t=="object"){if(u=a.get(t),u)return u.anchor??(u.anchor=n(t)),new vw.Alias(u.anchor);u={anchor:null,node:null},a.set(t,u)}e?.startsWith("!!")&&(e=xw+e.slice(2));let l=Sw(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new Ah.Scalar(t);return u&&(u.node=f),f}l=t instanceof Map?o[Fs.MAP]:Symbol.iterator in Object(t)?o[Fs.SEQ]:o[Fs.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 Ah.Scalar(t);return e?c.tag=e:l.default||(c.tag=l.tag),u&&(u.node=c),c}kh.createNode=Aw});var Lr=k(Or=>{"use strict";var kw=Xi(),at=W(),_w=Nr();function Au(t,e,s){let i=s;for(let n=e.length-1;n>=0;--n){let r=e[n];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=i,i=o}else i=new Map([[r,i]])}return kw.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var _h=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,ku=class extends _w.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(i=>at.isNode(i)||at.isPair(i)?i.clone(e):i),this.range&&(s.range=this.range.slice()),s}addIn(e,s){if(_h(e))this.add(s);else{let[i,...n]=e,r=this.get(i,!0);if(at.isCollection(r))r.addIn(n,s);else if(r===void 0&&this.schema)this.set(i,Au(this.schema,n,s));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[s,...i]=e;if(i.length===0)return this.delete(s);let n=this.get(s,!0);if(at.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}getIn(e,s){let[i,...n]=e,r=this.get(i,!0);return n.length===0?!s&&at.isScalar(r)?r.value:r:at.isCollection(r)?r.getIn(n,s):void 0}hasAllNullValues(e){return this.items.every(s=>{if(!at.isPair(s))return!1;let i=s.value;return i==null||e&&at.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[s,...i]=e;if(i.length===0)return this.has(s);let n=this.get(s,!0);return at.isCollection(n)?n.hasIn(i):!1}setIn(e,s){let[i,...n]=e;if(n.length===0)this.set(i,s);else{let r=this.get(i,!0);if(at.isCollection(r))r.setIn(n,s);else if(r===void 0&&this.schema)this.set(i,Au(this.schema,n,s));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};Or.Collection=ku;Or.collectionFromPath=Au;Or.isEmptyPath=_h});var en=k(Mr=>{"use strict";var $w=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function _u(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Bw=(t,e,s)=>t.endsWith(`
60
+ `)?_u(s,e):s.includes(`
61
61
  `)?`
62
- `+xu(s,e):(t.endsWith(" ")?"":" ")+s;Pr.indentComment=xu;Pr.lineComment=mb;Pr.stringifyComment=Db});var xd=k(Xi=>{"use strict";var gb="flow",Su="block",Or="quoted";function yb(t,e,s="flow",{indentAtStart:i,lineWidth:n=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!n||n<0)return t;n<r&&(r=0);let u=Math.max(1+r,1+n-e.length);if(t.length<=u)return t;let l=[],c={},f=n-e.length;typeof i=="number"&&(i>n-Math.max(2,r)?l.push(0):f=n-i);let h,d,m=!1,D=-1,g=-1,F=-1;s===Su&&(D=vd(t,D,e.length),D!==-1&&(f=D+u));for(let C;C=t[D+=1];){if(s===Or&&C==="\\"){switch(g=D,t[D+1]){case"x":D+=3;break;case"u":D+=5;break;case"U":D+=9;break;default:D+=1}F=D}if(C===`
63
- `)s===Su&&(D=vd(t,D,e.length)),f=D+e.length+u,h=void 0;else{if(C===" "&&d&&d!==" "&&d!==`
64
- `&&d!==" "){let E=t[D+1];E&&E!==" "&&E!==`
65
- `&&E!==" "&&(h=D)}if(D>=f)if(h)l.push(h),f=h+u,h=void 0;else if(s===Or){for(;d===" "||d===" ";)d=C,C=t[D+=1],m=!0;let E=D>F+1?D-2:g-1;if(c[E])return t;l.push(E),c[E]=!0,f=E+u,h=void 0}else m=!0}d=C}if(m&&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 E=l[C],v=l[C+1]||t.length;E===0?y=`
66
- ${e}${t.slice(0,v)}`:(s===Or&&c[E]&&(y+=`${t[E]}\\`),y+=`
67
- ${e}${t.slice(E+1,v)}`)}return y}function vd(t,e,s){let i=e,n=e+1,r=t[n];for(;r===" "||r===" ";)if(e<n+s)r=t[++e];else{do r=t[++e];while(r&&r!==`
68
- `);i=e,n=e+1,r=t[n]}return i}Xi.FOLD_BLOCK=Su;Xi.FOLD_FLOW=gb;Xi.FOLD_QUOTED=Or;Xi.foldFlowLines=yb});var tn=k(Sd=>{"use strict";var Je=ee(),Lt=xd(),Mr=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),jr=t=>/^(%|---|\.\.\.)/m.test(t);function Fb(t,e,s){if(!e||e<0)return!1;let i=e-s,n=t.length;if(n<=i)return!1;for(let r=0,o=0;r<n;++r)if(t[r]===`
69
- `){if(r-o>i)return!0;if(o=r+1,n-o<=i)return!1}return!0}function en(t,e){let s=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return s;let{implicitKey:i}=e,n=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(jr(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(i||s[u+2]==='"'||s.length<n)u+=1;else{for(o+=s.slice(a,u)+`
62
+ `+_u(s,e):(t.endsWith(" ")?"":" ")+s;Mr.indentComment=_u;Mr.lineComment=Bw;Mr.stringifyComment=$w});var Bh=k(tn=>{"use strict";var Tw="flow",$u="block",jr="quoted";function Iw(t,e,s="flow",{indentAtStart:i,lineWidth:n=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!n||n<0)return t;n<r&&(r=0);let u=Math.max(1+r,1+n-e.length);if(t.length<=u)return t;let l=[],c={},f=n-e.length;typeof i=="number"&&(i>n-Math.max(2,r)?l.push(0):f=n-i);let d,p,m=!1,D=-1,g=-1,F=-1;s===$u&&(D=$h(t,D,e.length),D!==-1&&(f=D+u));for(let C;C=t[D+=1];){if(s===jr&&C==="\\"){switch(g=D,t[D+1]){case"x":D+=3;break;case"u":D+=5;break;case"U":D+=9;break;default:D+=1}F=D}if(C===`
63
+ `)s===$u&&(D=$h(t,D,e.length)),f=D+e.length+u,d=void 0;else{if(C===" "&&p&&p!==" "&&p!==`
64
+ `&&p!==" "){let E=t[D+1];E&&E!==" "&&E!==`
65
+ `&&E!==" "&&(d=D)}if(D>=f)if(d)l.push(d),f=d+u,d=void 0;else if(s===jr){for(;p===" "||p===" ";)p=C,C=t[D+=1],m=!0;let E=D>F+1?D-2:g-1;if(c[E])return t;l.push(E),c[E]=!0,f=E+u,d=void 0}else m=!0}p=C}if(m&&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 E=l[C],v=l[C+1]||t.length;E===0?y=`
66
+ ${e}${t.slice(0,v)}`:(s===jr&&c[E]&&(y+=`${t[E]}\\`),y+=`
67
+ ${e}${t.slice(E+1,v)}`)}return y}function $h(t,e,s){let i=e,n=e+1,r=t[n];for(;r===" "||r===" ";)if(e<n+s)r=t[++e];else{do r=t[++e];while(r&&r!==`
68
+ `);i=e,n=e+1,r=t[n]}return i}tn.FOLD_BLOCK=$u;tn.FOLD_FLOW=Tw;tn.FOLD_QUOTED=jr;tn.foldFlowLines=Iw});var nn=k(Th=>{"use strict";var Je=ee(),Mt=Bh(),Ur=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Vr=t=>/^(%|---|\.\.\.)/m.test(t);function Rw(t,e,s){if(!e||e<0)return!1;let i=e-s,n=t.length;if(n<=i)return!1;for(let r=0,o=0;r<n;++r)if(t[r]===`
69
+ `){if(r-o>i)return!0;if(o=r+1,n-o<=i)return!1}return!0}function sn(t,e){let s=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return s;let{implicitKey:i}=e,n=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(Vr(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(i||s[u+2]==='"'||s.length<n)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,i?o:Lt.foldFlowLines(o,r,Lt.FOLD_QUOTED,Mr(e,!1))}function Au(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
73
- `)||/[ \t]\n|\n[ \t]/.test(t))return en(t,e);let s=e.indent||(jr(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
74
- ${s}`)+"'";return e.implicitKey?i:Lt.foldFlowLines(i,s,Lt.FOLD_FLOW,Mr(e,!1))}function ei(t,e){let{singleQuote:s}=e.options,i;if(s===!1)i=en;else{let n=t.includes('"'),r=t.includes("'");n&&!r?i=Au:r&&!n?i=en:i=s?Au:en}return i(t,e)}var ku;try{ku=new RegExp(`(^|(?<!
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,i?o:Mt.foldFlowLines(o,r,Mt.FOLD_QUOTED,Ur(e,!1))}function Bu(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
73
+ `)||/[ \t]\n|\n[ \t]/.test(t))return sn(t,e);let s=e.indent||(Vr(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
74
+ ${s}`)+"'";return e.implicitKey?i:Mt.foldFlowLines(i,s,Mt.FOLD_FLOW,Ur(e,!1))}function si(t,e){let{singleQuote:s}=e.options,i;if(s===!1)i=sn;else{let n=t.includes('"'),r=t.includes("'");n&&!r?i=Bu:r&&!n?i=sn:i=s?Bu:sn}return i(t,e)}var Tu;try{Tu=new RegExp(`(^|(?<!
75
75
  ))
76
76
  +(?!
77
- |$)`,"g")}catch{ku=/\n+(?!\n|$)/g}function Lr({comment:t,type:e,value:s},i,n,r){let{blockQuote:o,commentString:a,lineWidth:u}=i.options;if(!o||/\n[\t ]+$/.test(s))return ei(s,i);let l=i.indent||(i.forceBlockIndent||jr(s)?" ":""),c=o==="literal"?!0:o==="folded"||e===Je.Scalar.BLOCK_FOLDED?!1:e===Je.Scalar.BLOCK_LITERAL?!0:!Fb(s,u,l.length);if(!s)return c?`|
77
+ |$)`,"g")}catch{Tu=/\n+(?!\n|$)/g}function qr({comment:t,type:e,value:s},i,n,r){let{blockQuote:o,commentString:a,lineWidth:u}=i.options;if(!o||/\n[\t ]+$/.test(s))return si(s,i);let l=i.indent||(i.forceBlockIndent||Vr(s)?" ":""),c=o==="literal"?!0:o==="folded"||e===Je.Scalar.BLOCK_FOLDED?!1:e===Je.Scalar.BLOCK_LITERAL?!0:!Rw(s,u,l.length);if(!s)return c?`|
78
78
  `:`>
79
- `;let f,h;for(h=s.length;h>0;--h){let v=s[h-1];if(v!==`
80
- `&&v!==" "&&v!==" ")break}let d=s.substring(h),m=d.indexOf(`
81
- `);m===-1?f="-":s===d||m!==d.length-1?(f="+",r&&r()):f="",d&&(s=s.slice(0,-d.length),d[d.length-1]===`
82
- `&&(d=d.slice(0,-1)),d=d.replace(ku,`$&${l}`));let D=!1,g,F=-1;for(g=0;g<s.length;++g){let v=s[g];if(v===" ")D=!0;else if(v===`
79
+ `;let f,d;for(d=s.length;d>0;--d){let v=s[d-1];if(v!==`
80
+ `&&v!==" "&&v!==" ")break}let p=s.substring(d),m=p.indexOf(`
81
+ `);m===-1?f="-":s===p||m!==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(Tu,`$&${l}`));let D=!1,g,F=-1;for(g=0;g<s.length;++g){let v=s[g];if(v===" ")D=!0;else if(v===`
83
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 E=(D?l?"2":"1":"")+f;if(t&&(E+=" "+a(t.replace(/ ?[\r\n]+/g," ")),n&&n()),!c){let v=s.replace(/\n+/g,`
84
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),S=!1,T=Mr(i,!0);o!=="folded"&&e!==Je.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{S=!0});let b=Lt.foldFlowLines(`${y}${v}${d}`,l,Lt.FOLD_BLOCK,T);if(!S)return`>${E}
85
- ${l}${b}`}return s=s.replace(/\n+/g,`$&${l}`),`|${E}
86
- ${l}${y}${s}${d}`}function Cb(t,e,s,i){let{type:n,value:r}=t,{actualString:o,implicitKey:a,indent:u,indentStep:l,inFlow:c}=e;if(a&&r.includes(`
87
- `)||c&&/[[\]{},]/.test(r))return ei(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||c||!r.includes(`
88
- `)?ei(r,e):Lr(t,e,s,i);if(!a&&!c&&n!==Je.Scalar.PLAIN&&r.includes(`
89
- `))return Lr(t,e,s,i);if(jr(r)){if(u==="")return e.forceBlockIndent=!0,Lr(t,e,s,i);if(a&&u===l)return ei(r,e)}let f=r.replace(/\n+/g,`$&
90
- ${u}`);if(o){let h=D=>D.default&&D.tag!=="tag:yaml.org,2002:str"&&D.test?.test(f),{compat:d,tags:m}=e.doc.schema;if(m.some(h)||d?.some(h))return ei(r,e)}return a?f:Lt.foldFlowLines(f,u,Lt.FOLD_FLOW,Mr(e,!1))}function Eb(t,e,s,i){let{implicitKey:n,inFlow:r}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Je.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Je.Scalar.QUOTE_DOUBLE);let u=c=>{switch(c){case Je.Scalar.BLOCK_FOLDED:case Je.Scalar.BLOCK_LITERAL:return n||r?ei(o.value,e):Lr(o,e,s,i);case Je.Scalar.QUOTE_DOUBLE:return en(o.value,e);case Je.Scalar.QUOTE_SINGLE:return Au(o.value,e);case Je.Scalar.PLAIN:return Cb(o,e,s,i);default:return null}},l=u(a);if(l===null){let{defaultKeyType:c,defaultStringType:f}=e.options,h=n&&c||f;if(l=u(h),l===null)throw new Error(`Unsupported default string type ${h}`)}return l}Sd.stringifyString=Eb});var sn=k(_u=>{"use strict";var bb=$r(),Mt=W(),wb=Qi(),vb=tn();function xb(t,e){let s=Object.assign({blockQuote:!0,commentString:wb.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),i;switch(s.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:i,options:s}}function Sb(t,e){if(e.tag){let n=t.filter(r=>r.tag===e.tag);if(n.length>0)return n.find(r=>r.format===e.format)??n[0]}let s,i;if(Mt.isScalar(e)){i=e.value;let n=t.filter(r=>r.identify?.(i));if(n.length>1){let r=n.filter(o=>o.test);r.length>0&&(n=r)}s=n.find(r=>r.format===e.format)??n.find(r=>!r.format)}else i=e,s=t.find(n=>n.nodeClass&&i instanceof n.nodeClass);if(!s){let n=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${n} value`)}return s}function Ab(t,e,{anchors:s,doc:i}){if(!i.directives)return"";let n=[],r=(Mt.isScalar(t)||Mt.isCollection(t))&&t.anchor;r&&bb.anchorIsValid(r)&&(s.add(r),n.push(`&${r}`));let o=t.tag??(e.default?null:e.tag);return o&&n.push(i.directives.tagString(o)),n.join(" ")}function kb(t,e,s,i){if(Mt.isPair(t))return t.toString(e,s,i);if(Mt.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 n,r=Mt.isNode(t)?t:e.doc.createNode(t,{onTagObj:u=>n=u});n??(n=Sb(e.doc.schema.tags,r));let o=Ab(r,n,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof n.stringify=="function"?n.stringify(r,e,s,i):Mt.isScalar(r)?vb.stringifyString(r,e,s,i):r.toString(e,s,i);return o?Mt.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
91
- ${e.indent}${a}`:a}_u.createStringifyContext=xb;_u.stringify=kb});var Bd=k(_d=>{"use strict";var Ft=W(),Ad=ee(),kd=sn(),nn=Qi();function _b({key:t,value:e},s,i,n){let{allNullValues:r,doc:o,indent:a,indentStep:u,options:{commentString:l,indentSeq:c,simpleKeys:f}}=s,h=Ft.isNode(t)&&t.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Ft.isCollection(t)||!Ft.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let d=!f&&(!t||h&&e==null&&!s.inFlow||Ft.isCollection(t)||(Ft.isScalar(t)?t.type===Ad.Scalar.BLOCK_FOLDED||t.type===Ad.Scalar.BLOCK_LITERAL:typeof t=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!d&&(f||!r),indent:a+u});let m=!1,D=!1,g=kd.stringify(t,s,()=>m=!0,()=>D=!0);if(!d&&!s.inFlow&&g.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(s.inFlow){if(r||e==null)return m&&i&&i(),g===""?"?":d?`? ${g}`:g}else if(r&&!f||e==null&&d)return g=`? ${g}`,h&&!m?g+=nn.lineComment(g,s.indent,l(h)):D&&n&&n(),g;m&&(h=null),d?(h&&(g+=nn.lineComment(g,s.indent,l(h))),g=`? ${g}
92
- ${a}:`):(g=`${g}:`,h&&(g+=nn.lineComment(g,s.indent,l(h))));let F,y,C;Ft.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,!d&&!h&&Ft.isScalar(e)&&(s.indentAtStart=g.length+1),D=!1,!c&&u.length>=2&&!s.inFlow&&!d&&Ft.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(s.indent=s.indent.substring(2));let E=!1,v=kd.stringify(e,s,()=>E=!0,()=>D=!0),S=" ";if(h||F||y){if(S=F?`
84
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),S=!1,T=Ur(i,!0);o!=="folded"&&e!==Je.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{S=!0});let w=Mt.foldFlowLines(`${y}${v}${p}`,l,Mt.FOLD_BLOCK,T);if(!S)return`>${E}
85
+ ${l}${w}`}return s=s.replace(/\n+/g,`$&${l}`),`|${E}
86
+ ${l}${y}${s}${p}`}function Nw(t,e,s,i){let{type:n,value:r}=t,{actualString:o,implicitKey:a,indent:u,indentStep:l,inFlow:c}=e;if(a&&r.includes(`
87
+ `)||c&&/[[\]{},]/.test(r))return si(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||c||!r.includes(`
88
+ `)?si(r,e):qr(t,e,s,i);if(!a&&!c&&n!==Je.Scalar.PLAIN&&r.includes(`
89
+ `))return qr(t,e,s,i);if(Vr(r)){if(u==="")return e.forceBlockIndent=!0,qr(t,e,s,i);if(a&&u===l)return si(r,e)}let f=r.replace(/\n+/g,`$&
90
+ ${u}`);if(o){let d=D=>D.default&&D.tag!=="tag:yaml.org,2002:str"&&D.test?.test(f),{compat:p,tags:m}=e.doc.schema;if(m.some(d)||p?.some(d))return si(r,e)}return a?f:Mt.foldFlowLines(f,u,Mt.FOLD_FLOW,Ur(e,!1))}function Pw(t,e,s,i){let{implicitKey:n,inFlow:r}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Je.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Je.Scalar.QUOTE_DOUBLE);let u=c=>{switch(c){case Je.Scalar.BLOCK_FOLDED:case Je.Scalar.BLOCK_LITERAL:return n||r?si(o.value,e):qr(o,e,s,i);case Je.Scalar.QUOTE_DOUBLE:return sn(o.value,e);case Je.Scalar.QUOTE_SINGLE:return Bu(o.value,e);case Je.Scalar.PLAIN:return Nw(o,e,s,i);default:return null}},l=u(a);if(l===null){let{defaultKeyType:c,defaultStringType:f}=e.options,d=n&&c||f;if(l=u(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}Th.stringifyString=Pw});var rn=k(Iu=>{"use strict";var Ow=Rr(),jt=W(),Lw=en(),Mw=nn();function jw(t,e){let s=Object.assign({blockQuote:!0,commentString:Lw.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),i;switch(s.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:i,options:s}}function qw(t,e){if(e.tag){let n=t.filter(r=>r.tag===e.tag);if(n.length>0)return n.find(r=>r.format===e.format)??n[0]}let s,i;if(jt.isScalar(e)){i=e.value;let n=t.filter(r=>r.identify?.(i));if(n.length>1){let r=n.filter(o=>o.test);r.length>0&&(n=r)}s=n.find(r=>r.format===e.format)??n.find(r=>!r.format)}else i=e,s=t.find(n=>n.nodeClass&&i instanceof n.nodeClass);if(!s){let n=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${n} value`)}return s}function Uw(t,e,{anchors:s,doc:i}){if(!i.directives)return"";let n=[],r=(jt.isScalar(t)||jt.isCollection(t))&&t.anchor;r&&Ow.anchorIsValid(r)&&(s.add(r),n.push(`&${r}`));let o=t.tag??(e.default?null:e.tag);return o&&n.push(i.directives.tagString(o)),n.join(" ")}function Vw(t,e,s,i){if(jt.isPair(t))return t.toString(e,s,i);if(jt.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 n,r=jt.isNode(t)?t:e.doc.createNode(t,{onTagObj:u=>n=u});n??(n=qw(e.doc.schema.tags,r));let o=Uw(r,n,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof n.stringify=="function"?n.stringify(r,e,s,i):jt.isScalar(r)?Mw.stringifyString(r,e,s,i):r.toString(e,s,i);return o?jt.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
91
+ ${e.indent}${a}`:a}Iu.createStringifyContext=jw;Iu.stringify=Vw});var Ph=k(Nh=>{"use strict";var Ct=W(),Ih=ee(),Rh=rn(),on=en();function Ww({key:t,value:e},s,i,n){let{allNullValues:r,doc:o,indent:a,indentStep:u,options:{commentString:l,indentSeq:c,simpleKeys:f}}=s,d=Ct.isNode(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(Ct.isCollection(t)||!Ct.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!f&&(!t||d&&e==null&&!s.inFlow||Ct.isCollection(t)||(Ct.isScalar(t)?t.type===Ih.Scalar.BLOCK_FOLDED||t.type===Ih.Scalar.BLOCK_LITERAL:typeof t=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!p&&(f||!r),indent:a+u});let m=!1,D=!1,g=Rh.stringify(t,s,()=>m=!0,()=>D=!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 m&&i&&i(),g===""?"?":p?`? ${g}`:g}else if(r&&!f||e==null&&p)return g=`? ${g}`,d&&!m?g+=on.lineComment(g,s.indent,l(d)):D&&n&&n(),g;m&&(d=null),p?(d&&(g+=on.lineComment(g,s.indent,l(d))),g=`? ${g}
92
+ ${a}:`):(g=`${g}:`,d&&(g+=on.lineComment(g,s.indent,l(d))));let F,y,C;Ct.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&&Ct.isScalar(e)&&(s.indentAtStart=g.length+1),D=!1,!c&&u.length>=2&&!s.inFlow&&!p&&Ct.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(s.indent=s.indent.substring(2));let E=!1,v=Rh.stringify(e,s,()=>E=!0,()=>D=!0),S=" ";if(d||F||y){if(S=F?`
93
93
  `:"",y){let T=l(y);S+=`
94
- ${nn.indentComment(T,s.indent)}`}v===""&&!s.inFlow?S===`
94
+ ${on.indentComment(T,s.indent)}`}v===""&&!s.inFlow?S===`
95
95
  `&&C&&(S=`
96
96
 
97
97
  `):S+=`
98
- ${s.indent}`}else if(!d&&Ft.isCollection(e)){let T=v[0],b=v.indexOf(`
99
- `),R=b!==-1,O=s.inFlow??e.flow??e.items.length===0;if(R||!O){let J=!1;if(R&&(T==="&"||T==="!")){let G=v.indexOf(" ");T==="&"&&G!==-1&&G<b&&v[G+1]==="!"&&(G=v.indexOf(" ",G+1)),(G===-1||b<G)&&(J=!0)}J||(S=`
98
+ ${s.indent}`}else if(!p&&Ct.isCollection(e)){let T=v[0],w=v.indexOf(`
99
+ `),R=w!==-1,O=s.inFlow??e.flow??e.items.length===0;if(R||!O){let J=!1;if(R&&(T==="&"||T==="!")){let G=v.indexOf(" ");T==="&"&&G!==-1&&G<w&&v[G+1]==="!"&&(G=v.indexOf(" ",G+1)),(G===-1||w<G)&&(J=!0)}J||(S=`
100
100
  ${s.indent}`)}}else(v===""||v[0]===`
101
- `)&&(S="");return g+=S+v,s.inFlow?E&&i&&i():C&&!E?g+=nn.lineComment(g,s.indent,l(C)):D&&n&&n(),g}_d.stringifyPair=_b});var $u=k(Bu=>{"use strict";var $d=require("process");function Bb(t,...e){t==="debug"&&console.log(...e)}function $b(t,e){(t==="debug"||t==="warn")&&(typeof $d.emitWarning=="function"?$d.emitWarning(e):console.warn(e))}Bu.debug=Bb;Bu.warn=$b});var Wr=k(Vr=>{"use strict";var rn=W(),Td=ee(),qr="<<",Ur={identify:t=>t===qr||typeof t=="symbol"&&t.description===qr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Td.Scalar(Symbol(qr)),{addToJSMap:Id}),stringify:()=>qr},Tb=(t,e)=>(Ur.identify(e)||rn.isScalar(e)&&(!e.type||e.type===Td.Scalar.PLAIN)&&Ur.identify(e.value))&&t?.doc.schema.tags.some(s=>s.tag===Ur.tag&&s.default);function Id(t,e,s){if(s=t&&rn.isAlias(s)?s.resolve(t.doc):s,rn.isSeq(s))for(let i of s.items)Tu(t,e,i);else if(Array.isArray(s))for(let i of s)Tu(t,e,i);else Tu(t,e,s)}function Tu(t,e,s){let i=t&&rn.isAlias(s)?s.resolve(t.doc):s;if(!rn.isMap(i))throw new Error("Merge sources must be maps or map aliases");let n=i.toJSON(null,t,Map);for(let[r,o]of n)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}Vr.addMergeToJSMap=Id;Vr.isMergeKey=Tb;Vr.merge=Ur});var Ru=k(Pd=>{"use strict";var Ib=$u(),Rd=Wr(),Rb=sn(),Nd=W(),Iu=Pt();function Nb(t,e,{key:s,value:i}){if(Nd.isNode(s)&&s.addToJSMap)s.addToJSMap(t,e,i);else if(Rd.isMergeKey(t,s))Rd.addMergeToJSMap(t,e,i);else{let n=Iu.toJS(s,"",t);if(e instanceof Map)e.set(n,Iu.toJS(i,n,t));else if(e instanceof Set)e.add(n);else{let r=Pb(s,n,t),o=Iu.toJS(i,r,t);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Pb(t,e,s){if(e===null)return"";if(typeof e!="object")return String(e);if(Nd.isNode(t)&&s?.doc){let i=Rb.createStringifyContext(s.doc,{});i.anchors=new Set;for(let r of s.anchors.keys())i.anchors.add(r.anchor);i.inFlow=!0,i.inStringifyKey=!0;let n=t.toString(i);if(!s.mapKeyWarned){let r=JSON.stringify(n);r.length>40&&(r=r.substring(0,36)+'..."'),Ib.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 n}return JSON.stringify(e)}Pd.addPairToJSMap=Nb});var jt=k(Nu=>{"use strict";var Od=Zi(),Ob=Bd(),Lb=Ru(),zr=W();function Mb(t,e,s){let i=Od.createNode(t,void 0,s),n=Od.createNode(e,void 0,s);return new Gr(i,n)}var Gr=class t{constructor(e,s=null){Object.defineProperty(this,zr.NODE_TYPE,{value:zr.PAIR}),this.key=e,this.value=s}clone(e){let{key:s,value:i}=this;return zr.isNode(s)&&(s=s.clone(e)),zr.isNode(i)&&(i=i.clone(e)),new t(s,i)}toJSON(e,s){let i=s?.mapAsMap?new Map:{};return Lb.addPairToJSMap(s,i,this)}toString(e,s,i){return e?.doc?Ob.stringifyPair(this,e,s,i):JSON.stringify(this)}};Nu.Pair=Gr;Nu.createPair=Mb});var Pu=k(Md=>{"use strict";var Fs=W(),Ld=sn(),Kr=Qi();function jb(t,e,s){return(e.inFlow??t.flow?Ub:qb)(t,e,s)}function qb({comment:t,items:e},s,{blockItemPrefix:i,flowChars:n,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:u,options:{commentString:l}}=s,c=Object.assign({},s,{indent:r,type:null}),f=!1,h=[];for(let m=0;m<e.length;++m){let D=e[m],g=null;if(Fs.isNode(D))!f&&D.spaceBefore&&h.push(""),Yr(s,h,D.commentBefore,f),D.comment&&(g=D.comment);else if(Fs.isPair(D)){let y=Fs.isNode(D.key)?D.key:null;y&&(!f&&y.spaceBefore&&h.push(""),Yr(s,h,y.commentBefore,f))}f=!1;let F=Ld.stringify(D,c,()=>g=null,()=>f=!0);g&&(F+=Kr.lineComment(F,r,l(g))),f&&g&&(f=!1),h.push(i+F)}let d;if(h.length===0)d=n.start+n.end;else{d=h[0];for(let m=1;m<h.length;++m){let D=h[m];d+=D?`
101
+ `)&&(S="");return g+=S+v,s.inFlow?E&&i&&i():C&&!E?g+=on.lineComment(g,s.indent,l(C)):D&&n&&n(),g}Nh.stringifyPair=Ww});var Nu=k(Ru=>{"use strict";var Oh=require("process");function zw(t,...e){t==="debug"&&console.log(...e)}function Gw(t,e){(t==="debug"||t==="warn")&&(typeof Oh.emitWarning=="function"?Oh.emitWarning(e):console.warn(e))}Ru.debug=zw;Ru.warn=Gw});var Kr=k(Gr=>{"use strict";var an=W(),Lh=ee(),Wr="<<",zr={identify:t=>t===Wr||typeof t=="symbol"&&t.description===Wr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Lh.Scalar(Symbol(Wr)),{addToJSMap:Mh}),stringify:()=>Wr},Kw=(t,e)=>(zr.identify(e)||an.isScalar(e)&&(!e.type||e.type===Lh.Scalar.PLAIN)&&zr.identify(e.value))&&t?.doc.schema.tags.some(s=>s.tag===zr.tag&&s.default);function Mh(t,e,s){if(s=t&&an.isAlias(s)?s.resolve(t.doc):s,an.isSeq(s))for(let i of s.items)Pu(t,e,i);else if(Array.isArray(s))for(let i of s)Pu(t,e,i);else Pu(t,e,s)}function Pu(t,e,s){let i=t&&an.isAlias(s)?s.resolve(t.doc):s;if(!an.isMap(i))throw new Error("Merge sources must be maps or map aliases");let n=i.toJSON(null,t,Map);for(let[r,o]of n)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}Gr.addMergeToJSMap=Mh;Gr.isMergeKey=Kw;Gr.merge=zr});var Lu=k(Uh=>{"use strict";var Yw=Nu(),jh=Kr(),Jw=rn(),qh=W(),Ou=Ot();function Hw(t,e,{key:s,value:i}){if(qh.isNode(s)&&s.addToJSMap)s.addToJSMap(t,e,i);else if(jh.isMergeKey(t,s))jh.addMergeToJSMap(t,e,i);else{let n=Ou.toJS(s,"",t);if(e instanceof Map)e.set(n,Ou.toJS(i,n,t));else if(e instanceof Set)e.add(n);else{let r=Zw(s,n,t),o=Ou.toJS(i,r,t);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Zw(t,e,s){if(e===null)return"";if(typeof e!="object")return String(e);if(qh.isNode(t)&&s?.doc){let i=Jw.createStringifyContext(s.doc,{});i.anchors=new Set;for(let r of s.anchors.keys())i.anchors.add(r.anchor);i.inFlow=!0,i.inStringifyKey=!0;let n=t.toString(i);if(!s.mapKeyWarned){let r=JSON.stringify(n);r.length>40&&(r=r.substring(0,36)+'..."'),Yw.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 n}return JSON.stringify(e)}Uh.addPairToJSMap=Hw});var qt=k(Mu=>{"use strict";var Vh=Xi(),Qw=Ph(),Xw=Lu(),Yr=W();function eb(t,e,s){let i=Vh.createNode(t,void 0,s),n=Vh.createNode(e,void 0,s);return new Jr(i,n)}var Jr=class t{constructor(e,s=null){Object.defineProperty(this,Yr.NODE_TYPE,{value:Yr.PAIR}),this.key=e,this.value=s}clone(e){let{key:s,value:i}=this;return Yr.isNode(s)&&(s=s.clone(e)),Yr.isNode(i)&&(i=i.clone(e)),new t(s,i)}toJSON(e,s){let i=s?.mapAsMap?new Map:{};return Xw.addPairToJSMap(s,i,this)}toString(e,s,i){return e?.doc?Qw.stringifyPair(this,e,s,i):JSON.stringify(this)}};Mu.Pair=Jr;Mu.createPair=eb});var ju=k(zh=>{"use strict";var Cs=W(),Wh=rn(),Hr=en();function tb(t,e,s){return(e.inFlow??t.flow?ib:sb)(t,e,s)}function sb({comment:t,items:e},s,{blockItemPrefix:i,flowChars:n,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 m=0;m<e.length;++m){let D=e[m],g=null;if(Cs.isNode(D))!f&&D.spaceBefore&&d.push(""),Zr(s,d,D.commentBefore,f),D.comment&&(g=D.comment);else if(Cs.isPair(D)){let y=Cs.isNode(D.key)?D.key:null;y&&(!f&&y.spaceBefore&&d.push(""),Zr(s,d,y.commentBefore,f))}f=!1;let F=Wh.stringify(D,c,()=>g=null,()=>f=!0);g&&(F+=Hr.lineComment(F,r,l(g))),f&&g&&(f=!1),d.push(i+F)}let p;if(d.length===0)p=n.start+n.end;else{p=d[0];for(let m=1;m<d.length;++m){let D=d[m];p+=D?`
102
102
  ${u}${D}`:`
103
- `}}return t?(d+=`
104
- `+Kr.indentComment(l(t),u),a&&a()):f&&o&&o(),d}function Ub({items:t},e,{flowChars:s,itemIndent:i}){let{indent:n,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;i+=r;let u=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,c=0,f=[];for(let m=0;m<t.length;++m){let D=t[m],g=null;if(Fs.isNode(D))D.spaceBefore&&f.push(""),Yr(e,f,D.commentBefore,!1),D.comment&&(g=D.comment);else if(Fs.isPair(D)){let y=Fs.isNode(D.key)?D.key:null;y&&(y.spaceBefore&&f.push(""),Yr(e,f,y.commentBefore,!1),y.comment&&(l=!0));let C=Fs.isNode(D.value)?D.value:null;C?(C.comment&&(g=C.comment),C.commentBefore&&(l=!0)):D.value==null&&y?.comment&&(g=y.comment)}g&&(l=!0);let F=Ld.stringify(D,u,()=>g=null);m<t.length-1&&(F+=","),g&&(F+=Kr.lineComment(F,i,a(g))),!l&&(f.length>c||F.includes(`
105
- `))&&(l=!0),f.push(F),c=f.length}let{start:h,end:d}=s;if(f.length===0)return h+d;if(!l){let m=f.reduce((D,g)=>D+g.length+2,2);l=e.options.lineWidth>0&&m>e.options.lineWidth}if(l){let m=h;for(let D of f)m+=D?`
103
+ `}}return t?(p+=`
104
+ `+Hr.indentComment(l(t),u),a&&a()):f&&o&&o(),p}function ib({items:t},e,{flowChars:s,itemIndent:i}){let{indent:n,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;i+=r;let u=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,c=0,f=[];for(let m=0;m<t.length;++m){let D=t[m],g=null;if(Cs.isNode(D))D.spaceBefore&&f.push(""),Zr(e,f,D.commentBefore,!1),D.comment&&(g=D.comment);else if(Cs.isPair(D)){let y=Cs.isNode(D.key)?D.key:null;y&&(y.spaceBefore&&f.push(""),Zr(e,f,y.commentBefore,!1),y.comment&&(l=!0));let C=Cs.isNode(D.value)?D.value:null;C?(C.comment&&(g=C.comment),C.commentBefore&&(l=!0)):D.value==null&&y?.comment&&(g=y.comment)}g&&(l=!0);let F=Wh.stringify(D,u,()=>g=null);m<t.length-1&&(F+=","),g&&(F+=Hr.lineComment(F,i,a(g))),!l&&(f.length>c||F.includes(`
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 m=f.reduce((D,g)=>D+g.length+2,2);l=e.options.lineWidth>0&&m>e.options.lineWidth}if(l){let m=d;for(let D of f)m+=D?`
106
106
  ${r}${n}${D}`:`
107
107
  `;return`${m}
108
- ${n}${d}`}else return`${h}${o}${f.join(" ")}${o}${d}`}function Yr({indent:t,options:{commentString:e}},s,i,n){if(i&&n&&(i=i.replace(/^\n+/,"")),i){let r=Kr.indentComment(e(i),t);s.push(r.trimStart())}}Md.stringifyCollection=jb});var Ut=k(Lu=>{"use strict";var Vb=Pu(),Wb=Ru(),zb=Nr(),qt=W(),Jr=jt(),Gb=ee();function on(t,e){let s=qt.isScalar(e)?e.value:e;for(let i of t)if(qt.isPair(i)&&(i.key===e||i.key===s||qt.isScalar(i.key)&&i.key.value===s))return i}var Ou=class extends zb.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(qt.MAP,e),this.items=[]}static from(e,s,i){let{keepUndefined:n,replacer:r}=i,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||n)&&o.items.push(Jr.createPair(u,l,i))};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 i;qt.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new Jr.Pair(e,e?.value):i=new Jr.Pair(e.key,e.value);let n=on(this.items,i.key),r=this.schema?.sortMapEntries;if(n){if(!s)throw new Error(`Key ${i.key} already set`);qt.isScalar(n.value)&&Gb.isScalarValue(i.value)?n.value.value=i.value:n.value=i.value}else if(r){let o=this.items.findIndex(a=>r(i,a)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let s=on(this.items,e);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(e,s){let n=on(this.items,e)?.value;return(!s&&qt.isScalar(n)?n.value:n)??void 0}has(e){return!!on(this.items,e)}set(e,s){this.add(new Jr.Pair(e,s),!0)}toJSON(e,s,i){let n=i?new i:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(n);for(let r of this.items)Wb.addPairToJSMap(s,n,r);return n}toString(e,s,i){if(!e)return JSON.stringify(this);for(let n of this.items)if(!qt.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Vb.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:s})}};Lu.YAMLMap=Ou;Lu.findPair=on});var ti=k(qd=>{"use strict";var Kb=W(),jd=Ut(),Yb={collection:"map",default:!0,nodeClass:jd.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Kb.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,s)=>jd.YAMLMap.from(t,e,s)};qd.map=Yb});var Vt=k(Ud=>{"use strict";var Jb=Zi(),Hb=Pu(),Zb=Nr(),Zr=W(),Qb=ee(),Xb=Pt(),Mu=class extends Zb.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Zr.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let s=Hr(e);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(e,s){let i=Hr(e);if(typeof i!="number")return;let n=this.items[i];return!s&&Zr.isScalar(n)?n.value:n}has(e){let s=Hr(e);return typeof s=="number"&&s<this.items.length}set(e,s){let i=Hr(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[i];Zr.isScalar(n)&&Qb.isScalarValue(s)?n.value=s:this.items[i]=s}toJSON(e,s){let i=[];s?.onCreate&&s.onCreate(i);let n=0;for(let r of this.items)i.push(Xb.toJS(r,String(n++),s));return i}toString(e,s,i){return e?Hb.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:s}):JSON.stringify(this)}static from(e,s,i){let{replacer:n}=i,r=new this(e);if(s&&Symbol.iterator in Object(s)){let o=0;for(let a of s){if(typeof n=="function"){let u=s instanceof Set?a:String(o++);a=n.call(s,u,a)}r.items.push(Jb.createNode(a,void 0,i))}}return r}};function Hr(t){let e=Zr.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Ud.YAMLSeq=Mu});var si=k(Wd=>{"use strict";var ew=W(),Vd=Vt(),tw={collection:"seq",default:!0,nodeClass:Vd.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return ew.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,s)=>Vd.YAMLSeq.from(t,e,s)};Wd.seq=tw});var an=k(zd=>{"use strict";var sw=tn(),iw={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,s,i){return e=Object.assign({actualString:!0},e),sw.stringifyString(t,e,s,i)}};zd.string=iw});var Qr=k(Yd=>{"use strict";var Gd=ee(),Kd={identify:t=>t==null,createNode:()=>new Gd.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Gd.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Kd.test.test(t)?t:e.options.nullStr};Yd.nullTag=Kd});var ju=k(Hd=>{"use strict";var nw=ee(),Jd={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new nw.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},s){if(t&&Jd.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?s.options.trueStr:s.options.falseStr}};Hd.boolTag=Jd});var ii=k(Zd=>{"use strict";function rw({format:t,minFractionDigits:e,tag:s,value:i}){if(typeof i=="bigint")return String(i);let n=typeof i=="number"?i:Number(i);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let r=Object.is(i,-0)?"-0":JSON.stringify(i);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}Zd.stringifyNumber=rw});var Uu=k(Xr=>{"use strict";var ow=ee(),qu=ii(),aw={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:qu.stringifyNumber},uw={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():qu.stringifyNumber(t)}},lw={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 ow.Scalar(parseFloat(t)),s=t.indexOf(".");return s!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-s-1),e},stringify:qu.stringifyNumber};Xr.float=lw;Xr.floatExp=uw;Xr.floatNaN=aw});var Wu=k(to=>{"use strict";var Qd=ii(),eo=t=>typeof t=="bigint"||Number.isInteger(t),Vu=(t,e,s,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),s);function Xd(t,e,s){let{value:i}=t;return eo(i)&&i>=0?s+i.toString(e):Qd.stringifyNumber(t)}var cw={identify:t=>eo(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,s)=>Vu(t,2,8,s),stringify:t=>Xd(t,8,"0o")},fw={identify:eo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,s)=>Vu(t,0,10,s),stringify:Qd.stringifyNumber},hw={identify:t=>eo(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,s)=>Vu(t,2,16,s),stringify:t=>Xd(t,16,"0x")};to.int=fw;to.intHex=hw;to.intOct=cw});var tp=k(ep=>{"use strict";var dw=ti(),pw=Qr(),Dw=si(),mw=an(),gw=ju(),zu=Uu(),Gu=Wu(),yw=[dw.map,Dw.seq,mw.string,pw.nullTag,gw.boolTag,Gu.intOct,Gu.int,Gu.intHex,zu.floatNaN,zu.floatExp,zu.float];ep.schema=yw});var np=k(ip=>{"use strict";var Fw=ee(),Cw=ti(),Ew=si();function sp(t){return typeof t=="bigint"||Number.isInteger(t)}var so=({value:t})=>JSON.stringify(t),bw=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:so},{identify:t=>t==null,createNode:()=>new Fw.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:so},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:so},{identify:sp,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})=>sp(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:so}],ww={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},vw=[Cw.map,Ew.seq].concat(bw,ww);ip.schema=vw});var Yu=k(rp=>{"use strict";var un=require("buffer"),Ku=ee(),xw=tn(),Sw={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof un.Buffer=="function")return un.Buffer.from(t,"base64");if(typeof atob=="function"){let s=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(s.length);for(let n=0;n<s.length;++n)i[n]=s.charCodeAt(n);return i}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},i,n,r){if(!s)return"";let o=s,a;if(typeof un.Buffer=="function")a=o instanceof un.Buffer?o.toString("base64"):un.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=Ku.Scalar.BLOCK_LITERAL),e!==Ku.Scalar.QUOTE_DOUBLE){let u=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(a.length/u),c=new Array(l);for(let f=0,h=0;f<l;++f,h+=u)c[f]=a.substr(h,u);a=c.join(e===Ku.Scalar.BLOCK_LITERAL?`
109
- `:" ")}return xw.stringifyString({comment:t,type:e,value:a},i,n,r)}};rp.binary=Sw});var ro=k(no=>{"use strict";var io=W(),Ju=jt(),Aw=ee(),kw=Vt();function op(t,e){if(io.isSeq(t))for(let s=0;s<t.items.length;++s){let i=t.items[s];if(!io.isPair(i)){if(io.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let n=i.items[0]||new Ju.Pair(new Aw.Scalar(null));if(i.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${i.commentBefore}
108
+ ${n}${p}`}else return`${d}${o}${f.join(" ")}${o}${p}`}function Zr({indent:t,options:{commentString:e}},s,i,n){if(i&&n&&(i=i.replace(/^\n+/,"")),i){let r=Hr.indentComment(e(i),t);s.push(r.trimStart())}}zh.stringifyCollection=tb});var Vt=k(Uu=>{"use strict";var nb=ju(),rb=Lu(),ob=Lr(),Ut=W(),Qr=qt(),ab=ee();function un(t,e){let s=Ut.isScalar(e)?e.value:e;for(let i of t)if(Ut.isPair(i)&&(i.key===e||i.key===s||Ut.isScalar(i.key)&&i.key.value===s))return i}var qu=class extends ob.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ut.MAP,e),this.items=[]}static from(e,s,i){let{keepUndefined:n,replacer:r}=i,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||n)&&o.items.push(Qr.createPair(u,l,i))};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 i;Ut.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new Qr.Pair(e,e?.value):i=new Qr.Pair(e.key,e.value);let n=un(this.items,i.key),r=this.schema?.sortMapEntries;if(n){if(!s)throw new Error(`Key ${i.key} already set`);Ut.isScalar(n.value)&&ab.isScalarValue(i.value)?n.value.value=i.value:n.value=i.value}else if(r){let o=this.items.findIndex(a=>r(i,a)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let s=un(this.items,e);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(e,s){let n=un(this.items,e)?.value;return(!s&&Ut.isScalar(n)?n.value:n)??void 0}has(e){return!!un(this.items,e)}set(e,s){this.add(new Qr.Pair(e,s),!0)}toJSON(e,s,i){let n=i?new i:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(n);for(let r of this.items)rb.addPairToJSMap(s,n,r);return n}toString(e,s,i){if(!e)return JSON.stringify(this);for(let n of this.items)if(!Ut.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),nb.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:s})}};Uu.YAMLMap=qu;Uu.findPair=un});var ii=k(Kh=>{"use strict";var ub=W(),Gh=Vt(),lb={collection:"map",default:!0,nodeClass:Gh.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return ub.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,s)=>Gh.YAMLMap.from(t,e,s)};Kh.map=lb});var Wt=k(Yh=>{"use strict";var cb=Xi(),fb=ju(),db=Lr(),eo=W(),hb=ee(),pb=Ot(),Vu=class extends db.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(eo.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let s=Xr(e);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(e,s){let i=Xr(e);if(typeof i!="number")return;let n=this.items[i];return!s&&eo.isScalar(n)?n.value:n}has(e){let s=Xr(e);return typeof s=="number"&&s<this.items.length}set(e,s){let i=Xr(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[i];eo.isScalar(n)&&hb.isScalarValue(s)?n.value=s:this.items[i]=s}toJSON(e,s){let i=[];s?.onCreate&&s.onCreate(i);let n=0;for(let r of this.items)i.push(pb.toJS(r,String(n++),s));return i}toString(e,s,i){return e?fb.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:s}):JSON.stringify(this)}static from(e,s,i){let{replacer:n}=i,r=new this(e);if(s&&Symbol.iterator in Object(s)){let o=0;for(let a of s){if(typeof n=="function"){let u=s instanceof Set?a:String(o++);a=n.call(s,u,a)}r.items.push(cb.createNode(a,void 0,i))}}return r}};function Xr(t){let e=eo.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Yh.YAMLSeq=Vu});var ni=k(Hh=>{"use strict";var Db=W(),Jh=Wt(),mb={collection:"seq",default:!0,nodeClass:Jh.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Db.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,s)=>Jh.YAMLSeq.from(t,e,s)};Hh.seq=mb});var ln=k(Zh=>{"use strict";var gb=nn(),yb={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,s,i){return e=Object.assign({actualString:!0},e),gb.stringifyString(t,e,s,i)}};Zh.string=yb});var to=k(ep=>{"use strict";var Qh=ee(),Xh={identify:t=>t==null,createNode:()=>new Qh.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Qh.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Xh.test.test(t)?t:e.options.nullStr};ep.nullTag=Xh});var Wu=k(sp=>{"use strict";var Fb=ee(),tp={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Fb.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},s){if(t&&tp.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?s.options.trueStr:s.options.falseStr}};sp.boolTag=tp});var ri=k(ip=>{"use strict";function Cb({format:t,minFractionDigits:e,tag:s,value:i}){if(typeof i=="bigint")return String(i);let n=typeof i=="number"?i:Number(i);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let r=Object.is(i,-0)?"-0":JSON.stringify(i);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}ip.stringifyNumber=Cb});var Gu=k(so=>{"use strict";var Eb=ee(),zu=ri(),wb={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:zu.stringifyNumber},bb={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():zu.stringifyNumber(t)}},vb={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 Eb.Scalar(parseFloat(t)),s=t.indexOf(".");return s!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-s-1),e},stringify:zu.stringifyNumber};so.float=vb;so.floatExp=bb;so.floatNaN=wb});var Yu=k(no=>{"use strict";var np=ri(),io=t=>typeof t=="bigint"||Number.isInteger(t),Ku=(t,e,s,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),s);function rp(t,e,s){let{value:i}=t;return io(i)&&i>=0?s+i.toString(e):np.stringifyNumber(t)}var xb={identify:t=>io(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,s)=>Ku(t,2,8,s),stringify:t=>rp(t,8,"0o")},Sb={identify:io,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,s)=>Ku(t,0,10,s),stringify:np.stringifyNumber},Ab={identify:t=>io(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,s)=>Ku(t,2,16,s),stringify:t=>rp(t,16,"0x")};no.int=Sb;no.intHex=Ab;no.intOct=xb});var ap=k(op=>{"use strict";var kb=ii(),_b=to(),$b=ni(),Bb=ln(),Tb=Wu(),Ju=Gu(),Hu=Yu(),Ib=[kb.map,$b.seq,Bb.string,_b.nullTag,Tb.boolTag,Hu.intOct,Hu.int,Hu.intHex,Ju.floatNaN,Ju.floatExp,Ju.float];op.schema=Ib});var cp=k(lp=>{"use strict";var Rb=ee(),Nb=ii(),Pb=ni();function up(t){return typeof t=="bigint"||Number.isInteger(t)}var ro=({value:t})=>JSON.stringify(t),Ob=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:ro},{identify:t=>t==null,createNode:()=>new Rb.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ro},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:ro},{identify:up,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})=>up(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:ro}],Lb={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Mb=[Nb.map,Pb.seq].concat(Ob,Lb);lp.schema=Mb});var Qu=k(fp=>{"use strict";var cn=require("buffer"),Zu=ee(),jb=nn(),qb={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof cn.Buffer=="function")return cn.Buffer.from(t,"base64");if(typeof atob=="function"){let s=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(s.length);for(let n=0;n<s.length;++n)i[n]=s.charCodeAt(n);return i}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},i,n,r){if(!s)return"";let o=s,a;if(typeof cn.Buffer=="function")a=o instanceof cn.Buffer?o.toString("base64"):cn.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=Zu.Scalar.BLOCK_LITERAL),e!==Zu.Scalar.QUOTE_DOUBLE){let u=Math.max(i.options.lineWidth-i.indent.length,i.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===Zu.Scalar.BLOCK_LITERAL?`
109
+ `:" ")}return jb.stringifyString({comment:t,type:e,value:a},i,n,r)}};fp.binary=qb});var uo=k(ao=>{"use strict";var oo=W(),Xu=qt(),Ub=ee(),Vb=Wt();function dp(t,e){if(oo.isSeq(t))for(let s=0;s<t.items.length;++s){let i=t.items[s];if(!oo.isPair(i)){if(oo.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let n=i.items[0]||new Xu.Pair(new Ub.Scalar(null));if(i.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${i.commentBefore}
110
110
  ${n.key.commentBefore}`:i.commentBefore),i.comment){let r=n.value??n.key;r.comment=r.comment?`${i.comment}
111
- ${r.comment}`:i.comment}i=n}t.items[s]=io.isPair(i)?i:new Ju.Pair(i)}}else e("Expected a sequence for this tag");return t}function ap(t,e,s){let{replacer:i}=s,n=new kw.YAMLSeq(t);n.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.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;n.items.push(Ju.createPair(a,u,s))}return n}var _w={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:op,createNode:ap};no.createPairs=ap;no.pairs=_w;no.resolvePairs=op});var Qu=k(Zu=>{"use strict";var up=W(),Hu=Pt(),ln=Ut(),Bw=Vt(),lp=ro(),Cs=class t extends Bw.YAMLSeq{constructor(){super(),this.add=ln.YAMLMap.prototype.add.bind(this),this.delete=ln.YAMLMap.prototype.delete.bind(this),this.get=ln.YAMLMap.prototype.get.bind(this),this.has=ln.YAMLMap.prototype.has.bind(this),this.set=ln.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,s){if(!s)return super.toJSON(e);let i=new Map;s?.onCreate&&s.onCreate(i);for(let n of this.items){let r,o;if(up.isPair(n)?(r=Hu.toJS(n.key,"",s),o=Hu.toJS(n.value,r,s)):r=Hu.toJS(n,"",s),i.has(r))throw new Error("Ordered maps must not include duplicate keys");i.set(r,o)}return i}static from(e,s,i){let n=lp.createPairs(e,s,i),r=new this;return r.items=n.items,r}};Cs.tag="tag:yaml.org,2002:omap";var $w={collection:"seq",identify:t=>t instanceof Map,nodeClass:Cs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let s=lp.resolvePairs(t,e),i=[];for(let{key:n}of s.items)up.isScalar(n)&&(i.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):i.push(n.value));return Object.assign(new Cs,s)},createNode:(t,e,s)=>Cs.from(t,e,s)};Zu.YAMLOMap=Cs;Zu.omap=$w});var pp=k(Xu=>{"use strict";var cp=ee();function fp({value:t,source:e},s){return e&&(t?hp:dp).test.test(e)?e:t?s.options.trueStr:s.options.falseStr}var hp={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 cp.Scalar(!0),stringify:fp},dp={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 cp.Scalar(!1),stringify:fp};Xu.falseTag=dp;Xu.trueTag=hp});var Dp=k(oo=>{"use strict";var Tw=ee(),el=ii(),Iw={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:el.stringifyNumber},Rw={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():el.stringifyNumber(t)}},Nw={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 Tw.Scalar(parseFloat(t.replace(/_/g,""))),s=t.indexOf(".");if(s!==-1){let i=t.substring(s+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:el.stringifyNumber};oo.float=Nw;oo.floatExp=Rw;oo.floatNaN=Iw});var gp=k(fn=>{"use strict";var mp=ii(),cn=t=>typeof t=="bigint"||Number.isInteger(t);function ao(t,e,s,{intAsBigInt:i}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){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 n==="-"?BigInt(-1)*o:o}let r=parseInt(t,s);return n==="-"?-1*r:r}function tl(t,e,s){let{value:i}=t;if(cn(i)){let n=i.toString(e);return i<0?"-"+s+n.substr(1):s+n}return mp.stringifyNumber(t)}var Pw={identify:cn,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,s)=>ao(t,2,2,s),stringify:t=>tl(t,2,"0b")},Ow={identify:cn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,s)=>ao(t,1,8,s),stringify:t=>tl(t,8,"0")},Lw={identify:cn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,s)=>ao(t,0,10,s),stringify:mp.stringifyNumber},Mw={identify:cn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,s)=>ao(t,2,16,s),stringify:t=>tl(t,16,"0x")};fn.int=Lw;fn.intBin=Pw;fn.intHex=Mw;fn.intOct=Ow});var il=k(sl=>{"use strict";var co=W(),uo=jt(),lo=Ut(),Es=class t extends lo.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let s;co.isPair(e)?s=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?s=new uo.Pair(e.key,null):s=new uo.Pair(e,null),lo.findPair(this.items,s.key)||this.items.push(s)}get(e,s){let i=lo.findPair(this.items,e);return!s&&co.isPair(i)?co.isScalar(i.key)?i.key.value:i.key:i}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 i=lo.findPair(this.items,e);i&&!s?this.items.splice(this.items.indexOf(i),1):!i&&s&&this.items.push(new uo.Pair(e))}toJSON(e,s){return super.toJSON(e,s,Set)}toString(e,s,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),s,i);throw new Error("Set items must all have null values")}static from(e,s,i){let{replacer:n}=i,r=new this(e);if(s&&Symbol.iterator in Object(s))for(let o of s)typeof n=="function"&&(o=n.call(s,o,o)),r.items.push(uo.createPair(o,null,i));return r}};Es.tag="tag:yaml.org,2002:set";var jw={collection:"map",identify:t=>t instanceof Set,nodeClass:Es,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,s)=>Es.from(t,e,s),resolve(t,e){if(co.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Es,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};sl.YAMLSet=Es;sl.set=jw});var rl=k(fo=>{"use strict";var qw=ii();function nl(t,e){let s=t[0],i=s==="-"||s==="+"?t.substring(1):t,n=o=>e?BigInt(o):Number(o),r=i.replace(/_/g,"").split(":").reduce((o,a)=>o*n(60)+n(a),n(0));return s==="-"?n(-1)*r:r}function yp(t){let{value:e}=t,s=o=>o;if(typeof e=="bigint")s=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return qw.stringifyNumber(t);let i="";e<0&&(i="-",e*=s(-1));let n=s(60),r=[e%n];return e<60?r.unshift(0):(e=(e-r[0])/n,r.unshift(e%n),e>=60&&(e=(e-r[0])/n,r.unshift(e))),i+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Uw={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})=>nl(t,s),stringify:yp},Vw={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=>nl(t,!1),stringify:yp},Fp={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(Fp.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,i,n,r,o,a]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(s,i-1,n,r||0,o||0,a||0,u),c=e[8];if(c&&c!=="Z"){let f=nl(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$/,"")??""};fo.floatTime=Vw;fo.intTime=Uw;fo.timestamp=Fp});var bp=k(Ep=>{"use strict";var Ww=ti(),zw=Qr(),Gw=si(),Kw=an(),Yw=Yu(),Cp=pp(),ol=Dp(),ho=gp(),Jw=Wr(),Hw=Qu(),Zw=ro(),Qw=il(),al=rl(),Xw=[Ww.map,Gw.seq,Kw.string,zw.nullTag,Cp.trueTag,Cp.falseTag,ho.intBin,ho.intOct,ho.int,ho.intHex,ol.floatNaN,ol.floatExp,ol.float,Yw.binary,Jw.merge,Hw.omap,Zw.pairs,Qw.set,al.intTime,al.floatTime,al.timestamp];Ep.schema=Xw});var Tp=k(cl=>{"use strict";var Sp=ti(),e2=Qr(),Ap=si(),t2=an(),s2=ju(),ul=Uu(),ll=Wu(),i2=tp(),n2=np(),kp=Yu(),hn=Wr(),_p=Qu(),Bp=ro(),wp=bp(),$p=il(),po=rl(),vp=new Map([["core",i2.schema],["failsafe",[Sp.map,Ap.seq,t2.string]],["json",n2.schema],["yaml11",wp.schema],["yaml-1.1",wp.schema]]),xp={binary:kp.binary,bool:s2.boolTag,float:ul.float,floatExp:ul.floatExp,floatNaN:ul.floatNaN,floatTime:po.floatTime,int:ll.int,intHex:ll.intHex,intOct:ll.intOct,intTime:po.intTime,map:Sp.map,merge:hn.merge,null:e2.nullTag,omap:_p.omap,pairs:Bp.pairs,seq:Ap.seq,set:$p.set,timestamp:po.timestamp},r2={"tag:yaml.org,2002:binary":kp.binary,"tag:yaml.org,2002:merge":hn.merge,"tag:yaml.org,2002:omap":_p.omap,"tag:yaml.org,2002:pairs":Bp.pairs,"tag:yaml.org,2002:set":$p.set,"tag:yaml.org,2002:timestamp":po.timestamp};function o2(t,e,s){let i=vp.get(e);if(i&&!t)return s&&!i.includes(hn.merge)?i.concat(hn.merge):i.slice();let n=i;if(!n)if(Array.isArray(t))n=[];else{let r=Array.from(vp.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)n=n.concat(r);else typeof t=="function"&&(n=t(n.slice()));return s&&(n=n.concat(hn.merge)),n.reduce((r,o)=>{let a=typeof o=="string"?xp[o]:o;if(!a){let u=JSON.stringify(o),l=Object.keys(xp).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},[])}cl.coreKnownTags=r2;cl.getTags=o2});var dl=k(Ip=>{"use strict";var fl=W(),a2=ti(),u2=si(),l2=an(),Do=Tp(),c2=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,hl=class t{constructor({compat:e,customTags:s,merge:i,resolveKnownTags:n,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Do.getTags(e,"compat"):e?Do.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=n?Do.coreKnownTags:{},this.tags=Do.getTags(s,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,fl.MAP,{value:a2.map}),Object.defineProperty(this,fl.SCALAR,{value:l2.string}),Object.defineProperty(this,fl.SEQ,{value:u2.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?c2:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Ip.Schema=hl});var Np=k(Rp=>{"use strict";var f2=W(),pl=sn(),dn=Qi();function h2(t,e){let s=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let u=t.directives.toString(t);u?(s.push(u),i=!0):t.directives.docStart&&(i=!0)}i&&s.push("---");let n=pl.createStringifyContext(t,e),{commentString:r}=n.options;if(t.commentBefore){s.length!==1&&s.unshift("");let u=r(t.commentBefore);s.unshift(dn.indentComment(u,""))}let o=!1,a=null;if(t.contents){if(f2.isNode(t.contents)){if(t.contents.spaceBefore&&i&&s.push(""),t.contents.commentBefore){let c=r(t.contents.commentBefore);s.push(dn.indentComment(c,""))}n.forceBlockIndent=!!t.comment,a=t.contents.comment}let u=a?void 0:()=>o=!0,l=pl.stringify(t.contents,n,()=>a=null,u);a&&(l+=dn.lineComment(l,"",r(a))),(l[0]==="|"||l[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${l}`:s.push(l)}else s.push(pl.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let u=r(t.comment);u.includes(`
112
- `)?(s.push("..."),s.push(dn.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(dn.indentComment(r(u),"")))}return s.join(`
111
+ ${r.comment}`:i.comment}i=n}t.items[s]=oo.isPair(i)?i:new Xu.Pair(i)}}else e("Expected a sequence for this tag");return t}function hp(t,e,s){let{replacer:i}=s,n=new Vb.YAMLSeq(t);n.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.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;n.items.push(Xu.createPair(a,u,s))}return n}var Wb={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:dp,createNode:hp};ao.createPairs=hp;ao.pairs=Wb;ao.resolvePairs=dp});var sl=k(tl=>{"use strict";var pp=W(),el=Ot(),fn=Vt(),zb=Wt(),Dp=uo(),Es=class t extends zb.YAMLSeq{constructor(){super(),this.add=fn.YAMLMap.prototype.add.bind(this),this.delete=fn.YAMLMap.prototype.delete.bind(this),this.get=fn.YAMLMap.prototype.get.bind(this),this.has=fn.YAMLMap.prototype.has.bind(this),this.set=fn.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,s){if(!s)return super.toJSON(e);let i=new Map;s?.onCreate&&s.onCreate(i);for(let n of this.items){let r,o;if(pp.isPair(n)?(r=el.toJS(n.key,"",s),o=el.toJS(n.value,r,s)):r=el.toJS(n,"",s),i.has(r))throw new Error("Ordered maps must not include duplicate keys");i.set(r,o)}return i}static from(e,s,i){let n=Dp.createPairs(e,s,i),r=new this;return r.items=n.items,r}};Es.tag="tag:yaml.org,2002:omap";var Gb={collection:"seq",identify:t=>t instanceof Map,nodeClass:Es,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let s=Dp.resolvePairs(t,e),i=[];for(let{key:n}of s.items)pp.isScalar(n)&&(i.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):i.push(n.value));return Object.assign(new Es,s)},createNode:(t,e,s)=>Es.from(t,e,s)};tl.YAMLOMap=Es;tl.omap=Gb});var Cp=k(il=>{"use strict";var mp=ee();function gp({value:t,source:e},s){return e&&(t?yp:Fp).test.test(e)?e:t?s.options.trueStr:s.options.falseStr}var yp={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 mp.Scalar(!0),stringify:gp},Fp={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 mp.Scalar(!1),stringify:gp};il.falseTag=Fp;il.trueTag=yp});var Ep=k(lo=>{"use strict";var Kb=ee(),nl=ri(),Yb={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:nl.stringifyNumber},Jb={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():nl.stringifyNumber(t)}},Hb={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 Kb.Scalar(parseFloat(t.replace(/_/g,""))),s=t.indexOf(".");if(s!==-1){let i=t.substring(s+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:nl.stringifyNumber};lo.float=Hb;lo.floatExp=Jb;lo.floatNaN=Yb});var bp=k(hn=>{"use strict";var wp=ri(),dn=t=>typeof t=="bigint"||Number.isInteger(t);function co(t,e,s,{intAsBigInt:i}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){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 n==="-"?BigInt(-1)*o:o}let r=parseInt(t,s);return n==="-"?-1*r:r}function rl(t,e,s){let{value:i}=t;if(dn(i)){let n=i.toString(e);return i<0?"-"+s+n.substr(1):s+n}return wp.stringifyNumber(t)}var Zb={identify:dn,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,s)=>co(t,2,2,s),stringify:t=>rl(t,2,"0b")},Qb={identify:dn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,s)=>co(t,1,8,s),stringify:t=>rl(t,8,"0")},Xb={identify:dn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,s)=>co(t,0,10,s),stringify:wp.stringifyNumber},e2={identify:dn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,s)=>co(t,2,16,s),stringify:t=>rl(t,16,"0x")};hn.int=Xb;hn.intBin=Zb;hn.intHex=e2;hn.intOct=Qb});var al=k(ol=>{"use strict";var po=W(),fo=qt(),ho=Vt(),ws=class t extends ho.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let s;po.isPair(e)?s=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?s=new fo.Pair(e.key,null):s=new fo.Pair(e,null),ho.findPair(this.items,s.key)||this.items.push(s)}get(e,s){let i=ho.findPair(this.items,e);return!s&&po.isPair(i)?po.isScalar(i.key)?i.key.value:i.key:i}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 i=ho.findPair(this.items,e);i&&!s?this.items.splice(this.items.indexOf(i),1):!i&&s&&this.items.push(new fo.Pair(e))}toJSON(e,s){return super.toJSON(e,s,Set)}toString(e,s,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),s,i);throw new Error("Set items must all have null values")}static from(e,s,i){let{replacer:n}=i,r=new this(e);if(s&&Symbol.iterator in Object(s))for(let o of s)typeof n=="function"&&(o=n.call(s,o,o)),r.items.push(fo.createPair(o,null,i));return r}};ws.tag="tag:yaml.org,2002:set";var t2={collection:"map",identify:t=>t instanceof Set,nodeClass:ws,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,s)=>ws.from(t,e,s),resolve(t,e){if(po.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ws,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ol.YAMLSet=ws;ol.set=t2});var ll=k(Do=>{"use strict";var s2=ri();function ul(t,e){let s=t[0],i=s==="-"||s==="+"?t.substring(1):t,n=o=>e?BigInt(o):Number(o),r=i.replace(/_/g,"").split(":").reduce((o,a)=>o*n(60)+n(a),n(0));return s==="-"?n(-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 s2.stringifyNumber(t);let i="";e<0&&(i="-",e*=s(-1));let n=s(60),r=[e%n];return e<60?r.unshift(0):(e=(e-r[0])/n,r.unshift(e%n),e>=60&&(e=(e-r[0])/n,r.unshift(e))),i+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var i2={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})=>ul(t,s),stringify:vp},n2={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=>ul(t,!1),stringify:vp},xp={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(xp.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,i,n,r,o,a]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(s,i-1,n,r||0,o||0,a||0,u),c=e[8];if(c&&c!=="Z"){let f=ul(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$/,"")??""};Do.floatTime=n2;Do.intTime=i2;Do.timestamp=xp});var kp=k(Ap=>{"use strict";var r2=ii(),o2=to(),a2=ni(),u2=ln(),l2=Qu(),Sp=Cp(),cl=Ep(),mo=bp(),c2=Kr(),f2=sl(),d2=uo(),h2=al(),fl=ll(),p2=[r2.map,a2.seq,u2.string,o2.nullTag,Sp.trueTag,Sp.falseTag,mo.intBin,mo.intOct,mo.int,mo.intHex,cl.floatNaN,cl.floatExp,cl.float,l2.binary,c2.merge,f2.omap,d2.pairs,h2.set,fl.intTime,fl.floatTime,fl.timestamp];Ap.schema=p2});var Lp=k(pl=>{"use strict";var Tp=ii(),D2=to(),Ip=ni(),m2=ln(),g2=Wu(),dl=Gu(),hl=Yu(),y2=ap(),F2=cp(),Rp=Qu(),pn=Kr(),Np=sl(),Pp=uo(),_p=kp(),Op=al(),go=ll(),$p=new Map([["core",y2.schema],["failsafe",[Tp.map,Ip.seq,m2.string]],["json",F2.schema],["yaml11",_p.schema],["yaml-1.1",_p.schema]]),Bp={binary:Rp.binary,bool:g2.boolTag,float:dl.float,floatExp:dl.floatExp,floatNaN:dl.floatNaN,floatTime:go.floatTime,int:hl.int,intHex:hl.intHex,intOct:hl.intOct,intTime:go.intTime,map:Tp.map,merge:pn.merge,null:D2.nullTag,omap:Np.omap,pairs:Pp.pairs,seq:Ip.seq,set:Op.set,timestamp:go.timestamp},C2={"tag:yaml.org,2002:binary":Rp.binary,"tag:yaml.org,2002:merge":pn.merge,"tag:yaml.org,2002:omap":Np.omap,"tag:yaml.org,2002:pairs":Pp.pairs,"tag:yaml.org,2002:set":Op.set,"tag:yaml.org,2002:timestamp":go.timestamp};function E2(t,e,s){let i=$p.get(e);if(i&&!t)return s&&!i.includes(pn.merge)?i.concat(pn.merge):i.slice();let n=i;if(!n)if(Array.isArray(t))n=[];else{let r=Array.from($p.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)n=n.concat(r);else typeof t=="function"&&(n=t(n.slice()));return s&&(n=n.concat(pn.merge)),n.reduce((r,o)=>{let a=typeof o=="string"?Bp[o]:o;if(!a){let u=JSON.stringify(o),l=Object.keys(Bp).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},[])}pl.coreKnownTags=C2;pl.getTags=E2});var gl=k(Mp=>{"use strict";var Dl=W(),w2=ii(),b2=ni(),v2=ln(),yo=Lp(),x2=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,ml=class t{constructor({compat:e,customTags:s,merge:i,resolveKnownTags:n,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?yo.getTags(e,"compat"):e?yo.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=n?yo.coreKnownTags:{},this.tags=yo.getTags(s,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,Dl.MAP,{value:w2.map}),Object.defineProperty(this,Dl.SCALAR,{value:v2.string}),Object.defineProperty(this,Dl.SEQ,{value:b2.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?x2:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Mp.Schema=ml});var qp=k(jp=>{"use strict";var S2=W(),yl=rn(),Dn=en();function A2(t,e){let s=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let u=t.directives.toString(t);u?(s.push(u),i=!0):t.directives.docStart&&(i=!0)}i&&s.push("---");let n=yl.createStringifyContext(t,e),{commentString:r}=n.options;if(t.commentBefore){s.length!==1&&s.unshift("");let u=r(t.commentBefore);s.unshift(Dn.indentComment(u,""))}let o=!1,a=null;if(t.contents){if(S2.isNode(t.contents)){if(t.contents.spaceBefore&&i&&s.push(""),t.contents.commentBefore){let c=r(t.contents.commentBefore);s.push(Dn.indentComment(c,""))}n.forceBlockIndent=!!t.comment,a=t.contents.comment}let u=a?void 0:()=>o=!0,l=yl.stringify(t.contents,n,()=>a=null,u);a&&(l+=Dn.lineComment(l,"",r(a))),(l[0]==="|"||l[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${l}`:s.push(l)}else s.push(yl.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let u=r(t.comment);u.includes(`
112
+ `)?(s.push("..."),s.push(Dn.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(Dn.indentComment(r(u),"")))}return s.join(`
113
113
  `)+`
114
- `}Rp.stringifyDocument=h2});var pn=k(Pp=>{"use strict";var d2=Hi(),ni=Nr(),je=W(),p2=jt(),D2=Pt(),m2=dl(),g2=Np(),Dl=$r(),y2=Fu(),F2=Zi(),ml=yu(),gl=class t{constructor(e,s,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,je.NODE_TYPE,{value:je.DOC});let n=null;typeof s=="function"||Array.isArray(s)?n=s:i===void 0&&s&&(i=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"},i);this.options=r;let{version:o}=r;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ml.Directives({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,n,i)}clone(){let e=Object.create(t.prototype,{[je.NODE_TYPE]:{value:je.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=je.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ri(this.contents)&&this.contents.add(e)}addIn(e,s){ri(this.contents)&&this.contents.addIn(e,s)}createAlias(e,s){if(!e.anchor){let i=Dl.anchorNames(this);e.anchor=!s||i.has(s)?Dl.findNewAnchor(s||"a",i):s}return new d2.Alias(e.anchor)}createNode(e,s,i){let n;if(typeof s=="function")e=s.call({"":e},"",e),n=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)),n=s}else i===void 0&&s&&(i=s,s=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:u,onTagObj:l,tag:c}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:d}=Dl.createNodeAnchors(this,o||"a"),m={aliasDuplicateObjects:r??!0,keepUndefined:u??!1,onAnchor:f,onTagObj:l,replacer:n,schema:this.schema,sourceObjects:d},D=F2.createNode(e,c,m);return a&&je.isCollection(D)&&(D.flow=!0),h(),D}createPair(e,s,i={}){let n=this.createNode(e,null,i),r=this.createNode(s,null,i);return new p2.Pair(n,r)}delete(e){return ri(this.contents)?this.contents.delete(e):!1}deleteIn(e){return ni.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):ri(this.contents)?this.contents.deleteIn(e):!1}get(e,s){return je.isCollection(this.contents)?this.contents.get(e,s):void 0}getIn(e,s){return ni.isEmptyPath(e)?!s&&je.isScalar(this.contents)?this.contents.value:this.contents:je.isCollection(this.contents)?this.contents.getIn(e,s):void 0}has(e){return je.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return ni.isEmptyPath(e)?this.contents!==void 0:je.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,s){this.contents==null?this.contents=ni.collectionFromPath(this.schema,[e],s):ri(this.contents)&&this.contents.set(e,s)}setIn(e,s){ni.isEmptyPath(e)?this.contents=s:this.contents==null?this.contents=ni.collectionFromPath(this.schema,Array.from(e),s):ri(this.contents)&&this.contents.setIn(e,s)}setSchema(e,s={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ml.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ml.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(i)this.schema=new m2.Schema(Object.assign(i,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:s,mapAsMap:i,maxAliasCount:n,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},u=D2.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"?y2.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 g2.stringifyDocument(this,e)}};function ri(t){if(je.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Pp.Document=gl});var gn=k(mn=>{"use strict";var Dn=class extends Error{constructor(e,s,i,n){super(),this.name=e,this.code=i,this.message=n,this.pos=s}},yl=class extends Dn{constructor(e,s,i){super("YAMLParseError",e,s,i)}},Fl=class extends Dn{constructor(e,s,i){super("YAMLWarning",e,s,i)}},C2=(t,e)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(a=>e.linePos(a));let{line:i,col:n}=s.linePos[0];s.message+=` at line ${i}, column ${n}`;let r=n-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).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"),i>1&&/^ *$/.test(o.substring(0,r))){let a=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
114
+ `}jp.stringifyDocument=A2});var mn=k(Up=>{"use strict";var k2=Qi(),oi=Lr(),je=W(),_2=qt(),$2=Ot(),B2=gl(),T2=qp(),Fl=Rr(),I2=bu(),R2=Xi(),Cl=wu(),El=class t{constructor(e,s,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,je.NODE_TYPE,{value:je.DOC});let n=null;typeof s=="function"||Array.isArray(s)?n=s:i===void 0&&s&&(i=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"},i);this.options=r;let{version:o}=r;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Cl.Directives({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,n,i)}clone(){let e=Object.create(t.prototype,{[je.NODE_TYPE]:{value:je.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=je.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ai(this.contents)&&this.contents.add(e)}addIn(e,s){ai(this.contents)&&this.contents.addIn(e,s)}createAlias(e,s){if(!e.anchor){let i=Fl.anchorNames(this);e.anchor=!s||i.has(s)?Fl.findNewAnchor(s||"a",i):s}return new k2.Alias(e.anchor)}createNode(e,s,i){let n;if(typeof s=="function")e=s.call({"":e},"",e),n=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)),n=s}else i===void 0&&s&&(i=s,s=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:u,onTagObj:l,tag:c}=i??{},{onAnchor:f,setAnchors:d,sourceObjects:p}=Fl.createNodeAnchors(this,o||"a"),m={aliasDuplicateObjects:r??!0,keepUndefined:u??!1,onAnchor:f,onTagObj:l,replacer:n,schema:this.schema,sourceObjects:p},D=R2.createNode(e,c,m);return a&&je.isCollection(D)&&(D.flow=!0),d(),D}createPair(e,s,i={}){let n=this.createNode(e,null,i),r=this.createNode(s,null,i);return new _2.Pair(n,r)}delete(e){return ai(this.contents)?this.contents.delete(e):!1}deleteIn(e){return oi.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):ai(this.contents)?this.contents.deleteIn(e):!1}get(e,s){return je.isCollection(this.contents)?this.contents.get(e,s):void 0}getIn(e,s){return oi.isEmptyPath(e)?!s&&je.isScalar(this.contents)?this.contents.value:this.contents:je.isCollection(this.contents)?this.contents.getIn(e,s):void 0}has(e){return je.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return oi.isEmptyPath(e)?this.contents!==void 0:je.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,s){this.contents==null?this.contents=oi.collectionFromPath(this.schema,[e],s):ai(this.contents)&&this.contents.set(e,s)}setIn(e,s){oi.isEmptyPath(e)?this.contents=s:this.contents==null?this.contents=oi.collectionFromPath(this.schema,Array.from(e),s):ai(this.contents)&&this.contents.setIn(e,s)}setSchema(e,s={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Cl.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Cl.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(i)this.schema=new B2.Schema(Object.assign(i,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:s,mapAsMap:i,maxAliasCount:n,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},u=$2.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"?I2.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 T2.stringifyDocument(this,e)}};function ai(t){if(je.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Up.Document=El});var Fn=k(yn=>{"use strict";var gn=class extends Error{constructor(e,s,i,n){super(),this.name=e,this.code=i,this.message=n,this.pos=s}},wl=class extends gn{constructor(e,s,i){super("YAMLParseError",e,s,i)}},bl=class extends gn{constructor(e,s,i){super("YAMLWarning",e,s,i)}},N2=(t,e)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(a=>e.linePos(a));let{line:i,col:n}=s.linePos[0];s.message+=` at line ${i}, column ${n}`;let r=n-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).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"),i>1&&/^ *$/.test(o.substring(0,r))){let a=t.substring(e.lineStarts[i-2],e.lineStarts[i-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===i&&u.col>n&&(a=Math.max(1,Math.min(u.col-n,80-r)));let l=" ".repeat(r)+"^".repeat(a);s.message+=`:
116
116
 
117
117
  ${o}
118
118
  ${l}
119
- `}};mn.YAMLError=Dn;mn.YAMLParseError=yl;mn.YAMLWarning=Fl;mn.prettifyError=C2});var yn=k(Op=>{"use strict";function E2(t,{flow:e,indicator:s,next:i,offset:n,onError:r,parentIndent:o,startOnNewline:a}){let u=!1,l=a,c=a,f="",h="",d=!1,m=!1,D=null,g=null,F=null,y=null,C=null,E=null,v=null;for(let b of t)switch(m&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&r(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),D&&(l&&b.type!=="comment"&&b.type!=="newline"&&r(D,"TAB_AS_INDENT","Tabs are not allowed as indentation"),D=null),b.type){case"space":!e&&(s!=="doc-start"||i?.type!=="flow-collection")&&b.source.includes(" ")&&(D=b),c=!0;break;case"comment":{c||r(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let R=b.source.substring(1)||" ";f?f+=h+R:f=R,h="",l=!1;break}case"newline":l?f?f+=b.source:(!E||s!=="seq-item-ind")&&(u=!0):h+=b.source,l=!0,d=!0,(g||F)&&(y=b),c=!0;break;case"anchor":g&&r(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&r(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=b,v??(v=b.offset),l=!1,c=!1,m=!0;break;case"tag":{F&&r(b,"MULTIPLE_TAGS","A node can have at most one tag"),F=b,v??(v=b.offset),l=!1,c=!1,m=!0;break}case s:(g||F)&&r(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),E&&r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),E=b,l=s==="seq-item-ind"||s==="explicit-key-ind",c=!1;break;case"comma":if(e){C&&r(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),C=b,l=!1,c=!1;break}default:r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),l=!1,c=!1}let S=t[t.length-1],T=S?S.offset+S.source.length:n;return m&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&r(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),D&&(l&&D.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&r(D,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:C,found:E,spaceBefore:u,comment:f,hasNewline:d,anchor:g,tag:F,newlineAfterProp:y,end:T,start:v??T}}Op.resolveProps=E2});var mo=k(Lp=>{"use strict";function Cl(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(Cl(e.key)||Cl(e.value))return!0}return!1;default:return!0}}Lp.containsNewline=Cl});var El=k(Mp=>{"use strict";var b2=mo();function w2(t,e,s){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&b2.containsNewline(e)&&s(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Mp.flowIndentCheck=w2});var bl=k(qp=>{"use strict";var jp=W();function v2(t,e,s){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let n=typeof i=="function"?i:(r,o)=>r===o||jp.isScalar(r)&&jp.isScalar(o)&&r.value===o.value;return e.some(r=>n(r.key,s))}qp.mapIncludes=v2});var Kp=k(Gp=>{"use strict";var Up=jt(),x2=Ut(),Vp=yn(),S2=mo(),Wp=El(),A2=bl(),zp="All mapping items must start at the same column";function k2({composeNode:t,composeEmptyNode:e},s,i,n,r){let o=r?.nodeClass??x2.YAMLMap,a=new o(s.schema);s.atRoot&&(s.atRoot=!1);let u=i.offset,l=null;for(let c of i.items){let{start:f,key:h,sep:d,value:m}=c,D=Vp.resolveProps(f,{indicator:"explicit-key-ind",next:h??d?.[0],offset:u,onError:n,parentIndent:i.indent,startOnNewline:!0}),g=!D.found;if(g){if(h&&(h.type==="block-seq"?n(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==i.indent&&n(u,"BAD_INDENT",zp)),!D.anchor&&!D.tag&&!d){l=D.end,D.comment&&(a.comment?a.comment+=`
121
- `+D.comment:a.comment=D.comment);continue}(D.newlineAfterProp||S2.containsNewline(h))&&n(h??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else D.found?.indent!==i.indent&&n(u,"BAD_INDENT",zp);s.atKey=!0;let F=D.end,y=h?t(s,h,D,n):e(s,F,f,null,D,n);s.schema.compat&&Wp.flowIndentCheck(i.indent,h,n),s.atKey=!1,A2.mapIncludes(s,a.items,y)&&n(F,"DUPLICATE_KEY","Map keys must be unique");let C=Vp.resolveProps(d??[],{indicator:"map-value-ind",next:m,offset:y.range[2],onError:n,parentIndent:i.indent,startOnNewline:!h||h.type==="block-scalar"});if(u=C.end,C.found){g&&(m?.type==="block-map"&&!C.hasNewline&&n(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&D.start<C.found.offset-1024&&n(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let E=m?t(s,m,C,n):e(s,u,d,null,C,n);s.schema.compat&&Wp.flowIndentCheck(i.indent,m,n),u=E.range[2];let v=new Up.Pair(y,E);s.options.keepSourceTokens&&(v.srcToken=c),a.items.push(v)}else{g&&n(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 E=new Up.Pair(y);s.options.keepSourceTokens&&(E.srcToken=c),a.items.push(E)}}return l&&l<u&&n(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,u,l??u],a}Gp.resolveBlockMap=k2});var Jp=k(Yp=>{"use strict";var _2=Vt(),B2=yn(),$2=El();function T2({composeNode:t,composeEmptyNode:e},s,i,n,r){let o=r?.nodeClass??_2.YAMLSeq,a=new o(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let u=i.offset,l=null;for(let{start:c,value:f}of i.items){let h=B2.resolveProps(c,{indicator:"seq-item-ind",next:f,offset:u,onError:n,parentIndent:i.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||f)f?.type==="block-seq"?n(h.end,"BAD_INDENT","All sequence items must start at the same column"):n(u,"MISSING_CHAR","Sequence item without - indicator");else{l=h.end,h.comment&&(a.comment=h.comment);continue}let d=f?t(s,f,h,n):e(s,h.end,c,null,h,n);s.schema.compat&&$2.flowIndentCheck(i.indent,f,n),u=d.range[2],a.items.push(d)}return a.range=[i.offset,u,l??u],a}Yp.resolveBlockSeq=T2});var oi=k(Hp=>{"use strict";function I2(t,e,s,i){let n="";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&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let c=u.substring(1)||" ";n?n+=o+c:n=c,o="";break}case"newline":n&&(o+=u),r=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=u.length}}return{comment:n,offset:e}}Hp.resolveEnd=I2});var eD=k(Xp=>{"use strict";var R2=W(),N2=jt(),Zp=Ut(),P2=Vt(),O2=oi(),Qp=yn(),L2=mo(),M2=bl(),wl="Block collections are not allowed within flow collections",vl=t=>t&&(t.type==="block-map"||t.type==="block-seq");function j2({composeNode:t,composeEmptyNode:e},s,i,n,r){let o=i.start.source==="{",a=o?"flow map":"flow sequence",u=r?.nodeClass??(o?Zp.YAMLMap:P2.YAMLSeq),l=new u(s.schema);l.flow=!0;let c=s.atRoot;c&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let f=i.offset+i.start.source.length;for(let g=0;g<i.items.length;++g){let F=i.items[g],{start:y,key:C,sep:E,value:v}=F,S=Qp.resolveProps(y,{flow:a,indicator:"explicit-key-ind",next:C??E?.[0],offset:f,onError:n,parentIndent:i.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!E&&!v){g===0&&S.comma?n(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):g<i.items.length-1&&n(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),S.comment&&(l.comment?l.comment+=`
123
- `+S.comment:l.comment=S.comment),f=S.end;continue}!o&&s.options.strict&&L2.containsNewline(C)&&n(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)S.comma&&n(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(S.comma||n(S.start,"MISSING_CHAR",`Missing , between ${a} items`),S.comment){let T="";e:for(let b of y)switch(b.type){case"comma":case"space":break;case"comment":T=b.source.substring(1);break e;default:break e}if(T){let b=l.items[l.items.length-1];R2.isPair(b)&&(b=b.value??b.key),b.comment?b.comment+=`
124
- `+T:b.comment=T,S.comment=S.comment.substring(T.length+1)}}if(!o&&!E&&!S.found){let T=v?t(s,v,S,n):e(s,S.end,E,null,S,n);l.items.push(T),f=T.range[2],vl(v)&&n(T.range,"BLOCK_IN_FLOW",wl)}else{s.atKey=!0;let T=S.end,b=C?t(s,C,S,n):e(s,T,y,null,S,n);vl(C)&&n(b.range,"BLOCK_IN_FLOW",wl),s.atKey=!1;let R=Qp.resolveProps(E??[],{flow:a,indicator:"map-value-ind",next:v,offset:b.range[2],onError:n,parentIndent:i.indent,startOnNewline:!1});if(R.found){if(!o&&!S.found&&s.options.strict){if(E)for(let G of E){if(G===R.found)break;if(G.type==="newline"){n(G,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}S.start<R.found.offset-1024&&n(R.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else v&&("source"in v&&v.source?.[0]===":"?n(v,"MISSING_CHAR",`Missing space after : in ${a}`):n(R.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let O=v?t(s,v,R,n):R.found?e(s,R.end,E,null,R,n):null;O?vl(v)&&n(O.range,"BLOCK_IN_FLOW",wl):R.comment&&(b.comment?b.comment+=`
125
- `+R.comment:b.comment=R.comment);let J=new N2.Pair(b,O);if(s.options.keepSourceTokens&&(J.srcToken=F),o){let G=l;M2.mapIncludes(s,G.items,b)&&n(T,"DUPLICATE_KEY","Map keys must be unique"),G.items.push(J)}else{let G=new Zp.YAMLMap(s.schema);G.flow=!0,G.items.push(J);let z=(O??b).range;G.range=[b.range[0],z[1],z[2]],l.items.push(G)}f=O?O.range[2]:R.end}}let h=o?"}":"]",[d,...m]=i.end,D=f;if(d?.source===h)D=d.offset+d.source.length;else{let g=a[0].toUpperCase()+a.substring(1),F=c?`${g} must end with a ${h}`:`${g} in block collection must be sufficiently indented and end with a ${h}`;n(f,c?"MISSING_CHAR":"BAD_INDENT",F),d&&d.source.length!==1&&m.unshift(d)}if(m.length>0){let g=O2.resolveEnd(m,D,s.options.strict,n);g.comment&&(l.comment?l.comment+=`
126
- `+g.comment:l.comment=g.comment),l.range=[i.offset,D,g.offset]}else l.range=[i.offset,D,D];return l}Xp.resolveFlowCollection=j2});var sD=k(tD=>{"use strict";var q2=W(),U2=ee(),V2=Ut(),W2=Vt(),z2=Kp(),G2=Jp(),K2=eD();function xl(t,e,s,i,n,r){let o=s.type==="block-map"?z2.resolveBlockMap(t,e,s,i,r):s.type==="block-seq"?G2.resolveBlockSeq(t,e,s,i,r):K2.resolveFlowCollection(t,e,s,i,r),a=o.constructor;return n==="!"||n===a.tagName?(o.tag=a.tagName,o):(n&&(o.tag=n),o)}function Y2(t,e,s,i,n){let r=i.tag,o=r?e.directives.tagName(r.source,h=>n(r,"TAG_RESOLVE_FAILED",h)):null;if(s.type==="block-seq"){let{anchor:h,newlineAfterProp:d}=i,m=h&&r?h.offset>r.offset?h:r:h??r;m&&(!d||d.offset<m.offset)&&n(m,"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===V2.YAMLMap.tagName&&a==="map"||o===W2.YAMLSeq.tagName&&a==="seq")return xl(t,e,s,n,o);let u=e.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!u){let h=e.schema.knownTags[o];if(h?.collection===a)e.schema.tags.push(Object.assign({},h,{default:!1})),u=h;else return h?n(r,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):n(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),xl(t,e,s,n,o)}let l=xl(t,e,s,n,o,u),c=u.resolve?.(l,h=>n(r,"TAG_RESOLVE_FAILED",h),e.options)??l,f=q2.isNode(c)?c:new U2.Scalar(c);return f.range=l.range,f.tag=o,u?.format&&(f.format=u.format),f}tD.composeCollection=Y2});var Al=k(iD=>{"use strict";var Sl=ee();function J2(t,e,s){let i=e.offset,n=H2(e,t.options.strict,s);if(!n)return{value:"",type:null,comment:"",range:[i,i,i]};let r=n.mode===">"?Sl.Scalar.BLOCK_FOLDED:Sl.Scalar.BLOCK_LITERAL,o=e.source?Z2(e.source):[],a=o.length;for(let D=o.length-1;D>=0;--D){let g=o[D][1];if(g===""||g==="\r")a=D;else break}if(a===0){let D=n.chomp==="+"&&o.length>0?`
127
- `.repeat(Math.max(1,o.length-1)):"",g=i+n.length;return e.source&&(g+=e.source.length),{value:D,type:r,comment:n.comment,range:[i,g,g]}}let u=e.indent+n.indent,l=e.offset+n.length,c=0;for(let D=0;D<a;++D){let[g,F]=o[D];if(F===""||F==="\r")n.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"),n.indent===0&&(u=g.length),c=D,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 D=o.length-1;D>=a;--D)o[D][0].length>u&&(a=D+1);let f="",h="",d=!1;for(let D=0;D<c;++D)f+=o[D][0].slice(u)+`
128
- `;for(let D=c;D<a;++D){let[g,F]=o[D];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 E=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;s(l-F.length-(y?2:1),"BAD_INDENT",E),g=""}r===Sl.Scalar.BLOCK_LITERAL?(f+=h+g.slice(u)+F,h=`
129
- `):g.length>u||F[0]===" "?(h===" "?h=`
130
- `:!d&&h===`
131
- `&&(h=`
132
-
133
- `),f+=h+g.slice(u)+F,h=`
134
- `,d=!0):F===""?h===`
119
+ `}};yn.YAMLError=gn;yn.YAMLParseError=wl;yn.YAMLWarning=bl;yn.prettifyError=N2});var Cn=k(Vp=>{"use strict";function P2(t,{flow:e,indicator:s,next:i,offset:n,onError:r,parentIndent:o,startOnNewline:a}){let u=!1,l=a,c=a,f="",d="",p=!1,m=!1,D=null,g=null,F=null,y=null,C=null,E=null,v=null;for(let w of t)switch(m&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&r(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),D&&(l&&w.type!=="comment"&&w.type!=="newline"&&r(D,"TAB_AS_INDENT","Tabs are not allowed as indentation"),D=null),w.type){case"space":!e&&(s!=="doc-start"||i?.type!=="flow-collection")&&w.source.includes(" ")&&(D=w),c=!0;break;case"comment":{c||r(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let R=w.source.substring(1)||" ";f?f+=d+R:f=R,d="",l=!1;break}case"newline":l?f?f+=w.source:(!E||s!=="seq-item-ind")&&(u=!0):d+=w.source,l=!0,p=!0,(g||F)&&(y=w),c=!0;break;case"anchor":g&&r(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&r(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=w,v??(v=w.offset),l=!1,c=!1,m=!0;break;case"tag":{F&&r(w,"MULTIPLE_TAGS","A node can have at most one tag"),F=w,v??(v=w.offset),l=!1,c=!1,m=!0;break}case s:(g||F)&&r(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),E&&r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${e??"collection"}`),E=w,l=s==="seq-item-ind"||s==="explicit-key-ind",c=!1;break;case"comma":if(e){C&&r(w,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),C=w,l=!1,c=!1;break}default:r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),l=!1,c=!1}let S=t[t.length-1],T=S?S.offset+S.source.length:n;return m&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&r(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),D&&(l&&D.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&r(D,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:C,found:E,spaceBefore:u,comment:f,hasNewline:p,anchor:g,tag:F,newlineAfterProp:y,end:T,start:v??T}}Vp.resolveProps=P2});var Fo=k(Wp=>{"use strict";function vl(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(vl(e.key)||vl(e.value))return!0}return!1;default:return!0}}Wp.containsNewline=vl});var xl=k(zp=>{"use strict";var O2=Fo();function L2(t,e,s){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&O2.containsNewline(e)&&s(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}zp.flowIndentCheck=L2});var Sl=k(Kp=>{"use strict";var Gp=W();function M2(t,e,s){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let n=typeof i=="function"?i:(r,o)=>r===o||Gp.isScalar(r)&&Gp.isScalar(o)&&r.value===o.value;return e.some(r=>n(r.key,s))}Kp.mapIncludes=M2});var Xp=k(Qp=>{"use strict";var Yp=qt(),j2=Vt(),Jp=Cn(),q2=Fo(),Hp=xl(),U2=Sl(),Zp="All mapping items must start at the same column";function V2({composeNode:t,composeEmptyNode:e},s,i,n,r){let o=r?.nodeClass??j2.YAMLMap,a=new o(s.schema);s.atRoot&&(s.atRoot=!1);let u=i.offset,l=null;for(let c of i.items){let{start:f,key:d,sep:p,value:m}=c,D=Jp.resolveProps(f,{indicator:"explicit-key-ind",next:d??p?.[0],offset:u,onError:n,parentIndent:i.indent,startOnNewline:!0}),g=!D.found;if(g){if(d&&(d.type==="block-seq"?n(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==i.indent&&n(u,"BAD_INDENT",Zp)),!D.anchor&&!D.tag&&!p){l=D.end,D.comment&&(a.comment?a.comment+=`
121
+ `+D.comment:a.comment=D.comment);continue}(D.newlineAfterProp||q2.containsNewline(d))&&n(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else D.found?.indent!==i.indent&&n(u,"BAD_INDENT",Zp);s.atKey=!0;let F=D.end,y=d?t(s,d,D,n):e(s,F,f,null,D,n);s.schema.compat&&Hp.flowIndentCheck(i.indent,d,n),s.atKey=!1,U2.mapIncludes(s,a.items,y)&&n(F,"DUPLICATE_KEY","Map keys must be unique");let C=Jp.resolveProps(p??[],{indicator:"map-value-ind",next:m,offset:y.range[2],onError:n,parentIndent:i.indent,startOnNewline:!d||d.type==="block-scalar"});if(u=C.end,C.found){g&&(m?.type==="block-map"&&!C.hasNewline&&n(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&D.start<C.found.offset-1024&&n(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let E=m?t(s,m,C,n):e(s,u,p,null,C,n);s.schema.compat&&Hp.flowIndentCheck(i.indent,m,n),u=E.range[2];let v=new Yp.Pair(y,E);s.options.keepSourceTokens&&(v.srcToken=c),a.items.push(v)}else{g&&n(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 E=new Yp.Pair(y);s.options.keepSourceTokens&&(E.srcToken=c),a.items.push(E)}}return l&&l<u&&n(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,u,l??u],a}Qp.resolveBlockMap=V2});var tD=k(eD=>{"use strict";var W2=Wt(),z2=Cn(),G2=xl();function K2({composeNode:t,composeEmptyNode:e},s,i,n,r){let o=r?.nodeClass??W2.YAMLSeq,a=new o(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let u=i.offset,l=null;for(let{start:c,value:f}of i.items){let d=z2.resolveProps(c,{indicator:"seq-item-ind",next:f,offset:u,onError:n,parentIndent:i.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?n(d.end,"BAD_INDENT","All sequence items must start at the same column"):n(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,n):e(s,d.end,c,null,d,n);s.schema.compat&&G2.flowIndentCheck(i.indent,f,n),u=p.range[2],a.items.push(p)}return a.range=[i.offset,u,l??u],a}eD.resolveBlockSeq=K2});var ui=k(sD=>{"use strict";function Y2(t,e,s,i){let n="";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&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let c=u.substring(1)||" ";n?n+=o+c:n=c,o="";break}case"newline":n&&(o+=u),r=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=u.length}}return{comment:n,offset:e}}sD.resolveEnd=Y2});var oD=k(rD=>{"use strict";var J2=W(),H2=qt(),iD=Vt(),Z2=Wt(),Q2=ui(),nD=Cn(),X2=Fo(),ev=Sl(),Al="Block collections are not allowed within flow collections",kl=t=>t&&(t.type==="block-map"||t.type==="block-seq");function tv({composeNode:t,composeEmptyNode:e},s,i,n,r){let o=i.start.source==="{",a=o?"flow map":"flow sequence",u=r?.nodeClass??(o?iD.YAMLMap:Z2.YAMLSeq),l=new u(s.schema);l.flow=!0;let c=s.atRoot;c&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let f=i.offset+i.start.source.length;for(let g=0;g<i.items.length;++g){let F=i.items[g],{start:y,key:C,sep:E,value:v}=F,S=nD.resolveProps(y,{flow:a,indicator:"explicit-key-ind",next:C??E?.[0],offset:f,onError:n,parentIndent:i.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!E&&!v){g===0&&S.comma?n(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):g<i.items.length-1&&n(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),S.comment&&(l.comment?l.comment+=`
123
+ `+S.comment:l.comment=S.comment),f=S.end;continue}!o&&s.options.strict&&X2.containsNewline(C)&&n(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)S.comma&&n(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(S.comma||n(S.start,"MISSING_CHAR",`Missing , between ${a} items`),S.comment){let T="";e:for(let w of y)switch(w.type){case"comma":case"space":break;case"comment":T=w.source.substring(1);break e;default:break e}if(T){let w=l.items[l.items.length-1];J2.isPair(w)&&(w=w.value??w.key),w.comment?w.comment+=`
124
+ `+T:w.comment=T,S.comment=S.comment.substring(T.length+1)}}if(!o&&!E&&!S.found){let T=v?t(s,v,S,n):e(s,S.end,E,null,S,n);l.items.push(T),f=T.range[2],kl(v)&&n(T.range,"BLOCK_IN_FLOW",Al)}else{s.atKey=!0;let T=S.end,w=C?t(s,C,S,n):e(s,T,y,null,S,n);kl(C)&&n(w.range,"BLOCK_IN_FLOW",Al),s.atKey=!1;let R=nD.resolveProps(E??[],{flow:a,indicator:"map-value-ind",next:v,offset:w.range[2],onError:n,parentIndent:i.indent,startOnNewline:!1});if(R.found){if(!o&&!S.found&&s.options.strict){if(E)for(let G of E){if(G===R.found)break;if(G.type==="newline"){n(G,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}S.start<R.found.offset-1024&&n(R.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else v&&("source"in v&&v.source?.[0]===":"?n(v,"MISSING_CHAR",`Missing space after : in ${a}`):n(R.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let O=v?t(s,v,R,n):R.found?e(s,R.end,E,null,R,n):null;O?kl(v)&&n(O.range,"BLOCK_IN_FLOW",Al):R.comment&&(w.comment?w.comment+=`
125
+ `+R.comment:w.comment=R.comment);let J=new H2.Pair(w,O);if(s.options.keepSourceTokens&&(J.srcToken=F),o){let G=l;ev.mapIncludes(s,G.items,w)&&n(T,"DUPLICATE_KEY","Map keys must be unique"),G.items.push(J)}else{let G=new iD.YAMLMap(s.schema);G.flow=!0,G.items.push(J);let z=(O??w).range;G.range=[w.range[0],z[1],z[2]],l.items.push(G)}f=O?O.range[2]:R.end}}let d=o?"}":"]",[p,...m]=i.end,D=f;if(p?.source===d)D=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}`;n(f,c?"MISSING_CHAR":"BAD_INDENT",F),p&&p.source.length!==1&&m.unshift(p)}if(m.length>0){let g=Q2.resolveEnd(m,D,s.options.strict,n);g.comment&&(l.comment?l.comment+=`
126
+ `+g.comment:l.comment=g.comment),l.range=[i.offset,D,g.offset]}else l.range=[i.offset,D,D];return l}rD.resolveFlowCollection=tv});var uD=k(aD=>{"use strict";var sv=W(),iv=ee(),nv=Vt(),rv=Wt(),ov=Xp(),av=tD(),uv=oD();function _l(t,e,s,i,n,r){let o=s.type==="block-map"?ov.resolveBlockMap(t,e,s,i,r):s.type==="block-seq"?av.resolveBlockSeq(t,e,s,i,r):uv.resolveFlowCollection(t,e,s,i,r),a=o.constructor;return n==="!"||n===a.tagName?(o.tag=a.tagName,o):(n&&(o.tag=n),o)}function lv(t,e,s,i,n){let r=i.tag,o=r?e.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null;if(s.type==="block-seq"){let{anchor:d,newlineAfterProp:p}=i,m=d&&r?d.offset>r.offset?d:r:d??r;m&&(!p||p.offset<m.offset)&&n(m,"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===nv.YAMLMap.tagName&&a==="map"||o===rv.YAMLSeq.tagName&&a==="seq")return _l(t,e,s,n,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?n(r,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):n(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),_l(t,e,s,n,o)}let l=_l(t,e,s,n,o,u),c=u.resolve?.(l,d=>n(r,"TAG_RESOLVE_FAILED",d),e.options)??l,f=sv.isNode(c)?c:new iv.Scalar(c);return f.range=l.range,f.tag=o,u?.format&&(f.format=u.format),f}aD.composeCollection=lv});var Bl=k(lD=>{"use strict";var $l=ee();function cv(t,e,s){let i=e.offset,n=fv(e,t.options.strict,s);if(!n)return{value:"",type:null,comment:"",range:[i,i,i]};let r=n.mode===">"?$l.Scalar.BLOCK_FOLDED:$l.Scalar.BLOCK_LITERAL,o=e.source?dv(e.source):[],a=o.length;for(let D=o.length-1;D>=0;--D){let g=o[D][1];if(g===""||g==="\r")a=D;else break}if(a===0){let D=n.chomp==="+"&&o.length>0?`
127
+ `.repeat(Math.max(1,o.length-1)):"",g=i+n.length;return e.source&&(g+=e.source.length),{value:D,type:r,comment:n.comment,range:[i,g,g]}}let u=e.indent+n.indent,l=e.offset+n.length,c=0;for(let D=0;D<a;++D){let[g,F]=o[D];if(F===""||F==="\r")n.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"),n.indent===0&&(u=g.length),c=D,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 D=o.length-1;D>=a;--D)o[D][0].length>u&&(a=D+1);let f="",d="",p=!1;for(let D=0;D<c;++D)f+=o[D][0].slice(u)+`
128
+ `;for(let D=c;D<a;++D){let[g,F]=o[D];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 E=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;s(l-F.length-(y?2:1),"BAD_INDENT",E),g=""}r===$l.Scalar.BLOCK_LITERAL?(f+=d+g.slice(u)+F,d=`
129
+ `):g.length>u||F[0]===" "?(d===" "?d=`
130
+ `:!p&&d===`
131
+ `&&(d=`
132
+
133
+ `),f+=d+g.slice(u)+F,d=`
134
+ `,p=!0):F===""?d===`
135
135
  `?f+=`
136
- `:h=`
137
- `:(f+=h+F,h=" ",d=!1)}switch(n.chomp){case"-":break;case"+":for(let D=a;D<o.length;++D)f+=`
136
+ `:d=`
137
+ `:(f+=d+F,d=" ",p=!1)}switch(n.chomp){case"-":break;case"+":for(let D=a;D<o.length;++D)f+=`
138
138
  `+o[D][0].slice(u);f[f.length-1]!==`
139
139
  `&&(f+=`
140
140
  `);break;default:f+=`
141
- `}let m=i+n.length+e.source.length;return{value:f,type:r,comment:n.comment,range:[i,m,m]}}function H2({offset:t,props:e},s,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:n}=e[0],r=n[0],o=0,a="",u=-1;for(let h=1;h<n.length;++h){let d=n[h];if(!a&&(d==="-"||d==="+"))a=d;else{let m=Number(d);!o&&m?o=m:u===-1&&(u=t+h)}}u!==-1&&i(u,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let l=!1,c="",f=n.length;for(let h=1;h<e.length;++h){let d=e[h];switch(d.type){case"space":l=!0;case"newline":f+=d.source.length;break;case"comment":s&&!l&&i(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=d.source.length,c=d.source.substring(1);break;case"error":i(d,"UNEXPECTED_TOKEN",d.message),f+=d.source.length;break;default:{let m=`Unexpected token in block scalar header: ${d.type}`;i(d,"UNEXPECTED_TOKEN",m);let D=d.source;D&&typeof D=="string"&&(f+=D.length)}}}return{mode:r,indent:o,chomp:a,comment:c,length:f}}function Z2(t){let e=t.split(/\n( *)/),s=e[0],i=s.match(/^( *)/),r=[i?.[1]?[i[1],s.slice(i[1].length)]:["",s]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}iD.resolveBlockScalar=J2});var _l=k(rD=>{"use strict";var kl=ee(),Q2=oi();function X2(t,e,s){let{offset:i,type:n,source:r,end:o}=t,a,u,l=(h,d,m)=>s(i+h,d,m);switch(n){case"scalar":a=kl.Scalar.PLAIN,u=ev(r,l);break;case"single-quoted-scalar":a=kl.Scalar.QUOTE_SINGLE,u=tv(r,l);break;case"double-quoted-scalar":a=kl.Scalar.QUOTE_DOUBLE,u=sv(r,l);break;default:return s(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[i,i+r.length,i+r.length]}}let c=i+r.length,f=Q2.resolveEnd(o,c,e,s);return{value:u,type:a,comment:f.comment,range:[i,c,f.offset]}}function ev(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}`),nD(t)}function tv(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),nD(t.slice(1,-1)).replace(/''/g,"'")}function nD(t){let e,s;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
141
+ `}let m=i+n.length+e.source.length;return{value:f,type:r,comment:n.comment,range:[i,m,m]}}function fv({offset:t,props:e},s,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:n}=e[0],r=n[0],o=0,a="",u=-1;for(let d=1;d<n.length;++d){let p=n[d];if(!a&&(p==="-"||p==="+"))a=p;else{let m=Number(p);!o&&m?o=m:u===-1&&(u=t+d)}}u!==-1&&i(u,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let l=!1,c="",f=n.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&&i(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":i(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{let m=`Unexpected token in block scalar header: ${p.type}`;i(p,"UNEXPECTED_TOKEN",m);let D=p.source;D&&typeof D=="string"&&(f+=D.length)}}}return{mode:r,indent:o,chomp:a,comment:c,length:f}}function dv(t){let e=t.split(/\n( *)/),s=e[0],i=s.match(/^( *)/),r=[i?.[1]?[i[1],s.slice(i[1].length)]:["",s]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}lD.resolveBlockScalar=cv});var Il=k(fD=>{"use strict";var Tl=ee(),hv=ui();function pv(t,e,s){let{offset:i,type:n,source:r,end:o}=t,a,u,l=(d,p,m)=>s(i+d,p,m);switch(n){case"scalar":a=Tl.Scalar.PLAIN,u=Dv(r,l);break;case"single-quoted-scalar":a=Tl.Scalar.QUOTE_SINGLE,u=mv(r,l);break;case"double-quoted-scalar":a=Tl.Scalar.QUOTE_DOUBLE,u=gv(r,l);break;default:return s(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[i,i+r.length,i+r.length]}}let c=i+r.length,f=hv.resolveEnd(o,c,e,s);return{value:u,type:a,comment:f.comment,range:[i,c,f.offset]}}function Dv(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}`),cD(t)}function mv(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),cD(t.slice(1,-1)).replace(/''/g,"'")}function cD(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 i=e.exec(t);if(!i)return t;let n=i[1],r=" ",o=e.lastIndex;for(s.lastIndex=o;i=s.exec(t);)i[1]===""?r===`
144
144
  `?n+=r:r=`
145
- `:(n+=r+i[1],r=" "),o=s.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,i=a.exec(t),n+r+(i?.[1]??"")}function sv(t,e){let s="";for(let i=1;i<t.length-1;++i){let n=t[i];if(!(n==="\r"&&t[i+1]===`
145
+ `:(n+=r+i[1],r=" "),o=s.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,i=a.exec(t),n+r+(i?.[1]??"")}function gv(t,e){let s="";for(let i=1;i<t.length-1;++i){let n=t[i];if(!(n==="\r"&&t[i+1]===`
146
146
  `))if(n===`
147
- `){let{fold:r,offset:o}=iv(t,i);s+=r,i=o}else if(n==="\\"){let r=t[++i],o=nv[r];if(o)s+=o;else if(r===`
147
+ `){let{fold:r,offset:o}=yv(t,i);s+=r,i=o}else if(n==="\\"){let r=t[++i],o=Fv[r];if(o)s+=o;else if(r===`
148
148
  `)for(r=t[i+1];r===" "||r===" ";)r=t[++i+1];else if(r==="\r"&&t[i+1]===`
149
- `)for(r=t[++i+1];r===" "||r===" ";)r=t[++i+1];else if(r==="x"||r==="u"||r==="U"){let a={x:2,u:4,U:8}[r];s+=rv(t,i+1,a,e),i+=a}else{let a=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),s+=a}}else if(n===" "||n===" "){let r=i,o=t[i+1];for(;o===" "||o===" ";)o=t[++i+1];o!==`
149
+ `)for(r=t[++i+1];r===" "||r===" ";)r=t[++i+1];else if(r==="x"||r==="u"||r==="U"){let a={x:2,u:4,U:8}[r];s+=Cv(t,i+1,a,e),i+=a}else{let a=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),s+=a}}else if(n===" "||n===" "){let r=i,o=t[i+1];for(;o===" "||o===" ";)o=t[++i+1];o!==`
150
150
  `&&!(o==="\r"&&t[i+2]===`
151
- `)&&(s+=i>r?t.slice(r,i+1):n)}else s+=n}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),s}function iv(t,e){let s="",i=t[e+1];for(;(i===" "||i===" "||i===`
151
+ `)&&(s+=i>r?t.slice(r,i+1):n)}else s+=n}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),s}function yv(t,e){let s="",i=t[e+1];for(;(i===" "||i===" "||i===`
152
152
  `||i==="\r")&&!(i==="\r"&&t[e+2]!==`
153
153
  `);)i===`
154
154
  `&&(s+=`
155
- `),e+=1,i=t[e+1];return s||(s=" "),{fold:s,offset:e}}var nv={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 rv(t,e,s,i){let n=t.substr(e,s),o=n.length===s&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;if(isNaN(o)){let a=t.substr(e-2,s+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}rD.resolveFlowScalar=X2});var uD=k(aD=>{"use strict";var bs=W(),oD=ee(),ov=Al(),av=_l();function uv(t,e,s,i){let{value:n,type:r,comment:o,range:a}=e.type==="block-scalar"?ov.resolveBlockScalar(t,e,i):av.resolveFlowScalar(e,t.options.strict,i),u=s?t.directives.tagName(s.source,f=>i(s,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[bs.SCALAR]:u?l=lv(t.schema,n,u,s,i):e.type==="scalar"?l=cv(t,n,e,i):l=t.schema[bs.SCALAR];let c;try{let f=l.resolve(n,h=>i(s??e,"TAG_RESOLVE_FAILED",h),t.options);c=bs.isScalar(f)?f:new oD.Scalar(f)}catch(f){let h=f instanceof Error?f.message:String(f);i(s??e,"TAG_RESOLVE_FAILED",h),c=new oD.Scalar(n)}return c.range=a,c.source=n,r&&(c.type=r),u&&(c.tag=u),l.format&&(c.format=l.format),o&&(c.comment=o),c}function lv(t,e,s,i,n){if(s==="!")return t[bs.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):(n(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),t[bs.SCALAR])}function cv({atKey:t,directives:e,schema:s},i,n,r){let o=s.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(i))||s[bs.SCALAR];if(s.compat){let a=s.compat.find(u=>u.default&&u.test?.test(i))??s[bs.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(n,"TAG_RESOLVE_FAILED",c,!0)}}return o}aD.composeScalar=uv});var cD=k(lD=>{"use strict";function fv(t,e,s){if(e){s??(s=e.length);for(let i=s-1;i>=0;--i){let n=e[i];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++i];n?.type==="space";)t+=n.source.length,n=e[++i];break}}return t}lD.emptyScalarPosition=fv});var dD=k($l=>{"use strict";var hv=Hi(),dv=W(),pv=sD(),fD=uD(),Dv=oi(),mv=cD(),gv={composeNode:hD,composeEmptyNode:Bl};function hD(t,e,s,i){let n=t.atKey,{spaceBefore:r,comment:o,anchor:a,tag:u}=s,l,c=!0;switch(e.type){case"alias":l=yv(t,e,i),(a||u)&&i(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=fD.composeScalar(t,e,u,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=pv.composeCollection(gv,t,e,s,i),a&&(l.anchor=a.source.substring(1));break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",f),l=Bl(t,e.offset,void 0,null,s,i),c=!1}}return a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!dv.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(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 Bl(t,e,s,i,{spaceBefore:n,comment:r,anchor:o,tag:a,end:u},l){let c={type:"scalar",offset:mv.emptyScalarPosition(e,s,i),indent:-1,source:""},f=fD.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")),n&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=u),f}function yv({options:t},{offset:e,source:s,end:i},n){let r=new hv.Alias(s.substring(1));r.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&n(e+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+s.length,a=Dv.resolveEnd(i,o,t.strict,n);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}$l.composeEmptyNode=Bl;$l.composeNode=hD});var mD=k(DD=>{"use strict";var Fv=pn(),pD=dD(),Cv=oi(),Ev=yn();function bv(t,e,{offset:s,start:i,value:n,end:r},o){let a=Object.assign({_directives:e},t),u=new Fv.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},c=Ev.resolveProps(i,{indicator:"doc-start",next:n??r?.[0],offset:s,onError:o,parentIndent:0,startOnNewline:!0});c.found&&(u.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!c.hasNewline&&o(c.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=n?pD.composeNode(l,n,c,o):pD.composeEmptyNode(l,c.end,i,null,c,o);let f=u.contents.range[2],h=Cv.resolveEnd(r,f,!1,o);return h.comment&&(u.comment=h.comment),u.range=[s,f,h.offset],u}DD.composeDoc=bv});var Il=k(FD=>{"use strict";var wv=require("process"),vv=yu(),xv=pn(),Fn=gn(),gD=W(),Sv=mD(),Av=oi();function Cn(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 yD(t){let e="",s=!1,i=!1;for(let n=0;n<t.length;++n){let r=t[n];switch(r[0]){case"#":e+=(e===""?"":i?`
155
+ `),e+=1,i=t[e+1];return s||(s=" "),{fold:s,offset:e}}var Fv={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 Cv(t,e,s,i){let n=t.substr(e,s),o=n.length===s&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;if(isNaN(o)){let a=t.substr(e-2,s+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}fD.resolveFlowScalar=pv});var pD=k(hD=>{"use strict";var bs=W(),dD=ee(),Ev=Bl(),wv=Il();function bv(t,e,s,i){let{value:n,type:r,comment:o,range:a}=e.type==="block-scalar"?Ev.resolveBlockScalar(t,e,i):wv.resolveFlowScalar(e,t.options.strict,i),u=s?t.directives.tagName(s.source,f=>i(s,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[bs.SCALAR]:u?l=vv(t.schema,n,u,s,i):e.type==="scalar"?l=xv(t,n,e,i):l=t.schema[bs.SCALAR];let c;try{let f=l.resolve(n,d=>i(s??e,"TAG_RESOLVE_FAILED",d),t.options);c=bs.isScalar(f)?f:new dD.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);i(s??e,"TAG_RESOLVE_FAILED",d),c=new dD.Scalar(n)}return c.range=a,c.source=n,r&&(c.type=r),u&&(c.tag=u),l.format&&(c.format=l.format),o&&(c.comment=o),c}function vv(t,e,s,i,n){if(s==="!")return t[bs.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):(n(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),t[bs.SCALAR])}function xv({atKey:t,directives:e,schema:s},i,n,r){let o=s.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(i))||s[bs.SCALAR];if(s.compat){let a=s.compat.find(u=>u.default&&u.test?.test(i))??s[bs.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(n,"TAG_RESOLVE_FAILED",c,!0)}}return o}hD.composeScalar=bv});var mD=k(DD=>{"use strict";function Sv(t,e,s){if(e){s??(s=e.length);for(let i=s-1;i>=0;--i){let n=e[i];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++i];n?.type==="space";)t+=n.source.length,n=e[++i];break}}return t}DD.emptyScalarPosition=Sv});var FD=k(Nl=>{"use strict";var Av=Qi(),kv=W(),_v=uD(),gD=pD(),$v=ui(),Bv=mD(),Tv={composeNode:yD,composeEmptyNode:Rl};function yD(t,e,s,i){let n=t.atKey,{spaceBefore:r,comment:o,anchor:a,tag:u}=s,l,c=!0;switch(e.type){case"alias":l=Iv(t,e,i),(a||u)&&i(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=gD.composeScalar(t,e,u,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=_v.composeCollection(Tv,t,e,s,i),a&&(l.anchor=a.source.substring(1));break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",f),l=Rl(t,e.offset,void 0,null,s,i),c=!1}}return a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!kv.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(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 Rl(t,e,s,i,{spaceBefore:n,comment:r,anchor:o,tag:a,end:u},l){let c={type:"scalar",offset:Bv.emptyScalarPosition(e,s,i),indent:-1,source:""},f=gD.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")),n&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=u),f}function Iv({options:t},{offset:e,source:s,end:i},n){let r=new Av.Alias(s.substring(1));r.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&n(e+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+s.length,a=$v.resolveEnd(i,o,t.strict,n);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}Nl.composeEmptyNode=Rl;Nl.composeNode=yD});var wD=k(ED=>{"use strict";var Rv=mn(),CD=FD(),Nv=ui(),Pv=Cn();function Ov(t,e,{offset:s,start:i,value:n,end:r},o){let a=Object.assign({_directives:e},t),u=new Rv.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},c=Pv.resolveProps(i,{indicator:"doc-start",next:n??r?.[0],offset:s,onError:o,parentIndent:0,startOnNewline:!0});c.found&&(u.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!c.hasNewline&&o(c.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=n?CD.composeNode(l,n,c,o):CD.composeEmptyNode(l,c.end,i,null,c,o);let f=u.contents.range[2],d=Nv.resolveEnd(r,f,!1,o);return d.comment&&(u.comment=d.comment),u.range=[s,f,d.offset],u}ED.composeDoc=Ov});var Ol=k(xD=>{"use strict";var Lv=require("process"),Mv=wu(),jv=mn(),En=Fn(),bD=W(),qv=wD(),Uv=ui();function wn(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 vD(t){let e="",s=!1,i=!1;for(let n=0;n<t.length;++n){let r=t[n];switch(r[0]){case"#":e+=(e===""?"":i?`
157
157
 
158
158
  `:`
159
- `)+(r.substring(1)||" "),s=!0,i=!1;break;case"%":t[n+1]?.[0]!=="#"&&(n+=1),s=!1;break;default:s||(i=!0),s=!1}}return{comment:e,afterEmptyLine:i}}var Tl=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,i,n,r)=>{let o=Cn(s);r?this.warnings.push(new Fn.YAMLWarning(o,i,n)):this.errors.push(new Fn.YAMLParseError(o,i,n))},this.directives=new vv.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,s){let{comment:i,afterEmptyLine:n}=yD(this.prelude);if(i){let r=e.contents;if(s)e.comment=e.comment?`${e.comment}
160
- ${i}`:i;else if(n||e.directives.docStart||!r)e.commentBefore=i;else if(gD.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];gD.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${i}
159
+ `)+(r.substring(1)||" "),s=!0,i=!1;break;case"%":t[n+1]?.[0]!=="#"&&(n+=1),s=!1;break;default:s||(i=!0),s=!1}}return{comment:e,afterEmptyLine:i}}var Pl=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,i,n,r)=>{let o=wn(s);r?this.warnings.push(new En.YAMLWarning(o,i,n)):this.errors.push(new En.YAMLParseError(o,i,n))},this.directives=new Mv.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,s){let{comment:i,afterEmptyLine:n}=vD(this.prelude);if(i){let r=e.contents;if(s)e.comment=e.comment?`${e.comment}
160
+ ${i}`:i;else if(n||e.directives.docStart||!r)e.commentBefore=i;else if(bD.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];bD.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${i}
161
161
  ${a}`:i}else{let o=r.commentBefore;r.commentBefore=o?`${i}
162
- ${o}`:i}}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:yD(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,s=!1,i=-1){for(let n of e)yield*this.next(n);yield*this.end(s,i)}*next(e){switch(wv.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(s,i,n)=>{let r=Cn(e);r[0]+=s,this.onError(r,"BAD_DIRECTIVE",i,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let s=Sv.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,i=new Fn.YAMLParseError(Cn(e),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new Fn.YAMLParseError(Cn(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let s=Av.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
163
- ${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new Fn.YAMLParseError(Cn(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 i=Object.assign({_directives:this.directives},this.options),n=new xv.Document(void 0,i);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,s,s],this.decorate(n,!1),yield n}}};FD.Composer=Tl});var bD=k(go=>{"use strict";var kv=Al(),_v=_l(),Bv=gn(),CD=tn();function $v(t,e=!0,s){if(t){let i=(n,r,o)=>{let a=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(s)s(a,r,o);else throw new Bv.YAMLParseError([a,a+1],r,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return _v.resolveFlowScalar(t,e,i);case"block-scalar":return kv.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function Tv(t,e){let{implicitKey:s=!1,indent:i,inFlow:n=!1,offset:r=-1,type:o="PLAIN"}=e,a=CD.stringifyString({type:o,value:t},{implicitKey:s,indent:i>0?" ".repeat(i):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),u=e.end??[{type:"newline",offset:-1,indent:i,source:`
162
+ ${o}`:i}}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:vD(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,s=!1,i=-1){for(let n of e)yield*this.next(n);yield*this.end(s,i)}*next(e){switch(Lv.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(s,i,n)=>{let r=wn(e);r[0]+=s,this.onError(r,"BAD_DIRECTIVE",i,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let s=qv.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,i=new En.YAMLParseError(wn(e),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new En.YAMLParseError(wn(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let s=Uv.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
163
+ ${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new En.YAMLParseError(wn(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 i=Object.assign({_directives:this.directives},this.options),n=new jv.Document(void 0,i);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,s,s],this.decorate(n,!1),yield n}}};xD.Composer=Pl});var kD=k(Co=>{"use strict";var Vv=Bl(),Wv=Il(),zv=Fn(),SD=nn();function Gv(t,e=!0,s){if(t){let i=(n,r,o)=>{let a=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(s)s(a,r,o);else throw new zv.YAMLParseError([a,a+1],r,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Wv.resolveFlowScalar(t,e,i);case"block-scalar":return Vv.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function Kv(t,e){let{implicitKey:s=!1,indent:i,inFlow:n=!1,offset:r=-1,type:o="PLAIN"}=e,a=SD.stringifyString({type:o,value:t},{implicitKey:s,indent:i>0?" ".repeat(i):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),u=e.end??[{type:"newline",offset:-1,indent:i,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
- `,h=[{type:"block-scalar-header",offset:r,indent:i,source:c}];return ED(h,u)||h.push({type:"newline",offset:-1,indent:i,source:`
167
- `}),{type:"block-scalar",offset:r,indent:i,props:h,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:i,source:a,end:u};case"'":return{type:"single-quoted-scalar",offset:r,indent:i,source:a,end:u};default:return{type:"scalar",offset:r,indent:i,source:a,end:u}}}function Iv(t,e,s={}){let{afterKey:i=!1,implicitKey:n=!1,inFlow:r=!1,type:o}=s,a="indent"in t?t.indent:null;if(i&&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=CD.stringifyString({type:o,value:e},{implicitKey:n||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(u[0]){case"|":case">":Rv(t,u);break;case'"':Rl(t,u,"double-quoted-scalar");break;case"'":Rl(t,u,"single-quoted-scalar");break;default:Rl(t,u,"scalar")}}function Rv(t,e){let s=e.indexOf(`
166
+ `,d=[{type:"block-scalar-header",offset:r,indent:i,source:c}];return AD(d,u)||d.push({type:"newline",offset:-1,indent:i,source:`
167
+ `}),{type:"block-scalar",offset:r,indent:i,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:i,source:a,end:u};case"'":return{type:"single-quoted-scalar",offset:r,indent:i,source:a,end:u};default:return{type:"scalar",offset:r,indent:i,source:a,end:u}}}function Yv(t,e,s={}){let{afterKey:i=!1,implicitKey:n=!1,inFlow:r=!1,type:o}=s,a="indent"in t?t.indent:null;if(i&&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=SD.stringifyString({type:o,value:e},{implicitKey:n||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(u[0]){case"|":case">":Jv(t,u);break;case'"':Ll(t,u,"double-quoted-scalar");break;case"'":Ll(t,u,"single-quoted-scalar");break;default:Ll(t,u,"scalar")}}function Jv(t,e){let s=e.indexOf(`
168
168
  `),i=e.substring(0,s),n=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=i,t.source=n}else{let{offset:r}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:i}];ED(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:n})}}function ED(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 Rl(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 i=t.props.slice(1),n=e.length;t.props[0].type==="block-scalar-header"&&(n-=t.props[0].source.length);for(let r of i)r.offset+=n;delete t.props,Object.assign(t,{type:s,source:e,end:i});break}case"block-map":case"block-seq":{let n={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
171
- `};delete t.items,Object.assign(t,{type:s,source:e,end:[n]});break}default:{let i="indent"in t?t.indent:-1,n="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:i,source:e,end:n})}}}go.createScalarToken=Tv;go.resolveAsScalar=$v;go.setScalarValue=Iv});var vD=k(wD=>{"use strict";var Nv=t=>"type"in t?Fo(t):yo(t);function Fo(t){switch(t.type){case"block-scalar":{let e="";for(let s of t.props)e+=Fo(s);return e+t.source}case"block-map":case"block-seq":{let e="";for(let s of t.items)e+=yo(s);return e}case"flow-collection":{let e=t.start.source;for(let s of t.items)e+=yo(s);for(let s of t.end)e+=s.source;return e}case"document":{let e=yo(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 yo({start:t,key:e,sep:s,value:i}){let n="";for(let r of t)n+=r.source;if(e&&(n+=Fo(e)),s)for(let r of s)n+=r.source;return i&&(n+=Fo(i)),n}wD.stringify=Nv});var kD=k(AD=>{"use strict";var Nl=Symbol("break visit"),Pv=Symbol("skip children"),xD=Symbol("remove item");function ws(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),SD(Object.freeze([]),t,e)}ws.BREAK=Nl;ws.SKIP=Pv;ws.REMOVE=xD;ws.itemAtPath=(t,e)=>{let s=t;for(let[i,n]of e){let r=s?.[i];if(r&&"items"in r)s=r.items[n];else return}return s};ws.parentCollection=(t,e)=>{let s=ws.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],n=s?.[i];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function SD(t,e,s){let i=s(e,t);if(typeof i=="symbol")return i;for(let n of["key","value"]){let r=e[n];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=SD(Object.freeze(t.concat([[n,o]])),r.items[o],s);if(typeof a=="number")o=a-1;else{if(a===Nl)return Nl;a===xD&&(r.items.splice(o,1),o-=1)}}typeof i=="function"&&n==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}AD.visit=ws});var Co=k(Se=>{"use strict";var Pl=bD(),Ov=vD(),Lv=kD(),Ol="\uFEFF",Ll="",Ml="",jl="",Mv=t=>!!t&&"items"in t,jv=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function qv(t){switch(t){case Ol:return"<BOM>";case Ll:return"<DOC>";case Ml:return"<FLOW_END>";case jl:return"<SCALAR>";default:return JSON.stringify(t)}}function Uv(t){switch(t){case Ol:return"byte-order-mark";case Ll:return"doc-mode";case Ml:return"flow-error-end";case jl:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
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=i,t.source=n}else{let{offset:r}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:i}];AD(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:n})}}function AD(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 Ll(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 i=t.props.slice(1),n=e.length;t.props[0].type==="block-scalar-header"&&(n-=t.props[0].source.length);for(let r of i)r.offset+=n;delete t.props,Object.assign(t,{type:s,source:e,end:i});break}case"block-map":case"block-seq":{let n={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
171
+ `};delete t.items,Object.assign(t,{type:s,source:e,end:[n]});break}default:{let i="indent"in t?t.indent:-1,n="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:i,source:e,end:n})}}}Co.createScalarToken=Kv;Co.resolveAsScalar=Gv;Co.setScalarValue=Yv});var $D=k(_D=>{"use strict";var Hv=t=>"type"in t?wo(t):Eo(t);function wo(t){switch(t.type){case"block-scalar":{let e="";for(let s of t.props)e+=wo(s);return e+t.source}case"block-map":case"block-seq":{let e="";for(let s of t.items)e+=Eo(s);return e}case"flow-collection":{let e=t.start.source;for(let s of t.items)e+=Eo(s);for(let s of t.end)e+=s.source;return e}case"document":{let e=Eo(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 Eo({start:t,key:e,sep:s,value:i}){let n="";for(let r of t)n+=r.source;if(e&&(n+=wo(e)),s)for(let r of s)n+=r.source;return i&&(n+=wo(i)),n}_D.stringify=Hv});var RD=k(ID=>{"use strict";var Ml=Symbol("break visit"),Zv=Symbol("skip children"),BD=Symbol("remove item");function vs(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),TD(Object.freeze([]),t,e)}vs.BREAK=Ml;vs.SKIP=Zv;vs.REMOVE=BD;vs.itemAtPath=(t,e)=>{let s=t;for(let[i,n]of e){let r=s?.[i];if(r&&"items"in r)s=r.items[n];else return}return s};vs.parentCollection=(t,e)=>{let s=vs.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],n=s?.[i];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function TD(t,e,s){let i=s(e,t);if(typeof i=="symbol")return i;for(let n of["key","value"]){let r=e[n];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=TD(Object.freeze(t.concat([[n,o]])),r.items[o],s);if(typeof a=="number")o=a-1;else{if(a===Ml)return Ml;a===BD&&(r.items.splice(o,1),o-=1)}}typeof i=="function"&&n==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}ID.visit=vs});var bo=k(Se=>{"use strict";var jl=kD(),Qv=$D(),Xv=RD(),ql="\uFEFF",Ul="",Vl="",Wl="",e1=t=>!!t&&"items"in t,t1=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function s1(t){switch(t){case ql:return"<BOM>";case Ul:return"<DOC>";case Vl:return"<FLOW_END>";case Wl:return"<SCALAR>";default:return JSON.stringify(t)}}function i1(t){switch(t){case ql:return"byte-order-mark";case Ul:return"doc-mode";case Vl:return"flow-error-end";case Wl: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}Se.createScalarToken=Pl.createScalarToken;Se.resolveAsScalar=Pl.resolveAsScalar;Se.setScalarValue=Pl.setScalarValue;Se.stringify=Ov.stringify;Se.visit=Lv.visit;Se.BOM=Ol;Se.DOCUMENT=Ll;Se.FLOW_END=Ml;Se.SCALAR=jl;Se.isCollection=Mv;Se.isScalar=jv;Se.prettyToken=qv;Se.tokenType=Uv});var Vl=k(BD=>{"use strict";var En=Co();function He(t){switch(t){case void 0:case" ":case`
174
- `:case"\r":case" ":return!0;default:return!1}}var _D=new Set("0123456789ABCDEFabcdef"),Vv=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Eo=new Set(",[]{}"),Wv=new Set(` ,[]{}
175
- \r `),ql=t=>!t||Wv.has(t),Ul=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 i=this.next??"stream";for(;i&&(s||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,s=this.buffer[e];for(;s===" "||s===" ";)s=this.buffer[++e];return!s||s==="#"||s===`
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}Se.createScalarToken=jl.createScalarToken;Se.resolveAsScalar=jl.resolveAsScalar;Se.setScalarValue=jl.setScalarValue;Se.stringify=Qv.stringify;Se.visit=Xv.visit;Se.BOM=ql;Se.DOCUMENT=Ul;Se.FLOW_END=Vl;Se.SCALAR=Wl;Se.isCollection=e1;Se.isScalar=t1;Se.prettyToken=s1;Se.tokenType=i1});var Kl=k(PD=>{"use strict";var bn=bo();function He(t){switch(t){case void 0:case" ":case`
174
+ `:case"\r":case" ":return!0;default:return!1}}var ND=new Set("0123456789ABCDEFabcdef"),n1=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),vo=new Set(",[]{}"),r1=new Set(` ,[]{}
175
+ \r `),zl=t=>!t||r1.has(t),Gl=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 i=this.next??"stream";for(;i&&(s||this.hasChars(1));)i=yield*this.parseNext(i)}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 i=0;for(;s===" ";)s=this.buffer[++i+e];if(s==="\r"){let n=this.buffer[i+e+1];if(n===`
178
178
  `||!n&&!this.atEnd)return e+i+1}return s===`
179
179
  `||i>=this.indentNext||!s&&!this.atEnd?e+i:-1}if(s==="-"||s==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&He(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]===En.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let s=e.length,i=e.indexOf("#");for(;i!==-1;){let r=e[i-1];if(r===" "||r===" "){s=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let r=e[s-1];if(r===" "||r===" ")s-=1;else break}let n=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),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 En.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==="...")&&He(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&&!He(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===":")&&He(s)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,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(ql),"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,i=-1;do e=yield*this.pushNewline(),e>0?(s=yield*this.pushSpaces(!1),this.indentValue=i=s):s=0,s+=yield*this.pushSpaces(!0);while(e+s>0);let n=this.getLine();if(n===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&n[0]!=="#"||i===0&&(n.startsWith("---")||n.startsWith("..."))&&He(n[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield En.FLOW_END,yield*this.parseLineStart();let r=0;for(;n[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),n[r]){case void 0:return"flow";case"#":return yield*this.pushCount(n.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(ql),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||He(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 i=this.buffer.substring(0,s),n=i.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]===bn.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let s=e.length,i=e.indexOf("#");for(;i!==-1;){let r=e[i-1];if(r===" "||r===" "){s=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let r=e[s-1];if(r===" "||r===" ")s-=1;else break}let n=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),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 bn.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==="...")&&He(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&&!He(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===":")&&He(s)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,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(zl),"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,i=-1;do e=yield*this.pushNewline(),e>0?(s=yield*this.pushSpaces(!1),this.indentValue=i=s):s=0,s+=yield*this.pushSpaces(!0);while(e+s>0);let n=this.getLine();if(n===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&n[0]!=="#"||i===0&&(n.startsWith("---")||n.startsWith("..."))&&He(n[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield bn.FLOW_END,yield*this.parseLineStart();let r=0;for(;n[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),n[r]){case void 0:return"flow";case"#":return yield*this.pushCount(n.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(zl),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||He(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 i=this.buffer.substring(0,s),n=i.indexOf(`
181
181
  `,this.pos);if(n!==-1){for(;n!==-1;){let r=this.continueScalar(n+1);if(r===-1)break;n=i.indexOf(`
182
182
  `,r)}n!==-1&&(s=n-(i[n-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=>He(s)||s==="#")}*parseBlockScalar(){let e=this.pos-1,s=0,i;e:for(let r=this.pos;i=this.buffer[r];++r)switch(i){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(!i&&!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 n=e+1;for(i=this.buffer[n];i===" ";)i=this.buffer[++n];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
186
186
  `;)i=this.buffer[++n];e=n-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 En.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,s=this.pos-1,i=this.pos-1,n;for(;n=this.buffer[++i];)if(n===":"){let r=this.buffer[i+1];if(He(r)||e&&Eo.has(r))break;s=i}else if(He(n)){let r=this.buffer[i+1];if(n==="\r"&&(r===`
187
+ `&&r>=this.pos&&r+1+s>a)e=r;else break}while(!0);return yield bn.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,s=this.pos-1,i=this.pos-1,n;for(;n=this.buffer[++i];)if(n===":"){let r=this.buffer[i+1];if(He(r)||e&&vo.has(r))break;s=i}else if(He(n)){let r=this.buffer[i+1];if(n==="\r"&&(r===`
188
188
  `?(i+=1,n=`
189
- `,r=this.buffer[i+1]):s=i),r==="#"||e&&Eo.has(r))break;if(n===`
190
- `){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&Eo.has(n))break;s=i}return!n&&!this.atEnd?this.setNext("plain-scalar"):(yield En.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 i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.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(ql))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,s=this.charAt(1);if(He(s)||e&&Eo.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(;!He(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(Vv.has(s))s=this.buffer[++e];else if(s==="%"&&_D.has(this.buffer[e+1])&&_D.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===`
189
+ `,r=this.buffer[i+1]):s=i),r==="#"||e&&vo.has(r))break;if(n===`
190
+ `){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&vo.has(n))break;s=i}return!n&&!this.atEnd?this.setNext("plain-scalar"):(yield bn.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 i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.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(zl))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,s=this.charAt(1);if(He(s)||e&&vo.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(;!He(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(n1.has(s))s=this.buffer[++e];else if(s==="%"&&ND.has(this.buffer[e+1])&&ND.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,i;do i=this.buffer[++s];while(i===" "||e&&i===" ");let n=s-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=s),n}*pushUntil(e){let s=this.pos,i=this.buffer[s];for(;!e(i);)i=this.buffer[++s];return yield*this.pushToIndex(s,!1)}};BD.Lexer=Ul});var zl=k($D=>{"use strict";var Wl=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let s=0,i=this.lineStarts.length;for(;s<i;){let r=s+i>>1;this.lineStarts[r]<e?s=r+1:i=r}if(this.lineStarts[s]===e)return{line:s+1,col:1};if(s===0)return{line:0,col:e};let n=this.lineStarts[s-1];return{line:s,col:e-n+1}}}};$D.LineCounter=Wl});var Kl=k(PD=>{"use strict";var zv=require("process"),TD=Co(),Gv=Vl();function Wt(t,e){for(let s=0;s<t.length;++s)if(t[s].type===e)return!0;return!1}function ID(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 ND(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 bo(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 ai(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 RD(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Wt(e.start,"explicit-key-ind")&&!Wt(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,ND(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 Gl=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 Gv.Lexer,this.onNewLine=e}*parse(e,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,s))yield*this.next(i);s||(yield*this.end())}*next(e){if(this.source=e,zv.env.LOG_TOKENS&&console.log("|",TD.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let s=TD.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 i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,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 i=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in i?i.indent:0:s.type==="flow-collection"&&i.type==="document"&&(s.indent=0),s.type==="flow-collection"&&RD(s),i.type){case"document":i.value=s;break;case"block-scalar":i.props.push(s);break;case"block-map":{let n=i.items[i.items.length-1];if(n.value){i.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=s;else{Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=i.items[i.items.length-1];n.value?i.items.push({start:[],value:s}):n.value=s;break}case"flow-collection":{let n=i.items[i.items.length-1];!n||n.value?i.items.push({start:[],key:s,sep:[]}):n.sep?n.value=s:Object.assign(n,{key:s,sep:[]});return}default:yield*this.pop(),yield*this.pop(s)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){let n=s.items[s.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&ID(n.start)===-1&&(s.indent===0||n.start.every(r=>r.type!=="comment"||r.indent<s.indent))&&(i.type==="document"?i.end=n.start:i.items.push({start:n.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":{ID(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=bo(this.peek(2)),i=ai(s),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:n}]};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(`
192
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let s=this.pos-1,i;do i=this.buffer[++s];while(i===" "||e&&i===" ");let n=s-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=s),n}*pushUntil(e){let s=this.pos,i=this.buffer[s];for(;!e(i);)i=this.buffer[++s];return yield*this.pushToIndex(s,!1)}};PD.Lexer=Gl});var Jl=k(OD=>{"use strict";var Yl=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let s=0,i=this.lineStarts.length;for(;s<i;){let r=s+i>>1;this.lineStarts[r]<e?s=r+1:i=r}if(this.lineStarts[s]===e)return{line:s+1,col:1};if(s===0)return{line:0,col:e};let n=this.lineStarts[s-1];return{line:s,col:e-n+1}}}};OD.LineCounter=Yl});var Zl=k(UD=>{"use strict";var o1=require("process"),LD=bo(),a1=Kl();function zt(t,e){for(let s=0;s<t.length;++s)if(t[s].type===e)return!0;return!1}function MD(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 qD(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 xo(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 li(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 jD(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!zt(e.start,"explicit-key-ind")&&!zt(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,qD(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 Hl=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 a1.Lexer,this.onNewLine=e}*parse(e,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,s))yield*this.next(i);s||(yield*this.end())}*next(e){if(this.source=e,o1.env.LOG_TOKENS&&console.log("|",LD.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let s=LD.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 i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,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 i=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in i?i.indent:0:s.type==="flow-collection"&&i.type==="document"&&(s.indent=0),s.type==="flow-collection"&&jD(s),i.type){case"document":i.value=s;break;case"block-scalar":i.props.push(s);break;case"block-map":{let n=i.items[i.items.length-1];if(n.value){i.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=s;else{Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=i.items[i.items.length-1];n.value?i.items.push({start:[],value:s}):n.value=s;break}case"flow-collection":{let n=i.items[i.items.length-1];!n||n.value?i.items.push({start:[],key:s,sep:[]}):n.sep?n.value=s:Object.assign(n,{key:s,sep:[]});return}default:yield*this.pop(),yield*this.pop(s)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){let n=s.items[s.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&MD(n.start)===-1&&(s.indent===0||n.start.every(r=>r.type!=="comment"||r.indent<s.indent))&&(i.type==="document"?i.end=n.start:i.items.push({start:n.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":{MD(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=xo(this.peek(2)),i=li(s),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:n}]};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 i="end"in s.value?s.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,s.start),n.push(this.sourceToken),e.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,n=i&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind",r=[];if(n&&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":n||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):n||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(Wt(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(ND(s.key)&&!Wt(s.sep,"newline")){let o=ai(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(Wt(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{let o=ai(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||n?e.items.push({start:r,key:null,sep:[this.sourceToken]}):Wt(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);n||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&&!Wt(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 i&&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 i="end"in s.value?s.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,s.start),n.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||Wt(s.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let s=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.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 n=this.flowScalar(this.type);!s||s.value?e.items.push({start:[],key:n,sep:[]}):s.sep?this.stack.push(n):Object.assign(s,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let n=bo(i),r=ai(n);RD(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(`
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 i="end"in s.value?s.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,s.start),n.push(this.sourceToken),e.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,n=i&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind",r=[];if(n&&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":n||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):n||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(zt(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(qD(s.key)&&!zt(s.sep,"newline")){let o=li(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(zt(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{let o=li(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||n?e.items.push({start:r,key:null,sep:[this.sourceToken]}):zt(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);n||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&&!zt(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 i&&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 i="end"in s.value?s.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,s.start),n.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||zt(s.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let s=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.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 n=this.flowScalar(this.type);!s||s.value?e.items.push({start:[],key:n,sep:[]}):s.sep?this.stack.push(n):Object.assign(s,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let n=xo(i),r=li(n);jD(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=bo(e),i=ai(s);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let s=bo(e),i=ai(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,s){return this.type!=="comment"||this.indent<=s?!1:e.every(i=>i.type==="newline"||i.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())}}};PD.Parser=Gl});var qD=k(wn=>{"use strict";var OD=Il(),Kv=pn(),bn=gn(),Yv=$u(),Jv=W(),Hv=zl(),LD=Kl();function MD(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Hv.LineCounter||null,prettyErrors:e}}function Zv(t,e={}){let{lineCounter:s,prettyErrors:i}=MD(e),n=new LD.Parser(s?.addNewLine),r=new OD.Composer(e),o=Array.from(r.compose(n.parse(t)));if(i&&s)for(let a of o)a.errors.forEach(bn.prettifyError(t,s)),a.warnings.forEach(bn.prettifyError(t,s));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function jD(t,e={}){let{lineCounter:s,prettyErrors:i}=MD(e),n=new LD.Parser(s?.addNewLine),r=new OD.Composer(e),o=null;for(let a of r.compose(n.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new bn.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&s&&(o.errors.forEach(bn.prettifyError(t,s)),o.warnings.forEach(bn.prettifyError(t,s))),o}function Qv(t,e,s){let i;typeof e=="function"?i=e:s===void 0&&e&&typeof e=="object"&&(s=e);let n=jD(t,s);if(!n)return null;if(n.warnings.forEach(r=>Yv.warn(n.options.logLevel,r)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:i},s))}function Xv(t,e,s){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:s===void 0&&e&&(s=e),typeof s=="string"&&(s=s.length),typeof s=="number"){let n=Math.round(s);s=n<1?void 0:n>8?{indent:8}:{indent:n}}if(t===void 0){let{keepUndefined:n}=s??e??{};if(!n)return}return Jv.isDocument(t)&&!i?t.toString(s):new Kv.Document(t,i,s).toString(s)}wn.parse=Qv;wn.parseAllDocuments=Zv;wn.parseDocument=jD;wn.stringify=Xv});var VD=k(K=>{"use strict";var e1=Il(),t1=pn(),s1=dl(),Yl=gn(),i1=Hi(),zt=W(),n1=jt(),r1=ee(),o1=Ut(),a1=Vt(),u1=Co(),l1=Vl(),c1=zl(),f1=Kl(),wo=qD(),UD=Gi();K.Composer=e1.Composer;K.Document=t1.Document;K.Schema=s1.Schema;K.YAMLError=Yl.YAMLError;K.YAMLParseError=Yl.YAMLParseError;K.YAMLWarning=Yl.YAMLWarning;K.Alias=i1.Alias;K.isAlias=zt.isAlias;K.isCollection=zt.isCollection;K.isDocument=zt.isDocument;K.isMap=zt.isMap;K.isNode=zt.isNode;K.isPair=zt.isPair;K.isScalar=zt.isScalar;K.isSeq=zt.isSeq;K.Pair=n1.Pair;K.Scalar=r1.Scalar;K.YAMLMap=o1.YAMLMap;K.YAMLSeq=a1.YAMLSeq;K.CST=u1;K.Lexer=l1.Lexer;K.LineCounter=c1.LineCounter;K.Parser=f1.Parser;K.parse=wo.parse;K.parseAllDocuments=wo.parseAllDocuments;K.parseDocument=wo.parseDocument;K.stringify=wo.stringify;K.visit=UD.visit;K.visitAsync=UD.visitAsync});function Hl(){return(0,Jl.join)(h1,"defaults")}function vo(...t){return(0,Jl.join)(Hl(),...t)}var Jl,h1,xo=M(()=>{"use strict";Jl=require("node:path"),h1=__dirname});function d1(t,e){let s=t.name;if(typeof s!="string")return null;let i=e.trim();if(!i)return null;let n=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:i,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,...n&&{executorSettings:n}}}async function vn(t){let{glob:e}=await Promise.resolve().then(()=>(Sr(),td)),{join:s}=await import("node:path");try{let i=await e("*.md",{cwd:t}),n=[],r=[],o=await Promise.all(i.map(async a=>{let u=s(t,a);try{return{agents:(await xn(u,d1)).map(c=>({...c,path:u})),failed:null}}catch(l){return p.error(`Error loading agent from ${a}:`,l),{agents:[],failed:a}}}));return n.push(...o.flatMap(a=>a.agents)),r.push(...o.map(a=>a.failed).filter(a=>a!==null)),r.length>0&&p.warn(`Loaded ${n.length}/${i.length} agents, ${r.length} failed: ${r.join(", ")}`),n}catch(i){if(i.code==="ENOENT")return[];throw i}}var Zl=M(()=>{"use strict";Sn();Y()});function Ao(t){if(!t||typeof t!="string")return null;let e=t.lastIndexOf("#"),s,i;if(e!==-1){if(s=t.slice(0,e),i=t.slice(e+1),!i||i.includes("..")||i.includes("\0"))return null}else s=t;return g1(s)?{url:s,ref:i}:null}function g1(t){return p1.test(t)||D1.test(t)||m1.test(t)}function Ql(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 ko(t){let e=t.url;return e.startsWith("git@")?e=e.replace(/^git@[^:]+:/,""):e=e.replace(/^https?:\/\/[^/]+\//,""),e=e.replace(/\.git$/,""),e}var p1,D1,m1,Xl=M(()=>{"use strict";p1=/^https?:\/\/.+/,D1=/^git@.+:.+/,m1=/^ssh:\/\/.+/});function An(){return(0,_o.join)((0,ec.homedir)(),".diffray","extends")}function kn(){return(0,_o.join)((0,ec.homedir)(),".diffray","extends.lock.json")}function WD(t){return(0,_o.join)(An(),Ql(t))}function tc(t,e){return{ref:t,refString:e,localPath:WD(t)}}var ec,_o,Bo=M(()=>{"use strict";ec=require("node:os"),_o=require("node:path");Xl()});function C1(){return kn()+".lock"}async function E1(){let t=C1(),e=Date.now();for(;;)try{return await(0,be.mkdir)(t),async()=>{try{await(0,be.rm)(t,{recursive:!0,force:!0})}catch{}}}catch(s){if(s.code==="EEXIST"){if(Date.now()-e>y1){await(0,be.rm)(t,{recursive:!0,force:!0});continue}await new Promise(i=>setTimeout(i,F1));continue}throw s}}async function GD(t){let e=await E1();try{return await t()}finally{await e()}}function b1(){return{version:1,updated:new Date().toISOString(),packages:{}}}async function Ct(){let t=kn();try{await(0,be.access)(t);let e=await(0,be.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 b1();throw e}}async function KD(t){let e=kn();await(0,be.mkdir)((0,zD.dirname)(e),{recursive:!0}),t.updated=new Date().toISOString();let s=e+".tmp."+process.pid;await(0,be.writeFile)(s,JSON.stringify(t,null,2),"utf-8"),await(0,be.rename)(s,e)}async function YD(t){return(await Ct()).packages[t]||null}async function sc(t,e){await GD(async()=>{let s=await Ct();s.packages[t]=e,await KD(s)})}async function ic(t){await GD(async()=>{let e=await Ct();delete e.packages[t],await KD(e)})}async function $o(t){let e=await YD(t);if(!e)return!1;try{return await(0,be.access)(e.path),!0}catch{return!1}}var be,zD,y1,F1,nc=M(()=>{"use strict";be=require("node:fs/promises"),zD=require("node:path");Bo();y1=1e4,F1=100});function To(t){let e=(0,qe.resolve)(An()),s=(0,qe.resolve)(t),i=(0,qe.relative)(e,s);if(i.startsWith("..")||(0,qe.resolve)(e,i)!==s)throw new Error("Invalid extend path: path traversal detected");let n=i.split(/[/\\]/);for(let r of n)if(r==="."||r===".."||r.includes("\0"))throw new Error("Invalid extend path: suspicious path component")}async function rc(t){let{ref:e,localPath:s}=t;To(s),await(0,Gt.mkdir)(An(),{recursive:!0}),await(0,Gt.rm)(s,{recursive:!0,force:!0});let i=["clone","--depth","1"];e.ref&&i.push("--branch",e.ref),i.push(e.url,s);try{await JD("git",i,{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:n}=await JD("git",["rev-parse","HEAD"],{cwd:s});return await(0,Gt.rm)((0,qe.join)(s,".git"),{recursive:!0,force:!0}),n.trim()}async function oc(t){let e={agents:[],rules:[]},s=(0,qe.join)(t,"agents");try{let n=await gt("*.md",{cwd:s});for(let r of n){let o=await HD((0,qe.join)(s,r));o&&e.agents.push(o)}}catch{}let i=(0,qe.join)(t,"rules");try{let n=await gt("**/*.md",{cwd:i});for(let r of n){let o=await HD((0,qe.join)(i,r));o&&e.rules.push(o)}}catch{}return e}async function HD(t){try{let e=await(0,Gt.readFile)(t,"utf-8");if(!e.startsWith("---"))return null;let s=e.indexOf("---",3);if(s===-1)return null;let n=e.slice(3,s).match(/^name:\s*(.+)$/m);return n&&n[1]?n[1].trim().replace(/^["']|["']$/g,""):null}catch{return null}}async function ac(t){To(t),await(0,Gt.rm)(t,{recursive:!0,force:!0})}var Gt,qe,ZD,QD,JD,uc=M(()=>{"use strict";Gt=require("node:fs/promises"),qe=require("node:path"),ZD=require("node:child_process"),QD=require("node:util");Bo();Sr();JD=(0,QD.promisify)(ZD.execFile)});var lc={};di(lc,{getInstalledExtendPaths:()=>_n,loadAgentsFromExtends:()=>XD,loadFromExtends:()=>tm,scanRuleRefsFromExtends:()=>em});async function _n(t){let e=await Ct(),s=[];for(let i of t){let n=e.packages[i];n?(To(n.path),s.push(n.path)):p.warn(`Extension not installed: ${i}. Run 'diffray extends install'`)}return s}async function XD(t){let e=await _n(t),s=[];for(let i of e){let n=(0,Io.join)(i,"agents");try{let r=await vn(n);s.push(...r.map(o=>({...o,source:"extends"})))}catch{}}return s}async function em(t){let e=await _n(t),s=[];for(let i of e){let n=(0,Io.join)(i,"rules");try{let r=await Kt(n,"extends");s.push(...r)}catch{}}return s}async function tm(t,e,s){let i=await _n(s),n=[];for(let r of i){let o=(0,Io.join)(r,t);try{let a=await e(o);n.push(a)}catch{n.push([])}}return n}var Io,Ro=M(()=>{"use strict";Io=require("node:path");Zl();Sn();nc();uc();Y()});function Bn(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(),i=t.slice(e+3).trim();if(!s)return{frontmatter:{},body:i};let n;try{n=im.default.parse(s)}catch(r){throw new Error(`Invalid YAML in frontmatter: ${r instanceof Error?r.message:String(r)}`)}return{frontmatter:n,body:i}}function So(t,e){try{let{frontmatter:s,body:i}=Bn(t),n=e(s,i);return n?[n]:[]}catch(s){return p.error("Failed to parse markdown:",s),[]}}async function xn(t,e){try{let s=await(0,cc.readFile)(t,"utf-8");return e?So(s,e):Bn(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 nm(t,e,s){try{let i=await gt("**/*.md",{cwd:t});if(i.length===0)return[];let n=[];for(let o of i){let a=(0,vs.join)(t,o);try{let u=await xn(a,e);n.push(...u)}catch(u){p.error(`Error processing file ${o}:`,u)}}let r=s?s(n):n;return p.info(`Loaded ${r.length} items from ${i.length} files in ${t} (recursive)`),r}catch{return[]}}function rm(...t){let e=new Map;for(let s of t)for(let i of s)e.set(i.name,i);return Array.from(e.values())}function No(t,e){return{defaults:(0,vs.join)(Hl(),t),user:(0,vs.join)((0,sm.homedir)(),".diffray",t),project:(0,vs.join)(e,".diffray",t)}}async function om(t,e,s){let i=No(t,s),[n,r,o]=await Promise.all([e(i.defaults),e(i.user),e(i.project)]);return rm(n,r,o)}async function Kt(t,e){try{let s=await gt("**/*.md",{cwd:t}),i=await Promise.all(s.map(async r=>{let o=(0,vs.join)(t,r);try{let a=await(0,cc.readFile)(o,"utf-8");return{filePath:o,content:a}}catch{return null}})),n=[];for(let r of i)if(r)try{let{frontmatter:o}=Bn(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&&n.push({name:a,description:typeof u=="string"?u:"",path:r.filePath,patterns:c.filter(f=>typeof f=="string"),agent:l,source:e})}catch{}return n}catch{return[]}}async function am(t){let e=No("rules",t),[s,i,n]=await Promise.all([Kt(e.defaults,"defaults"),Kt(e.user,"user"),Kt(e.project,"project")]),r=new Map;for(let o of[...s,...i,...n])r.set(o.name,o);return Array.from(r.values())}async function um(t,e,s,i){let n=No(t,s),{loadFromExtends:r}=await Promise.resolve().then(()=>(Ro(),lc)),[o,a,u,l]=await Promise.all([e(n.defaults),r(t,e,i),e(n.user),e(n.project)]);return rm(o,...a,u,l)}async function lm(t,e){let s=No("rules",t),{scanRuleRefsFromExtends:i}=await Promise.resolve().then(()=>(Ro(),lc)),[n,r,o,a]=await Promise.all([Kt(s.defaults,"defaults"),i(e),Kt(s.user,"user"),Kt(s.project,"project")]),u=new Map;for(let l of[...n,...r,...o,...a])u.set(l.name,l);return Array.from(u.values())}var cc,vs,sm,im,Sn=M(()=>{"use strict";Y();Sr();cc=require("node:fs/promises"),vs=require("node:path"),sm=require("node:os"),im=bt(VD(),1);xo()});var mm={};di(mm,{expandBraces:()=>pc,loadRuleFromRef:()=>hc,loadRuleMarkdown:()=>w1,loadRuleRefs:()=>Yt,loadRules:()=>S1,loadRulesFromDirectoryRecursive:()=>v1,loadRulesFromRefs:()=>dm,matchAndLoadRules:()=>dc,matchPattern:()=>Jt,matchRuleRefs:()=>Dm,matchRules:()=>A1,parseRuleMarkdown:()=>hm,parseSingleRule:()=>x1});function fc(t,e){let s=t.name,i=t.agent,n=t.patterns,r=e.trim();return typeof s!="string"||typeof i!="string"||!Array.isArray(n)||n.length===0||!r?null:{name:s,description:typeof t.description=="string"?t.description:"",patterns:n.filter(a=>typeof a=="string"),agent:i,prompt:r}}function hm(t){return So(t,fc)}async function w1(t){try{return await xn(t,fc)}catch(e){return p.error(`Error loading rule markdown from ${t}:`,e),[]}}async function v1(t){return nm(t,fc)}function x1(t){let e=hm(t);return e.length>0?e[0]??null:null}async function Yt(t){let e=t||process.cwd(),s=await Fe(e);return(s.extends.length>0?await lm(e,s.extends):await am(e)).map(n=>{let r=s.rules[n.name]||{};return{...n,agent:r.agent??n.agent,_enabled:r.enabled??!0}}).filter(n=>n._enabled!==!1).map(({_enabled:n,...r})=>r)}async function hc(t){try{let e=await(0,fm.readFile)(t.path,"utf-8"),{body:s}=Bn(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 p.error(`Failed to load rule from ${t.path}:`,e),null}}async function dm(t){return(await Promise.all(t.map(hc))).filter(s=>s!==null)}async function S1(t){let e=await Yt(t);return dm(e)}function pm(t,e,s){let i=new Map(s.map(r=>[r.name,r])),n=[];for(let r of t){let o=i.get(r.agent);if(!o){p.warn(`Rule references unknown agent "${r.agent}"`);continue}let a=e.filter(u=>r.patterns.some(l=>Jt(u.file,l))).map(u=>u.file);a.length!==0&&n.push({item:r,files:a,agent:o})}return n}function Dm(t,e,s){return pm(t,e,s).map(({item:i,...n})=>({ref:i,...n}))}async function dc(t,e,s){let i=Dm(t,e,s);return(await Promise.all(i.map(async({ref:r,files:o,agent:a})=>{let u=await hc(r);return u?{rule:u,files:o,agent:a}:null}))).filter(r=>r!==null)}function A1(t,e,s){return pm(t,e,s).map(({item:i,...n})=>({rule:i,...n}))}function pc(t){let e=t.match(k1);if(!e||e.index===void 0||!e[1])return[t];let s=e[1].split(",").map(o=>o.trim()),i=t.substring(0,e.index),n=t.substring(e.index+e[0].length),r=[];for(let o of s){let a=i+o+n;r.push(...pc(a))}return r}function Jt(t,e){return pc(e).some(i=>_1(t,i))}function _1(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 i=cm.get(s);return i||(i=new RegExp(`^${s}$`),cm.set(s,i)),i.test(t)}var fm,k1,cm,xs=M(()=>{"use strict";Sn();fm=require("node:fs/promises");Y();Ge();k1=/\{([^}]+)\}/;cm=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},Qo={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 Jo(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 Xo(t,e,s=".",i){if(!Jo(e))return Xo(t,{},s,i);let n=Object.assign({},e);for(let r in t){if(r==="__proto__"||r==="constructor")continue;let o=t[r];o!=null&&(i&&i(n,r,o,s)||(Array.isArray(o)&&Array.isArray(n[r])?n[r]=[...o,...n[r]]:Jo(o)&&Jo(n[r])?n[r]=Xo(o,n[r],(s?`${s}.`:"")+r.toString(),i):n[r]=o))}return n}function Wg(t){return(...e)=>e.reduce((s,i)=>Xo(s,i,"",t),{})}var zg=Wg();function Gg(t){return Object.prototype.toString.call(t)==="[object Object]"}function Kg(t){return!(!Gg(t)||!t.message&&!t.args||t.stack)}var Ho=!1,wc=[],ie=class t{options;_lastLog;_mockFn;constructor(e={}){let s=e.types||Qo;this.options=zg({...e,defaults:{...e.defaults},level:Zo(e.level,s),reporters:[...e.reporters||[]]},{types:Qo,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let i in s){let n={type:i,...this.options.defaults,...s[i]};this[i]=this._wrapLogFn(n),this[i].raw=this._wrapLogFn(n,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=Zo(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=i=>{this[s].raw(String(i).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(){Ho=!0}resumeLogs(){Ho=!1;let e=wc.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 i in this.options.types)this[i]=s(i,this.options.types[i])||this[i],this[i].raw=this[i]}_wrapLogFn(e,s){return(...i)=>{if(Ho){wc.push([this,e,i,s]);return}return this._logFn(e,i,s)}}_logFn(e,s,i){if((e.level||0)>this.level)return!1;let n={date:new Date,args:[],...e,level:Zo(e.level,this.options.types)};!i&&s.length===1&&Kg(s[0])?Object.assign(n,s[0]):n.args=[...s],n.message&&(n.args.unshift(n.message),delete n.message),n.additional&&(Array.isArray(n.additional)||(n.additional=n.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=xo(e),i=li(s);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let s=xo(e),i=li(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,s){return this.type!=="comment"||this.indent<=s?!1:e.every(i=>i.type==="newline"||i.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=Hl});var KD=k(xn=>{"use strict";var VD=Ol(),u1=mn(),vn=Fn(),l1=Nu(),c1=W(),f1=Jl(),WD=Zl();function zD(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new f1.LineCounter||null,prettyErrors:e}}function d1(t,e={}){let{lineCounter:s,prettyErrors:i}=zD(e),n=new WD.Parser(s?.addNewLine),r=new VD.Composer(e),o=Array.from(r.compose(n.parse(t)));if(i&&s)for(let a of o)a.errors.forEach(vn.prettifyError(t,s)),a.warnings.forEach(vn.prettifyError(t,s));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function GD(t,e={}){let{lineCounter:s,prettyErrors:i}=zD(e),n=new WD.Parser(s?.addNewLine),r=new VD.Composer(e),o=null;for(let a of r.compose(n.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new vn.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&s&&(o.errors.forEach(vn.prettifyError(t,s)),o.warnings.forEach(vn.prettifyError(t,s))),o}function h1(t,e,s){let i;typeof e=="function"?i=e:s===void 0&&e&&typeof e=="object"&&(s=e);let n=GD(t,s);if(!n)return null;if(n.warnings.forEach(r=>l1.warn(n.options.logLevel,r)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:i},s))}function p1(t,e,s){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:s===void 0&&e&&(s=e),typeof s=="string"&&(s=s.length),typeof s=="number"){let n=Math.round(s);s=n<1?void 0:n>8?{indent:8}:{indent:n}}if(t===void 0){let{keepUndefined:n}=s??e??{};if(!n)return}return c1.isDocument(t)&&!i?t.toString(s):new u1.Document(t,i,s).toString(s)}xn.parse=h1;xn.parseAllDocuments=d1;xn.parseDocument=GD;xn.stringify=p1});var JD=k(K=>{"use strict";var D1=Ol(),m1=mn(),g1=gl(),Ql=Fn(),y1=Qi(),Gt=W(),F1=qt(),C1=ee(),E1=Vt(),w1=Wt(),b1=bo(),v1=Kl(),x1=Jl(),S1=Zl(),So=KD(),YD=Yi();K.Composer=D1.Composer;K.Document=m1.Document;K.Schema=g1.Schema;K.YAMLError=Ql.YAMLError;K.YAMLParseError=Ql.YAMLParseError;K.YAMLWarning=Ql.YAMLWarning;K.Alias=y1.Alias;K.isAlias=Gt.isAlias;K.isCollection=Gt.isCollection;K.isDocument=Gt.isDocument;K.isMap=Gt.isMap;K.isNode=Gt.isNode;K.isPair=Gt.isPair;K.isScalar=Gt.isScalar;K.isSeq=Gt.isSeq;K.Pair=F1.Pair;K.Scalar=C1.Scalar;K.YAMLMap=E1.YAMLMap;K.YAMLSeq=w1.YAMLSeq;K.CST=b1;K.Lexer=v1.Lexer;K.LineCounter=x1.LineCounter;K.Parser=S1.Parser;K.parse=So.parse;K.parseAllDocuments=So.parseAllDocuments;K.parseDocument=So.parseDocument;K.stringify=So.stringify;K.visit=YD.visit;K.visitAsync=YD.visitAsync});function Xl(){return(0,Sn.join)(A1,"defaults")}function Ao(...t){return(0,Sn.join)(Xl(),...t)}var Sn,HD,k1,A1,ko=M(()=>{"use strict";Sn=require("node:path"),HD=require("node:url"),k1={},A1=typeof __dirname<"u"?__dirname:(0,Sn.dirname)((0,HD.fileURLToPath)(k1.url))});function _1(t,e){let s=t.name;if(typeof s!="string")return null;let i=e.trim();if(!i)return null;let n=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:i,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,...n&&{executorSettings:n}}}async function An(t){let{glob:e}=await Promise.resolve().then(()=>(_r(),ah)),{join:s}=await import("node:path");try{let i=await e("*.md",{cwd:t}),n=[],r=[],o=await Promise.all(i.map(async a=>{let u=s(t,a);try{return{agents:(await kn(u,_1)).map(c=>({...c,path:u})),failed:null}}catch(l){return h.error(`Error loading agent from ${a}:`,l),{agents:[],failed:a}}}));return n.push(...o.flatMap(a=>a.agents)),r.push(...o.map(a=>a.failed).filter(a=>a!==null)),r.length>0&&h.warn(`Loaded ${n.length}/${i.length} agents, ${r.length} failed: ${r.join(", ")}`),n}catch(i){if(i.code==="ENOENT")return[];throw i}}var ec=M(()=>{"use strict";_n();Y()});function $o(t){if(!t||typeof t!="string")return null;let e=t.lastIndexOf("#"),s,i;if(e!==-1){if(s=t.slice(0,e),i=t.slice(e+1),!i||i.includes("..")||i.includes("\0"))return null}else s=t;return I1(s)?{url:s,ref:i}:null}function I1(t){return $1.test(t)||B1.test(t)||T1.test(t)}function tc(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 Bo(t){let e=t.url;return e.startsWith("git@")?e=e.replace(/^git@[^:]+:/,""):e=e.replace(/^https?:\/\/[^/]+\//,""),e=e.replace(/\.git$/,""),e}var $1,B1,T1,sc=M(()=>{"use strict";$1=/^https?:\/\/.+/,B1=/^git@.+:.+/,T1=/^ssh:\/\/.+/});function $n(){return(0,To.join)((0,ic.homedir)(),".diffray","extends")}function Bn(){return(0,To.join)((0,ic.homedir)(),".diffray","extends.lock.json")}function ZD(t){return(0,To.join)($n(),tc(t))}function nc(t,e){return{ref:t,refString:e,localPath:ZD(t)}}var ic,To,Io=M(()=>{"use strict";ic=require("node:os"),To=require("node:path");sc()});function P1(){return Bn()+".lock"}async function O1(){let t=P1(),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>R1){await(0,we.rm)(t,{recursive:!0,force:!0});continue}await new Promise(i=>setTimeout(i,N1));continue}throw s}}async function XD(t){let e=await O1();try{return await t()}finally{await e()}}function L1(){return{version:1,updated:new Date().toISOString(),packages:{}}}async function Et(){let t=Bn();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 L1();throw e}}async function em(t){let e=Bn();await(0,we.mkdir)((0,QD.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 tm(t){return(await Et()).packages[t]||null}async function rc(t,e){await XD(async()=>{let s=await Et();s.packages[t]=e,await em(s)})}async function oc(t){await XD(async()=>{let e=await Et();delete e.packages[t],await em(e)})}async function Ro(t){let e=await tm(t);if(!e)return!1;try{return await(0,we.access)(e.path),!0}catch{return!1}}var we,QD,R1,N1,ac=M(()=>{"use strict";we=require("node:fs/promises"),QD=require("node:path");Io();R1=1e4,N1=100});function No(t){let e=(0,qe.resolve)($n()),s=(0,qe.resolve)(t),i=(0,qe.relative)(e,s);if(i.startsWith("..")||(0,qe.resolve)(e,i)!==s)throw new Error("Invalid extend path: path traversal detected");let n=i.split(/[/\\]/);for(let r of n)if(r==="."||r===".."||r.includes("\0"))throw new Error("Invalid extend path: suspicious path component")}async function uc(t){let{ref:e,localPath:s}=t;No(s),await(0,Kt.mkdir)($n(),{recursive:!0}),await(0,Kt.rm)(s,{recursive:!0,force:!0});let i=["clone","--depth","1"];e.ref&&i.push("--branch",e.ref),i.push(e.url,s);try{await sm("git",i,{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:n}=await sm("git",["rev-parse","HEAD"],{cwd:s});return await(0,Kt.rm)((0,qe.join)(s,".git"),{recursive:!0,force:!0}),n.trim()}async function lc(t){let e={agents:[],rules:[]},s=(0,qe.join)(t,"agents");try{let n=await yt("*.md",{cwd:s});for(let r of n){let o=await im((0,qe.join)(s,r));o&&e.agents.push(o)}}catch{}let i=(0,qe.join)(t,"rules");try{let n=await yt("**/*.md",{cwd:i});for(let r of n){let o=await im((0,qe.join)(i,r));o&&e.rules.push(o)}}catch{}return e}async function im(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 n=e.slice(3,s).match(/^name:\s*(.+)$/m);return n&&n[1]?n[1].trim().replace(/^["']|["']$/g,""):null}catch{return null}}async function cc(t){No(t),await(0,Kt.rm)(t,{recursive:!0,force:!0})}var Kt,qe,nm,rm,sm,fc=M(()=>{"use strict";Kt=require("node:fs/promises"),qe=require("node:path"),nm=require("node:child_process"),rm=require("node:util");Io();_r();sm=(0,rm.promisify)(nm.execFile)});var dc={};Di(dc,{getInstalledExtendPaths:()=>Tn,loadAgentsFromExtends:()=>om,loadFromExtends:()=>um,scanRuleRefsFromExtends:()=>am});async function Tn(t){let e=await Et(),s=[];for(let i of t){let n=e.packages[i];n?(No(n.path),s.push(n.path)):h.warn(`Extension not installed: ${i}. Run 'diffray extends install'`)}return s}async function om(t){let e=await Tn(t),s=[];for(let i of e){let n=(0,Po.join)(i,"agents");try{let r=await An(n);s.push(...r.map(o=>({...o,source:"extends"})))}catch{}}return s}async function am(t){let e=await Tn(t),s=[];for(let i of e){let n=(0,Po.join)(i,"rules");try{let r=await Yt(n,"extends");s.push(...r)}catch{}}return s}async function um(t,e,s){let i=await Tn(s),n=[];for(let r of i){let o=(0,Po.join)(r,t);try{let a=await e(o);n.push(a)}catch{n.push([])}}return n}var Po,Oo=M(()=>{"use strict";Po=require("node:path");ec();_n();ac();fc();Y()});function In(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(),i=t.slice(e+3).trim();if(!s)return{frontmatter:{},body:i};let n;try{n=cm.default.parse(s)}catch(r){throw new Error(`Invalid YAML in frontmatter: ${r instanceof Error?r.message:String(r)}`)}return{frontmatter:n,body:i}}function _o(t,e){try{let{frontmatter:s,body:i}=In(t),n=e(s,i);return n?[n]:[]}catch(s){return h.error("Failed to parse markdown:",s),[]}}async function kn(t,e){try{let s=await(0,hc.readFile)(t,"utf-8");return e?_o(s,e):In(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 fm(t,e,s){try{let i=await yt("**/*.md",{cwd:t});if(i.length===0)return[];let n=[];for(let o of i){let a=(0,xs.join)(t,o);try{let u=await kn(a,e);n.push(...u)}catch(u){h.error(`Error processing file ${o}:`,u)}}let r=s?s(n):n;return h.info(`Loaded ${r.length} items from ${i.length} files in ${t} (recursive)`),r}catch{return[]}}function dm(...t){let e=new Map;for(let s of t)for(let i of s)e.set(i.name,i);return Array.from(e.values())}function Lo(t,e){return{defaults:(0,xs.join)(Xl(),t),user:(0,xs.join)((0,lm.homedir)(),".diffray",t),project:(0,xs.join)(e,".diffray",t)}}async function hm(t,e,s){let i=Lo(t,s),[n,r,o]=await Promise.all([e(i.defaults),e(i.user),e(i.project)]);return dm(n,r,o)}async function Yt(t,e){try{let s=await yt("**/*.md",{cwd:t}),i=await Promise.all(s.map(async r=>{let o=(0,xs.join)(t,r);try{let a=await(0,hc.readFile)(o,"utf-8");return{filePath:o,content:a}}catch{return null}})),n=[];for(let r of i)if(r)try{let{frontmatter:o}=In(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&&n.push({name:a,description:typeof u=="string"?u:"",path:r.filePath,patterns:c.filter(f=>typeof f=="string"),agent:l,source:e})}catch{}return n}catch{return[]}}async function pm(t){let e=Lo("rules",t),[s,i,n]=await Promise.all([Yt(e.defaults,"defaults"),Yt(e.user,"user"),Yt(e.project,"project")]),r=new Map;for(let o of[...s,...i,...n])r.set(o.name,o);return Array.from(r.values())}async function Dm(t,e,s,i){let n=Lo(t,s),{loadFromExtends:r}=await Promise.resolve().then(()=>(Oo(),dc)),[o,a,u,l]=await Promise.all([e(n.defaults),r(t,e,i),e(n.user),e(n.project)]);return dm(o,...a,u,l)}async function mm(t,e){let s=Lo("rules",t),{scanRuleRefsFromExtends:i}=await Promise.resolve().then(()=>(Oo(),dc)),[n,r,o,a]=await Promise.all([Yt(s.defaults,"defaults"),i(e),Yt(s.user,"user"),Yt(s.project,"project")]),u=new Map;for(let l of[...n,...r,...o,...a])u.set(l.name,l);return Array.from(u.values())}var hc,xs,lm,cm,_n=M(()=>{"use strict";Y();_r();hc=require("node:fs/promises"),xs=require("node:path"),lm=require("node:os"),cm=bt(JD(),1);ko()});var bm={};Di(bm,{expandBraces:()=>gc,loadRuleFromRef:()=>Dc,loadRuleMarkdown:()=>M1,loadRuleRefs:()=>Jt,loadRules:()=>U1,loadRulesFromDirectoryRecursive:()=>j1,loadRulesFromRefs:()=>Cm,matchAndLoadRules:()=>mc,matchPattern:()=>Ht,matchRuleRefs:()=>wm,matchRules:()=>V1,parseRuleMarkdown:()=>Fm,parseSingleRule:()=>q1});function pc(t,e){let s=t.name,i=t.agent,n=t.patterns,r=e.trim();return typeof s!="string"||typeof i!="string"||!Array.isArray(n)||n.length===0||!r?null:{name:s,description:typeof t.description=="string"?t.description:"",patterns:n.filter(a=>typeof a=="string"),agent:i,prompt:r}}function Fm(t){return _o(t,pc)}async function M1(t){try{return await kn(t,pc)}catch(e){return h.error(`Error loading rule markdown from ${t}:`,e),[]}}async function j1(t){return fm(t,pc)}function q1(t){let e=Fm(t);return e.length>0?e[0]??null:null}async function Jt(t){let e=t||process.cwd(),s=await Fe(e);return(s.extends.length>0?await mm(e,s.extends):await pm(e)).map(n=>{let r=s.rules[n.name]||{};return{...n,agent:r.agent??n.agent,_enabled:r.enabled??!0}}).filter(n=>n._enabled!==!1).map(({_enabled:n,...r})=>r)}async function Dc(t){try{let e=await(0,ym.readFile)(t.path,"utf-8"),{body:s}=In(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 Cm(t){return(await Promise.all(t.map(Dc))).filter(s=>s!==null)}async function U1(t){let e=await Jt(t);return Cm(e)}function Em(t,e,s){let i=new Map(s.map(r=>[r.name,r])),n=[];for(let r of t){let o=i.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&&n.push({item:r,files:a,agent:o})}return n}function wm(t,e,s){return Em(t,e,s).map(({item:i,...n})=>({ref:i,...n}))}async function mc(t,e,s){let i=wm(t,e,s);return(await Promise.all(i.map(async({ref:r,files:o,agent:a})=>{let u=await Dc(r);return u?{rule:u,files:o,agent:a}:null}))).filter(r=>r!==null)}function V1(t,e,s){return Em(t,e,s).map(({item:i,...n})=>({rule:i,...n}))}function gc(t){let e=t.match(W1);if(!e||e.index===void 0||!e[1])return[t];let s=e[1].split(",").map(o=>o.trim()),i=t.substring(0,e.index),n=t.substring(e.index+e[0].length),r=[];for(let o of s){let a=i+o+n;r.push(...gc(a))}return r}function Ht(t,e){return gc(e).some(i=>z1(t,i))}function z1(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 i=gm.get(s);return i||(i=new RegExp(`^${s}$`),gm.set(s,i)),i.test(t)}var ym,W1,gm,Ss=M(()=>{"use strict";_n();ym=require("node:fs/promises");Y();Ge();W1=/\{([^}]+)\}/;gm=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},sa={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 Xo(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 ia(t,e,s=".",i){if(!Xo(e))return ia(t,{},s,i);let n=Object.assign({},e);for(let r in t){if(r==="__proto__"||r==="constructor")continue;let o=t[r];o!=null&&(i&&i(n,r,o,s)||(Array.isArray(o)&&Array.isArray(n[r])?n[r]=[...o,...n[r]]:Xo(o)&&Xo(n[r])?n[r]=ia(o,n[r],(s?`${s}.`:"")+r.toString(),i):n[r]=o))}return n}function r0(t){return(...e)=>e.reduce((s,i)=>ia(s,i,"",t),{})}var o0=r0();function a0(t){return Object.prototype.toString.call(t)==="[object Object]"}function u0(t){return!(!a0(t)||!t.message&&!t.args||t.stack)}var ea=!1,_c=[],ie=class t{options;_lastLog;_mockFn;constructor(e={}){let s=e.types||sa;this.options=o0({...e,defaults:{...e.defaults},level:ta(e.level,s),reporters:[...e.reporters||[]]},{types:sa,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let i in s){let n={type:i,...this.options.defaults,...s[i]};this[i]=this._wrapLogFn(n),this[i].raw=this._wrapLogFn(n,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=ta(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=i=>{this[s].raw(String(i).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(){ea=!0}resumeLogs(){ea=!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 i in this.options.types)this[i]=s(i,this.options.types[i])||this[i],this[i].raw=this[i]}_wrapLogFn(e,s){return(...i)=>{if(ea){_c.push([this,e,i,s]);return}return this._logFn(e,i,s)}}_logFn(e,s,i){if((e.level||0)>this.level)return!1;let n={date:new Date,args:[],...e,level:ta(e.level,this.options.types)};!i&&s.length===1&&u0(s[0])?Object.assign(n,s[0]):n.args=[...s],n.message&&(n.args.unshift(n.message),delete n.message),n.additional&&(Array.isArray(n.additional)||(n.additional=n.additional.split(`
197
197
  `)),n.args.push(`
198
198
  `+n.additional.join(`
199
- `)),delete n.additional),n.type=typeof n.type=="string"?n.type.toLowerCase():"log",n.tag=typeof n.tag=="string"?n.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=n,this._log(n))};clearTimeout(this._lastLog.timeout);let o=this._lastLog.time&&n.date?n.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=n.date,o<this.options.throttle)try{let a=JSON.stringify([n.type,n.tag,n.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 Zo(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 vc(t={}){return new ie(t)}var ta=require("node:util"),xc=require("node:path");function sa(t,e){let s=process.cwd()+xc.sep;return t.split(`
199
+ `)),delete n.additional),n.type=typeof n.type=="string"?n.type.toLowerCase():"log",n.tag=typeof n.tag=="string"?n.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=n,this._log(n))};clearTimeout(this._lastLog.timeout);let o=this._lastLog.time&&n.date?n.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=n.date,o<this.options.throttle)try{let a=JSON.stringify([n.type,n.tag,n.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 ta(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 $c(t={}){return new ie(t)}var ra=require("node:util"),Bc=require("node:path");function oa(t,e){let s=process.cwd()+Bc.sep;return t.split(`
200
200
  `).splice(e.split(`
201
- `).length).map(n=>n.trim().replace("file://","").replace(s,""))}function Yg(t,e){return(e.__write||e.write).call(e,t)}var ea=t=>t?`[${t}]`:"",pi=class{formatStack(e,s,i){let n=" ".repeat((i?.errorLevel||0)+1);return n+sa(e,s).join(`
202
- ${n}`)}formatError(e,s){let i=e.message??(0,ta.formatWithOptions)(s,e),n=e.stack?this.formatStack(e.stack,i,s):"",r=s?.errorLevel||0,o=r>0?`${" ".repeat(r)}[cause]: `:"",a=e.cause?`
201
+ `).length).map(n=>n.trim().replace("file://","").replace(s,""))}function l0(t,e){return(e.__write||e.write).call(e,t)}var na=t=>t?`[${t}]`:"",mi=class{formatStack(e,s,i){let n=" ".repeat((i?.errorLevel||0)+1);return n+oa(e,s).join(`
202
+ ${n}`)}formatError(e,s){let i=e.message??(0,ra.formatWithOptions)(s,e),n=e.stack?this.formatStack(e.stack,i,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+i+`
205
- `+n+a}formatArgs(e,s){let i=e.map(n=>n&&typeof n.stack=="string"?this.formatError(n,s):n);return(0,ta.formatWithOptions)(s,...i)}formatDate(e,s){return s.date?e.toLocaleTimeString():""}filterAndJoin(e){return e.filter(Boolean).join(" ")}formatLogObj(e,s){let i=this.formatArgs(e.args,s);return e.type==="box"?`
206
- `+[ea(e.tag),e.title&&e.title,...i.split(`
205
+ `+n+a}formatArgs(e,s){let i=e.map(n=>n&&typeof n.stack=="string"?this.formatError(n,s):n);return(0,ra.formatWithOptions)(s,...i)}formatDate(e,s){return s.date?e.toLocaleTimeString():""}filterAndJoin(e){return e.filter(Boolean).join(" ")}formatLogObj(e,s){let i=this.formatArgs(e.args,s);return e.type==="box"?`
206
+ `+[na(e.tag),e.title&&e.title,...i.split(`
207
207
  `)].filter(Boolean).map(n=>" > "+n).join(`
208
208
  `)+`
209
- `:this.filterAndJoin([ea(e.type),ea(e.tag),i])}log(e,s){let i=this.formatLogObj(e,{columns:s.options.stdout.columns||0,...s.options.formatOptions});return Yg(i+`
210
- `,e.level<2?s.options.stderr||process.stderr:s.options.stdout||process.stdout)}};var ma=bt(require("node:process"),1);var Ln=bt(require("node:tty"),1),{env:wt={},argv:kc=[],platform:Jg=""}=typeof process>"u"?{}:process,Hg="NO_COLOR"in wt||kc.includes("--no-color"),Zg="FORCE_COLOR"in wt||kc.includes("--color"),Qg=Jg==="win32",_c=wt.TERM==="dumb",Xg=Ln&&Ln.isatty&&Ln.isatty(1)&&wt.TERM&&!_c,e0="CI"in wt&&("GITHUB_ACTIONS"in wt||"GITLAB_CI"in wt||"CIRCLECI"in wt),t0=!Hg&&(Zg||Qg&&!_c||Xg||e0);function Bc(t,e,s,i,n=e.slice(0,Math.max(0,t))+i,r=e.slice(Math.max(0,t+s.length)),o=r.indexOf(s)){return n+(o<0?r:Bc(o,r,s,i))}function s0(t,e,s,i,n){return t<0?s+e+i:s+Bc(t,e,i,n)+i}function i0(t,e,s=t,i=t.length+1){return n=>n||!(n===""||n===void 0)?s0((""+n).indexOf(e,i),n,t,e,s):""}function j(t,e,s){return i0(`\x1B[${t}m`,`\x1B[${e}m`,s)}var Sc={reset:j(0,0),bold:j(1,22,"\x1B[22m\x1B[1m"),dim:j(2,22,"\x1B[22m\x1B[2m"),italic:j(3,23),underline:j(4,24),inverse:j(7,27),hidden:j(8,28),strikethrough:j(9,29),black:j(30,39),red:j(31,39),green:j(32,39),yellow:j(33,39),blue:j(34,39),magenta:j(35,39),cyan:j(36,39),white:j(37,39),gray:j(90,39),bgBlack:j(40,49),bgRed:j(41,49),bgGreen:j(42,49),bgYellow:j(43,49),bgBlue:j(44,49),bgMagenta:j(45,49),bgCyan:j(46,49),bgWhite:j(47,49),blackBright:j(90,39),redBright:j(91,39),greenBright:j(92,39),yellowBright:j(93,39),blueBright:j(94,39),magentaBright:j(95,39),cyanBright:j(96,39),whiteBright:j(97,39),bgBlackBright:j(100,49),bgRedBright:j(101,49),bgGreenBright:j(102,49),bgYellowBright:j(103,49),bgBlueBright:j(104,49),bgMagentaBright:j(105,49),bgCyanBright:j(106,49),bgWhiteBright:j(107,49)};function n0(t=t0){return t?Sc:Object.fromEntries(Object.keys(Sc).map(e=>[e,String]))}var H=n0();function $c(t,e="reset"){return H[t]||H[e]}var r0=[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 lt(t){return t.replace(new RegExp(r0,"g"),"")}var Ac={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"}},o0={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function ia(t,e={}){let s={...e,style:{...o0,...e.style}},i=t.split(`
211
- `),n=[],r=$c(s.style.borderColor),o={...typeof s.style.borderStyle=="string"?Ac[s.style.borderStyle]||Ac.solid:s.style.borderStyle};if(r)for(let d in o)o[d]=r(o[d]);let a=s.style.padding%2===0?s.style.padding:s.style.padding+1,u=i.length+a,l=Math.max(...i.map(d=>lt(d).length),s.title?lt(s.title).length:0)+a,c=l+a,f=s.style.marginLeft>0?" ".repeat(s.style.marginLeft):"";if(s.style.marginTop>0&&n.push("".repeat(s.style.marginTop)),s.title){let d=r?r(s.title):s.title,m=o.h.repeat(Math.floor((l-lt(s.title).length)/2)),D=o.h.repeat(l-lt(s.title).length-lt(m).length+a);n.push(`${f}${o.tl}${m}${d}${D}${o.tr}`)}else n.push(`${f}${o.tl}${o.h.repeat(c)}${o.tr}`);let h=s.style.valign==="center"?Math.floor((u-i.length)/2):s.style.valign==="top"?u-i.length-a:u-i.length;for(let d=0;d<u;d++)if(d<h||d>=h+i.length)n.push(`${f}${o.v}${" ".repeat(c)}${o.v}`);else{let m=i[d-h],D=" ".repeat(a),g=" ".repeat(l-lt(m).length);n.push(`${f}${o.v}${D}${m}${g}${o.v}`)}return n.push(`${f}${o.bl}${o.h.repeat(c)}${o.br}`),s.style.marginBottom>0&&n.push("".repeat(s.style.marginBottom)),n.join(`
212
- `)}var Hx=require("node:util"),Zx=require("node:path"),Qx=require("node:tty"),$y={},zn=Object.create(null),mi=t=>globalThis.process?.env||$y.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?zn:globalThis),vt=new Proxy(zn,{get(t,e){return mi()[e]??zn[e]},has(t,e){let s=mi();return e in s||e in zn},set(t,e,s){let i=mi(!0);return i[e]=s,!0},deleteProperty(t,e){if(!e)return!1;let s=mi(!0);return delete s[e],!0},ownKeys(){let t=mi(!0);return Object.keys(t)}}),K0=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",Y0=[["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 J0(){if(globalThis.process?.env)for(let t of Y0){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 rf=J0();rf.name;function Ht(t){return t?t!=="false":!1}var H0=globalThis.process?.platform||"",ya=Ht(vt.CI)||rf.ci!==!1,of=Ht(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),Z0=Ht(vt.DEBUG),Fa=K0==="test"||Ht(vt.TEST);Ht(vt.MINIMAL);var Q0=/^win/i.test(H0);!Ht(vt.NO_COLOR)&&(Ht(vt.FORCE_COLOR)||(of||Q0)&&vt.TERM);var X0=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(X0?.split(".")[0]);var ey=globalThis.process||Object.create(null),tf={versions:{}};new Proxy(ey,{get(t,e){if(e==="env")return vt;if(e in t)return t[e];if(e in tf)return tf[e]}});var ty=globalThis.process?.release?.name==="node",sy=!!globalThis.Bun||!!globalThis.process?.versions?.bun,iy=!!globalThis.Deno,ny=!!globalThis.fastly,ry=!!globalThis.Netlify,oy=!!globalThis.EdgeRuntime,ay=globalThis.navigator?.userAgent==="Cloudflare-Workers",uy=[[ry,"netlify"],[oy,"edge-light"],[ay,"workerd"],[ny,"fastly"],[iy,"deno"],[sy,"bun"],[ty,"node"]];function ly(){let t=uy.find(e=>e[0]);if(t)return{name:t[1]}}var cy=ly();cy?.name;function fy({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 hy=fy();function dy(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(hy,"")}function py(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 Dy(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function my(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 gy(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function yy(t,{ambiguousAsWide:e=!1}={}){return gy(t),Dy(t)||my(t)||e&&py(t)?2:1}var Fy=()=>/[#*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,Cy=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:t=>t.split("")},Ey=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function by(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:s=!0,countAnsiEscapeCodes:i=!1}=e;if(i||(t=dy(t)),t.length===0)return 0;let n=0,r={ambiguousAsWide:!s};for(let{segment:o}of Cy.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)&&!Ey.test(o)){if(Fy().test(o)){n+=2;continue}n+=yy(a,r)}}return n}function wy(){let{env:t}=ma.default,{TERM:e,TERM_PROGRAM:s}=t;return ma.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"},xy={0:"red",1:"yellow"},Sy=wy(),Xe=(t,e)=>Sy?t:e,sf={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 nf(t){return!(typeof Intl=="object")||!Intl.Segmenter?lt(t).length:by(t)}var ga=class extends pi{formatStack(e,s,i){let n=" ".repeat((i?.errorLevel||0)+1);return`
213
- ${n}`+sa(e,s).map(r=>" "+r.replace(/^at +/,o=>H.gray(o)).replace(/\((.+)\)/,(o,a)=>`(${H.cyan(a)})`)).join(`
214
- ${n}`)}formatType(e,s,i){let n=vy[e.type]||xy[e.level]||"gray";if(s)return ky(n)(H.black(` ${e.type.toUpperCase()} `));let r=typeof sf[e.type]=="string"?sf[e.type]:e.icon||e.type;return r?Ay(n)(r):""}formatLogObj(e,s){let[i,...n]=this.formatArgs(e.args,s).split(`
215
- `);if(e.type==="box")return ia(Wn(i+(n.length>0?`
209
+ `:this.filterAndJoin([na(e.type),na(e.tag),i])}log(e,s){let i=this.formatLogObj(e,{columns:s.options.stdout.columns||0,...s.options.formatOptions});return l0(i+`
210
+ `,e.level<2?s.options.stderr||process.stderr:s.options.stdout||process.stdout)}};var Ca=bt(require("node:process"),1);var qn=bt(require("node:tty"),1),{env:vt={},argv:Rc=[],platform:c0=""}=typeof process>"u"?{}:process,f0="NO_COLOR"in vt||Rc.includes("--no-color"),d0="FORCE_COLOR"in vt||Rc.includes("--color"),h0=c0==="win32",Nc=vt.TERM==="dumb",p0=qn&&qn.isatty&&qn.isatty(1)&&vt.TERM&&!Nc,D0="CI"in vt&&("GITHUB_ACTIONS"in vt||"GITLAB_CI"in vt||"CIRCLECI"in vt),m0=!f0&&(d0||h0&&!Nc||p0||D0);function Pc(t,e,s,i,n=e.slice(0,Math.max(0,t))+i,r=e.slice(Math.max(0,t+s.length)),o=r.indexOf(s)){return n+(o<0?r:Pc(o,r,s,i))}function g0(t,e,s,i,n){return t<0?s+e+i:s+Pc(t,e,i,n)+i}function y0(t,e,s=t,i=t.length+1){return n=>n||!(n===""||n===void 0)?g0((""+n).indexOf(e,i),n,t,e,s):""}function j(t,e,s){return y0(`\x1B[${t}m`,`\x1B[${e}m`,s)}var Tc={reset:j(0,0),bold:j(1,22,"\x1B[22m\x1B[1m"),dim:j(2,22,"\x1B[22m\x1B[2m"),italic:j(3,23),underline:j(4,24),inverse:j(7,27),hidden:j(8,28),strikethrough:j(9,29),black:j(30,39),red:j(31,39),green:j(32,39),yellow:j(33,39),blue:j(34,39),magenta:j(35,39),cyan:j(36,39),white:j(37,39),gray:j(90,39),bgBlack:j(40,49),bgRed:j(41,49),bgGreen:j(42,49),bgYellow:j(43,49),bgBlue:j(44,49),bgMagenta:j(45,49),bgCyan:j(46,49),bgWhite:j(47,49),blackBright:j(90,39),redBright:j(91,39),greenBright:j(92,39),yellowBright:j(93,39),blueBright:j(94,39),magentaBright:j(95,39),cyanBright:j(96,39),whiteBright:j(97,39),bgBlackBright:j(100,49),bgRedBright:j(101,49),bgGreenBright:j(102,49),bgYellowBright:j(103,49),bgBlueBright:j(104,49),bgMagentaBright:j(105,49),bgCyanBright:j(106,49),bgWhiteBright:j(107,49)};function F0(t=m0){return t?Tc:Object.fromEntries(Object.keys(Tc).map(e=>[e,String]))}var H=F0();function Oc(t,e="reset"){return H[t]||H[e]}var C0=[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 ct(t){return t.replace(new RegExp(C0,"g"),"")}var Ic={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"}},E0={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function aa(t,e={}){let s={...e,style:{...E0,...e.style}},i=t.split(`
211
+ `),n=[],r=Oc(s.style.borderColor),o={...typeof s.style.borderStyle=="string"?Ic[s.style.borderStyle]||Ic.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=i.length+a,l=Math.max(...i.map(p=>ct(p).length),s.title?ct(s.title).length:0)+a,c=l+a,f=s.style.marginLeft>0?" ".repeat(s.style.marginLeft):"";if(s.style.marginTop>0&&n.push("".repeat(s.style.marginTop)),s.title){let p=r?r(s.title):s.title,m=o.h.repeat(Math.floor((l-ct(s.title).length)/2)),D=o.h.repeat(l-ct(s.title).length-ct(m).length+a);n.push(`${f}${o.tl}${m}${p}${D}${o.tr}`)}else n.push(`${f}${o.tl}${o.h.repeat(c)}${o.tr}`);let d=s.style.valign==="center"?Math.floor((u-i.length)/2):s.style.valign==="top"?u-i.length-a:u-i.length;for(let p=0;p<u;p++)if(p<d||p>=d+i.length)n.push(`${f}${o.v}${" ".repeat(c)}${o.v}`);else{let m=i[p-d],D=" ".repeat(a),g=" ".repeat(l-ct(m).length);n.push(`${f}${o.v}${D}${m}${g}${o.v}`)}return n.push(`${f}${o.bl}${o.h.repeat(c)}${o.br}`),s.style.marginBottom>0&&n.push("".repeat(s.style.marginBottom)),n.join(`
212
+ `)}var hS=require("node:util"),pS=require("node:path"),DS=require("node:tty"),Gy={},Yn=Object.create(null),yi=t=>globalThis.process?.env||Gy.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?Yn:globalThis),xt=new Proxy(Yn,{get(t,e){return yi()[e]??Yn[e]},has(t,e){let s=yi();return e in s||e in Yn},set(t,e,s){let i=yi(!0);return i[e]=s,!0},deleteProperty(t,e){if(!e)return!1;let s=yi(!0);return delete s[e],!0},ownKeys(){let t=yi(!0);return Object.keys(t)}}),uy=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",ly=[["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 cy(){if(globalThis.process?.env)for(let t of ly){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 ff=cy();ff.name;function Zt(t){return t?t!=="false":!1}var fy=globalThis.process?.platform||"",wa=Zt(xt.CI)||ff.ci!==!1,df=Zt(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),dy=Zt(xt.DEBUG),ba=uy==="test"||Zt(xt.TEST);Zt(xt.MINIMAL);var hy=/^win/i.test(fy);!Zt(xt.NO_COLOR)&&(Zt(xt.FORCE_COLOR)||(df||hy)&&xt.TERM);var py=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(py?.split(".")[0]);var Dy=globalThis.process||Object.create(null),uf={versions:{}};new Proxy(Dy,{get(t,e){if(e==="env")return xt;if(e in t)return t[e];if(e in uf)return uf[e]}});var my=globalThis.process?.release?.name==="node",gy=!!globalThis.Bun||!!globalThis.process?.versions?.bun,yy=!!globalThis.Deno,Fy=!!globalThis.fastly,Cy=!!globalThis.Netlify,Ey=!!globalThis.EdgeRuntime,wy=globalThis.navigator?.userAgent==="Cloudflare-Workers",by=[[Cy,"netlify"],[Ey,"edge-light"],[wy,"workerd"],[Fy,"fastly"],[yy,"deno"],[gy,"bun"],[my,"node"]];function vy(){let t=by.find(e=>e[0]);if(t)return{name:t[1]}}var xy=vy();xy?.name;function Sy({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 Ay=Sy();function ky(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Ay,"")}function _y(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 $y(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function By(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 Ty(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function Iy(t,{ambiguousAsWide:e=!1}={}){return Ty(t),$y(t)||By(t)||e&&_y(t)?2:1}var Ry=()=>/[#*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,Ny=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:t=>t.split("")},Py=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function Oy(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:s=!0,countAnsiEscapeCodes:i=!1}=e;if(i||(t=ky(t)),t.length===0)return 0;let n=0,r={ambiguousAsWide:!s};for(let{segment:o}of Ny.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)&&!Py.test(o)){if(Ry().test(o)){n+=2;continue}n+=Iy(a,r)}}return n}function Ly(){let{env:t}=Ca.default,{TERM:e,TERM_PROGRAM:s}=t;return Ca.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 My={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},jy={0:"red",1:"yellow"},qy=Ly(),Xe=(t,e)=>qy?t:e,lf={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 cf(t){return!(typeof Intl=="object")||!Intl.Segmenter?ct(t).length:Oy(t)}var Ea=class extends mi{formatStack(e,s,i){let n=" ".repeat((i?.errorLevel||0)+1);return`
213
+ ${n}`+oa(e,s).map(r=>" "+r.replace(/^at +/,o=>H.gray(o)).replace(/\((.+)\)/,(o,a)=>`(${H.cyan(a)})`)).join(`
214
+ ${n}`)}formatType(e,s,i){let n=My[e.type]||jy[e.level]||"gray";if(s)return Vy(n)(H.black(` ${e.type.toUpperCase()} `));let r=typeof lf[e.type]=="string"?lf[e.type]:e.icon||e.type;return r?Uy(n)(r):""}formatLogObj(e,s){let[i,...n]=this.formatArgs(e.args,s).split(`
215
+ `);if(e.type==="box")return aa(Kn(i+(n.length>0?`
216
216
  `+n.join(`
217
- `):"")),{title:e.title?Wn(e.title):void 0,style:e.style});let r=this.formatDate(e.date,s),o=r&&H.gray(r),a=e.badge??e.level<2,u=this.formatType(e,a,s),l=e.tag?H.gray(e.tag):"",c,f=this.filterAndJoin([u,Wn(i)]),h=this.filterAndJoin(s.columns?[l,o]:[l]),d=(s.columns||0)-nf(f)-nf(h)-2;if(c=d>0&&(s.columns||0)>=80?f+" ".repeat(d)+h:(h?`${H.gray(`[${h}]`)} `:"")+f,c+=Wn(n.length>0?`
217
+ `):"")),{title:e.title?Kn(e.title):void 0,style:e.style});let r=this.formatDate(e.date,s),o=r&&H.gray(r),a=e.badge??e.level<2,u=this.formatType(e,a,s),l=e.tag?H.gray(e.tag):"",c,f=this.filterAndJoin([u,Kn(i)]),d=this.filterAndJoin(s.columns?[l,o]:[l]),p=(s.columns||0)-cf(f)-cf(d)-2;if(c=p>0&&(s.columns||0)>=80?f+" ".repeat(p)+d:(d?`${H.gray(`[${d}]`)} `:"")+f,c+=Kn(n.length>0?`
218
218
  `+n.join(`
219
219
  `):""),e.type==="trace"){let m=new Error("Trace: "+e.message);c+=this.formatStack(m.stack||"",m.message)}return a?`
220
220
  `+c+`
221
- `:c}};function Wn(t){return t.replace(/`([^`]+)`/gm,(e,s)=>H.cyan(s)).replace(/\s+_([^_]+)_\s+/gm,(e,s)=>` ${H.underline(s)} `)}function Ay(t="white"){return H[t]||H.white}function ky(t="bgWhite"){return H[`bg${t[0].toUpperCase()}${t.slice(1)}`]||H.bgWhite}function _y(t={}){let e=By();return process.env.CONSOLA_LEVEL&&(e=Number.parseInt(process.env.CONSOLA_LEVEL)??e),vc({level:e,defaults:{level:e},stdout:process.stdout,stderr:process.stderr,prompt:(...i)=>Promise.resolve().then(()=>(ef(),Xc)).then(n=>n.prompt(...i)),reporters:t.reporters||[t.fancy??!(ya||Fa)?new ga:new pi],...t})}function By(){return Z0?ue.debug:Fa?ue.warn:ue.info}var Bs=_y();var aS=require("node:tty");function Ty(t){return Array.isArray(t)?t:t===void 0?[]:[t]}function Ca(t,e=""){let s=[];for(let i of t)for(let[n,r]of i.entries())s[n]=Math.max(s[n]||0,r.length);return t.map(i=>i.map((n,r)=>e+n[r===0?"padStart":"padEnd"](s[r])).join(" ")).join(`
222
- `)}function We(t){return typeof t=="function"?t():t}var xt=class extends Error{constructor(e,s){super(e),this.code=s,this.name="CLIError"}},Iy=/\d/,Ry=["-","_","/","."];function Ny(t=""){if(!Iy.test(t))return t!==t.toLowerCase()}function af(t,e){let s=e??Ry,i=[];if(!t||typeof t!="string")return i;let n="",r,o;for(let a of t){let u=s.includes(a);if(u===!0){i.push(n),n="",r=void 0;continue}let l=Ny(a);if(o===!1){if(r===!1&&l===!0){i.push(n),n=a,r=l;continue}if(r===!0&&l===!1&&n.length>1){let c=n.at(-1);i.push(n.slice(0,Math.max(0,n.length-1))),n=c+a,r=l;continue}}n+=a,r=l,o=u}return i.push(n),i}function Py(t){return t?t[0].toUpperCase()+t.slice(1):""}function Oy(t){return t?t[0].toLowerCase()+t.slice(1):""}function Ly(t,e){return t?(Array.isArray(t)?t:af(t)).map(s=>Py(e?.normalize?s.toLowerCase():s)).join(""):""}function My(t,e){return Oy(Ly(t||"",e))}function jy(t,e){return t?(Array.isArray(t)?t:af(t)).map(s=>s.toLowerCase()).join(e??"-"):""}function Ea(t){return t==null?[]:Array.isArray(t)?t:[t]}function qy(t,e,s,i){let n,r=t[e],o=~i.string.indexOf(e)?s==null||s===!0?"":String(s):typeof s=="boolean"?s:~i.boolean.indexOf(e)?s==="false"?!1:s==="true"||(t._.push((n=+s,n*0===0?n:s)),!!s):(n=+s,n*0===0?n:s);t[e]=r==null?o:Array.isArray(r)?r.concat(o):[r,o]}function Uy(t=[],e={}){let s,i,n,r,o,a={_:[]},u=0,l=0,c=0,f=t.length,h=e.alias!==void 0,d=e.unknown!==void 0,m=e.default!==void 0;if(e.alias=e.alias||{},e.string=Ea(e.string),e.boolean=Ea(e.boolean),h)for(s in e.alias)for(i=e.alias[s]=Ea(e.alias[s]),u=0;u<i.length;u++)(e.alias[i[u]]=i.concat(s)).splice(u,1);for(u=e.boolean.length;u-- >0;)for(i=e.alias[e.boolean[u]]||[],l=i.length;l-- >0;)e.boolean.push(i[l]);for(u=e.string.length;u-- >0;)for(i=e.alias[e.string[u]]||[],l=i.length;l-- >0;)e.string.push(i[l]);if(m){for(s in e.default)if(r=typeof e.default[s],i=e.alias[s]=e.alias[s]||[],e[r]!==void 0)for(e[r].push(s),u=0;u<i.length;u++)e[r].push(i[u])}let D=d?Object.keys(e.alias):[];for(u=0;u<f;u++){if(n=t[u],n==="--"){a._=a._.concat(t.slice(++u));break}for(l=0;l<n.length&&n.charCodeAt(l)===45;l++);if(l===0)a._.push(n);else if(n.substring(l,l+3)==="no-"){if(r=n.slice(Math.max(0,l+3)),d&&!~D.indexOf(r))return e.unknown(n);a[r]=!1}else{for(c=l+1;c<n.length&&n.charCodeAt(c)!==61;c++);for(r=n.substring(l,c),o=n.slice(Math.max(0,++c))||u+1===f||(""+t[u+1]).charCodeAt(0)===45||t[++u],i=l===2?[r]:r,c=0;c<i.length;c++){if(r=i[c],d&&!~D.indexOf(r))return e.unknown("-".repeat(l)+r);qy(a,r,c+1<i.length||o,e)}}}if(m)for(s in e.default)a[s]===void 0&&(a[s]=e.default[s]);if(h)for(s in a)for(i=e.alias[s]||[];i.length>0;)a[i.shift()]=a[s];return a}function Vy(t,e){let s={boolean:[],string:[],mixed:[],alias:{},default:{}},i=uf(e);for(let a of i)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 n=Uy(t,s),[...r]=n._,o=new Proxy(n,{get(a,u){return a[u]??a[My(u)]??a[jy(u)]}});for(let[,a]of i.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 xt(`Missing required positional argument: ${a.name.toUpperCase()}`,"EARG");o[a.name]=a.default}}else if(a.required&&o[a.name]===void 0)throw new xt(`Missing required argument: --${a.name}`,"EARG");return o}function uf(t){let e=[];for(let[s,i]of Object.entries(t||{}))e.push({...i,name:s,alias:Ty(i.alias)});return e}async function lf(t,e){let s=await We(t.args||{}),i=Vy(e.rawArgs,s),n={rawArgs:e.rawArgs,args:i,data:e.data,cmd:t};typeof t.setup=="function"&&await t.setup(n);let r;try{let o=await We(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 xt(`Unknown command \`${u}\``,"E_UNKNOWN_COMMAND");let l=await We(o[u]);l&&await lf(l,{rawArgs:e.rawArgs.slice(a+1)})}else if(!t.run)throw new xt("No command specified.","E_NO_COMMAND")}typeof t.run=="function"&&(r=await t.run(n))}finally{typeof t.cleanup=="function"&&await t.cleanup(n)}return{result:r}}async function ba(t,e,s){let i=await We(t.subCommands);if(i&&Object.keys(i).length>0){let n=e.findIndex(a=>!a.startsWith("-")),r=e[n],o=await We(i[r]);if(o)return ba(o,e.slice(n+1),t)}return[t,s]}async function Wy(t,e){try{Bs.log(await zy(t,e)+`
223
- `)}catch(s){Bs.error(s)}}async function zy(t,e){let s=await We(t.meta||{}),i=uf(await We(t.args||{})),n=await We(e?.meta||{}),r=`${n.name?`${n.name} `:""}`+(s.name||process.argv[1]),o=[],a=[],u=[],l=[];for(let d of i)if(d.type==="positional"){let m=d.name.toUpperCase(),D=d.required!==!1&&d.default===void 0,g=d.default?`="${d.default}"`:"";a.push(["`"+m+g+"`",d.description||"",d.valueHint?`<${d.valueHint}>`:""]),l.push(D?`<${m}>`:`[${m}]`)}else{let m=d.required===!0&&d.default===void 0,D=(d.type==="boolean"&&d.default===!0?[...(d.alias||[]).map(g=>`--no-${g}`),`--no-${d.name}`].join(", "):[...(d.alias||[]).map(g=>`-${g}`),`--${d.name}`].join(", "))+(d.type==="string"&&(d.valueHint||d.default)?`=${d.valueHint?`<${d.valueHint}>`:`"${d.default||""}"`}`:"");o.push(["`"+D+(m?" (required)":"")+"`",d.description||""]),m&&l.push(D)}if(t.subCommands){let d=[],m=await We(t.subCommands);for(let[D,g]of Object.entries(m)){let F=await We(g),y=await We(F?.meta);u.push([`\`${D}\``,y?.description||""]),d.push(D)}l.push(d.join("|"))}let c=[],f=s.version||n.version;c.push(H.gray(`${s.description} (${r+(f?` v${f}`:"")})`),"");let h=o.length>0||a.length>0;return c.push(`${H.underline(H.bold("USAGE"))} \`${r}${h?" [OPTIONS]":""} ${l.join(" ")}\``,""),a.length>0&&(c.push(H.underline(H.bold("ARGUMENTS")),""),c.push(Ca(a," ")),c.push("")),o.length>0&&(c.push(H.underline(H.bold("OPTIONS")),""),c.push(Ca(o," ")),c.push("")),u.length>0&&(c.push(H.underline(H.bold("COMMANDS")),""),c.push(Ca(u," ")),c.push("",`Use \`${r} <command> --help\` for more information about a command.`)),c.filter(d=>typeof d=="string").join(`
224
- `)}async function cf(t,e={}){let s=e.rawArgs||process.argv.slice(2),i=e.showUsage||Wy;try{if(s.includes("--help")||s.includes("-h"))await i(...await ba(t,s)),process.exit(0);else if(s.length===1&&s[0]==="--version"){let n=typeof t.meta=="function"?await t.meta():await t.meta;if(!n?.version)throw new xt("No version specified","E_NO_VERSION");Bs.log(n.version)}else await lf(t,{rawArgs:s})}catch(n){let r=n instanceof xt;r||Bs.error(n,`
225
- `),r&&await i(...await ba(t,s)),Bs.error(n.message),process.exit(1)}}var Gn={name:"diffray",version:"0.5.0",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 && cp -r src/defaults dist/","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/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",diff:"^8.0.2",glob:"^13.0.0",yaml:"^2.8.2",zod:"^3.22.4"}};var gi=class{diff(e,s,i={}){let n;typeof i=="function"?(n=i,i={}):"callback"in i&&(n=i.callback);let r=this.castInput(e,i),o=this.castInput(s,i),a=this.removeEmpty(this.tokenize(r,i)),u=this.removeEmpty(this.tokenize(o,i));return this.diffWithOptionsObj(a,u,i,n)}diffWithOptionsObj(e,s,i,n){var r;let o=y=>{if(y=this.postProcess(y,i),n){setTimeout(function(){n(y)},0);return}else return y},a=s.length,u=e.length,l=1,c=a+u;i.maxEditLength!=null&&(c=Math.min(c,i.maxEditLength));let f=(r=i.timeout)!==null&&r!==void 0?r:1/0,h=Date.now()+f,d=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(d[0],s,e,0,i);if(d[0].oldPos+1>=u&&m+1>=a)return o(this.buildValues(d[0].lastComponent,s,e));let D=-1/0,g=1/0,F=()=>{for(let y=Math.max(D,-l);y<=Math.min(g,l);y+=2){let C,E=d[y-1],v=d[y+1];E&&(d[y-1]=void 0);let S=!1;if(v){let b=v.oldPos-y;S=v&&0<=b&&b<a}let T=E&&E.oldPos+1<u;if(!S&&!T){d[y]=void 0;continue}if(!T||S&&E.oldPos<v.oldPos?C=this.addToPath(v,!0,!1,0,i):C=this.addToPath(E,!1,!0,1,i),m=this.extractCommon(C,s,e,y,i),C.oldPos+1>=u&&m+1>=a)return o(this.buildValues(C.lastComponent,s,e))||!0;d[y]=C,C.oldPos+1>=u&&(g=Math.min(g,y-1)),m+1>=a&&(D=Math.max(D,y+1))}l++};if(n)(function y(){setTimeout(function(){if(l>c||Date.now()>h)return n(void 0);F()||y()},0)})();else for(;l<=c&&Date.now()<=h;){let y=F();if(y)return y}}addToPath(e,s,i,n,r){let o=e.lastComponent;return o&&!r.oneChangePerToken&&o.added===s&&o.removed===i?{oldPos:e.oldPos+n,lastComponent:{count:o.count+1,added:s,removed:i,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:s,removed:i,previousComponent:o}}}extractCommon(e,s,i,n,r){let o=s.length,a=i.length,u=e.oldPos,l=u-n,c=0;for(;l+1<o&&u+1<a&&this.equals(i[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,i){return i.comparator?i.comparator(e,s):e===s||!!i.ignoreCase&&e.toLowerCase()===s.toLowerCase()}removeEmpty(e){let s=[];for(let i=0;i<e.length;i++)e[i]&&s.push(e[i]);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,i){let n=[],r;for(;e;)n.push(e),r=e.previousComponent,delete e.previousComponent,e=r;n.reverse();let o=n.length,a=0,u=0,l=0;for(;a<o;a++){let c=n[a];if(c.removed)c.value=this.join(i.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(h,d){let m=i[l+d];return m.length>h.length?m:h}),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 n}};var wa=class extends gi{constructor(){super(...arguments),this.tokenize=Yy}equals(e,s,i){return i.ignoreWhitespace?((!i.newlineIsToken||!e.includes(`
221
+ `:c}};function Kn(t){return t.replace(/`([^`]+)`/gm,(e,s)=>H.cyan(s)).replace(/\s+_([^_]+)_\s+/gm,(e,s)=>` ${H.underline(s)} `)}function Uy(t="white"){return H[t]||H.white}function Vy(t="bgWhite"){return H[`bg${t[0].toUpperCase()}${t.slice(1)}`]||H.bgWhite}function Wy(t={}){let e=zy();return process.env.CONSOLA_LEVEL&&(e=Number.parseInt(process.env.CONSOLA_LEVEL)??e),$c({level:e,defaults:{level:e},stdout:process.stdout,stderr:process.stderr,prompt:(...i)=>Promise.resolve().then(()=>(af(),of)).then(n=>n.prompt(...i)),reporters:t.reporters||[t.fancy??!(wa||ba)?new Ea:new mi],...t})}function zy(){return dy?ue.debug:ba?ue.warn:ue.info}var Ts=Wy();var vS=require("node:tty");function Ky(t){return Array.isArray(t)?t:t===void 0?[]:[t]}function va(t,e=""){let s=[];for(let i of t)for(let[n,r]of i.entries())s[n]=Math.max(s[n]||0,r.length);return t.map(i=>i.map((n,r)=>e+n[r===0?"padStart":"padEnd"](s[r])).join(" ")).join(`
222
+ `)}function We(t){return typeof t=="function"?t():t}var St=class extends Error{constructor(e,s){super(e),this.code=s,this.name="CLIError"}},Yy=/\d/,Jy=["-","_","/","."];function Hy(t=""){if(!Yy.test(t))return t!==t.toLowerCase()}function hf(t,e){let s=e??Jy,i=[];if(!t||typeof t!="string")return i;let n="",r,o;for(let a of t){let u=s.includes(a);if(u===!0){i.push(n),n="",r=void 0;continue}let l=Hy(a);if(o===!1){if(r===!1&&l===!0){i.push(n),n=a,r=l;continue}if(r===!0&&l===!1&&n.length>1){let c=n.at(-1);i.push(n.slice(0,Math.max(0,n.length-1))),n=c+a,r=l;continue}}n+=a,r=l,o=u}return i.push(n),i}function Zy(t){return t?t[0].toUpperCase()+t.slice(1):""}function Qy(t){return t?t[0].toLowerCase()+t.slice(1):""}function Xy(t,e){return t?(Array.isArray(t)?t:hf(t)).map(s=>Zy(e?.normalize?s.toLowerCase():s)).join(""):""}function eF(t,e){return Qy(Xy(t||"",e))}function tF(t,e){return t?(Array.isArray(t)?t:hf(t)).map(s=>s.toLowerCase()).join(e??"-"):""}function xa(t){return t==null?[]:Array.isArray(t)?t:[t]}function sF(t,e,s,i){let n,r=t[e],o=~i.string.indexOf(e)?s==null||s===!0?"":String(s):typeof s=="boolean"?s:~i.boolean.indexOf(e)?s==="false"?!1:s==="true"||(t._.push((n=+s,n*0===0?n:s)),!!s):(n=+s,n*0===0?n:s);t[e]=r==null?o:Array.isArray(r)?r.concat(o):[r,o]}function iF(t=[],e={}){let s,i,n,r,o,a={_:[]},u=0,l=0,c=0,f=t.length,d=e.alias!==void 0,p=e.unknown!==void 0,m=e.default!==void 0;if(e.alias=e.alias||{},e.string=xa(e.string),e.boolean=xa(e.boolean),d)for(s in e.alias)for(i=e.alias[s]=xa(e.alias[s]),u=0;u<i.length;u++)(e.alias[i[u]]=i.concat(s)).splice(u,1);for(u=e.boolean.length;u-- >0;)for(i=e.alias[e.boolean[u]]||[],l=i.length;l-- >0;)e.boolean.push(i[l]);for(u=e.string.length;u-- >0;)for(i=e.alias[e.string[u]]||[],l=i.length;l-- >0;)e.string.push(i[l]);if(m){for(s in e.default)if(r=typeof e.default[s],i=e.alias[s]=e.alias[s]||[],e[r]!==void 0)for(e[r].push(s),u=0;u<i.length;u++)e[r].push(i[u])}let D=p?Object.keys(e.alias):[];for(u=0;u<f;u++){if(n=t[u],n==="--"){a._=a._.concat(t.slice(++u));break}for(l=0;l<n.length&&n.charCodeAt(l)===45;l++);if(l===0)a._.push(n);else if(n.substring(l,l+3)==="no-"){if(r=n.slice(Math.max(0,l+3)),p&&!~D.indexOf(r))return e.unknown(n);a[r]=!1}else{for(c=l+1;c<n.length&&n.charCodeAt(c)!==61;c++);for(r=n.substring(l,c),o=n.slice(Math.max(0,++c))||u+1===f||(""+t[u+1]).charCodeAt(0)===45||t[++u],i=l===2?[r]:r,c=0;c<i.length;c++){if(r=i[c],p&&!~D.indexOf(r))return e.unknown("-".repeat(l)+r);sF(a,r,c+1<i.length||o,e)}}}if(m)for(s in e.default)a[s]===void 0&&(a[s]=e.default[s]);if(d)for(s in a)for(i=e.alias[s]||[];i.length>0;)a[i.shift()]=a[s];return a}function nF(t,e){let s={boolean:[],string:[],mixed:[],alias:{},default:{}},i=pf(e);for(let a of i)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 n=iF(t,s),[...r]=n._,o=new Proxy(n,{get(a,u){return a[u]??a[eF(u)]??a[tF(u)]}});for(let[,a]of i.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 St(`Missing required positional argument: ${a.name.toUpperCase()}`,"EARG");o[a.name]=a.default}}else if(a.required&&o[a.name]===void 0)throw new St(`Missing required argument: --${a.name}`,"EARG");return o}function pf(t){let e=[];for(let[s,i]of Object.entries(t||{}))e.push({...i,name:s,alias:Ky(i.alias)});return e}async function Df(t,e){let s=await We(t.args||{}),i=nF(e.rawArgs,s),n={rawArgs:e.rawArgs,args:i,data:e.data,cmd:t};typeof t.setup=="function"&&await t.setup(n);let r;try{let o=await We(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 St(`Unknown command \`${u}\``,"E_UNKNOWN_COMMAND");let l=await We(o[u]);l&&await Df(l,{rawArgs:e.rawArgs.slice(a+1)})}else if(!t.run)throw new St("No command specified.","E_NO_COMMAND")}typeof t.run=="function"&&(r=await t.run(n))}finally{typeof t.cleanup=="function"&&await t.cleanup(n)}return{result:r}}async function Sa(t,e,s){let i=await We(t.subCommands);if(i&&Object.keys(i).length>0){let n=e.findIndex(a=>!a.startsWith("-")),r=e[n],o=await We(i[r]);if(o)return Sa(o,e.slice(n+1),t)}return[t,s]}async function rF(t,e){try{Ts.log(await oF(t,e)+`
223
+ `)}catch(s){Ts.error(s)}}async function oF(t,e){let s=await We(t.meta||{}),i=pf(await We(t.args||{})),n=await We(e?.meta||{}),r=`${n.name?`${n.name} `:""}`+(s.name||process.argv[1]),o=[],a=[],u=[],l=[];for(let p of i)if(p.type==="positional"){let m=p.name.toUpperCase(),D=p.required!==!1&&p.default===void 0,g=p.default?`="${p.default}"`:"";a.push(["`"+m+g+"`",p.description||"",p.valueHint?`<${p.valueHint}>`:""]),l.push(D?`<${m}>`:`[${m}]`)}else{let m=p.required===!0&&p.default===void 0,D=(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(["`"+D+(m?" (required)":"")+"`",p.description||""]),m&&l.push(D)}if(t.subCommands){let p=[],m=await We(t.subCommands);for(let[D,g]of Object.entries(m)){let F=await We(g),y=await We(F?.meta);u.push([`\`${D}\``,y?.description||""]),p.push(D)}l.push(p.join("|"))}let c=[],f=s.version||n.version;c.push(H.gray(`${s.description} (${r+(f?` v${f}`:"")})`),"");let d=o.length>0||a.length>0;return c.push(`${H.underline(H.bold("USAGE"))} \`${r}${d?" [OPTIONS]":""} ${l.join(" ")}\``,""),a.length>0&&(c.push(H.underline(H.bold("ARGUMENTS")),""),c.push(va(a," ")),c.push("")),o.length>0&&(c.push(H.underline(H.bold("OPTIONS")),""),c.push(va(o," ")),c.push("")),u.length>0&&(c.push(H.underline(H.bold("COMMANDS")),""),c.push(va(u," ")),c.push("",`Use \`${r} <command> --help\` for more information about a command.`)),c.filter(p=>typeof p=="string").join(`
224
+ `)}async function mf(t,e={}){let s=e.rawArgs||process.argv.slice(2),i=e.showUsage||rF;try{if(s.includes("--help")||s.includes("-h"))await i(...await Sa(t,s)),process.exit(0);else if(s.length===1&&s[0]==="--version"){let n=typeof t.meta=="function"?await t.meta():await t.meta;if(!n?.version)throw new St("No version specified","E_NO_VERSION");Ts.log(n.version)}else await Df(t,{rawArgs:s})}catch(n){let r=n instanceof St;r||Ts.error(n,`
225
+ `),r&&await i(...await Sa(t,s)),Ts.error(n.message),process.exit(1)}}var Jn={name:"diffray",version:"0.5.1",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 && cp -r src/defaults dist/","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/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",diff:"^8.0.2",glob:"^13.0.0",yaml:"^2.8.2",zod:"^3.22.4"}};var Fi=class{diff(e,s,i={}){let n;typeof i=="function"?(n=i,i={}):"callback"in i&&(n=i.callback);let r=this.castInput(e,i),o=this.castInput(s,i),a=this.removeEmpty(this.tokenize(r,i)),u=this.removeEmpty(this.tokenize(o,i));return this.diffWithOptionsObj(a,u,i,n)}diffWithOptionsObj(e,s,i,n){var r;let o=y=>{if(y=this.postProcess(y,i),n){setTimeout(function(){n(y)},0);return}else return y},a=s.length,u=e.length,l=1,c=a+u;i.maxEditLength!=null&&(c=Math.min(c,i.maxEditLength));let f=(r=i.timeout)!==null&&r!==void 0?r:1/0,d=Date.now()+f,p=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(p[0],s,e,0,i);if(p[0].oldPos+1>=u&&m+1>=a)return o(this.buildValues(p[0].lastComponent,s,e));let D=-1/0,g=1/0,F=()=>{for(let y=Math.max(D,-l);y<=Math.min(g,l);y+=2){let C,E=p[y-1],v=p[y+1];E&&(p[y-1]=void 0);let S=!1;if(v){let w=v.oldPos-y;S=v&&0<=w&&w<a}let T=E&&E.oldPos+1<u;if(!S&&!T){p[y]=void 0;continue}if(!T||S&&E.oldPos<v.oldPos?C=this.addToPath(v,!0,!1,0,i):C=this.addToPath(E,!1,!0,1,i),m=this.extractCommon(C,s,e,y,i),C.oldPos+1>=u&&m+1>=a)return o(this.buildValues(C.lastComponent,s,e))||!0;p[y]=C,C.oldPos+1>=u&&(g=Math.min(g,y-1)),m+1>=a&&(D=Math.max(D,y+1))}l++};if(n)(function y(){setTimeout(function(){if(l>c||Date.now()>d)return n(void 0);F()||y()},0)})();else for(;l<=c&&Date.now()<=d;){let y=F();if(y)return y}}addToPath(e,s,i,n,r){let o=e.lastComponent;return o&&!r.oneChangePerToken&&o.added===s&&o.removed===i?{oldPos:e.oldPos+n,lastComponent:{count:o.count+1,added:s,removed:i,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:s,removed:i,previousComponent:o}}}extractCommon(e,s,i,n,r){let o=s.length,a=i.length,u=e.oldPos,l=u-n,c=0;for(;l+1<o&&u+1<a&&this.equals(i[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,i){return i.comparator?i.comparator(e,s):e===s||!!i.ignoreCase&&e.toLowerCase()===s.toLowerCase()}removeEmpty(e){let s=[];for(let i=0;i<e.length;i++)e[i]&&s.push(e[i]);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,i){let n=[],r;for(;e;)n.push(e),r=e.previousComponent,delete e.previousComponent,e=r;n.reverse();let o=n.length,a=0,u=0,l=0;for(;a<o;a++){let c=n[a];if(c.removed)c.value=this.join(i.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 m=i[l+p];return m.length>d.length?m: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 n}};var Aa=class extends Fi{constructor(){super(...arguments),this.tokenize=lF}equals(e,s,i){return i.ignoreWhitespace?((!i.newlineIsToken||!e.includes(`
226
226
  `))&&(e=e.trim()),(!i.newlineIsToken||!s.includes(`
227
227
  `))&&(s=s.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(e.endsWith(`
228
228
  `)&&(e=e.slice(0,-1)),s.endsWith(`
229
- `)&&(s=s.slice(0,-1))),super.equals(e,s,i)}},Ky=new wa;function va(t,e,s){return Ky.diff(t,e,s)}function Yy(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
230
- `));let s=[],i=t.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let n=0;n<i.length;n++){let r=i[n];n%2&&!e.newlineIsToken?s[s.length-1]+=r:s.push(r)}return s}function xa(t,e,s,i,n,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;va(s,i,Object.assign(Object.assign({},a),{callback:f=>{let h=l(f);c(h)}}))}else return l(va(s,i,a));function l(c){if(!c)return;c.push({value:"",lines:[]});function f(y){return y.map(function(C){return" "+C})}let h=[],d=0,m=0,D=[],g=1,F=1;for(let y=0;y<c.length;y++){let C=c[y],E=C.lines||Jy(C.value);if(C.lines=E,C.added||C.removed){if(!d){let v=c[y-1];d=g,m=F,v&&(D=u>0?f(v.lines.slice(-u)):[],d-=D.length,m-=D.length)}for(let v of E)D.push((C.added?"+":"-")+v);C.added?F+=E.length:g+=E.length}else{if(d)if(E.length<=u*2&&y<c.length-2)for(let v of f(E))D.push(v);else{let v=Math.min(E.length,u);for(let T of f(E.slice(0,v)))D.push(T);let S={oldStart:d,oldLines:g-d+v,newStart:m,newLines:F-m+v,lines:D};h.push(S),d=0,m=0,D=[]}g+=E.length,F+=E.length}}for(let y of h)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:n,newHeader:r,hunks:h}}}function Kn(t){if(Array.isArray(t))return t.map(Kn).join(`
229
+ `)&&(s=s.slice(0,-1))),super.equals(e,s,i)}},uF=new Aa;function ka(t,e,s){return uF.diff(t,e,s)}function lF(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
230
+ `));let s=[],i=t.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let n=0;n<i.length;n++){let r=i[n];n%2&&!e.newlineIsToken?s[s.length-1]+=r:s.push(r)}return s}function _a(t,e,s,i,n,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;ka(s,i,Object.assign(Object.assign({},a),{callback:f=>{let d=l(f);c(d)}}))}else return l(ka(s,i,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,m=0,D=[],g=1,F=1;for(let y=0;y<c.length;y++){let C=c[y],E=C.lines||cF(C.value);if(C.lines=E,C.added||C.removed){if(!p){let v=c[y-1];p=g,m=F,v&&(D=u>0?f(v.lines.slice(-u)):[],p-=D.length,m-=D.length)}for(let v of E)D.push((C.added?"+":"-")+v);C.added?F+=E.length:g+=E.length}else{if(p)if(E.length<=u*2&&y<c.length-2)for(let v of f(E))D.push(v);else{let v=Math.min(E.length,u);for(let T of f(E.slice(0,v)))D.push(T);let S={oldStart:p,oldLines:g-p+v,newStart:m,newLines:F-m+v,lines:D};d.push(S),p=0,m=0,D=[]}g+=E.length,F+=E.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:n,newHeader:r,hunks:d}}}function Hn(t){if(Array.isArray(t))return t.map(Hn).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 i=t.hunks[s];i.oldLines===0&&(i.oldStart-=1),i.newLines===0&&(i.newStart-=1),e.push("@@ -"+i.oldStart+","+i.oldLines+" +"+i.newStart+","+i.newLines+" @@");for(let n of i.lines)e.push(n)}return e.join(`
233
233
  `)+`
234
- `}function ff(t,e,s,i,n,r,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){let{callback:a}=o;xa(t,e,s,i,n,r,Object.assign(Object.assign({},o),{callback:u=>{a(u?Kn(u):void 0)}}))}else{let a=xa(t,e,s,i,n,r,o);return a?Kn(a):void 0}}function $s(t,e,s,i,n,r){return ff(t,t,e,s,i,n,r)}function Jy(t){let e=t.endsWith(`
234
+ `}function gf(t,e,s,i,n,r,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){let{callback:a}=o;_a(t,e,s,i,n,r,Object.assign(Object.assign({},o),{callback:u=>{a(u?Hn(u):void 0)}}))}else{let a=_a(t,e,s,i,n,r,o);return a?Hn(a):void 0}}function Is(t,e,s,i,n,r){return gf(t,t,e,s,i,n,r)}function cF(t){let e=t.endsWith(`
235
235
  `),s=t.split(`
236
236
  `).map(i=>i+`
237
- `);return e?s.pop():s.push(s.pop().slice(0,-1)),s}var Df=require("node:child_process"),Ci=require("node:fs/promises"),mf=require("node:path");yi();Y();var pf=3e4;async function le(t,e=process.cwd()){return new Promise((s,i)=>{let n=(0,Df.spawn)("git",t,{cwd:e}),r=[],o=[];n.stdout.on("data",u=>r.push(u)),n.stderr.on("data",u=>o.push(u));let a=setTimeout(()=>{n.kill(),i(new Error(`git ${t[0]} timeout after ${pf/1e3}s`))},pf);n.on("close",u=>{if(clearTimeout(a),u===0)s(Buffer.concat(r).toString("utf-8"));else{let l=Buffer.concat(o).toString("utf-8");i(new Error(`git ${t[0]} failed: ${l||`exit code ${u}`}`))}}),n.on("error",u=>{clearTimeout(a),i(u)})})}async function Aa(){try{let e=(await le(["rev-parse","--abbrev-ref","HEAD"])).trim();return e==="HEAD"?null:e}catch(t){return p.debug(`getCurrentBranch failed: ${t}`),null}}async function gf(){try{let i=(await le(["symbolic-ref","refs/remotes/origin/HEAD"])).trim().replace("refs/remotes/origin/","");if(i)return i}catch{}let t=["main","master","develop"];for(let e of t)try{return await le(["rev-parse","--verify",e]),e}catch{}return null}async function yf(t){try{return await le(["rev-parse","--verify",t]),!0}catch{try{return await le(["rev-parse","--verify",`origin/${t}`]),!0}catch{return!1}}}async function Qy(){return(await le(["rev-parse","HEAD"])).trim()}async function Xy(t){return(await le(["rev-parse",t])).trim()}async function Ei(t){await le(["checkout",t]),bf()}async function Ff(t){let e=await Qy(),s=await Xy(t);if(e===s)return{checkoutNeeded:!1,originalRef:null};let n=await Aa()||e;return await Ei(t),{checkoutNeeded:!0,originalRef:n}}async function Cf(){try{return(await le(["status","--porcelain"])).trim().split(`
238
- `).filter(s=>s&&!s.startsWith("??")).length>0}catch(t){return p.debug(`hasUncommittedChanges failed: ${t}`),!1}}function eF(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 Ef(){return ct(we.GIT_STATUS,async()=>{let t=await le(["status","--porcelain"]);return eF(t)})}function bf(){Ts(we.GIT_STATUS)}async function wf(){try{return await le(["rev-parse","--git-dir"]),!0}catch(t){return p.debug(`isGitRepository: not a git repo: ${t}`),!1}}async function tF(){try{return(await Ef()).map(e=>e.file)}catch(t){throw new Error(`Failed to get changed files: ${t}`)}}async function sF(t){try{let e="",s="";try{e=await le(["show",`HEAD:${t}`])}catch{e=""}try{s=await(0,Ci.readFile)(t,"utf-8")}catch{s=""}return $s(t,e,s,"HEAD","Working Directory")}catch(e){throw new Error(`Failed to get diff for ${t}: ${e}`)}}async function iF(t){try{let s=(await Ef()).find(i=>i.file===t);return s?s.index==="A"||s.index==="?"||s.worktree==="?"?"added":s.index==="D"||s.worktree==="D"?"deleted":"modified":"modified"}catch(e){return p.debug(`getFileStatus failed for ${t}: ${e}`),"modified"}}function ka(t){let e=t.split(`
240
- `),s=0,i=0;for(let n of e)n.startsWith("+")&&!n.startsWith("+++")?s++:n.startsWith("-")&&!n.startsWith("---")&&i++;return{additions:s,deletions:i}}async function vf(){bf();let t=await tF();return(await Promise.all(t.map(async s=>{try{let[i,n]=await Promise.all([sF(s),iF(s)]),{additions:r,deletions:o}=ka(i);return{file:s,status:n,diff:i,additions:r,deletions:o}}catch(i){return p.debug(`getAllDiffs: skipping ${s}: ${i}`),null}}))).filter(s=>s!==null).filter(s=>s.diff.trim().length>0)}function xf(t){return t.trim().split(`
241
- `).filter(e=>e.length>0).map(e=>{let[s,...i]=e.split(" "),n=i.join(" "),r="modified";return s==="A"?r="added":s==="D"?r="deleted":s?.startsWith("R")&&(r="modified"),{file:n,status:r}}).filter(e=>e.file)}async function Sf(){try{let t=await le(["diff","--name-status","HEAD~1","HEAD"]),e=xf(t);return e.length===0?[]:(await Promise.all(e.map(async({file:i,status:n})=>{try{let r=await le(["diff","HEAD~1","HEAD","--",i]),{additions:o,deletions:a}=ka(r),u=r.startsWith("diff --git")?r:$s(i,"","","HEAD~1","HEAD");return{file:i,status:n,diff:u,additions:o,deletions:a}}catch(r){return p.debug(`getLastCommitDiffs: skipping ${i}: ${r}`),null}}))).filter(i=>i!==null&&i.diff.trim().length>0)}catch(t){throw new Error(`Failed to get last commit diffs: ${t}`)}}async function Af(t,e="HEAD"){try{return(await le(["log","--format=%B%n---COMMIT_SEPARATOR---",`${t}..${e}`])).split("---COMMIT_SEPARATOR---").map(i=>i.trim()).filter(i=>i.length>0)}catch(s){return p.debug(`getCommitMessages failed: ${s}`),[]}}async function _a(t,e="HEAD"){try{let s=await le(["diff","--name-status",t,e]),i=xf(s);return i.length===0?[]:(await Promise.all(i.map(async({file:r,status:o})=>{try{let a=await le(["diff",t,e,"--",r]),{additions:u,deletions:l}=ka(a),c=a.startsWith("diff --git")?a:$s(r,"","",t,e);return{file:r,status:o,diff:c,additions:u,deletions:l}}catch(a){return p.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 kf(t,e){let s=new Map(t.map(r=>[r.file,r])),i=[],n=[];for(let r of e){let o=s.get(r);o?i.push(o):n.push(r)}return{matched:i,unmatched:n}}async function nF(t){let e=(0,mf.resolve)(process.cwd(),t);try{if(!(await(0,Ci.stat)(e)).isFile())return null;let i=await(0,Ci.readFile)(e,"utf-8"),n=$s(t,"",i,"/dev/null",t),r=n.split(`
242
- `).filter(o=>o.startsWith("+")&&!o.startsWith("+++")).length;return{file:t,status:"added",diff:n,additions:r,deletions:0}}catch(s){return p.debug(`createFullFileDiff failed for ${t}: ${s}`),null}}async function _f(t){let e=await Promise.all(t.map(async n=>({file:n,diff:await nF(n)}))),s=[],i=[];for(let{file:n,diff:r}of e)r?s.push(r):i.push(n);return{diffs:s,notFound:i}}Ge();Y();xs();Zl();Sn();Ge();async function Et(t){let e=typeof t=="string"?{projectPath:t}:t||{},s=e.projectPath||process.cwd(),i=await Fe(s),n=i.extends.length>0?await um("agents",vn,s,i.extends):await om("agents",vn,s),r=e.executorOverride||i.executor,o=i.executors[r]||{};return n.map(a=>{let u=a.stage||"review",l=o[u]||{},c=i.agents[a.name]||{};return{...a,executor:a.executor||r,executorSettings:{...l,...a.executorSettings,...c.model&&{model:c.model},...c.timeout&&{timeout:c.timeout}},enabled:c.enabled??a.enabled}}).filter(a=>a.enabled!==!1)}Y();function gm(){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,i]=await Promise.all([Yt(),t.agents&&t.agents.length>0?Promise.resolve(t.agents):Et()]);if(t.ruleFilter&&t.ruleFilter.length>0){let n=new Set(t.ruleFilter);s=s.filter(r=>n.has(r.name))}if(t.excludeRules&&t.excludeRules.length>0){let n=new Set(t.excludeRules);s=s.filter(r=>!n.has(r.name))}if(t.agentFilter&&t.agentFilter.length>0){let n=new Set(t.agentFilter);i=i.filter(r=>n.has(r.name))}if(t.excludeAgents&&t.excludeAgents.length>0){let n=new Set(t.excludeAgents);i=i.filter(r=>!n.has(r.name))}return t.ruleRefs=s,t.agents=i,t.quiet||p.sync(`Loaded ${s.length} rule(s), ${i.length} agent(s)`),{stageId:"load-rules",stageName:"Load Rules",success:!0,duration:Date.now()-e}}}}xs();Y();function ym(){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??[],i=t.agents??[],n=await dc(s,t.diffs,i);if(t.matchedRules=n,!t.quiet){p.sync(`Matched ${n.length} rule(s)`);for(let r of n)p.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 Po=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 Dc=class extends Po{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 i=this.get(e);i&&(i.executor=s)}countEnabled(){return this.list().filter(e=>e.enabled).length}},ui=new Dc;Ge();Us();Y();yi();Y();var Em=require("node:fs/promises");xo();var B1=3,Fm=1e3;async function Cm(t){return new Promise(e=>setTimeout(e,t))}async function bm(t,e,s=B1){let i;for(let n=0;n<s;n++)try{let r=await fetch(t,e);if(r.ok||r.status>=400&&r.status<500&&r.status!==429)return r;if(i=new Error(`HTTP ${r.status}`),n<s-1){let o=Fm*Math.pow(2,n);process.env.DEBUG&&p.plain(`\u23F3 Retry ${n+1}/${s-1} after ${o}ms (${r.status})`),await Cm(o)}}catch(r){if(i=r instanceof Error?r:new Error(String(r)),n<s-1){let o=Fm*Math.pow(2,n);process.env.DEBUG&&p.plain(`\u23F3 Retry ${n+1}/${s-1} after ${o}ms (${i.message})`),await Cm(o)}}throw i||new Error("Max retries exceeded")}var $1=`# Output Format
237
+ `);return e?s.pop():s.push(s.pop().slice(0,-1)),s}var Ef=require("node:child_process"),wi=require("node:fs/promises"),wf=require("node:path");Ci();Y();var Cf=3e4;async function le(t,e=process.cwd()){return new Promise((s,i)=>{let n=(0,Ef.spawn)("git",t,{cwd:e}),r=[],o=[];n.stdout.on("data",u=>r.push(u)),n.stderr.on("data",u=>o.push(u));let a=setTimeout(()=>{n.kill(),i(new Error(`git ${t[0]} timeout after ${Cf/1e3}s`))},Cf);n.on("close",u=>{if(clearTimeout(a),u===0)s(Buffer.concat(r).toString("utf-8"));else{let l=Buffer.concat(o).toString("utf-8");i(new Error(`git ${t[0]} failed: ${l||`exit code ${u}`}`))}}),n.on("error",u=>{clearTimeout(a),i(u)})})}async function Ba(){try{let e=(await le(["rev-parse","--abbrev-ref","HEAD"])).trim();return e==="HEAD"?null:e}catch(t){return h.debug(`getCurrentBranch failed: ${t}`),null}}async function bf(){try{let i=(await le(["symbolic-ref","refs/remotes/origin/HEAD"])).trim().replace("refs/remotes/origin/","");if(i)return i}catch{}let t=["main","master","develop"];for(let e of t)try{return await le(["rev-parse","--verify",e]),e}catch{}return null}async function vf(t){try{return await le(["rev-parse","--verify",t]),!0}catch{try{return await le(["rev-parse","--verify",`origin/${t}`]),!0}catch{return!1}}}async function hF(){return(await le(["rev-parse","HEAD"])).trim()}async function pF(t){return(await le(["rev-parse",t])).trim()}async function bi(t){await le(["checkout",t]),kf()}async function xf(t){let e=await hF(),s=await pF(t);if(e===s)return{checkoutNeeded:!1,originalRef:null};let n=await Ba()||e;return await bi(t),{checkoutNeeded:!0,originalRef:n}}async function Sf(){try{return(await le(["status","--porcelain"])).trim().split(`
238
+ `).filter(s=>s&&!s.startsWith("??")).length>0}catch(t){return h.debug(`hasUncommittedChanges failed: ${t}`),!1}}function DF(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 Af(){return ft(be.GIT_STATUS,async()=>{let t=await le(["status","--porcelain"]);return DF(t)})}function kf(){Rs(be.GIT_STATUS)}async function _f(){try{return await le(["rev-parse","--git-dir"]),!0}catch(t){return h.debug(`isGitRepository: not a git repo: ${t}`),!1}}async function mF(){try{return(await Af()).map(e=>e.file)}catch(t){throw new Error(`Failed to get changed files: ${t}`)}}async function gF(t){try{let e="",s="";try{e=await le(["show",`HEAD:${t}`])}catch{e=""}try{s=await(0,wi.readFile)(t,"utf-8")}catch{s=""}return Is(t,e,s,"HEAD","Working Directory")}catch(e){throw new Error(`Failed to get diff for ${t}: ${e}`)}}async function yF(t){try{let s=(await Af()).find(i=>i.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 Ta(t){let e=t.split(`
240
+ `),s=0,i=0;for(let n of e)n.startsWith("+")&&!n.startsWith("+++")?s++:n.startsWith("-")&&!n.startsWith("---")&&i++;return{additions:s,deletions:i}}async function $f(){kf();let t=await mF();return(await Promise.all(t.map(async s=>{try{let[i,n]=await Promise.all([gF(s),yF(s)]),{additions:r,deletions:o}=Ta(i);return{file:s,status:n,diff:i,additions:r,deletions:o}}catch(i){return h.debug(`getAllDiffs: skipping ${s}: ${i}`),null}}))).filter(s=>s!==null).filter(s=>s.diff.trim().length>0)}function Bf(t){return t.trim().split(`
241
+ `).filter(e=>e.length>0).map(e=>{let[s,...i]=e.split(" "),n=i.join(" "),r="modified";return s==="A"?r="added":s==="D"?r="deleted":s?.startsWith("R")&&(r="modified"),{file:n,status:r}}).filter(e=>e.file)}async function Tf(){try{let t=await le(["diff","--name-status","HEAD~1","HEAD"]),e=Bf(t);return e.length===0?[]:(await Promise.all(e.map(async({file:i,status:n})=>{try{let r=await le(["diff","HEAD~1","HEAD","--",i]),{additions:o,deletions:a}=Ta(r),u=r.startsWith("diff --git")?r:Is(i,"","","HEAD~1","HEAD");return{file:i,status:n,diff:u,additions:o,deletions:a}}catch(r){return h.debug(`getLastCommitDiffs: skipping ${i}: ${r}`),null}}))).filter(i=>i!==null&&i.diff.trim().length>0)}catch(t){throw new Error(`Failed to get last commit diffs: ${t}`)}}async function If(t,e="HEAD"){try{return(await le(["log","--format=%B%n---COMMIT_SEPARATOR---",`${t}..${e}`])).split("---COMMIT_SEPARATOR---").map(i=>i.trim()).filter(i=>i.length>0)}catch(s){return h.debug(`getCommitMessages failed: ${s}`),[]}}async function Ia(t,e="HEAD"){try{let s=await le(["diff","--name-status",t,e]),i=Bf(s);return i.length===0?[]:(await Promise.all(i.map(async({file:r,status:o})=>{try{let a=await le(["diff",t,e,"--",r]),{additions:u,deletions:l}=Ta(a),c=a.startsWith("diff --git")?a:Is(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 Rf(t,e){let s=new Map(t.map(r=>[r.file,r])),i=[],n=[];for(let r of e){let o=s.get(r);o?i.push(o):n.push(r)}return{matched:i,unmatched:n}}async function FF(t){let e=(0,wf.resolve)(process.cwd(),t);try{if(!(await(0,wi.stat)(e)).isFile())return null;let i=await(0,wi.readFile)(e,"utf-8"),n=Is(t,"",i,"/dev/null",t),r=n.split(`
242
+ `).filter(o=>o.startsWith("+")&&!o.startsWith("+++")).length;return{file:t,status:"added",diff:n,additions:r,deletions:0}}catch(s){return h.debug(`createFullFileDiff failed for ${t}: ${s}`),null}}async function Nf(t){let e=await Promise.all(t.map(async n=>({file:n,diff:await FF(n)}))),s=[],i=[];for(let{file:n,diff:r}of e)r?s.push(r):i.push(n);return{diffs:s,notFound:i}}Ge();Y();Ss();ec();_n();Ge();async function wt(t){let e=typeof t=="string"?{projectPath:t}:t||{},s=e.projectPath||process.cwd(),i=await Fe(s),n=i.extends.length>0?await Dm("agents",An,s,i.extends):await hm("agents",An,s),r=e.executorOverride||i.executor,o=i.executors[r]||{};return n.map(a=>{let u=a.stage||"review",l=o[u]||{},c=i.agents[a.name]||{};return{...a,executor:a.executor||r,executorSettings:{...l,...a.executorSettings,...c.model&&{model:c.model},...c.timeout&&{timeout:c.timeout}},enabled:c.enabled??a.enabled}}).filter(a=>a.enabled!==!1)}Y();function vm(){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,i]=await Promise.all([Jt(),t.agents&&t.agents.length>0?Promise.resolve(t.agents):wt()]);if(t.ruleFilter&&t.ruleFilter.length>0){let n=new Set(t.ruleFilter);s=s.filter(r=>n.has(r.name))}if(t.excludeRules&&t.excludeRules.length>0){let n=new Set(t.excludeRules);s=s.filter(r=>!n.has(r.name))}if(t.agentFilter&&t.agentFilter.length>0){let n=new Set(t.agentFilter);i=i.filter(r=>n.has(r.name))}if(t.excludeAgents&&t.excludeAgents.length>0){let n=new Set(t.excludeAgents);i=i.filter(r=>!n.has(r.name))}return t.ruleRefs=s,t.agents=i,t.quiet||h.sync(`Loaded ${s.length} rule(s), ${i.length} agent(s)`),{stageId:"load-rules",stageName:"Load Rules",success:!0,duration:Date.now()-e}}}}Ss();Y();function xm(){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??[],i=t.agents??[],n=await mc(s,t.diffs,i);if(t.matchedRules=n,!t.quiet){h.sync(`Matched ${n.length} rule(s)`);for(let r of n)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 Mo=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 yc=class extends Mo{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 i=this.get(e);i&&(i.executor=s)}countEnabled(){return this.list().filter(e=>e.enabled).length}},ci=new yc;Ge();Ws();Y();Ci();Y();var km=require("node:fs/promises");ko();var G1=3,Sm=1e3;async function Am(t){return new Promise(e=>setTimeout(e,t))}async function _m(t,e,s=G1){let i;for(let n=0;n<s;n++)try{let r=await fetch(t,e);if(r.ok||r.status>=400&&r.status<500&&r.status!==429)return r;if(i=new Error(`HTTP ${r.status}`),n<s-1){let o=Sm*Math.pow(2,n);process.env.DEBUG&&h.plain(`\u23F3 Retry ${n+1}/${s-1} after ${o}ms (${r.status})`),await Am(o)}}catch(r){if(i=r instanceof Error?r:new Error(String(r)),n<s-1){let o=Sm*Math.pow(2,n);process.env.DEBUG&&h.plain(`\u23F3 Retry ${n+1}/${s-1} after ${o}ms (${i.message})`),await Am(o)}}throw i||new Error("Max retries exceeded")}var K1=`# Output Format
243
243
 
244
244
  Return your findings as a **JSON array** wrapped in \`<json>...</json>\` XML tags:
245
245
 
@@ -259,46 +259,46 @@ 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 Oo(){return ct(we.OUTPUT_FORMAT,async()=>{try{let t=vo("prompts","output-format.md");return await(0,Em.readFile)(t,"utf-8")}catch{return $1}})}function Lo(t,e,s){return`${t}
262
+ `;async function jo(){return ft(be.OUTPUT_FORMAT,async()=>{try{let t=Ao("prompts","output-format.md");return await(0,km.readFile)(t,"utf-8")}catch{return K1}})}function qo(t,e,s){return`${t}
263
263
 
264
264
  # Input:
265
265
  ${e}
266
266
 
267
- ${s}`}function Mo(t,e){return`${t}
267
+ ${s}`}function Uo(t,e){return`${t}
268
268
 
269
- ${e}`}function Ze(t,e,s,i,n,r){return{agent:t.agent.name,executor:t.executor.name,success:e,output:s,error:i,duration:n,prompt:r}}var wm=I.object({model:I.string().optional(),temperature:I.number().min(0).max(2).optional(),maxTokens:I.number().positive().optional()});function T1(t,e){return{name:t.name,description:t.description,type:"llm-api",enabled:!!t.apiKey,async execute(s){let i=Date.now();try{let n=await Oo(),r=Mo(s.input,n);s.verbose&&p.plain(`\u{1F527} API: ${t.name} (model: ${t.model})`);let o=await e(s.systemPrompt,r,t);return s.verbose&&(p.plain(`\u{1F4E5} API raw response (${o.length} chars):`),p.plain(` ${o.slice(0,500)}${o.length>500?"...":""}`)),Ze(s,!0,o,void 0,Date.now()-i,r)}catch(n){return Ze(s,!1,"",n instanceof Error?n.message:String(n),Date.now()-i)}},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:wm,applySettings:s=>{let i=wm.safeParse(s),n=i.success?i.data:{};return{name:t.name,description:t.description,type:"llm-api",provider:"custom",model:n.model??t.model,apiKey:t.apiKey,baseUrl:t.baseUrl,temperature:n.temperature??t.temperature,maxTokens:n.maxTokens??t.maxTokens,enabled:!!t.apiKey}}}}var jo={model:"llama-3.3-70b",temperature:.7,maxTokens:8192,baseUrl:"https://api.cerebras.ai/v1"};async function I1(t,e,s){if(!s.apiKey)throw new Error("CEREBRAS_API_KEY not set");let i=await bm(`${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(!i.ok){let r=await i.text();throw new Error(`Cerebras API: ${i.status} - ${r}`)}return(await i.json()).choices?.[0]?.message?.content||""}var vm=T1({name:"cerebras-api",description:"Execute via Cerebras AI API",model:jo.model,apiKey:process.env.CEREBRAS_API_KEY,baseUrl:jo.baseUrl,temperature:jo.temperature,maxTokens:jo.maxTokens},I1);Us();var Lm=require("node:child_process");Y();var qo=new Set,xm=!1;function li(t){qo.add(t),t.once("exit",()=>{qo.delete(t)})}function Uo(t,e=3e3){return t.kill("SIGTERM"),setTimeout(()=>{t.killed||t.kill("SIGKILL")},e)}function R1(){let t=[...qo];qo.clear();for(let e of t)e.kill("SIGTERM");setTimeout(()=>{for(let e of t)e.killed||e.kill("SIGKILL")},2e3)}function ci(){xm||(xm=!0,process.on("SIGINT",()=>{R1(),process.exit(130)}))}var $m=require("node:child_process");Y();function Vo(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 N1(t){return t.lineStart!==void 0?Vo(t.lineStart,0):t.line!==void 0?Vo(t.line,0):t.lineNumber!==void 0?Vo(t.lineNumber,0):1}function P1(t,e){let s=t.file||t.path||"",i=N1(t),n=Vo(t.lineEnd,i),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:i,lineEnd:n,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 O1(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 Sm(t){return t.match(/<json>\s*([\s\S]*?)\s*<\/json>/)?.[1]?.trim()??null}function L1(t){try{let e=JSON.parse(t);if(e.type==="result"&&typeof e.result=="string"){let s=e.result,i=Sm(s);if(i)return i;let n=s.match(/```json\s*([\s\S]*?)```/);if(n)return n[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 fi(t,e){try{let s=t,i=L1(t);if(i)s=i;else{let r=Sm(t);r&&(s=r)}let n=null;try{let r=JSON.parse(s);n=Array.isArray(r)?r:r.issues??null}catch{n=O1(s)}return Array.isArray(n)?n.map(r=>P1(r,e)).filter(r=>r.file&&(r.shortDescription||r.fullDescription)&&r.lineStart>0):[]}catch{return[]}}var U={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 M1(t){switch(t){case"critical":return U.red;case"high":return U.yellow;case"medium":return U.blue;case"low":return U.cyan}}function j1(t){switch(t){case"critical":return"\u2717";case"high":return"\u26A0";case"medium":return"\u25CB";case"low":return"\u25C7"}}function q1(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 mc(t){switch(t){case"critical":return 0;case"high":return 1;case"medium":return 2;case"low":return 3}}function gc(t){return[...t].sort((e,s)=>{let i=mc(e.severity),n=mc(s.severity);return i-n})}function $n(t,e=!1){let s=M1(t.severity),i=j1(t.severity),n=q1(t.category),r=[];return e?r.push(`${i} ${U.bold}${t.file}:${t.lineStart}${U.reset} - ${s}${t.shortDescription}${U.reset}`):(r.push(""),r.push(`${i} ${s}${U.bold}${t.severity.toUpperCase()}${U.reset} ${n} ${U.dim}${t.category}${U.reset}`),r.push(`${U.bold}${t.file}${U.reset}:${U.cyan}${t.lineStart}${t.lineEnd!==t.lineStart?`-${t.lineEnd}`:""}${U.reset}`),r.push(""),r.push(`${U.bold}${t.shortDescription}${U.reset}`),t.fullDescription&&t.fullDescription!==t.shortDescription&&(r.push(""),r.push(`${U.dim}${t.fullDescription}${U.reset}`)),t.suggestion&&(r.push(""),r.push(`${U.green}\u2192 Suggestion:${U.reset}`),r.push(`${U.dim}${t.suggestion}${U.reset}`)),r.push(""),r.push(`${U.gray}Agent: ${t.agent}${U.reset}`),t.rule&&r.push(`${U.gray}Rule: ${t.rule}${U.reset}`),t.confidence!==void 0&&r.push(`${U.gray}Confidence: ${t.confidence}%${U.reset}`),r.push(""),r.push(U.gray+"\u2500".repeat(80)+U.reset)),r.join(`
270
- `)}function km(t){let e=new Map;for(let s of t){let i=e.get(s.file)||[];i.push(s),e.set(s.file,i)}return e}function Am(t){return Math.min(...t.map(e=>mc(e.severity)))}function _m(t){if(t.length===0)return`${U.green}\u2713 No issues found \u{1F389}${U.reset}`;let e=km(t),s=[];s.push(""),s.push(`${U.bold}Found ${t.length} issue(s) in ${e.size} file(s)${U.reset}`),s.push("");let i=Array.from(e.entries()).sort(([,n],[,r])=>Am(n)-Am(r));for(let[n,r]of i){s.push(`${U.bold}${U.cyan}${n}${U.reset} ${U.dim}(${r.length} issue(s))${U.reset}`),s.push("");let o=gc(r);for(let a of o)s.push($n(a,!1))}return s.join(`
271
- `)}function Bm(t,e,s,i,n,r){let o=t.filter(m=>m.severity==="critical").length,a=t.filter(m=>m.severity==="high").length,u=t.filter(m=>m.severity==="medium").length,l=t.filter(m=>m.severity==="low").length,c=gc(t),f=km(c),h=Array.from(f.entries()).map(([m,D])=>({file:m,issueCount:D.length,issues:gc(D)})),d={success:e,totalDuration:s,stats:{totalIssues:t.length,critical:o,high:a,medium:u,low:l,filesAnalyzed:r,agentsExecuted:i,agentsSucceeded:n,agentsFailed:i-n},issues:c,files:h};return JSON.stringify(d,null,2)}function U1(t,e){let s=fi(t,e);if(s.length!==0){p.plain(`
272
- \x1B[33m\u26A0 Preliminary issues (may be filtered):\x1B[0m`);for(let i of s)p.plain($n(i,!0));p.plain("")}}function V1(t,e,s){if(s.verbose&&p.plain(`\x1B[90m${e}\x1B[0m`),s.stream&&!s.verbose){if(t.type==="system"){let i=t.tools?.length||0,n=t.model||"unknown";p.plain(`\x1B[90m\u{1F4CB} ${n}, ${i} tools\x1B[0m`)}else if(t.type==="assistant"&&t.message?.content){for(let i of t.message.content)if(i.type==="tool_use")p.plain(`\x1B[36m\u{1F527} ${i.name}\x1B[0m`);else if(i.type==="text"&&i.text){let n=i.text.slice(0,200),r=i.text.length>200?"...":"";p.plain(`\x1B[90m\u{1F4AD} ${n}${r}\x1B[0m`)}}}if(t.type==="result"){if(s.stream&&!s.verbose){let i=t.total_cost_usd?`$${t.total_cost_usd.toFixed(4)}`:"",n=t.duration_ms?`${(t.duration_ms/1e3).toFixed(1)}s`:"";p.plain(`\x1B[90m\u{1F4CA} ${n} ${i}\x1B[0m`)}if(t.subtype==="success"&&t.result)return t.result;if(t.subtype==="error")throw new Error(t.error||"Claude CLI returned error")}return null}async function Tm(t,e,s,i){if(t.length===0)throw new Error("No command provided to streamClaudeCli");ci();let[n,...r]=t,o=(0,$m.spawn)(n,r,{stdio:["ignore","pipe","pipe"],env:{...process.env,...e},cwd:i.cwd});li(o);let a=s*1e3,u=setTimeout(()=>Uo(o,2e3),a);return new Promise((l,c)=>{let f="",h="",d=[];o.stderr?.on("data",m=>d.push(m)),o.stdout?.on("data",m=>{h+=m.toString("utf-8");let D=h.split(`
273
- `);h=D.pop()||"";for(let g of D)if(g.trim())try{let F=JSON.parse(g),y=V1(F,g,i);y!==null&&(f=y,i.stream&&i.agentName&&U1(f,i.agentName))}catch{process.env.DEBUG&&p.plain(`\u{1F4E1} Stream parse error: ${g}`)}}),o.on("close",m=>{if(clearTimeout(u),h.trim())try{let g=JSON.parse(h);g.type==="result"&&g.subtype==="success"&&g.result&&(f=g.result)}catch{}let D=Buffer.concat(d).toString("utf-8");if(m===null){c(new Error(`Process killed (timeout after ${s}s or signal)${D?`: ${D}`:""}`));return}if(m!==0){c(new Error(`Exit code ${m}: ${D}`));return}l(f.trim())}),o.on("error",m=>{clearTimeout(u),c(m)})})}var Im=require("node:child_process");Y();function W1(t,e){let s=fi(t,e);if(s.length!==0){p.plain(`
274
- \x1B[33m\u26A0 Preliminary issues (may be filtered):\x1B[0m`);for(let i of s)p.plain($n(i,!0));p.plain("")}}function z1(t,e,s){if(s.verbose&&p.plain(`\x1B[90m${e}\x1B[0m`),s.stream&&!s.verbose){if(t.type==="system"){let i=t.tools?.length||0,n=t.model||"unknown";p.plain(`\x1B[90m\u{1F4CB} ${n}, ${i} tools\x1B[0m`)}else if(t.type==="assistant"&&t.message?.content){for(let i of t.message.content)if(i.type==="tool_use")p.plain(`\x1B[36m\u{1F527} ${i.name}\x1B[0m`);else if(i.type==="text"&&i.text){let n=i.text.slice(0,200),r=i.text.length>200?"...":"";p.plain(`\x1B[90m\u{1F4AD} ${n}${r}\x1B[0m`)}}}if(t.type==="result"){if(s.stream&&!s.verbose){let i=t.total_cost_usd?`$${t.total_cost_usd.toFixed(4)}`:"",n=t.duration_ms?`${(t.duration_ms/1e3).toFixed(1)}s`:"";p.plain(`\x1B[90m\u{1F4CA} ${n} ${i}\x1B[0m`)}if(t.subtype==="success"&&t.result)return t.result;if(t.subtype==="error")throw new Error(t.error||"Cursor Agent CLI returned error")}return null}async function Rm(t,e,s,i){if(t.length===0)throw new Error("No command provided to streamCursorAgentCli");ci();let[n,...r]=t,o=(0,Im.spawn)(n,r,{stdio:["ignore","pipe","pipe"],env:{...process.env,...e},cwd:i.cwd});li(o);let a=s*1e3,u=setTimeout(()=>Uo(o,2e3),a);return new Promise((l,c)=>{let f="",h="",d=[];o.stderr?.on("data",m=>d.push(m)),o.stdout?.on("data",m=>{h+=m.toString("utf-8");let D=h.split(`
275
- `);h=D.pop()||"";for(let g of D)if(g.trim())try{let F=JSON.parse(g),y=z1(F,g,i);y!==null&&(f=y,i.stream&&i.agentName&&W1(f,i.agentName))}catch{i.verbose&&p.plain(`\u{1F4E1} ${g}`),f+=g+`
276
- `}}),o.on("close",m=>{if(clearTimeout(u),h.trim())try{let g=JSON.parse(h);g.type==="result"&&g.subtype==="success"&&g.result&&(f=g.result)}catch{f+=h}let D=Buffer.concat(d).toString("utf-8");if(m===null){c(new Error(`Process killed (timeout after ${s}s or signal)${D?`: ${D}`:""}`));return}if(m!==0){c(new Error(`Exit code ${m}: ${D}`));return}l(f.trim())}),o.on("error",m=>{clearTimeout(u),c(m)})})}var Nm=I.object({model:I.string().optional(),timeout:I.number().positive().optional()}),Pm={model:"opus",timeout:120},Om={model:"opus-4.5",timeout:120};function yc(t,e){return t.executor.type==="cli"&&t.executor.timeout!==void 0?t.executor.timeout:e||60}function Fc(t,e){return t.executor.type==="cli"&&t.executor.model!==void 0?t.executor.model:e}async function G1(t,e,s){let i=Date.now(),n=`${e.systemPrompt}
269
+ ${e}`}function Ze(t,e,s,i,n,r){return{agent:t.agent.name,executor:t.executor.name,success:e,output:s,error:i,duration:n,prompt:r}}var $m=I.object({model:I.string().optional(),temperature:I.number().min(0).max(2).optional(),maxTokens:I.number().positive().optional()});function Y1(t,e){return{name:t.name,description:t.description,type:"llm-api",enabled:!!t.apiKey,async execute(s){let i=Date.now();try{let n=await jo(),r=Uo(s.input,n);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()-i,r)}catch(n){return Ze(s,!1,"",n instanceof Error?n.message:String(n),Date.now()-i)}},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:$m,applySettings:s=>{let i=$m.safeParse(s),n=i.success?i.data:{};return{name:t.name,description:t.description,type:"llm-api",provider:"custom",model:n.model??t.model,apiKey:t.apiKey,baseUrl:t.baseUrl,temperature:n.temperature??t.temperature,maxTokens:n.maxTokens??t.maxTokens,enabled:!!t.apiKey}}}}var Vo={model:"llama-3.3-70b",temperature:.7,maxTokens:8192,baseUrl:"https://api.cerebras.ai/v1"};async function J1(t,e,s){if(!s.apiKey)throw new Error("CEREBRAS_API_KEY not set");let i=await _m(`${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(!i.ok){let r=await i.text();throw new Error(`Cerebras API: ${i.status} - ${r}`)}return(await i.json()).choices?.[0]?.message?.content||""}var Bm=Y1({name:"cerebras-api",description:"Execute via Cerebras AI API",model:Vo.model,apiKey:process.env.CEREBRAS_API_KEY,baseUrl:Vo.baseUrl,temperature:Vo.temperature,maxTokens:Vo.maxTokens},J1);Ws();var zm=require("node:child_process");Y();var Wo=new Set,Tm=!1;function fi(t){Wo.add(t),t.once("exit",()=>{Wo.delete(t)})}function zo(t,e=3e3){return t.kill("SIGTERM"),setTimeout(()=>{t.killed||t.kill("SIGKILL")},e)}function H1(){let t=[...Wo];Wo.clear();for(let e of t)e.kill("SIGTERM");setTimeout(()=>{for(let e of t)e.killed||e.kill("SIGKILL")},2e3)}function di(){Tm||(Tm=!0,process.on("SIGINT",()=>{H1(),process.exit(130)}))}var Lm=require("node:child_process");Y();function Go(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 Z1(t){return t.lineStart!==void 0?Go(t.lineStart,0):t.line!==void 0?Go(t.line,0):t.lineNumber!==void 0?Go(t.lineNumber,0):1}function Q1(t,e){let s=t.file||t.path||"",i=Z1(t),n=Go(t.lineEnd,i),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:i,lineEnd:n,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 X1(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 Im(t){return t.match(/<json>\s*([\s\S]*?)\s*<\/json>/)?.[1]?.trim()??null}function ex(t){try{let e=JSON.parse(t);if(e.type==="result"&&typeof e.result=="string"){let s=e.result,i=Im(s);if(i)return i;let n=s.match(/```json\s*([\s\S]*?)```/);if(n)return n[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 hi(t,e){try{let s=t,i=ex(t);if(i)s=i;else{let r=Im(t);r&&(s=r)}let n=null;try{let r=JSON.parse(s);n=Array.isArray(r)?r:r.issues??null}catch{n=X1(s)}return Array.isArray(n)?n.map(r=>Q1(r,e)).filter(r=>r.file&&(r.shortDescription||r.fullDescription)&&r.lineStart>0):[]}catch{return[]}}var U={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 tx(t){switch(t){case"critical":return U.red;case"high":return U.yellow;case"medium":return U.blue;case"low":return U.cyan}}function sx(t){switch(t){case"critical":return"\u2717";case"high":return"\u26A0";case"medium":return"\u25CB";case"low":return"\u25C7"}}function ix(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 Fc(t){switch(t){case"critical":return 0;case"high":return 1;case"medium":return 2;case"low":return 3}}function Cc(t){return[...t].sort((e,s)=>{let i=Fc(e.severity),n=Fc(s.severity);return i-n})}function Rn(t,e=!1){let s=tx(t.severity),i=sx(t.severity),n=ix(t.category),r=[];return e?r.push(`${i} ${U.bold}${t.file}:${t.lineStart}${U.reset} - ${s}${t.shortDescription}${U.reset}`):(r.push(""),r.push(`${i} ${s}${U.bold}${t.severity.toUpperCase()}${U.reset} ${n} ${U.dim}${t.category}${U.reset}`),r.push(`${U.bold}${t.file}${U.reset}:${U.cyan}${t.lineStart}${t.lineEnd!==t.lineStart?`-${t.lineEnd}`:""}${U.reset}`),r.push(""),r.push(`${U.bold}${t.shortDescription}${U.reset}`),t.fullDescription&&t.fullDescription!==t.shortDescription&&(r.push(""),r.push(`${U.dim}${t.fullDescription}${U.reset}`)),t.suggestion&&(r.push(""),r.push(`${U.green}\u2192 Suggestion:${U.reset}`),r.push(`${U.dim}${t.suggestion}${U.reset}`)),r.push(""),r.push(`${U.gray}Agent: ${t.agent}${U.reset}`),t.rule&&r.push(`${U.gray}Rule: ${t.rule}${U.reset}`),t.confidence!==void 0&&r.push(`${U.gray}Confidence: ${t.confidence}%${U.reset}`),r.push(""),r.push(U.gray+"\u2500".repeat(80)+U.reset)),r.join(`
270
+ `)}function Nm(t){let e=new Map;for(let s of t){let i=e.get(s.file)||[];i.push(s),e.set(s.file,i)}return e}function Rm(t){return Math.min(...t.map(e=>Fc(e.severity)))}function Pm(t){if(t.length===0)return`${U.green}\u2713 No issues found \u{1F389}${U.reset}`;let e=Nm(t),s=[];s.push(""),s.push(`${U.bold}Found ${t.length} issue(s) in ${e.size} file(s)${U.reset}`),s.push("");let i=Array.from(e.entries()).sort(([,n],[,r])=>Rm(n)-Rm(r));for(let[n,r]of i){s.push(`${U.bold}${U.cyan}${n}${U.reset} ${U.dim}(${r.length} issue(s))${U.reset}`),s.push("");let o=Cc(r);for(let a of o)s.push(Rn(a,!1))}return s.join(`
271
+ `)}function Om(t,e,s,i,n,r){let o=t.filter(m=>m.severity==="critical").length,a=t.filter(m=>m.severity==="high").length,u=t.filter(m=>m.severity==="medium").length,l=t.filter(m=>m.severity==="low").length,c=Cc(t),f=Nm(c),d=Array.from(f.entries()).map(([m,D])=>({file:m,issueCount:D.length,issues:Cc(D)})),p={success:e,totalDuration:s,stats:{totalIssues:t.length,critical:o,high:a,medium:u,low:l,filesAnalyzed:r,agentsExecuted:i,agentsSucceeded:n,agentsFailed:i-n},issues:c,files:d};return JSON.stringify(p,null,2)}function nx(t,e){let s=hi(t,e);if(s.length!==0){h.plain(`
272
+ \x1B[33m\u26A0 Preliminary issues (may be filtered):\x1B[0m`);for(let i of s)h.plain(Rn(i,!0));h.plain("")}}function rx(t,e,s){if(s.verbose&&h.plain(`\x1B[90m${e}\x1B[0m`),s.stream&&!s.verbose){if(t.type==="system"){let i=t.tools?.length||0,n=t.model||"unknown";h.plain(`\x1B[90m\u{1F4CB} ${n}, ${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 n=i.text.slice(0,200),r=i.text.length>200?"...":"";h.plain(`\x1B[90m\u{1F4AD} ${n}${r}\x1B[0m`)}}}if(t.type==="result"){if(s.stream&&!s.verbose){let i=t.total_cost_usd?`$${t.total_cost_usd.toFixed(4)}`:"",n=t.duration_ms?`${(t.duration_ms/1e3).toFixed(1)}s`:"";h.plain(`\x1B[90m\u{1F4CA} ${n} ${i}\x1B[0m`)}if(t.subtype==="success"&&t.result)return t.result;if(t.subtype==="error")throw new Error(t.error||"Claude CLI returned error")}return null}async function Mm(t,e,s,i){if(t.length===0)throw new Error("No command provided to streamClaudeCli");di();let[n,...r]=t,o=(0,Lm.spawn)(n,r,{stdio:["ignore","pipe","pipe"],env:{...process.env,...e},cwd:i.cwd});fi(o);let a=s*1e3,u=setTimeout(()=>zo(o,2e3),a);return new Promise((l,c)=>{let f="",d="",p=[];o.stderr?.on("data",m=>p.push(m)),o.stdout?.on("data",m=>{d+=m.toString("utf-8");let D=d.split(`
273
+ `);d=D.pop()||"";for(let g of D)if(g.trim())try{let F=JSON.parse(g),y=rx(F,g,i);y!==null&&(f=y,i.stream&&i.agentName&&nx(f,i.agentName))}catch{process.env.DEBUG&&h.plain(`\u{1F4E1} Stream parse error: ${g}`)}}),o.on("close",m=>{if(clearTimeout(u),d.trim())try{let g=JSON.parse(d);g.type==="result"&&g.subtype==="success"&&g.result&&(f=g.result)}catch{}let D=Buffer.concat(p).toString("utf-8");if(m===null){c(new Error(`Process killed (timeout after ${s}s or signal)${D?`: ${D}`:""}`));return}if(m!==0){c(new Error(`Exit code ${m}: ${D}`));return}l(f.trim())}),o.on("error",m=>{clearTimeout(u),c(m)})})}var jm=require("node:child_process");Y();function ox(t,e){let s=hi(t,e);if(s.length!==0){h.plain(`
274
+ \x1B[33m\u26A0 Preliminary issues (may be filtered):\x1B[0m`);for(let i of s)h.plain(Rn(i,!0));h.plain("")}}function ax(t,e,s){if(s.verbose&&h.plain(`\x1B[90m${e}\x1B[0m`),s.stream&&!s.verbose){if(t.type==="system"){let i=t.tools?.length||0,n=t.model||"unknown";h.plain(`\x1B[90m\u{1F4CB} ${n}, ${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 n=i.text.slice(0,200),r=i.text.length>200?"...":"";h.plain(`\x1B[90m\u{1F4AD} ${n}${r}\x1B[0m`)}}}if(t.type==="result"){if(s.stream&&!s.verbose){let i=t.total_cost_usd?`$${t.total_cost_usd.toFixed(4)}`:"",n=t.duration_ms?`${(t.duration_ms/1e3).toFixed(1)}s`:"";h.plain(`\x1B[90m\u{1F4CA} ${n} ${i}\x1B[0m`)}if(t.subtype==="success"&&t.result)return t.result;if(t.subtype==="error")throw new Error(t.error||"Cursor Agent CLI returned error")}return null}async function qm(t,e,s,i){if(t.length===0)throw new Error("No command provided to streamCursorAgentCli");di();let[n,...r]=t,o=(0,jm.spawn)(n,r,{stdio:["ignore","pipe","pipe"],env:{...process.env,...e},cwd:i.cwd});fi(o);let a=s*1e3,u=setTimeout(()=>zo(o,2e3),a);return new Promise((l,c)=>{let f="",d="",p=[];o.stderr?.on("data",m=>p.push(m)),o.stdout?.on("data",m=>{d+=m.toString("utf-8");let D=d.split(`
275
+ `);d=D.pop()||"";for(let g of D)if(g.trim())try{let F=JSON.parse(g),y=ax(F,g,i);y!==null&&(f=y,i.stream&&i.agentName&&ox(f,i.agentName))}catch{i.verbose&&h.plain(`\u{1F4E1} ${g}`),f+=g+`
276
+ `}}),o.on("close",m=>{if(clearTimeout(u),d.trim())try{let g=JSON.parse(d);g.type==="result"&&g.subtype==="success"&&g.result&&(f=g.result)}catch{f+=d}let D=Buffer.concat(p).toString("utf-8");if(m===null){c(new Error(`Process killed (timeout after ${s}s or signal)${D?`: ${D}`:""}`));return}if(m!==0){c(new Error(`Exit code ${m}: ${D}`));return}l(f.trim())}),o.on("error",m=>{clearTimeout(u),c(m)})})}var Um=I.object({model:I.string().optional(),timeout:I.number().positive().optional()}),Vm={model:"opus",timeout:120},Wm={model:"opus-4.5",timeout:120};function Ec(t,e){return t.executor.type==="cli"&&t.executor.timeout!==void 0?t.executor.timeout:e||60}function wc(t,e){return t.executor.type==="cli"&&t.executor.model!==void 0?t.executor.model:e}async function ux(t,e,s){let i=Date.now(),n=`${e.systemPrompt}
277
277
 
278
- ${s}`,r=e.input,o=Fc(e,t.model),a=yc(e,t.timeout),u=t.args||[];o&&(u=[...u,"--model",o]);let l=u.map(d=>d==="--output-format"?"--output-format":d),c=l.indexOf("json");c!==-1&&(l[c]="stream-json"),l.push("--verbose");let f;if(t.systemPromptArg)f=[t.command,...l,t.systemPromptArg,n,r];else{let d=Lo(n,e.input,s);f=t.useStdin?[t.command,...l]:[t.command,...l,d]}let h=await Tm(f,t.env||{},a,{stream:e.stream??!1,verbose:e.verbose??!1,agentName:e.agent.name,cwd:e.cwd});return Ze(e,!0,h,void 0,Date.now()-i,r)}async function K1(t,e,s){let i=Date.now(),r=`<system>
278
+ ${s}`,r=e.input,o=wc(e,t.model),a=Ec(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,n,r];else{let p=qo(n,e.input,s);f=t.useStdin?[t.command,...l]:[t.command,...l,p]}let d=await Mm(f,t.env||{},a,{stream:e.stream??!1,verbose:e.verbose??!1,agentName:e.agent.name,cwd:e.cwd});return Ze(e,!0,d,void 0,Date.now()-i,r)}async function lx(t,e,s){let i=Date.now(),r=`<system>
279
279
  ${`${e.systemPrompt}
280
280
 
281
281
  ${s}`}
282
282
  </system>
283
283
 
284
- ${e.input}`,o=Fc(e,t.model),a=yc(e,t.timeout),u=[t.command];u.push("-p","--output-format","stream-json"),o&&u.push("--model",o),u.push(r);let l=await Rm(u,t.env||{},a,{stream:e.stream??!1,verbose:e.verbose??!1,agentName:e.agent.name,cwd:e.cwd});return Ze(e,!0,l,void 0,Date.now()-i,e.input)}async function Y1(t,e,s){let i=Date.now(),n=Mo(e.input,s),r=e.systemPrompt,o=Fc(e,t.model),a=yc(e,t.timeout),u=t.args||[];o&&(u=[...u,"--model",o]);let l;if(t.systemPromptArg)l=[...u,t.systemPromptArg,r,n];else{let c=Lo(r,e.input,s);l=t.useStdin?[...u]:[...u,c]}return e.verbose&&p.plain(`\u{1F527} CLI: ${t.command} ${l.slice(0,-1).join(" ")} <prompt ${n.length} chars>`),ci(),new Promise(c=>{let f=(0,Lm.spawn)(t.command,l,{stdio:[t.useStdin?"pipe":"ignore","pipe","pipe"],env:{...process.env,...t.env},cwd:e.cwd});li(f);let h=[],d=[];if(f.stdout?.on("data",g=>h.push(g)),f.stderr?.on("data",g=>d.push(g)),t.useStdin&&f.stdin){let g=t.systemPromptArg?n:Lo(e.systemPrompt,e.input,s);f.stdin.write(g),f.stdin.end()}let m=a*1e3,D=setTimeout(()=>f.kill(),m);f.on("close",g=>{clearTimeout(D);let F=Buffer.concat(h).toString("utf-8"),y=Buffer.concat(d).toString("utf-8");if(e.verbose&&(p.plain(`\u{1F4E5} CLI raw response (${F.length} chars):`),p.plain(` ${F.slice(0,500)}${F.length>500?"...":""}`),y&&p.plain(` stderr: ${y.slice(0,200)}`)),g===null){c(Ze(e,!1,"",`Process killed (timeout after ${a}s or signal)${y?`: ${y}`:""}`,Date.now()-i,n));return}if(g!==0){c(Ze(e,!1,"",`Exit code ${g}: ${y}`,Date.now()-i,n));return}c(Ze(e,!0,F,void 0,Date.now()-i,n))}),f.on("error",g=>{clearTimeout(D),c(Ze(e,!1,"",`Process error: ${g.message}`,Date.now()-i,n))})})}function Cc(t){return{name:t.name,description:t.description,type:"cli",enabled:!0,async execute(e){let s=Date.now();try{let i=await Oo();return t.name==="claude-cli"?await G1(t,e,i):t.name==="cursor-agent-cli"?await K1(t,e,i):await Y1(t,e,i)}catch(i){return Ze(e,!1,"",i instanceof Error?i.message:String(i),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:Nm,applySettings:e=>{let s=Nm.safeParse(e),i=s.success?s.data:{};return{name:t.name,description:t.description,type:"cli",command:t.command,args:t.args,env:t.env,timeout:i.timeout??t.timeout,model:i.model??t.model,installCommand:t.installCommand,enabled:!0}}}}var Mm=Cc({name:"claude-cli",description:"Execute via Claude Code CLI",command:"claude",args:["-p","--output-format","json","--no-session-persistence"],timeout:Pm.timeout,model:Pm.model,useStdin:!1,systemPromptArg:"--system-prompt",installCommand:"npm install -g @anthropic-ai/claude-code"}),jm=Cc({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}),qm=Cc({name:"cursor-agent-cli",description:"Execute via Cursor Agent CLI",command:"cursor-agent",args:[],timeout:Om.timeout,model:Om.model,useStdin:!1,installCommand:"curl https://cursor.com/install -fsS | bash"});var Tn=new Map([["cerebras-api",vm],["claude-cli",Mm],["cursor-agent-cli",qm],["test-cli",jm]]);function hi(t){return Tn.get(t)}function Um(){return[...Tn.values()]}function Vm(t){let e=Tn.get(t.name);e&&(e.enabled=t.enabled)}async function Wm(t){let e=Tn.get(t.executor.name);if((!e||!e.enabled)&&(process.env.DEBUG&&console.warn(`Executor "${t.executor.name}" not available, using test-cli`),e=Tn.get("test-cli")),!e)throw new Error(`No executor found: ${t.executor.name}`);return e.execute(t)}var Qe={async autoDiscover(){},get:hi,listExecutors(){return Um().map(t=>t.getInfo())},registerExecutor:Vm,executeAgent:Wm};async function In(){return await Qe.autoDiscover(),Qe.listExecutors()}Y();function Rn(t){return Math.ceil(t.length/4)}function zm(){return"simple (1 token \u2248 4 chars)"}function J1(t){let e=`File: ${t.file}
285
- ${t.diff}`;return Rn(e)}var Gm=1e4;function H1(){let t=process.env.DIFFRAY_BATCH_TOKENS,e=t?parseInt(t,10):Gm;return{maxTokensPerBatch:isNaN(e)?Gm:e}}function Km(t,e,s){let i=s||H1(),n=[],r=Rn(e),o=i.maxTokensPerBatch-r-1e3,a=[],u=0;for(let l of t){let c=J1(l);if(c>o){a.length>0&&(n.push({diffs:a,tokenCount:u+r,batchIndex:n.length}),a=[],u=0),n.push({diffs:[l],tokenCount:c+r,batchIndex:n.length});continue}u+c>o&&a.length>0&&(n.push({diffs:a,tokenCount:u+r,batchIndex:n.length}),a=[],u=0),a.push(l),u+=c}return a.length>0&&n.push({diffs:a,tokenCount:u+r,batchIndex:n.length}),n}function Ym(t,e=!1){let s=t.diffs.length,i=t.tokenCount.toLocaleString();if(e){let n=t.diffs.map(r=>` ${r.file}`).join(`
284
+ ${e.input}`,o=wc(e,t.model),a=Ec(e,t.timeout),u=[t.command];u.push("-p","--output-format","stream-json"),o&&u.push("--model",o),u.push(r);let l=await qm(u,t.env||{},a,{stream:e.stream??!1,verbose:e.verbose??!1,agentName:e.agent.name,cwd:e.cwd});return Ze(e,!0,l,void 0,Date.now()-i,e.input)}async function cx(t,e,s){let i=Date.now(),n=Uo(e.input,s),r=e.systemPrompt,o=wc(e,t.model),a=Ec(e,t.timeout),u=t.args||[];o&&(u=[...u,"--model",o]);let l;if(t.systemPromptArg)l=[...u,t.systemPromptArg,r,n];else{let c=qo(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 ${n.length} chars>`),di(),new Promise(c=>{let f=(0,zm.spawn)(t.command,l,{stdio:[t.useStdin?"pipe":"ignore","pipe","pipe"],env:{...process.env,...t.env},cwd:e.cwd});fi(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?n:qo(e.systemPrompt,e.input,s);f.stdin.write(g),f.stdin.end()}let m=a*1e3,D=setTimeout(()=>f.kill(),m);f.on("close",g=>{clearTimeout(D);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()-i,n));return}if(g!==0){c(Ze(e,!1,"",`Exit code ${g}: ${y}`,Date.now()-i,n));return}c(Ze(e,!0,F,void 0,Date.now()-i,n))}),f.on("error",g=>{clearTimeout(D),c(Ze(e,!1,"",`Process error: ${g.message}`,Date.now()-i,n))})})}function bc(t){return{name:t.name,description:t.description,type:"cli",enabled:!0,async execute(e){let s=Date.now();try{let i=await jo();return t.name==="claude-cli"?await ux(t,e,i):t.name==="cursor-agent-cli"?await lx(t,e,i):await cx(t,e,i)}catch(i){return Ze(e,!1,"",i instanceof Error?i.message:String(i),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:Um,applySettings:e=>{let s=Um.safeParse(e),i=s.success?s.data:{};return{name:t.name,description:t.description,type:"cli",command:t.command,args:t.args,env:t.env,timeout:i.timeout??t.timeout,model:i.model??t.model,installCommand:t.installCommand,enabled:!0}}}}var Gm=bc({name:"claude-cli",description:"Execute via Claude Code CLI",command:"claude",args:["-p","--output-format","json","--no-session-persistence"],timeout:Vm.timeout,model:Vm.model,useStdin:!1,systemPromptArg:"--system-prompt",installCommand:"npm install -g @anthropic-ai/claude-code"}),Km=bc({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}),Ym=bc({name:"cursor-agent-cli",description:"Execute via Cursor Agent CLI",command:"cursor-agent",args:[],timeout:Wm.timeout,model:Wm.model,useStdin:!1,installCommand:"curl https://cursor.com/install -fsS | bash"});var Nn=new Map([["cerebras-api",Bm],["claude-cli",Gm],["cursor-agent-cli",Ym],["test-cli",Km]]);function pi(t){return Nn.get(t)}function Jm(){return[...Nn.values()]}function Hm(t){let e=Nn.get(t.name);e&&(e.enabled=t.enabled)}async function Zm(t){let e=Nn.get(t.executor.name);if((!e||!e.enabled)&&(process.env.DEBUG&&console.warn(`Executor "${t.executor.name}" not available, using test-cli`),e=Nn.get("test-cli")),!e)throw new Error(`No executor found: ${t.executor.name}`);return e.execute(t)}var Qe={async autoDiscover(){},get:pi,listExecutors(){return Jm().map(t=>t.getInfo())},registerExecutor:Hm,executeAgent:Zm};async function Pn(){return await Qe.autoDiscover(),Qe.listExecutors()}Y();function On(t){return Math.ceil(t.length/4)}function Qm(){return"simple (1 token \u2248 4 chars)"}function fx(t){let e=`File: ${t.file}
285
+ ${t.diff}`;return On(e)}var Xm=1e4;function dx(){let t=process.env.DIFFRAY_BATCH_TOKENS,e=t?parseInt(t,10):Xm;return{maxTokensPerBatch:isNaN(e)?Xm:e}}function eg(t,e,s){let i=s||dx(),n=[],r=On(e),o=i.maxTokensPerBatch-r-1e3,a=[],u=0;for(let l of t){let c=fx(l);if(c>o){a.length>0&&(n.push({diffs:a,tokenCount:u+r,batchIndex:n.length}),a=[],u=0),n.push({diffs:[l],tokenCount:c+r,batchIndex:n.length});continue}u+c>o&&a.length>0&&(n.push({diffs:a,tokenCount:u+r,batchIndex:n.length}),a=[],u=0),a.push(l),u+=c}return a.length>0&&n.push({diffs:a,tokenCount:u+r,batchIndex:n.length}),n}function tg(t,e=!1){let s=t.diffs.length,i=t.tokenCount.toLocaleString();if(e){let n=t.diffs.map(r=>` ${r.file}`).join(`
286
286
  `);return`Batch ${t.batchIndex+1}: ${s} file(s), ~${i} tokens
287
287
  Files:
288
- ${n}`}return`Batch ${t.batchIndex+1}: ${s} file(s), ~${i} tokens`}function Ss(t){if(t<1)throw new Error("Concurrency must be at least 1");let e=[],s=0,i=()=>{s--,e.length>0&&e.shift()?.()};return n=>new Promise((r,o)=>{let a=async()=>{s++;try{let u=await n();r(u)}catch(u){o(u)}finally{i()}};s<t?a():e.push(a)})}Ge();Y();function Jm(t,e){if(e<1)throw new Error("Chunk size must be at least 1");let s=[];for(let i=0;i<t.length;i+=e)s.push(t.slice(i,i+e));return s}function Z1(t){let{label:e,batchIndex:s,totalBatches:i,itemCount:n,itemName:r="item"}=t;if(i===1)return n!==void 0?`${e} (${n} ${r}${n!==1?"s":""})...`:`${e}...`;let o=`batch ${s+1}/${i}`;return n!==void 0?`${e} (${o}, ${n} ${r}${n!==1?"s":""})...`:`${e} (${o})...`}function Wo(t){let e=t.filter(i=>!!i);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 zo(t,e,s,i,n){let r=Date.now(),o=Z1(t),a=e?null:new Jn(o);try{a?.start();let u=await s(),l=Date.now()-r;if(u.success){let c=i?i(u.data,l):`${t.label} (${l}ms)`;a?.succeed(c)}else{let c=n?n(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=n?n(c):`${t.label}: ${c}`;return a?.fail(f),{success:!1,data:void 0,error:c,duration:l}}finally{a?.stop()}}function Hm(t){return t.every(e=>e.success)}function Zm(t){return t.filter(e=>!e.success)}xs();async function Q1(t,e,s){let i=new Map;for(let n of t){let r=e.matchedRules?.filter(m=>m.agent.name===n.name)||[];if(r.length===0)continue;let o=new Map,a=new Map,u=new Set;for(let m of r)for(let D of m.files){u.add(D);let F=m.rule.patterns.find(C=>Jt(D,C))?.length??0,y=a.get(D)??0;F>y&&(o.set(D,m.rule.name),a.set(D,F))}let l=e.diffs.filter(m=>u.has(m.file)),c=n.systemPrompt,f=r.map(m=>m.rule.prompt).filter(Boolean).join(`
288
+ ${n}`}return`Batch ${t.batchIndex+1}: ${s} file(s), ~${i} tokens`}function As(t){if(t<1)throw new Error("Concurrency must be at least 1");let e=[],s=0,i=()=>{s--,e.length>0&&e.shift()?.()};return n=>new Promise((r,o)=>{let a=async()=>{s++;try{let u=await n();r(u)}catch(u){o(u)}finally{i()}};s<t?a():e.push(a)})}Ge();Y();function sg(t,e){if(e<1)throw new Error("Chunk size must be at least 1");let s=[];for(let i=0;i<t.length;i+=e)s.push(t.slice(i,i+e));return s}function hx(t){let{label:e,batchIndex:s,totalBatches:i,itemCount:n,itemName:r="item"}=t;if(i===1)return n!==void 0?`${e} (${n} ${r}${n!==1?"s":""})...`:`${e}...`;let o=`batch ${s+1}/${i}`;return n!==void 0?`${e} (${o}, ${n} ${r}${n!==1?"s":""})...`:`${e} (${o})...`}function Ko(t){let e=t.filter(i=>!!i);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 Yo(t,e,s,i,n){let r=Date.now(),o=hx(t),a=e?null:new Qn(o);try{a?.start();let u=await s(),l=Date.now()-r;if(u.success){let c=i?i(u.data,l):`${t.label} (${l}ms)`;a?.succeed(c)}else{let c=n?n(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=n?n(c):`${t.label}: ${c}`;return a?.fail(f),{success:!1,data:void 0,error:c,duration:l}}finally{a?.stop()}}function ig(t){return t.every(e=>e.success)}function ng(t){return t.filter(e=>!e.success)}Ss();async function px(t,e,s){let i=new Map;for(let n of t){let r=e.matchedRules?.filter(m=>m.agent.name===n.name)||[];if(r.length===0)continue;let o=new Map,a=new Map,u=new Set;for(let m of r)for(let D of m.files){u.add(D);let F=m.rule.patterns.find(C=>Ht(D,C))?.length??0,y=a.get(D)??0;F>y&&(o.set(D,m.rule.name),a.set(D,F))}let l=e.diffs.filter(m=>u.has(m.file)),c=n.systemPrompt,f=r.map(m=>m.rule.prompt).filter(Boolean).join(`
289
289
 
290
290
  `);f&&(c=`${c}
291
291
 
292
292
  ${f}`),s&&(c=`${c}
293
293
 
294
- ${s}`);let h=Km(l,c),d=r.map(m=>m.rule.name);i.set(n.name,{batches:h,files:l.length,rules:r.length,ruleNames:d,systemPrompt:c,fileToRule:o})}return i}async function X1(t,e,s,i,n,r,o,a,u,l){return u(async()=>{t.batchIndex===0&&l?.startTask(s.name);let f=["# 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(`
295
- `),h=t.diffs.map(y=>{let C=o.get(y.file);return C?`- ${y.file}: rule="${C}"`:null}).filter(Boolean),d=h.length>0?`
294
+ ${s}`);let d=eg(l,c),p=r.map(m=>m.rule.name);i.set(n.name,{batches:d,files:l.length,rules:r.length,ruleNames:p,systemPrompt:c,fileToRule:o})}return i}async function Dx(t,e,s,i,n,r,o,a,u,l){return u(async()=>{t.batchIndex===0&&l?.startTask(s.name);let f=["# 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(`
295
+ `),d=t.diffs.map(y=>{let C=o.get(y.file);return C?`- ${y.file}: rule="${C}"`:null}).filter(Boolean),p=d.length>0?`
296
296
 
297
297
  # File-Rule Mappings
298
298
 
299
299
  Each file was matched by a specific rule. Include the rule name in the "rule" field of each issue:
300
- ${h.join(`
301
- `)}`:"",m=`${f}${d}
300
+ ${d.join(`
301
+ `)}`:"",m=`${f}${p}
302
302
 
303
303
  ${t.diffs.map(y=>`File: ${y.file}
304
304
  ${y.diff}`).join(`
@@ -307,54 +307,113 @@ ${y.diff}`).join(`
307
307
  `),E=`${n}
308
308
 
309
309
  # Input:
310
- ${C}`;p.newline(),p.plain(`Prompt for ${s.name} (batch ${t.batchIndex+1}/${e.length}):`),p.plain(` Tokens: ${t.tokenCount.toLocaleString()} (~${r.toLocaleString()} system + ~${y.toLocaleString()} input)`),p.plain("\u2500".repeat(80)),p.plain(E),p.plain("\u2500".repeat(80)),p.newline()}let D=s.executorSettings&&i.applySettings?i.applySettings(s.executorSettings):i.getInfo(),g={agent:s,executor:D,input:m,systemPrompt:n,verbose:a.verbose,quiet:a.quiet,stream:a.stream,cwd:a.metadata.repository},F=async()=>{let y=await Qe.executeAgent(g),C=fi(y.output,s.name);return{success:y.success,data:C,error:y.error}};if(l){let y=Date.now();try{let C=await F(),E=Date.now()-y;return C.success?l.completeBatch(s.name):l.failTask(s.name),{...C,duration:E}}catch(C){let E=Date.now()-y,v=C instanceof Error?C.message:String(C);return l.failTask(s.name),{success:!1,data:[],error:v,duration:E}}}return zo({label:s.name,batchIndex:t.batchIndex,totalBatches:e.length},a.quiet??!1,F,(y,C)=>e.length>1?`${s.name} (batch ${t.batchIndex+1}/${e.length}, ${C}ms)`:`${s.name} (${C}ms)`,y=>e.length>1?`${s.name} (batch ${t.batchIndex+1}/${e.length}): ${y}`:`${s.name}: ${y}`)})}function ex(t,e,s){let i=[],n=0;for(let a of t)i.push(...a.data),n+=a.duration||0;let r=t.every(a=>a.success),o=Wo(t.map(a=>a.error));return{agent:e.name,executor:e.executor||"unknown",success:r,output:`Processed ${s.length} batch(es), found ${i.length} issue(s)`,duration:n,issues:i,error:o}}function Qm(){return{id:"review",name:"Review",description:"Run code review agents",enabled:!0,order:2,execute:async t=>{let e=Date.now(),s=await or(),i=t.config,o=((i.executors[i.executor]||{}).review||{}).concurrency??t.concurrency,a=Ss(o);t.verbose&&!t.quiet&&p.plain(`Token counter: ${zm()}`);let u=ui.listEnabled();if(u.length===0)return t.quiet||p.warn("No enabled Agents found"),{stageId:"review",stageName:"Review",success:!0,duration:Date.now()-e};let l=await Q1(u,t,s),c=0;for(let[,b]of l)c+=b.batches.length;let f=u.filter(b=>b.stage!=="validation"),h=f.filter(b=>l.has(b.name)),d=f.filter(b=>!l.has(b.name));if(!t.quiet){p.sync(`Code Review: ${h.length} agent${h.length!==1?"s":""} (${c} batch${c!==1?"es":""} total)...`);for(let b of d)p.plain(` \u2022 ${b.name}: skipped (no matching rules)`)}let D=!t.quiet&&!t.stream&&!t.verbose?new Is:void 0;if(D){for(let b of h){let R=l.get(b.name);if(R){let O=R.ruleNames.slice(0,3).join(", "),J=`${R.files} files | ${O}${R.rules>3?"...":""}`;D.addTask(b.name,b.name,R.batches.length,R.files,R.rules,J)}}D.start()}let g;try{g=await Promise.all(h.map(async b=>{try{let R=b.executor||i.executor,O=Qe.get(R);if(!O)return t.quiet||p.warn(`Executor not found: ${R}`),null;let J=l.get(b.name),{batches:G,systemPrompt:z}=J,ae=Rn(z);!t.quiet&&t.verbose&&G.forEach(As=>{p.plain(` ${Ym(As,!0)}`)});let ye=await Promise.all(G.map(As=>X1(As,G,b,O,z,ae,J.fileToRule,t,a,D))),$e=ex(ye,b,G);return t.issues.push(...$e.issues),t.results.push($e),$e}catch(R){let O=R instanceof Error?R.message:String(R);t.quiet||p.error(`${b.name}: ${O}`);let J={agent:b.name,executor:b.executor||"unknown",success:!1,output:"",error:O,duration:0,issues:[]};return t.results.push(J),J}}))}finally{D?.stop()}let F=g.filter(b=>b?.success).length,y=g.filter(b=>b&&!b.success),C=y.length,E=Date.now()-e,v=E>=1e3?`${(E/1e3).toFixed(1)}s`:`${E}ms`;if(t.quiet||p.done(`Review complete: ${F}/${h.length} agents (${v})`),C>0&&!t.quiet)for(let b of y)p.warn(`Agent "${b?.agent}" failed: ${b?.error||"execution failed"} - issues from this agent excluded`);let S=F>0,T;return C>0&&(T=y.map(R=>`${R?.agent||"Unknown"}: ${R?.error||"execution failed"}`).filter(Boolean).join("; ")),{stageId:"review",stageName:"Review",success:S,duration:E,error:T}}}}Y();function Xm(){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(n=>n.success).length,i=t.results.filter(n=>!n.success).length;return t.quiet||p.sync(`Results: ${s} success, ${i} failed`),{stageId:"aggregate-results",stageName:"Aggregate Results",success:!0,duration:Date.now()-e}}}}Y();var tx=80;function eg(){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??tx,i=0,n=0,r=0;for(let a of t.results){let u=a.issues.length;i+=u,a.issues=a.issues.filter(l=>l.confidence===void 0?(r++,!0):l.confidence>=s),n+=u-a.issues.length}let o=i-n;return t.issues=t.results.flatMap(a=>a.issues),t.quiet||(i>0&&p.sync(`Confidence filter (>=${s}%): ${o} kept, ${n} filtered out`),r>0&&p.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:i,totalAfter:o,filteredOut:n,minConfidence:s}}}}}Y();var sx=.6;function tg(t){let e=t.toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter(s=>s.length>2);return new Set(e)}function ix(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 n of t)e.has(n)&&s++;let i=t.size+e.size-s;return s/i}function nx(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 i=tg(t.shortDescription),n=tg(e.shortDescription);return ix(i,n)>=sx}function sg(){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),i=s.length,n=new Set,r=s.filter(c=>{let f=`${c.file}:${c.lineStart}:${c.lineEnd}`;return n.has(f)?!1:(n.add(f),!0)}),o=[];for(let c of r)o.some(h=>nx(h,c))||o.push(c);t.issues=o;let a=i-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`),p.sync(`Removed ${l} duplicate issue(s) (${c.join(", ")})`)}return{stageId:"deduplication",stageName:"Deduplication",success:!0,duration:Date.now()-e}}}}Y();yi();Ge();xo();var ug=require("node:fs/promises"),rx=6,ig=50,ox=-40,ax=2e3,ng=`
311
- ... (diff truncated due to size) ...`,Nn={FILE_EXACT_MATCH:40,FILE_PARTIAL_MATCH:30,LINE_OVERLAP:30,LINE_NEARBY:15,DESCRIPTION:30},Ec={MINIMUM_SCORE:40,LINE_TOLERANCE:5,LINE_EXTENDED_TOLERANCE:20},rg={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.
310
+ ${C}`;h.newline(),h.plain(`Prompt for ${s.name} (batch ${t.batchIndex+1}/${e.length}):`),h.plain(` Tokens: ${t.tokenCount.toLocaleString()} (~${r.toLocaleString()} system + ~${y.toLocaleString()} input)`),h.plain("\u2500".repeat(80)),h.plain(E),h.plain("\u2500".repeat(80)),h.newline()}let D=s.executorSettings&&i.applySettings?i.applySettings(s.executorSettings):i.getInfo(),g={agent:s,executor:D,input:m,systemPrompt:n,verbose:a.verbose,quiet:a.quiet,stream:a.stream,cwd:a.metadata.repository},F=async()=>{let y=await Qe.executeAgent(g),C=hi(y.output,s.name);return{success:y.success,data:C,error:y.error}};if(l){let y=Date.now();try{let C=await F(),E=Date.now()-y;return C.success?l.completeBatch(s.name):l.failTask(s.name),{...C,duration:E}}catch(C){let E=Date.now()-y,v=C instanceof Error?C.message:String(C);return l.failTask(s.name),{success:!1,data:[],error:v,duration:E}}}return Yo({label:s.name,batchIndex:t.batchIndex,totalBatches:e.length},a.quiet??!1,F,(y,C)=>e.length>1?`${s.name} (batch ${t.batchIndex+1}/${e.length}, ${C}ms)`:`${s.name} (${C}ms)`,y=>e.length>1?`${s.name} (batch ${t.batchIndex+1}/${e.length}): ${y}`:`${s.name}: ${y}`)})}function mx(t,e,s){let i=[],n=0;for(let a of t)i.push(...a.data),n+=a.duration||0;let r=t.every(a=>a.success),o=Ko(t.map(a=>a.error));return{agent:e.name,executor:e.executor||"unknown",success:r,output:`Processed ${s.length} batch(es), found ${i.length} issue(s)`,duration:n,issues:i,error:o}}function rg(){return{id:"review",name:"Review",description:"Run code review agents",enabled:!0,order:2,execute:async t=>{let e=Date.now(),s=await lr(),i=t.config,o=((i.executors[i.executor]||{}).review||{}).concurrency??t.concurrency,a=As(o);t.verbose&&!t.quiet&&h.plain(`Token counter: ${Qm()}`);let u=ci.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 px(u,t,s),c=0;for(let[,w]of l)c+=w.batches.length;let f=u.filter(w=>w.stage!=="validation"),d=f.filter(w=>l.has(w.name)),p=f.filter(w=>!l.has(w.name));if(!t.quiet){h.sync(`Code Review: ${d.length} agent${d.length!==1?"s":""} (${c} batch${c!==1?"es":""} total)...`);for(let w of p)h.plain(` \u2022 ${w.name}: skipped (no matching rules)`)}let D=!t.quiet&&!t.stream&&!t.verbose?new Ns:void 0;if(D){for(let w of d){let R=l.get(w.name);if(R){let O=R.ruleNames.slice(0,3).join(", "),J=`${R.files} files | ${O}${R.rules>3?"...":""}`;D.addTask(w.name,w.name,R.batches.length,R.files,R.rules,J)}}D.start()}let g;try{g=await Promise.all(d.map(async w=>{try{let R=w.executor||i.executor,O=Qe.get(R);if(!O)return t.quiet||h.warn(`Executor not found: ${R}`),null;let J=l.get(w.name),{batches:G,systemPrompt:z}=J,ae=On(z);!t.quiet&&t.verbose&&G.forEach(_s=>{h.plain(` ${tg(_s,!0)}`)});let ye=await Promise.all(G.map(_s=>Dx(_s,G,w,O,z,ae,J.fileToRule,t,a,D))),Be=mx(ye,w,G);return t.issues.push(...Be.issues),t.results.push(Be),Be}catch(R){let O=R instanceof Error?R.message:String(R);t.quiet||h.error(`${w.name}: ${O}`);let J={agent:w.name,executor:w.executor||"unknown",success:!1,output:"",error:O,duration:0,issues:[]};return t.results.push(J),J}}))}finally{D?.stop()}let F=g.filter(w=>w?.success).length,y=g.filter(w=>w&&!w.success),C=y.length,E=Date.now()-e,v=E>=1e3?`${(E/1e3).toFixed(1)}s`:`${E}ms`;if(t.quiet||h.done(`Review complete: ${F}/${d.length} agents (${v})`),C>0&&!t.quiet)for(let w of y)h.warn(`Agent "${w?.agent}" failed: ${w?.error||"execution failed"} - issues from this agent excluded`);let S=F>0,T;return C>0&&(T=y.map(R=>`${R?.agent||"Unknown"}: ${R?.error||"execution failed"}`).filter(Boolean).join("; ")),{stageId:"review",stageName:"Review",success:S,duration:E,error:T}}}}Y();function og(){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(n=>n.success).length,i=t.results.filter(n=>!n.success).length;return t.quiet||h.sync(`Results: ${s} success, ${i} failed`),{stageId:"aggregate-results",stageName:"Aggregate Results",success:!0,duration:Date.now()-e}}}}Y();var gx=80;function ag(){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??gx,i=0,n=0,r=0;for(let a of t.results){let u=a.issues.length;i+=u,a.issues=a.issues.filter(l=>l.confidence===void 0?(r++,!0):l.confidence>=s),n+=u-a.issues.length}let o=i-n;return t.issues=t.results.flatMap(a=>a.issues),t.quiet||(i>0&&h.sync(`Confidence filter (>=${s}%): ${o} kept, ${n} 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:i,totalAfter:o,filteredOut:n,minConfidence:s}}}}}Y();var yx=.6;function ug(t){let e=t.toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter(s=>s.length>2);return new Set(e)}function Fx(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 n of t)e.has(n)&&s++;let i=t.size+e.size-s;return s/i}function Cx(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 i=ug(t.shortDescription),n=ug(e.shortDescription);return Fx(i,n)>=yx}function lg(){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),i=s.length,n=new Set,r=s.filter(c=>{let f=`${c.file}:${c.lineStart}:${c.lineEnd}`;return n.has(f)?!1:(n.add(f),!0)}),o=[];for(let c of r)o.some(d=>Cx(d,c))||o.push(c);t.issues=o;let a=i-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}}}}Y();Ci();Ge();ko();var Dg=require("node:fs/promises"),Ex=6,cg=50,wx=-40,bx=2e3,fg=`
311
+ ... (diff truncated due to size) ...`,Ln={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},dg={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.
312
312
 
313
313
  You may include your analysis and reasoning, but MUST include a JSON array of valid issues somewhere in your response.
314
- Be strict but fair. Only filter out clear false positives.`,enabled:!0,order:999,executor:"claude-cli",executorSettings:{model:"opus",timeout:180}};async function ux(t){return ct(we.VALIDATION_PROMPT,async()=>{try{return(await Et({projectPath:t})).find(i=>i.name==="validation"||i.stage==="validation")??rg}catch{return rg}})}async function lx(){try{let t=vo("prompts","validation-instructions.md");return await(0,ug.readFile)(t,"utf-8")}catch(t){if(t instanceof Error&&"code"in t&&t.code==="ENOENT")p.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);p.warn(`Failed to load validation instructions (defaults/prompts/validation-instructions.md): ${s}`)}return""}}function cx(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(`
314
+ Be strict but fair. Only filter out clear false positives.`,enabled:!0,order:999,executor:"claude-cli",executorSettings:{model:"opus",timeout:180}};async function vx(t){return ft(be.VALIDATION_PROMPT,async()=>{try{return(await wt({projectPath:t})).find(i=>i.name==="validation"||i.stage==="validation")??dg}catch{return dg}})}async function xx(){try{let t=Ao("prompts","validation-instructions.md");return await(0,Dg.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 Sx(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(`
315
315
  `)}).join(`
316
316
 
317
- `)}function og(t){return t.replace(/\\/g,"/").replace(/^\.\//,"").toLowerCase()}function fx(t,e,s,i,n=Ec.LINE_TOLERANCE){return t<=i&&s<=e?!0:Math.abs(t-s)<=n||Math.abs(e-i)<=n||Math.abs(t-i)<=n||Math.abs(e-s)<=n}function hx(t,e){let s=0;if(!e.file)return 0;let i=og(t.file),n=og(e.file);if(i===n)s+=Nn.FILE_EXACT_MATCH;else if(i.endsWith(n)||n.endsWith(i))s+=Nn.FILE_PARTIAL_MATCH;else return 0;if(typeof e.lineStart=="number"){let r=e.lineEnd??e.lineStart;fx(t.lineStart,t.lineEnd,e.lineStart,r)?s+=Nn.LINE_OVERLAP:Math.abs(t.lineStart-e.lineStart)<=Ec.LINE_EXTENDED_TOLERANCE&&(s+=Nn.LINE_NEARBY)}if(e.shortDescription&&t.shortDescription){let o=new Set(t.shortDescription.toLowerCase().split(/\W+/).filter(c=>c.length>=3)),a=new Set(e.shortDescription.toLowerCase().split(/\W+/).filter(c=>c.length>=3)),l=[...o].filter(c=>a.has(c)).length/Math.max(o.size,a.size,1);s+=Math.round(l*Nn.DESCRIPTION)}return s}var dx=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 i=(s.issues||[]).filter(r=>typeof r.id=="number").map(r=>({id:r.id,confidence:typeof r.confidence=="number"?r.confidence:100})),n=(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:i,filteredIssues:n}}catch{return null}},px=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(n=>typeof n=="number")?null:{validatedIssues:s.map(n=>({id:n,confidence:100})),filteredIssues:[]}}catch{return null}},Dx=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 i=s.filter(r=>typeof r=="number");return i.length===0?null:{validatedIssues:i.map(r=>({id:r,confidence:100})),filteredIssues:[]}}catch{return null}},mx=(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 i=JSON.parse(s[1]);if(!Array.isArray(i)||i.length===0)return null;let n=new Set;for(let o of i){let a=null,u=0;for(let l of e){if(n.has(l.id))continue;let c=hx(l,o);c>u&&c>=Ec.MINIMUM_SCORE&&(u=c,a=l)}a&&n.add(a.id)}return n.size===0?null:{validatedIssues:Array.from(n).map(o=>({id:o,confidence:100})),filteredIssues:[]}}catch{return null}};function gx(t,e){let s=[dx,px,Dx,mx];for(let i of s){let n=i(t,e);if(n!==null)return n}return{validatedIssues:[],filteredIssues:[]}}function yx(t,e,s){let i=t.executor||s,n=hi(i);return!n||!n.enabled?(e.quiet||p.warn(`Validation executor '${i}' not found or disabled, skipping validation`),null):t.executorSettings&&n.applySettings?n.applySettings(t.executorSettings):n.getInfo()}function Fx(t,e){if(t.length<=e)return t;let s=Math.floor((e-ng.length)/2),i=t.slice(0,s),n=t.slice(-s);return i+ng+n}function Cx(t,e,s,i,n){let r=cx(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((m,D)=>`### Commit ${D+1}:
317
+ `)}function hg(t){return t.replace(/\\/g,"/").replace(/^\.\//,"").toLowerCase()}function Ax(t,e,s,i,n=vc.LINE_TOLERANCE){return t<=i&&s<=e?!0:Math.abs(t-s)<=n||Math.abs(e-i)<=n||Math.abs(t-i)<=n||Math.abs(e-s)<=n}function kx(t,e){let s=0;if(!e.file)return 0;let i=hg(t.file),n=hg(e.file);if(i===n)s+=Ln.FILE_EXACT_MATCH;else if(i.endsWith(n)||n.endsWith(i))s+=Ln.FILE_PARTIAL_MATCH;else return 0;if(typeof e.lineStart=="number"){let r=e.lineEnd??e.lineStart;Ax(t.lineStart,t.lineEnd,e.lineStart,r)?s+=Ln.LINE_OVERLAP:Math.abs(t.lineStart-e.lineStart)<=vc.LINE_EXTENDED_TOLERANCE&&(s+=Ln.LINE_NEARBY)}if(e.shortDescription&&t.shortDescription){let o=new Set(t.shortDescription.toLowerCase().split(/\W+/).filter(c=>c.length>=3)),a=new Set(e.shortDescription.toLowerCase().split(/\W+/).filter(c=>c.length>=3)),l=[...o].filter(c=>a.has(c)).length/Math.max(o.size,a.size,1);s+=Math.round(l*Ln.DESCRIPTION)}return s}var _x=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 i=(s.issues||[]).filter(r=>typeof r.id=="number").map(r=>({id:r.id,confidence:typeof r.confidence=="number"?r.confidence:100})),n=(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:i,filteredIssues:n}}catch{return null}},$x=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(n=>typeof n=="number")?null:{validatedIssues:s.map(n=>({id:n,confidence:100})),filteredIssues:[]}}catch{return null}},Bx=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 i=s.filter(r=>typeof r=="number");return i.length===0?null:{validatedIssues:i.map(r=>({id:r,confidence:100})),filteredIssues:[]}}catch{return null}},Tx=(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 i=JSON.parse(s[1]);if(!Array.isArray(i)||i.length===0)return null;let n=new Set;for(let o of i){let a=null,u=0;for(let l of e){if(n.has(l.id))continue;let c=kx(l,o);c>u&&c>=vc.MINIMUM_SCORE&&(u=c,a=l)}a&&n.add(a.id)}return n.size===0?null:{validatedIssues:Array.from(n).map(o=>({id:o,confidence:100})),filteredIssues:[]}}catch{return null}};function Ix(t,e){let s=[_x,$x,Bx,Tx];for(let i of s){let n=i(t,e);if(n!==null)return n}return{validatedIssues:[],filteredIssues:[]}}function Rx(t,e,s){let i=t.executor||s,n=pi(i);return!n||!n.enabled?(e.quiet||h.warn(`Validation executor '${i}' not found or disabled, skipping validation`),null):t.executorSettings&&n.applySettings?n.applySettings(t.executorSettings):n.getInfo()}function Nx(t,e){if(t.length<=e)return t;let s=Math.floor((e-fg.length)/2),i=t.slice(0,s),n=t.slice(-s);return i+fg+n}function Px(t,e,s,i,n){let r=Sx(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((m,D)=>`### Commit ${D+1}:
318
318
  ${m}`)].join(`
319
319
  `):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(`
320
- `),l=new Set(t.map(m=>m.file)),c=e.diffs.filter(m=>l.has(m.file)),f=c.length>0?["","## Changed Files (diffs for context)","These are the actual changes being reviewed. Use these to verify issues.","",...c.map(m=>{let D=Fx(m.diff,ax);return`File: ${m.file}
320
+ `),l=new Set(t.map(m=>m.file)),c=e.diffs.filter(m=>l.has(m.file)),f=c.length>0?["","## Changed Files (diffs for context)","These are the actual changes being reviewed. Use these to verify issues.","",...c.map(m=>{let D=Nx(m.diff,bx);return`File: ${m.file}
321
321
  ${D}`})].join(`
322
- `):"",h=`${u}${f}
322
+ `):"",d=`${u}${f}
323
323
 
324
324
  ${n}
325
325
 
326
326
  # Issues to validate (${t.length} total):
327
327
 
328
- ${r}`,d=s.systemPrompt;return i&&(d=`${d}
328
+ ${r}`,p=s.systemPrompt;return i&&(p=`${p}
329
329
 
330
- ${i}`),{input:h,systemPrompt:d}}function Ex(t,e,s,i,n,r){if(!t.verbose||t.quiet)return;let o=r>1;p.plain(`
331
- Validation prompt${o?` (batch ${n+1}/${r})`:""}:`),p.plain(` Executor: ${e.name}`),p.plain(` Issues to validate: ${s.length}`),p.plain("\u2500".repeat(80)),p.plain(i.slice(0,2e3)+(i.length>2e3?"...":"")),p.plain("\u2500".repeat(80)),p.newline()}function bx(t,e){let s=t instanceof Error?t.message:String(t);return{success:!1,data:[],validatedIssues:[],filteredIssues:[],error:s,duration:e}}function ag(t,e,s,i){let n;return s==="low-confidence"?n=`Low validation confidence (${e}%, threshold: ${i.threshold}%)`:n=`Confidence delta too negative (${i.delta}, original: ${i.originalConfidence}%, validated: ${e}%)`,{id:t,confidence:e,reason:n}}async function wx(t,e){let s=Date.now();try{let i=await t(),n=Date.now()-s;return i.success?e.completeBatch("validation"):e.failTask("validation"),{success:i.success,data:i.data,validatedIssues:i.validatedIssues,filteredIssues:i.filteredIssues,error:i.error,duration:n}}catch(i){let n=Date.now()-s;return e.failTask("validation"),bx(i,n)}}async function vx(t,e,s,i,n){let r=await zo({label:"Validating",batchIndex:i,totalBatches:n,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)=>n>1?`Validated batch ${i+1}/${n} (${o.validIds.length} valid, ${a}ms)`:`Validated ${o.validIds.length} issue(s) (${a}ms)`,o=>n>1?`Validation failed (batch ${i+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 xx(t,e,s,i,n,r,o,a,u){u&&e===0&&u.startTask("validation");let{input:l,systemPrompt:c}=Cx(t,r,i,o,a),f={agent:i,executor:n,input:l,systemPrompt:c,verbose:r.verbose,quiet:r.quiet,cwd:r.metadata.repository};Ex(r,n,t,l,e,s);let h=async()=>{let d=await Qe.executeAgent(f);if(!d.success)return{success:!1,data:[],validatedIssues:[],filteredIssues:[],error:d.error};let m=gx(d.output,t);return{success:!0,data:m.validatedIssues.map(D=>D.id),validatedIssues:m.validatedIssues,filteredIssues:m.filteredIssues}};return u?wx(h,u):vx(h,r,t,e,s)}function lg(){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||p.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||p.sync("No issues to validate"),{stageId:"validation",stageName:"Validation",success:!0,duration:Date.now()-e};let i=s.map((y,C)=>({...y,id:C+1})),n=await ux(t.metadata.repository),r=await or(),o=await lx(),a=t.config,u=a.executor,c=(a.executors[u]||{}).validation||{},f=c.batchSize??rx,h=c.concurrency??t.concurrency,d=yx(n,t,u);if(!d)return{stageId:"validation",stageName:"Validation",success:!0,duration:Date.now()-e};let m=Jm(i,f),D=d.type==="llm-api"||d.type==="cli"?d.model:void 0;t.quiet||(p.sync(`Validating ${s.length} issue(s)...`),t.verbose&&p.plain(` Executor: ${d.name}${D?` (model: ${D})`:""}`));let F=!t.quiet&&!t.stream&&!t.verbose?new Is:void 0;F&&(F.addTask("validation","Validation",m.length,s.length,1,`${s.length} issues`),F.start());try{let y,C=Ss(h);if(y=await Promise.all(m.map((z,ae)=>C(()=>xx(z,ae,m.length,n,d,t,r,o,F)))),F?.stop(),!Hm(y)){let z=Zm(y),ae=Wo(z.map(ye=>ye.error));return{stageId:"validation",stageName:"Validation",success:!1,duration:Date.now()-e,error:ae}}let E=y.flatMap(z=>z.validatedIssues),v=y.flatMap(z=>z.filteredIssues),S=new Set,T=[],b=new Map(i.map(z=>[z.id,z]));for(let z of E){let ye=b.get(z.id)?.confidence??100,$e=z.confidence-ye;z.confidence<ig?T.push(ag(z.id,z.confidence,"low-confidence",{threshold:ig})):$e<ox?T.push(ag(z.id,z.confidence,"negative-delta",{delta:$e,originalConfidence:ye})):S.add(z.id)}let R=[...v,...T];t.issues=i.filter(z=>S.has(z.id));let O=S.size,J=s.length-O,G=Date.now()-e;if(!t.quiet){let z=T.length,ae=v.length;if(z>0?p.done(`Validation complete: ${O} valid, ${ae} filtered by validator, ${z} filtered by delta (${G}ms)`):p.done(`Validation complete: ${O} valid, ${J} filtered out (${G}ms)`),t.verbose&&R.length>0){p.newline(),p.plain("Filtered issues:");for(let ye of R){let $e=b.get(ye.id);$e?p.plain(` [${ye.id}] ${$e.file}:${$e.lineStart} \u2014 ${ye.reason}`):p.plain(` [${ye.id}] \u2014 ${ye.reason}`)}}}return{stageId:"validation",stageName:"Validation",success:!0,duration:G,output:{validCount:O,filteredCount:J,filteredIssues:R,deltaFilteredCount:T.length}}}catch(y){F?.stop();let C=y instanceof Error?y.message:String(y);return t.quiet||p.error(`Validation error: ${C}`),{stageId:"validation",stageName:"Validation",success:!1,duration:Date.now()-e,error:C}}}}}function cg(){return[gm(),ym(),Qm(),Xm(),eg(),sg(),lg()]}Ge();var Go=class{agents=[];executors=new Map;stages=[];constructor(e=[],s=[],i){this.agents=[...e].sort((n,r)=>n.order-r.order);for(let n of s)this.executors.set(n.name,n),Qe.registerExecutor(n);for(let n of e)ui.register(n);this.stages=i||cg()}addAgent(e){this.agents.push(e),this.agents.sort((s,i)=>s.order-i.order),ui.register(e)}removeAgent(e){this.agents=this.agents.filter(s=>s.name!==e),ui.remove(e)}getAgents(){return this.agents}getEnabledAgents(){return this.agents.filter(e=>e.enabled)}addExecutor(e){this.executors.set(e.name,e),Qe.registerExecutor(e)}getExecutor(e){return this.executors.get(e)}async execute(e,s={}){let{verbose:i=!1,quiet:n=!1,concurrency:r=3,skipValidation:o=!1,stream:a=!1,baseRef:u,headRef:l,ruleFilter:c,excludeRules:f,agentFilter:h,excludeAgents:d,minConfidence:m}=s,D=Date.now(),g=process.cwd(),F=await Fe(g),y=[];u&&l&&(y=await Af(u,l),i&&y.length>0&&p.plain(`Fetched ${y.length} commit message(s) for context`));let C={diffs:e,results:[],issues:[],metadata:{timestamp:Date.now(),repository:g,baseRef:u,headRef:l,commitMessages:y.length>0?y:void 0},verbose:i,quiet:n,stream:a,concurrency:r,skipValidation:o,ruleFilter:c,excludeRules:f,agentFilter:h,excludeAgents:d,minConfidence:m,config:F,agents:this.agents},E=[];for(let S of this.stages)if(S.enabled)try{let T=await S.execute(C);if(E.push(T),!T.success){p.error(`Stage ${S.name} failed: ${T.error}`);break}}catch(T){let b=T instanceof Error?T.message:String(T);p.error(`Stage ${S.name} failed: ${b}`),E.push({stageId:S.id,stageName:S.name,success:!1,duration:0,error:b});break}let v=Date.now()-D;return{success:E.every(S=>S.success),context:C,totalDuration:v,stages:E}}};Y();xs();var fg=require("node:child_process");Ge();Y();async function hg(t){let e=t||process.cwd(),s=await Fe(e),i=La(),n=ki(e),r=await Ma(),o=await rr(e);p.plain(`Configuration
332
- `),p.plain(`Global: ${i}${r?"":" (not found)"}`),p.plain(`Project: ${n}${o?"":" (not found)"}`),p.plain(`
330
+ ${i}`),{input:d,systemPrompt:p}}function Ox(t,e,s,i,n,r){if(!t.verbose||t.quiet)return;let o=r>1;h.plain(`
331
+ Validation prompt${o?` (batch ${n+1}/${r})`:""}:`),h.plain(` Executor: ${e.name}`),h.plain(` Issues to validate: ${s.length}`),h.plain("\u2500".repeat(80)),h.plain(i.slice(0,2e3)+(i.length>2e3?"...":"")),h.plain("\u2500".repeat(80)),h.newline()}function Lx(t,e){let s=t instanceof Error?t.message:String(t);return{success:!1,data:[],validatedIssues:[],filteredIssues:[],error:s,duration:e}}function pg(t,e,s,i){let n;return s==="low-confidence"?n=`Low validation confidence (${e}%, threshold: ${i.threshold}%)`:n=`Confidence delta too negative (${i.delta}, original: ${i.originalConfidence}%, validated: ${e}%)`,{id:t,confidence:e,reason:n}}async function Mx(t,e){let s=Date.now();try{let i=await t(),n=Date.now()-s;return i.success?e.completeBatch("validation"):e.failTask("validation"),{success:i.success,data:i.data,validatedIssues:i.validatedIssues,filteredIssues:i.filteredIssues,error:i.error,duration:n}}catch(i){let n=Date.now()-s;return e.failTask("validation"),Lx(i,n)}}async function jx(t,e,s,i,n){let r=await Yo({label:"Validating",batchIndex:i,totalBatches:n,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)=>n>1?`Validated batch ${i+1}/${n} (${o.validIds.length} valid, ${a}ms)`:`Validated ${o.validIds.length} issue(s) (${a}ms)`,o=>n>1?`Validation failed (batch ${i+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 qx(t,e,s,i,n,r,o,a,u){u&&e===0&&u.startTask("validation");let{input:l,systemPrompt:c}=Px(t,r,i,o,a),f={agent:i,executor:n,input:l,systemPrompt:c,verbose:r.verbose,quiet:r.quiet,cwd:r.metadata.repository};Ox(r,n,t,l,e,s);let d=async()=>{let p=await Qe.executeAgent(f);if(!p.success)return{success:!1,data:[],validatedIssues:[],filteredIssues:[],error:p.error};let m=Ix(p.output,t);return{success:!0,data:m.validatedIssues.map(D=>D.id),validatedIssues:m.validatedIssues,filteredIssues:m.filteredIssues}};return u?Mx(d,u):jx(d,r,t,e,s)}function mg(){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 i=s.map((y,C)=>({...y,id:C+1})),n=await vx(t.metadata.repository),r=await lr(),o=await xx(),a=t.config,u=a.executor,c=(a.executors[u]||{}).validation||{},f=c.batchSize??Ex,d=c.concurrency??t.concurrency,p=Rx(n,t,u);if(!p)return{stageId:"validation",stageName:"Validation",success:!0,duration:Date.now()-e};let m=sg(i,f),D=p.type==="llm-api"||p.type==="cli"?p.model:void 0;t.quiet||(h.sync(`Validating ${s.length} issue(s)...`),t.verbose&&h.plain(` Executor: ${p.name}${D?` (model: ${D})`:""}`));let F=!t.quiet&&!t.stream&&!t.verbose?new Ns:void 0;F&&(F.addTask("validation","Validation",m.length,s.length,1,`${s.length} issues`),F.start());try{let y,C=As(d);if(y=await Promise.all(m.map((z,ae)=>C(()=>qx(z,ae,m.length,n,p,t,r,o,F)))),F?.stop(),!ig(y)){let z=ng(y),ae=Ko(z.map(ye=>ye.error));return{stageId:"validation",stageName:"Validation",success:!1,duration:Date.now()-e,error:ae}}let E=y.flatMap(z=>z.validatedIssues),v=y.flatMap(z=>z.filteredIssues),S=new Set,T=[],w=new Map(i.map(z=>[z.id,z]));for(let z of E){let ye=w.get(z.id)?.confidence??100,Be=z.confidence-ye;z.confidence<cg?T.push(pg(z.id,z.confidence,"low-confidence",{threshold:cg})):Be<wx?T.push(pg(z.id,z.confidence,"negative-delta",{delta:Be,originalConfidence:ye})):S.add(z.id)}let R=[...v,...T];t.issues=i.filter(z=>S.has(z.id));let O=S.size,J=s.length-O,G=Date.now()-e;if(!t.quiet){let z=T.length,ae=v.length;if(z>0?h.done(`Validation complete: ${O} valid, ${ae} filtered by validator, ${z} filtered by delta (${G}ms)`):h.done(`Validation complete: ${O} valid, ${J} filtered out (${G}ms)`),t.verbose&&R.length>0){h.newline(),h.plain("Filtered issues:");for(let ye of R){let Be=w.get(ye.id);Be?h.plain(` [${ye.id}] ${Be.file}:${Be.lineStart} \u2014 ${ye.reason}`):h.plain(` [${ye.id}] \u2014 ${ye.reason}`)}}}return{stageId:"validation",stageName:"Validation",success:!0,duration:G,output:{validCount:O,filteredCount:J,filteredIssues:R,deltaFilteredCount:T.length}}}catch(y){F?.stop();let C=y instanceof Error?y.message:String(y);return t.quiet||h.error(`Validation error: ${C}`),{stageId:"validation",stageName:"Validation",success:!1,duration:Date.now()-e,error:C}}}}}function gg(){return[vm(),xm(),rg(),og(),ag(),lg(),mg()]}Ge();var Jo=class{agents=[];executors=new Map;stages=[];constructor(e=[],s=[],i){this.agents=[...e].sort((n,r)=>n.order-r.order);for(let n of s)this.executors.set(n.name,n),Qe.registerExecutor(n);for(let n of e)ci.register(n);this.stages=i||gg()}addAgent(e){this.agents.push(e),this.agents.sort((s,i)=>s.order-i.order),ci.register(e)}removeAgent(e){this.agents=this.agents.filter(s=>s.name!==e),ci.remove(e)}getAgents(){return this.agents}getEnabledAgents(){return this.agents.filter(e=>e.enabled)}addExecutor(e){this.executors.set(e.name,e),Qe.registerExecutor(e)}getExecutor(e){return this.executors.get(e)}async execute(e,s={}){let{verbose:i=!1,quiet:n=!1,concurrency:r=3,skipValidation:o=!1,stream:a=!1,baseRef:u,headRef:l,ruleFilter:c,excludeRules:f,agentFilter:d,excludeAgents:p,minConfidence:m}=s,D=Date.now(),g=process.cwd(),F=await Fe(g),y=[];u&&l&&(y=await If(u,l),i&&y.length>0&&h.plain(`Fetched ${y.length} commit message(s) for context`));let C={diffs:e,results:[],issues:[],metadata:{timestamp:Date.now(),repository:g,baseRef:u,headRef:l,commitMessages:y.length>0?y:void 0},verbose:i,quiet:n,stream:a,concurrency:r,skipValidation:o,ruleFilter:c,excludeRules:f,agentFilter:d,excludeAgents:p,minConfidence:m,config:F,agents:this.agents},E=[];for(let S of this.stages)if(S.enabled)try{let T=await S.execute(C);if(E.push(T),!T.success){h.error(`Stage ${S.name} failed: ${T.error}`);break}}catch(T){let w=T instanceof Error?T.message:String(T);h.error(`Stage ${S.name} failed: ${w}`),E.push({stageId:S.id,stageName:S.name,success:!1,duration:0,error:w});break}let v=Date.now()-D;return{success:E.every(S=>S.success),context:C,totalDuration:v,stages:E}}};Y();Ss();var yg=require("node:child_process");Ge();Y();async function Fg(t){let e=t||process.cwd(),s=await Fe(e),i=Ua(),n=$i(e),r=await Va(),o=await ur(e);h.plain(`Configuration
332
+ `),h.plain(`Global: ${i}${r?"":" (not found)"}`),h.plain(`Project: ${n}${o?"":" (not found)"}`),h.plain(`
333
333
  Merged config:
334
- `),p.plain(JSON.stringify(s,null,2))}async function dg(t){let e=t||process.cwd();if(await rr(e)){p.warn("Project config already exists"),p.plain(`Location: ${ki(e)}`);return}let i=await Zf(e);p.success("Project config created"),p.plain(`Location: ${i}`),p.plain(`
335
- Edit the file to override global settings.`)}async function pg(t){let e=process.env.EDITOR||"nano",s;if(t.global)s=La(),await Ma()||(p.warn("Global config does not exist. Creating with defaults..."),await Hf(Oa()));else{let n=t.projectPath||process.cwd();if(!await rr(n)){p.warn("Project config does not exist. Run `diffray config init` first.");return}s=ki(n)}p.info(`Opening ${s} in ${e}...`);let i=(0,fg.spawnSync)(e,[s],{stdio:"inherit"});i.error&&(p.error(`Failed to open editor: ${i.error.message}`),process.exit(1))}var Dg={meta:{name:"config",description:"Manage configuration"},subCommands:{show:{meta:{description:"Show merged configuration (defaults + global + project)"},run:async()=>{await hg()}},init:{meta:{description:"Initialize project config (.diffray.json)"},run:async()=>{await dg()}},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 pg({global:t.global})}}}};Y();function Sx(t){return!t||Object.keys(t).length===0?"-":Object.entries(t).map(([e,s])=>`${e}=${s}`).join(", ")}async function mg(){let t=await Et(process.cwd());if(p.robot("Available Agents"),p.newline(),t.length===0){p.plain("No Agents configured");return}for(let e of t){let s=e.enabled?"\u25CF":"\u25CB",i=e.stage||"review",n=Fi(e.path);p.plain(`${s} ${e.name} (${i})`),p.plain(` executor: ${e.executor}`),e.executorSettings&&Object.keys(e.executorSettings).length>0&&p.plain(` settings: ${Sx(e.executorSettings)}`),p.plain(` path: ${n}`),p.newline()}}async function gg(t){let s=(await Et(process.cwd())).find(i=>i.name===t);if(s||(p.error(`Agent not found: ${t}`),process.exit(1)),p.robot(`Agent: ${s.name}`),p.newline(),p.plain(`Description: ${s.description}`),p.plain(`Enabled: ${s.enabled?"Yes":"No"}`),p.plain(`Order: ${s.order}`),p.plain(`Stage: ${s.stage||"review"}`),p.plain(`Executor: ${s.executor}`),p.plain(`Path: ${Fi(s.path)}`),s.executorSettings&&Object.keys(s.executorSettings).length>0){p.newline(),p.plain("Executor Settings:");for(let[i,n]of Object.entries(s.executorSettings))p.plain(` ${i}: ${n}`)}p.newline(),p.plain("System Prompt:"),p.separator("\u2500"),p.plain(s.systemPrompt||"(no prompt)"),p.separator("\u2500")}var yg={meta:{name:"agents",description:`List agents or show agent details
334
+ `),h.plain(JSON.stringify(s,null,2))}async function Cg(t){let e=t||process.cwd();if(await ur(e)){h.warn("Project config already exists"),h.plain(`Location: ${$i(e)}`);return}let i=await id(e);h.success("Project config created"),h.plain(`Location: ${i}`),h.plain(`
335
+ Edit the file to override global settings.`)}async function Eg(t){let e=process.env.EDITOR||"nano",s;if(t.global)s=Ua(),await Va()||(h.warn("Global config does not exist. Creating with defaults..."),await sd(qa()));else{let n=t.projectPath||process.cwd();if(!await ur(n)){h.warn("Project config does not exist. Run `diffray config init` first.");return}s=$i(n)}h.info(`Opening ${s} in ${e}...`);let i=(0,yg.spawnSync)(e,[s],{stdio:"inherit"});i.error&&(h.error(`Failed to open editor: ${i.error.message}`),process.exit(1))}var wg={meta:{name:"config",description:"Manage configuration"},subCommands:{show:{meta:{description:"Show merged configuration (defaults + global + project)"},run:async()=>{await Fg()}},init:{meta:{description:"Initialize project config (.diffray.json)"},run:async()=>{await Cg()}},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 Eg({global:t.global})}}}};Y();function Ux(t){return!t||Object.keys(t).length===0?"-":Object.entries(t).map(([e,s])=>`${e}=${s}`).join(", ")}async function bg(){let t=await wt(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",i=e.stage||"review",n=Ei(e.path);h.plain(`${s} ${e.name} (${i})`),h.plain(` executor: ${e.executor}`),e.executorSettings&&Object.keys(e.executorSettings).length>0&&h.plain(` settings: ${Ux(e.executorSettings)}`),h.plain(` path: ${n}`),h.newline()}}async function vg(t){let s=(await wt(process.cwd())).find(i=>i.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: ${Ei(s.path)}`),s.executorSettings&&Object.keys(s.executorSettings).length>0){h.newline(),h.plain("Executor Settings:");for(let[i,n]of Object.entries(s.executorSettings))h.plain(` ${i}: ${n}`)}h.newline(),h.plain("System Prompt:"),h.separator("\u2500"),h.plain(s.systemPrompt||"(no prompt)"),h.separator("\u2500")}var xg={meta:{name:"agents",description:`List agents or show agent details
336
336
 
337
337
  Examples:
338
338
  diffray agents # List all agents
339
339
  diffray agents validation # Show validation agent details
340
- 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 gg(t.name):await mg()}};var Fg=require("node:child_process");Ge();Y();function Ax(t){return t.type==="cli"?t.installCommand:void 0}function kx(t){try{return(0,Fg.execFileSync)("which",[t],{stdio:"ignore"}),!0}catch{return!1}}function _x(t){return t.type==="llm-api"||t.type==="cli"?t.model:void 0}function Bx(t){let e=hi(t);if(!e?.settingsSchema)return[];let s=e.settingsSchema;return"shape"in s&&typeof s.shape=="object"?Object.keys(s.shape):[]}async function Cg(){let t=await Fe(process.cwd()),e=t.executor,s=t.executors[e]||{};p.plain(`Executor: \x1B[36m${e}\x1B[0m`),p.newline(),p.plain("Stages:");let i=["review","validation"];for(let n of i){let r=s[n],o=[];r?.model&&o.push(`model=${r.model}`),r?.timeout&&o.push(`timeout=${r.timeout}`);let a=o.length>0?` (${o.join(", ")})`:"";p.plain(` ${n.padEnd(12)} \u2192 ${e}${a}`)}p.newline()}async function Eg(t){let e=await In(),s=e.find(n=>n.name===t);if(!s){p.error(`Executor not found: ${t}`),p.newline(),p.plain("Available executors:");for(let n of e)p.plain(` \u2022 ${n.name}`);process.exit(1)}if(p.robot(`Executor: ${s.name}`),p.newline(),p.plain(`Type: ${s.type}`),p.plain(`Description: ${s.description}`),s.type==="cli"&&s.command){let n=s.command,r=kx(n);if(p.plain(`Command: ${n} ${r?"\x1B[32m\u2713\x1B[0m":"\x1B[33m\u2717 not installed\x1B[0m"}`),!r){let a=Ax(s);a&&p.plain(`Install: ${a}`)}p.plain(`Args: ${s.args?.join(" ")||"(none)"}`);let o=_x(s);o&&p.plain(`Model: ${o}`),p.plain(`Timeout: ${s.timeout||60}s`)}else s.type==="llm-api"&&(p.plain(`Provider: ${s.provider}`),p.plain(`Model: ${s.model}`),p.plain(`Temperature: ${s.temperature??.7}`),p.plain(`Max Tokens: ${s.maxTokens??4096}`));if(s.type==="cli"&&s.env){p.newline(),p.plain("Environment Variables:");for(let[n,r]of Object.entries(s.env)){let o=n.includes("KEY")||n.includes("TOKEN")?String(r).substring(0,8)+"...":r;p.plain(` ${n}: ${o}`)}}let i=Bx(t);if(i.length>0){p.newline(),p.plain("Stage Settings (in config.executors.<executor>.<stage>):");for(let n of i)p.plain(` \u2022 ${n}`)}}var bg={meta:{name:"executors",description:`List executors or show executor details
340
+ 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 vg(t.name):await bg()}};var Sg=require("node:child_process");Ge();Y();function Vx(t){return t.type==="cli"?t.installCommand:void 0}function Wx(t){try{return(0,Sg.execFileSync)("which",[t],{stdio:"ignore"}),!0}catch{return!1}}function zx(t){return t.type==="llm-api"||t.type==="cli"?t.model:void 0}function Gx(t){let e=pi(t);if(!e?.settingsSchema)return[];let s=e.settingsSchema;return"shape"in s&&typeof s.shape=="object"?Object.keys(s.shape):[]}async function Ag(){let t=await Fe(process.cwd()),e=t.executor,s=t.executors[e]||{};h.plain(`Executor: \x1B[36m${e}\x1B[0m`),h.newline(),h.plain("Stages:");let i=["review","validation"];for(let n of i){let r=s[n],o=[];r?.model&&o.push(`model=${r.model}`),r?.timeout&&o.push(`timeout=${r.timeout}`);let a=o.length>0?` (${o.join(", ")})`:"";h.plain(` ${n.padEnd(12)} \u2192 ${e}${a}`)}h.newline()}async function kg(t){let e=await Pn(),s=e.find(n=>n.name===t);if(!s){h.error(`Executor not found: ${t}`),h.newline(),h.plain("Available executors:");for(let n of e)h.plain(` \u2022 ${n.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 n=s.command,r=Wx(n);if(h.plain(`Command: ${n} ${r?"\x1B[32m\u2713\x1B[0m":"\x1B[33m\u2717 not installed\x1B[0m"}`),!r){let a=Vx(s);a&&h.plain(`Install: ${a}`)}h.plain(`Args: ${s.args?.join(" ")||"(none)"}`);let o=zx(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[n,r]of Object.entries(s.env)){let o=n.includes("KEY")||n.includes("TOKEN")?String(r).substring(0,8)+"...":r;h.plain(` ${n}: ${o}`)}}let i=Gx(t);if(i.length>0){h.newline(),h.plain("Stage Settings (in config.executors.<executor>.<stage>):");for(let n of i)h.plain(` \u2022 ${n}`)}}var _g={meta:{name:"executors",description:`List executors or show executor details
341
341
 
342
342
  Examples:
343
343
  diffray executors # List all executors
344
344
  diffray executors claude-cli # Show claude-cli executor details
345
- 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 Eg(t.name):await Cg()}};xs();Y();function $x(t){switch(t){case"defaults":return"\u25C6";case"extends":return"\u25C9";case"user":return"\u25C7";case"project":return"\u25CF";default:return"?"}}async function wg(){let t=await Yt();if(t.length===0){p.warn("No rules configured");return}p.robot("Rules"),p.newline();for(let e of t){let s=$x(e.source),i=Fi(e.path);p.plain(`${s} ${e.name}`),p.plain(` agent: ${e.agent}`),p.plain(` patterns: ${e.patterns.join(", ")}`),p.plain(` path: ${i}`),p.newline()}p.plain("\u25C6 defaults \u25C9 extends \u25C7 user \u25CF project")}async function vg(t){let{loadRuleFromRef:e}=await Promise.resolve().then(()=>(xs(),mm)),i=(await Yt()).find(r=>r.name===t);i||(p.error(`Rule not found: ${t}`),process.exit(1));let n=await e(i);n||(p.error(`Failed to load rule content from: ${i.path}`),process.exit(1)),p.robot(`Rule: ${n.name}`),p.newline(),p.plain(`Source: ${i.source}`),p.plain(`Path: ${i.path}`),p.plain(`Description: ${n.description}`),p.plain(`Patterns: ${n.patterns.join(", ")}`),p.plain(`Agent: ${n.agent}`),n.prompt&&(p.newline(),p.plain("Prompt:"),p.separator("\u2500"),p.plain(n.prompt),p.separator("\u2500"))}async function xg(t,e){let i=(await Yt()).find(o=>o.name===t);i||(p.error(`Rule not found: ${t}`),process.exit(1)),p.robot(`Testing rule: ${i.name}`),p.plain(`Patterns: ${i.patterns.join(", ")}`),p.newline();let n=[],r=[];for(let o of e)i.patterns.some(u=>Jt(o,u))?n.push(o):r.push(o);p.success(`Matched ${n.length} file(s):`);for(let o of n)p.plain(` \u25CF ${o}`);if(r.length>0){p.newline(),p.plain(`Not matched ${r.length} file(s):`);for(let o of r)p.plain(` \u25CB ${o}`)}}var Sg={meta:{name:"rules",description:`List rules or show rule details
345
+ 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 kg(t.name):await Ag()}};Ss();Y();function Kx(t){switch(t){case"defaults":return"\u25C6";case"extends":return"\u25C9";case"user":return"\u25C7";case"project":return"\u25CF";default:return"?"}}async function $g(){let t=await Jt();if(t.length===0){h.warn("No rules configured");return}h.robot("Rules"),h.newline();for(let e of t){let s=Kx(e.source),i=Ei(e.path);h.plain(`${s} ${e.name}`),h.plain(` agent: ${e.agent}`),h.plain(` patterns: ${e.patterns.join(", ")}`),h.plain(` path: ${i}`),h.newline()}h.plain("\u25C6 defaults \u25C9 extends \u25C7 user \u25CF project")}async function Bg(t){let{loadRuleFromRef:e}=await Promise.resolve().then(()=>(Ss(),bm)),i=(await Jt()).find(r=>r.name===t);i||(h.error(`Rule not found: ${t}`),process.exit(1));let n=await e(i);n||(h.error(`Failed to load rule content from: ${i.path}`),process.exit(1)),h.robot(`Rule: ${n.name}`),h.newline(),h.plain(`Source: ${i.source}`),h.plain(`Path: ${i.path}`),h.plain(`Description: ${n.description}`),h.plain(`Patterns: ${n.patterns.join(", ")}`),h.plain(`Agent: ${n.agent}`),n.prompt&&(h.newline(),h.plain("Prompt:"),h.separator("\u2500"),h.plain(n.prompt),h.separator("\u2500"))}async function Tg(t,e){let i=(await Jt()).find(o=>o.name===t);i||(h.error(`Rule not found: ${t}`),process.exit(1)),h.robot(`Testing rule: ${i.name}`),h.plain(`Patterns: ${i.patterns.join(", ")}`),h.newline();let n=[],r=[];for(let o of e)i.patterns.some(u=>Ht(o,u))?n.push(o):r.push(o);h.success(`Matched ${n.length} file(s):`);for(let o of n)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 Ig={meta:{name:"rules",description:`List rules or show rule details
346
346
 
347
347
  Examples:
348
348
  diffray rules # List all rules
349
349
  diffray rules code-security # Show rule details
350
- 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],i=e.slice(1);(!s||i.length===0)&&(console.error("Usage: diffray rules test <rule-name> <files...>"),process.exit(1)),await xg(s,i)}else t.name?await vg(t.name):await wg()}};Ge();Y();Xl();Bo();nc();uc();Ro();async function Ag(t={}){let e=t.projectPath||process.cwd(),s;if(t.url?s=[t.url]:s=(await Fe(e)).extends,s.length===0){p.info("No extends configured. Add extends to .diffray.json:"),p.info(' { "extends": ["https://github.com/owner/repo"] }'),p.info("Or install directly: diffray extends install https://github.com/owner/repo");return}p.info(`Installing ${s.length} extension(s)...`),p.info("");let i=Ss(4),n=s.map(l=>i(async()=>{let c=Ao(l);if(!c)return p.error(`Invalid git URL: ${l}`),p.info(" Expected format: https://github.com/owner/repo or git@host:owner/repo"),p.info(" Optional ref: https://github.com/owner/repo#v1.0"),{status:"error",displayRef:l};let f=ko(c),h=c.ref?`${f}#${c.ref}`:f;if(!t.force&&await $o(l))return p.info(` ${h} - already installed`),{status:"skipped",displayRef:h};try{p.info(` ${h} - cloning...`);let d=tc(c,l),m=await rc(d),D=await oc(d.localPath);return await sc(l,{url:c.url,ref:c.ref,resolvedRef:m,downloadedAt:new Date().toISOString(),path:d.localPath,agents:D.agents,rules:D.rules}),p.success(` ${h} - installed (${D.agents.length} agents, ${D.rules.length} rules)`),{status:"success",displayRef:h}}catch(d){let m=d instanceof Error?d.message:String(d);return p.error(` ${h} - failed: ${m}`),{status:"error",displayRef:h,message:m}}})),r=await Promise.all(n),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 Qf(t.url,!!t.global,e),p.success(`Added to ${l} config`)}p.info(""),p.info(`Done: ${o} installed, ${a} skipped, ${u} failed`)}async function kg(){let t=await Ct(),e=Object.entries(t.packages);if(e.length===0){p.info("No extends installed."),p.info("Run `diffray extends install` to install extends from config.");return}p.info(`Installed extends (${e.length}):`),p.info("");for(let[s,i]of e){let n=i.agents.length,r=i.rules.length,o=i.resolvedRef.slice(0,7);p.info(` ${s}`),p.info(` Commit: ${o}`),p.info(` Agents: ${n>0?i.agents.join(", "):"(none)"}`),p.info(` Rules: ${r>0?i.rules.join(", "):"(none)"}`),p.info(` Downloaded: ${i.downloadedAt}`),p.info("")}}async function _g(t){let e=Ao(t);if(!e){p.error(`Invalid git URL: ${t}`);return}if(!await $o(t)){p.error(`Extension not installed: ${t}`);return}let i=(await Ct()).packages[t];if(i){await ac(i.path),await ic(t);let n=ko(e);p.success(`Removed: ${n}`)}}var Bg={meta:{name:"extends",description:`Manage extends (external agents and rules from git)
350
+ 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],i=e.slice(1);(!s||i.length===0)&&(console.error("Usage: diffray rules test <rule-name> <files...>"),process.exit(1)),await Tg(s,i)}else t.name?await Bg(t.name):await $g()}};Ge();Y();sc();Io();ac();fc();Oo();async function Rg(t={}){let e=t.projectPath||process.cwd(),s;if(t.url?s=[t.url]:s=(await Fe(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 i=As(4),n=s.map(l=>i(async()=>{let c=$o(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=Bo(c),d=c.ref?`${f}#${c.ref}`:f;if(!t.force&&await Ro(l))return h.info(` ${d} - already installed`),{status:"skipped",displayRef:d};try{h.info(` ${d} - cloning...`);let p=nc(c,l),m=await uc(p),D=await lc(p.localPath);return await rc(l,{url:c.url,ref:c.ref,resolvedRef:m,downloadedAt:new Date().toISOString(),path:p.localPath,agents:D.agents,rules:D.rules}),h.success(` ${d} - installed (${D.agents.length} agents, ${D.rules.length} rules)`),{status:"success",displayRef:d}}catch(p){let m=p instanceof Error?p.message:String(p);return h.error(` ${d} - failed: ${m}`),{status:"error",displayRef:d,message:m}}})),r=await Promise.all(n),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 nd(t.url,!!t.global,e),h.success(`Added to ${l} config`)}h.info(""),h.info(`Done: ${o} installed, ${a} skipped, ${u} failed`)}async function Ng(){let t=await Et(),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,i]of e){let n=i.agents.length,r=i.rules.length,o=i.resolvedRef.slice(0,7);h.info(` ${s}`),h.info(` Commit: ${o}`),h.info(` Agents: ${n>0?i.agents.join(", "):"(none)"}`),h.info(` Rules: ${r>0?i.rules.join(", "):"(none)"}`),h.info(` Downloaded: ${i.downloadedAt}`),h.info("")}}async function Pg(t){let e=$o(t);if(!e){h.error(`Invalid git URL: ${t}`);return}if(!await Ro(t)){h.error(`Extension not installed: ${t}`);return}let i=(await Et()).packages[t];if(i){await cc(i.path),await oc(t);let n=Bo(e);h.success(`Removed: ${n}`)}}var Og={meta:{name:"extends",description:`Manage extends (external agents and rules from git)
351
351
 
352
352
  Examples:
353
353
  diffray extends install # Install from config
354
354
  diffray extends install https://github.com/org/repo # Install specific URL
355
355
  diffray extends install --force # Force re-clone
356
356
  diffray extends list # List installed
357
- 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 Ag({force:t.force,url:t.url,global:t.global})}},list:{meta:{description:"List installed extends"},run:async()=>{await kg()}},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 _g(t.ref)}}}};Us();var bc=["critical","high","medium","low"],Pn=I.string().optional().transform(t=>{if(t)return t.split(",").map(e=>e.trim())}),Tx=I.object({confidence:I.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:I.string().optional().refine(t=>t?t.split(",").map(i=>i.trim()).filter(i=>!bc.includes(i)).length===0:!0,t=>t?{message:`Invalid severity values: ${t.split(",").map(i=>i.trim()).filter(i=>!bc.includes(i)).join(", ")}. Must be one of: ${bc.join(", ")}`}:{message:""}).transform(t=>{if(t)return t.split(",").map(e=>e.trim())}),agent:Pn,"exclude-agent":Pn,rule:Pn,"exclude-rule":Pn,files:Pn,base:I.string().optional(),head:I.string().optional(),branch:I.string().optional(),executor:I.string().optional(),stream:I.boolean().optional(),verbose:I.boolean().optional(),json:I.boolean().optional(),"skip-validation":I.boolean().optional(),full:I.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 $g(t){return Tx.parse(t)}Us();function Ix(t){switch(t){case"modified":return"~";case"added":return"+";case"deleted":return"-";case"renamed":return"\u2192";default:return"\xB7"}}async function Tg(t,e){if(await Cf())return e||(p.warn("Uncommitted changes detected - cannot checkout to head ref"),p.info("CLI tools will only see diff context, not full files")),null;let s=await Ff(t);return s.checkoutNeeded?(e||p.info(`Checked out to ${t} for full file access`),s.originalRef):null}async function Ig(t){let e=await vf();return e.length===0?(t||p.info("No uncommitted changes, reviewing last commit..."),e=await Sf(),{diffs:e,sourceLabel:" (last commit)"}):{diffs:e,sourceLabel:" (uncommitted)"}}async function Rx(t){let{full:e,filesFilter:s,base:i,head:n,json:r}=t,o=null;if(e){(!s||s.length===0)&&(p.error("--full requires --files"),process.exit(1)),r||p.info(`Full file review: ${s.length} file(s)`);let{diffs:u,notFound:l}=await _f(s);if(l.length>0&&!r)for(let c of l)p.warn(`File not found: ${c}`);return u.length===0&&(p.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(i){let h=n||"HEAD";r||p.info(`Comparing ${i}...${h} for files: ${s.join(", ")}`),o=await Tg(h,r),u=await _a(i,h),l=` (${i}...${h})`}else{let h=await Ig(r);u=h.diffs,l=h.sourceLabel}let{matched:c,unmatched:f}=kf(u,s);if(f.length>0&&!r)for(let h of f)p.warn(`No changes found for: ${h}`);return c.length===0?(p.success("No changes to review for specified files"),o&&(await Ei(o),r||p.info(`Restored to ${o}`)),null):{diffs:c,sourceLabel:l,originalRef:o}}if(i){let u=n||"HEAD";r||p.info(`Comparing ${i}...${u}`),o=await Tg(u,r);let l=await _a(i,u);return l.length===0?(p.success("No changes between commits"),o&&(await Ei(o),r||p.info(`Restored to ${o}`)),null):{diffs:l,sourceLabel:` (${i}...${u})`,originalRef:o}}let a=await Ig(r);return a.diffs.length===0?(p.success("No changes to review"),null):{diffs:a.diffs,sourceLabel:a.sourceLabel,originalRef:null}}function Nx(t){let{result:e,filteredDiffs:s,severityFilter:i,json:n}=t,r=e.context.issues,o=r;i&&i.length>0&&(o=r.filter(u=>i.includes(u.severity)));let a=e.context.results.filter(u=>u.success).length;if(n){let u=Bm(o,e.success,e.totalDuration,e.context.results.length,a,s.length);console.log(u);return}if(p.separator(),e.success?p.success(`Pipeline completed successfully in ${e.totalDuration}ms`):p.warn(`Pipeline completed with errors in ${e.totalDuration}ms`),p.chart(`${a}/${e.context.results.length} agents succeeded`),i&&i.length>0){let u=i.join(", ");p.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`),p.chart(`${o.length} issue(s): ${l.join(", ")}`),p.newline(),console.log(_m(o))}else if(p.newline(),i&&i.length>0){let u=i.join(", ");p.success(`No ${u} issues found \u{1F389}`)}else p.success("No issues found \u{1F389}");p.newline()}async function Px(t){let{verbose:e=!1,json:s=!1,stream:i=!1,severity:n,base:r,head:o,branch:a,skipValidation:u=!1,agent:l,excludeAgent:c,rule:f,excludeRule:h,executor:d,confidence:m,files:D,full:g=!1}=t,F=r,y=o;if(a!==void 0&&a!==""){let O=a==="."?await Aa():a;O||(s||(p.error("Could not determine current branch (detached HEAD?)"),p.info("Specify branch explicitly: diffray review --branch feature-auth")),process.exit(1));let J=r||await gf();J||(s||(p.error("Could not detect default branch (main/master/develop)"),p.info("Use --base explicitly: diffray review --branch --base main")),process.exit(1)),a!=="."&&!await yf(a)&&(s||p.error(`Branch not found: ${a}`),process.exit(1)),O===J?s||p.warn(`Branch "${O}" is the base branch, reviewing uncommitted changes instead`):(F=J,y=O,s||p.info(`Reviewing "${O}" against "${J}"`))}s||p.logo();let C=process.cwd(),E=await Fe(C);await wf()||(s||p.error("Not a git repository"),process.exit(1)),s||p.chart("Analyzing changes...");let S=await Rx({full:g,filesFilter:D,base:F,head:y,json:s});if(!S)return;let{diffs:T,sourceLabel:b,originalRef:R}=S;try{let O=T.filter(te=>!E.excludePatterns.some(ut=>Jt(te.file,ut)));if(O.length===0){p.success("No changes (all excluded)");return}let J=O.reduce((te,ut)=>te+ut.additions,0),G=O.reduce((te,ut)=>te+ut.deletions,0),z=J+G,ae=O.reduce((te,ut)=>(te[ut.status]=(te[ut.status]||0)+1,te),{});if(!s){let te=[];if(ae.modified&&te.push(`${ae.modified} modified`),ae.added&&te.push(`${ae.added} added`),ae.deleted&&te.push(`${ae.deleted} deleted`),ae.renamed&&te.push(`${ae.renamed} renamed`),p.file(`${O.length} files${b}: ${te.join(", ")}`),p.plain(` ${z} changes: +${J} -${G}`),e||O.length<=5){p.newline();for(let On of O){let Og=Ix(On.status);p.plain(` ${Og} ${On.file}: +${On.additions} -${On.deletions}`)}}p.newline(),p.robot("Loading executors and Agents...")}let ye=await In(),$e=ye.filter(te=>te.enabled);s||p.success(`Loaded ${$e.length} executor(s)`);let As=await Et({projectPath:C,executorOverride:d});d&&!s&&p.info(`Using executor: ${d}`),s||(l&&p.info(`Agent filter: ${l.join(", ")}`),c&&p.info(`Excluding agents: ${c.join(", ")}`),f&&p.info(`Rule filter: ${f.join(", ")}`),h&&p.info(`Excluding rules: ${h.join(", ")}`));let Ng=As.filter(te=>te.enabled);s||(p.success(`Loaded ${Ng.length} Agent(s)`),p.newline());let Pg=await new Go(As,ye).execute(O,{verbose:e,quiet:s,concurrency:E.concurrency,skipValidation:u,stream:i,baseRef:F,headRef:y,agentFilter:l,excludeAgents:c,ruleFilter:f,excludeRules:h,minConfidence:m});Nx({result:Pg,filteredDiffs:O,severityFilter:n,json:s})}finally{R&&(await Ei(R),s||p.info(`Restored to ${R}`))}}var Ox={meta:{name:"review",description:`Run code review on current changes
357
+ 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 Rg({force:t.force,url:t.url,global:t.global})}},list:{meta:{description:"List installed extends"},run:async()=>{await Ng()}},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 Pg(t.ref)}}}};var ut=require("node:fs/promises"),Mg=require("node:os"),ks=require("node:path"),jg=require("node:child_process"),qg=require("node:util");Y();var Yx=(0,qg.promisify)(jg.execFile),xc="diffray.md";async function Ug(t){try{return await Yx(t,["--version"]),!0}catch{return!1}}var Lg=`---
358
+ description: Run AI-powered code review with diffray
359
+ ---
360
+
361
+ # Diffray Code Review
362
+
363
+ You are running diffray, an AI-powered multi-agent code review tool.
364
+
365
+ ## Mode
366
+
367
+ ### If \`$ARGUMENTS\` contains options:
368
+ Pass them directly to diffray without asking:
369
+ \`\`\`bash
370
+ diffray review $ARGUMENTS
371
+ \`\`\`
372
+
373
+ ### If \`$ARGUMENTS\` is empty:
374
+ Ask the user what to review using AskUserQuestion tool:
375
+
376
+ **Question:** "What would you like to review?"
377
+ **Options:**
378
+ 1. **Uncommitted changes** - Review current unstaged/staged changes
379
+ 2. **Last commit** - Review the most recent commit
380
+ 3. **Branch vs main** - Review all changes in current branch compared to main
381
+ 4. **Specific files** - Let me specify which files to review
382
+
383
+ Then run the appropriate command:
384
+ - Uncommitted changes: \`diffray review\`
385
+ - Last commit: \`diffray review --base HEAD~1\`
386
+ - Branch vs main: \`diffray review --branch .\`
387
+ - Specific files: Ask which files, then run \`diffray review --files <files>\`
388
+
389
+ ## Common Usage Examples
390
+
391
+ - \`/diffray\` - Interactive mode (asks what to review)
392
+ - \`/diffray --base main\` - Compare current HEAD to main branch
393
+ - \`/diffray --branch .\` - Review current branch vs main (auto-detect)
394
+ - \`/diffray --files src/auth.ts\` - Review specific file
395
+ - \`/diffray --agent security-scan\` - Run only security agent
396
+ - \`/diffray --severity critical,high\` - Show only critical/high issues
397
+ - \`/diffray --stream\` - Show streaming output with thinking
398
+ - \`/diffray --executor cursor-agent-cli\` - Use Cursor Agent as executor
399
+ - \`/diffray --executor claude-cli\` - Use Claude CLI as executor
400
+
401
+ ## Output
402
+
403
+ After running the command, summarize the results:
404
+ 1. Number of files reviewed
405
+ 2. Issues found (grouped by severity)
406
+ 3. Key recommendations
407
+
408
+ If issues are found, offer to help fix them.
409
+ `;function Sc(){let t=(0,Mg.homedir)();return[{name:"Claude Code",path:(0,ks.join)(t,".claude","commands"),cliCommand:"claude",installUrl:"https://claude.ai/code"},{name:"Cursor Agent",path:(0,ks.join)(t,".cursor","commands"),cliCommand:"cursor-agent",installUrl:"https://cursor.com"},{name:"OpenCode",path:(0,ks.join)(t,".config","opencode","commands"),cliCommand:"opencode",installUrl:"https://opencode.ai"}]}async function Ho(t){try{return await(0,ut.access)(t),!0}catch{return!1}}async function Vg(t={}){let e=Sc(),i=(await Promise.all(e.map(async r=>({target:r,available:await Ug(r.cliCommand)})))).filter(r=>r.available).map(r=>r.target);if(i.length===0){h.error("No supported CLI tools found"),h.newline(),h.plain("/diffray command requires 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 n=0;for(let r of i){let o=(0,ks.join)(r.path,xc);if(await Ho(o)&&!t.force)try{if(await(0,ut.readFile)(o,"utf-8")===Lg){h.info(`${r.name}: Already installed (up to date)`);continue}h.warn(`${r.name}: Already exists at ${o}`),h.plain(" Use --force to overwrite");continue}catch(a){h.error(`${r.name}: Failed to read ${o}: ${a.message}`);continue}try{await Ho(r.path)||await(0,ut.mkdir)(r.path,{recursive:!0}),await(0,ut.writeFile)(o,Lg,"utf-8"),h.success(`${r.name}: Installed`),h.plain(` ${o}`),n++}catch(a){h.error(`${r.name}: Failed to install: ${a.message}`);continue}}n>0&&(h.newline(),h.success("Done! Type /diffray in your editor to run."))}async function Wg(){let t=Sc(),e=0;for(let s of t){let i=(0,ks.join)(s.path,xc);if(await Ho(i))try{await(0,ut.unlink)(i),h.success(`${s.name}: Removed`),h.plain(` ${i}`),e++}catch(n){h.error(`${s.name}: Failed to remove: ${n.message}`)}}e===0?h.info("No installations found"):(h.newline(),h.success(`Removed ${e} installation(s)`))}async function zg(){let t=Sc();h.plain(`Installation Status
410
+ `);let e=await Promise.all(t.map(async s=>{let i=(0,ks.join)(s.path,xc);return{target:s,commandPath:i,cliAvailable:await Ug(s.cliCommand),commandExists:await Ho(i)}}));for(let{target:s,commandPath:i,cliAvailable:n,commandExists:r}of e)n?r?(h.success(`${s.name}: Installed`),h.plain(` ${i}`)):(h.warn(`${s.name}: CLI available but command not installed`),h.plain(" Run: diffray setup-command")):(h.plain(`${s.name}: CLI not found (${s.cliCommand})`),h.plain(` Install: ${s.installUrl}`))}var Ac={meta:{name:"setup-command",description:`Install /diffray command for Claude Code, Cursor Agent, OpenCode, and other editors
411
+
412
+ Examples:
413
+ diffray setup-command # Install command
414
+ diffray setup-command --force # Overwrite existing
415
+ diffray setup-command status # Show installation status
416
+ 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 zg()}},remove:{meta:{description:"Remove /diffray command from all tools"},run:async()=>{await Wg()}}},run:async({args:t,rawArgs:e})=>{let s=Object.keys(Ac.subCommands||{});e.some(n=>s.includes(n))||await Vg({force:t.force})}};Ws();var kc=["critical","high","medium","low"],Mn=I.string().optional().transform(t=>{if(t)return t.split(",").map(e=>e.trim())}),Jx=I.object({confidence:I.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:I.string().optional().refine(t=>t?t.split(",").map(i=>i.trim()).filter(i=>!kc.includes(i)).length===0:!0,t=>t?{message:`Invalid severity values: ${t.split(",").map(i=>i.trim()).filter(i=>!kc.includes(i)).join(", ")}. Must be one of: ${kc.join(", ")}`}:{message:""}).transform(t=>{if(t)return t.split(",").map(e=>e.trim())}),agent:Mn,"exclude-agent":Mn,rule:Mn,"exclude-rule":Mn,files:Mn,base:I.string().optional(),head:I.string().optional(),branch:I.string().optional(),executor:I.string().optional(),stream:I.boolean().optional(),verbose:I.boolean().optional(),json:I.boolean().optional(),"skip-validation":I.boolean().optional(),full:I.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 Gg(t){return Jx.parse(t)}Ws();function Hx(t){switch(t){case"modified":return"~";case"added":return"+";case"deleted":return"-";case"renamed":return"\u2192";default:return"\xB7"}}async function Kg(t,e){if(await Sf())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 xf(t);return s.checkoutNeeded?(e||h.info(`Checked out to ${t} for full file access`),s.originalRef):null}async function Yg(t){let e=await $f();return e.length===0?(t||h.info("No uncommitted changes, reviewing last commit..."),e=await Tf(),{diffs:e,sourceLabel:" (last commit)"}):{diffs:e,sourceLabel:" (uncommitted)"}}async function Zx(t){let{full:e,filesFilter:s,base:i,head:n,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 Nf(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(i){let d=n||"HEAD";r||h.info(`Comparing ${i}...${d} for files: ${s.join(", ")}`),o=await Kg(d,r),u=await Ia(i,d),l=` (${i}...${d})`}else{let d=await Yg(r);u=d.diffs,l=d.sourceLabel}let{matched:c,unmatched:f}=Rf(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"),o&&(await bi(o),r||h.info(`Restored to ${o}`)),null):{diffs:c,sourceLabel:l,originalRef:o}}if(i){let u=n||"HEAD";r||h.info(`Comparing ${i}...${u}`),o=await Kg(u,r);let l=await Ia(i,u);return l.length===0?(h.success("No changes between commits"),o&&(await bi(o),r||h.info(`Restored to ${o}`)),null):{diffs:l,sourceLabel:` (${i}...${u})`,originalRef:o}}let a=await Yg(r);return a.diffs.length===0?(h.success("No changes to review"),null):{diffs:a.diffs,sourceLabel:a.sourceLabel,originalRef:null}}function Qx(t){let{result:e,filteredDiffs:s,severityFilter:i,json:n}=t,r=e.context.issues,o=r;i&&i.length>0&&(o=r.filter(u=>i.includes(u.severity)));let a=e.context.results.filter(u=>u.success).length;if(n){let u=Om(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`),i&&i.length>0){let u=i.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(Pm(o))}else if(h.newline(),i&&i.length>0){let u=i.join(", ");h.success(`No ${u} issues found \u{1F389}`)}else h.success("No issues found \u{1F389}");h.newline()}async function Xx(t){let{verbose:e=!1,json:s=!1,stream:i=!1,severity:n,base:r,head:o,branch:a,skipValidation:u=!1,agent:l,excludeAgent:c,rule:f,excludeRule:d,executor:p,confidence:m,files:D,full:g=!1}=t,F=r,y=o;if(a!==void 0&&a!==""){let O=a==="."?await Ba():a;O||(s||(h.error("Could not determine current branch (detached HEAD?)"),h.info("Specify branch explicitly: diffray review --branch feature-auth")),process.exit(1));let J=r||await bf();J||(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)),O===J?s||h.warn(`Branch "${O}" is the base branch, reviewing uncommitted changes instead`):(F=J,y=O,s||h.info(`Reviewing "${O}" against "${J}"`))}s||h.logo();let C=process.cwd(),E=await Fe(C);await _f()||(s||h.error("Not a git repository"),process.exit(1)),s||h.chart("Analyzing changes...");let S=await Zx({full:g,filesFilter:D,base:F,head:y,json:s});if(!S)return;let{diffs:T,sourceLabel:w,originalRef:R}=S;try{let O=T.filter(te=>!E.excludePatterns.some(lt=>Ht(te.file,lt)));if(O.length===0){h.success("No changes (all excluded)");return}let J=O.reduce((te,lt)=>te+lt.additions,0),G=O.reduce((te,lt)=>te+lt.deletions,0),z=J+G,ae=O.reduce((te,lt)=>(te[lt.status]=(te[lt.status]||0)+1,te),{});if(!s){let te=[];if(ae.modified&&te.push(`${ae.modified} modified`),ae.added&&te.push(`${ae.added} added`),ae.deleted&&te.push(`${ae.deleted} deleted`),ae.renamed&&te.push(`${ae.renamed} renamed`),h.file(`${O.length} files${w}: ${te.join(", ")}`),h.plain(` ${z} changes: +${J} -${G}`),e||O.length<=5){h.newline();for(let jn of O){let Qg=Hx(jn.status);h.plain(` ${Qg} ${jn.file}: +${jn.additions} -${jn.deletions}`)}}h.newline(),h.robot("Loading executors and Agents...")}let ye=await Pn(),Be=ye.filter(te=>te.enabled);s||h.success(`Loaded ${Be.length} executor(s)`);let _s=await wt({projectPath:C,executorOverride:p});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 Hg=_s.filter(te=>te.enabled);s||(h.success(`Loaded ${Hg.length} Agent(s)`),h.newline());let Zg=await new Jo(_s,ye).execute(O,{verbose:e,quiet:s,concurrency:E.concurrency,skipValidation:u,stream:i,baseRef:F,headRef:y,agentFilter:l,excludeAgents:c,ruleFilter:f,excludeRules:d,minConfidence:m});Qx({result:Zg,filteredDiffs:O,severityFilter:n,json:s})}finally{R&&(await bi(R),s||h.info(`Restored to ${R}`))}}var eS={meta:{name:"review",description:`Run code review on current changes
358
417
 
359
418
  Examples:
360
419
  diffray review Review uncommitted changes
@@ -366,4 +425,4 @@ Examples:
366
425
  diffray review --base main Compare HEAD to main
367
426
  diffray review --agent general Run only general agent
368
427
  diffray review --severity critical,high
369
- diffray review --stream Show thinking and tool usage`},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., cursor-agent-cli, claude-cli)"},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=$g(t);await Px({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 pe){let i=e.errors[0]?.message||"Invalid argument";t.json?console.error(JSON.stringify({error:i})):p.error(i),process.exit(1)}throw e}}},Rg={meta:{name:"diffray",version:Gn.version,description:"AI-powered code review CLI"},subCommands:{review:Ox,config:Dg,agents:yg,executors:bg,rules:Sg,extends:Bg}};Y();var Ko=process.argv.slice(2),Lx=["-v","--version","-h","--help"],Mx=Ko.length===0||Ko.some(t=>Lx.includes(t));Mx&&(p.logo(),(Ko.includes("-v")||Ko.includes("--version"))&&(p.plain(`v${Gn.version}`),process.exit(0)));cf(Rg);
428
+ diffray review --stream Show thinking and tool usage`},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., cursor-agent-cli, claude-cli)"},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=Gg(t);await Xx({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 pe){let i=e.errors[0]?.message||"Invalid argument";t.json?console.error(JSON.stringify({error:i})):h.error(i),process.exit(1)}throw e}}},Jg={meta:{name:"diffray",version:Jn.version,description:"AI-powered code review CLI"},subCommands:{review:eS,config:wg,agents:xg,executors:_g,rules:Ig,extends:Og,"setup-command":Ac}};Y();var Zo=process.argv.slice(2),tS=["-v","--version","-h","--help"],sS=Zo.length===0||Zo.some(t=>tS.includes(t));sS&&(h.logo(),(Zo.includes("-v")||Zo.includes("--version"))&&(h.plain(`v${Jn.version}`),process.exit(0)));mf(Jg);