@seed-design/codemod 0.0.20 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.cjs +3 -3
- package/bin/transforms/replace-css-seed-design-color-variable/index.js +25 -25
- package/bin/transforms/replace-css-seed-design-typography-variable/index.js +26 -26
- package/bin/transforms/replace-custom-imported-typography-variable/index.js +37 -0
- package/bin/transforms/replace-custom-seed-design-color/index.js +37 -0
- package/bin/transforms/replace-custom-seed-design-text-component/index.js +2 -2
- package/bin/transforms/replace-custom-seed-design-typography/index.js +37 -0
- package/bin/transforms/replace-custom-seed-design-vars/index.js +37 -0
- package/bin/transforms/replace-custom-text-component-color-prop/index.js +2 -2
- package/bin/transforms/replace-react-icon/index.js +1 -1
- package/bin/transforms/replace-seed-design-token-typography-classname/index.js +18 -18
- package/bin/transforms/replace-seed-design-token-vars/index.js +2 -2
- package/bin/transforms/replace-stitches-styled-color/index.js +1 -1
- package/bin/transforms/replace-stitches-styled-typography/index.js +2 -2
- package/bin/transforms/replace-stitches-theme-color/index.js +1 -1
- package/bin/transforms/replace-tailwind-color/index.js +1 -1
- package/bin/transforms/replace-tailwind-typography/index.js +1 -1
- package/package.json +16 -17
package/bin/index.cjs
CHANGED
@@ -3,7 +3,7 @@ var bS=Object.create;var Vc=Object.defineProperty;var wS=Object.getOwnPropertyDe
|
|
3
3
|
`).join(`
|
4
4
|
`+o),e.push(s+"m+"+so.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=fA()+t+" "+e[0]}function fA(){return Q.inspectOpts.hideDate?"":new Date().toISOString()+" "}function dA(...e){return process.stderr.write(no.formatWithOptions(Q.inspectOpts,...e)+`
|
5
5
|
`)}function pA(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function mA(){return process.env.DEBUG}function hA(e){e.inspectOpts={};let t=Object.keys(Q.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=Q.inspectOpts[t[r]]}so.exports=za()(Q);var{formatters:ry}=so.exports;ry.o=function(e){return this.inspectOpts.colors=this.useColors,no.inspect(e,this.inspectOpts).split(`
|
6
|
-
`).map(t=>t.trim()).join(" ")};ry.O=function(e){return this.inspectOpts.colors=this.useColors,no.inspect(e,this.inspectOpts)}});var Ha=w((d9,Za)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Za.exports=Xg():Za.exports=ny()});var sy=w(be=>{"use strict";var gA=be&&be.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(be,"__esModule",{value:!0});var yA=require("fs"),bA=gA(Ha()),Er=bA.default("@kwsites/file-exists");function wA(e,t,r){Er("checking %s",e);try{let n=yA.statSync(e);return n.isFile()&&t?(Er("[OK] path represents a file"),!0):n.isDirectory()&&r?(Er("[OK] path represents a directory"),!0):(Er("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Er("[FAIL] path is not accessible: %o",n),!1;throw Er("[FATAL] %o",n),n}}function SA(e,t=be.READABLE){return wA(e,(t&be.FILE)>0,(t&be.FOLDER)>0)}be.exists=SA;be.FILE=1;be.FOLDER=2;be.READABLE=be.FILE+be.FOLDER});var oy=w(oo=>{"use strict";function xA(e){for(var t in e)oo.hasOwnProperty(t)||(oo[t]=e[t])}Object.defineProperty(oo,"__esModule",{value:!0});xA(sy())});var Xa=w(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.createDeferred=qt.deferred=void 0;function Ya(){let e,t,r="pending";return{promise:new Promise((s,o)=>{e=s,t=o}),done(s){r==="pending"&&(r="resolved",e(s))},fail(s){r==="pending"&&(r="rejected",t(s))},get fulfilled(){return r!=="pending"},get status(){return r}}}qt.deferred=Ya;qt.createDeferred=Ya;qt.default=Ya});var zw=w((H9,Bc)=>{var ko=process||{},qw=ko.argv||[],Ro=ko.env||{},$$=!(Ro.NO_COLOR||qw.includes("--no-color"))&&(!!Ro.FORCE_COLOR||qw.includes("--color")||ko.platform==="win32"||(ko.stdout||{}).isTTY&&Ro.TERM!=="dumb"||!!Ro.CI),D$=(e,t,r=e)=>n=>{let s=""+n,o=s.indexOf(t,e.length);return~o?e+L$(s,t,r,o)+t:e+s+t},L$=(e,t,r,n)=>{let s="",o=0;do s+=e.substring(o,n)+r,o=n+t.length,n=e.indexOf(t,o);while(~n);return s+e.substring(o)},Vw=(e=$$)=>{let t=e?D$:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Bc.exports=Vw();Bc.exports.createColors=Vw});var Hw=w((X9,N$)=>{N$.exports={name:"@seed-design/codemod",version:"0.0.
|
6
|
+
`).map(t=>t.trim()).join(" ")};ry.O=function(e){return this.inspectOpts.colors=this.useColors,no.inspect(e,this.inspectOpts)}});var Ha=w((d9,Za)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Za.exports=Xg():Za.exports=ny()});var sy=w(be=>{"use strict";var gA=be&&be.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(be,"__esModule",{value:!0});var yA=require("fs"),bA=gA(Ha()),Er=bA.default("@kwsites/file-exists");function wA(e,t,r){Er("checking %s",e);try{let n=yA.statSync(e);return n.isFile()&&t?(Er("[OK] path represents a file"),!0):n.isDirectory()&&r?(Er("[OK] path represents a directory"),!0):(Er("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Er("[FAIL] path is not accessible: %o",n),!1;throw Er("[FATAL] %o",n),n}}function SA(e,t=be.READABLE){return wA(e,(t&be.FILE)>0,(t&be.FOLDER)>0)}be.exists=SA;be.FILE=1;be.FOLDER=2;be.READABLE=be.FILE+be.FOLDER});var oy=w(oo=>{"use strict";function xA(e){for(var t in e)oo.hasOwnProperty(t)||(oo[t]=e[t])}Object.defineProperty(oo,"__esModule",{value:!0});xA(sy())});var Xa=w(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.createDeferred=qt.deferred=void 0;function Ya(){let e,t,r="pending";return{promise:new Promise((s,o)=>{e=s,t=o}),done(s){r==="pending"&&(r="resolved",e(s))},fail(s){r==="pending"&&(r="rejected",t(s))},get fulfilled(){return r!=="pending"},get status(){return r}}}qt.deferred=Ya;qt.createDeferred=Ya;qt.default=Ya});var zw=w((H9,Bc)=>{var ko=process||{},qw=ko.argv||[],Ro=ko.env||{},$$=!(Ro.NO_COLOR||qw.includes("--no-color"))&&(!!Ro.FORCE_COLOR||qw.includes("--color")||ko.platform==="win32"||(ko.stdout||{}).isTTY&&Ro.TERM!=="dumb"||!!Ro.CI),D$=(e,t,r=e)=>n=>{let s=""+n,o=s.indexOf(t,e.length);return~o?e+L$(s,t,r,o)+t:e+s+t},L$=(e,t,r,n)=>{let s="",o=0;do s+=e.substring(o,n)+r,o=n+t.length,n=e.indexOf(t,o);while(~n);return s+e.substring(o)},Vw=(e=$$)=>{let t=e?D$:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Bc.exports=Vw();Bc.exports.createColors=Vw});var Hw=w((X9,N$)=>{N$.exports={name:"@seed-design/codemod",version:"0.0.22",repository:{type:"git",url:"git+https://github.com/daangn/seed-design.git",directory:"packages/codemod"},license:"MIT",bin:"./bin/index.cjs",files:["bin"],scripts:{dev:"bun ./dev.mjs",build:"bun ./build.mjs",test:"LOG=true bun vitest","lint:publish":"bun publint"},dependencies:{"@seed-design/migration-index":"^0.0.20",cac:"^6.7.14","change-case":"^5.4.4","es-toolkit":"^1.35.0",execa:"^9.5.2",glob:"^11.0.2",jscodeshift:"^17.3.0",picocolors:"^1.1.1",postcss:"^8.5.3",semver:"^7.7.1","simple-git":"^3.27.0",winston:"^3.17.0",zod:"^3.24.3"},devDependencies:{"@types/jscodeshift":"^17.3.0","@types/node":"^22.14.1","csv-parse":"^5.6.0",dotenv:"^16.5.0",esbuild:"^0.25.3",typescript:"^5.8.3"},optionalDependencies:{"@karrotmarket/react-monochrome-icon":"^0.0.22","@karrotmarket/react-multicolor-icon":"^0.0.16"},publishConfig:{access:"public"},engines:{node:">=20.16.0"}}});var Zc=require("events");function Do(e){return e==null?[]:Array.isArray(e)?e:[e]}function ES(e,t,r,n){var s,o=e[t],i=~n.string.indexOf(t)?r==null||r===!0?"":String(r):typeof r=="boolean"?r:~n.boolean.indexOf(t)?r==="false"?!1:r==="true"||(e._.push((s=+r,s*0===0?s:r)),!!r):(s=+r,s*0===0?s:r);e[t]=o==null?i:Array.isArray(o)?o.concat(i):[o,i]}function TS(e,t){e=e||[],t=t||{};var r,n,s,o,i,a={_:[]},c=0,u=0,l=0,f=e.length;let d=t.alias!==void 0,p=t.unknown!==void 0,b=t.default!==void 0;if(t.alias=t.alias||{},t.string=Do(t.string),t.boolean=Do(t.boolean),d)for(r in t.alias)for(n=t.alias[r]=Do(t.alias[r]),c=0;c<n.length;c++)(t.alias[n[c]]=n.concat(r)).splice(c,1);for(c=t.boolean.length;c-- >0;)for(n=t.alias[t.boolean[c]]||[],u=n.length;u-- >0;)t.boolean.push(n[u]);for(c=t.string.length;c-- >0;)for(n=t.alias[t.string[c]]||[],u=n.length;u-- >0;)t.string.push(n[u]);if(b){for(r in t.default)if(o=typeof t.default[r],n=t.alias[r]=t.alias[r]||[],t[o]!==void 0)for(t[o].push(r),c=0;c<n.length;c++)t[o].push(n[c])}let T=p?Object.keys(t.alias):[];for(c=0;c<f;c++){if(s=e[c],s==="--"){a._=a._.concat(e.slice(++c));break}for(u=0;u<s.length&&s.charCodeAt(u)===45;u++);if(u===0)a._.push(s);else if(s.substring(u,u+3)==="no-"){if(o=s.substring(u+3),p&&!~T.indexOf(o))return t.unknown(s);a[o]=!1}else{for(l=u+1;l<s.length&&s.charCodeAt(l)!==61;l++);for(o=s.substring(u,l),i=s.substring(++l)||c+1===f||(""+e[c+1]).charCodeAt(0)===45||e[++c],n=u===2?[o]:o,l=0;l<n.length;l++){if(o=n[l],p&&!~T.indexOf(o))return t.unknown("-".repeat(u)+o);ES(a,o,l+1<n.length||i,t)}}}if(b)for(r in t.default)a[r]===void 0&&(a[r]=t.default[r]);if(d)for(r in a)for(n=t.alias[r]||[];n.length>0;)a[n.shift()]=a[r];return a}var Hc=e=>e.replace(/[<[].+/,"").trim(),OS=e=>{let t=/<([^>]+)>/g,r=/\[([^\]]+)\]/g,n=[],s=a=>{let c=!1,u=a[1];return u.startsWith("...")&&(u=u.slice(3),c=!0),{required:a[0].startsWith("<"),value:u,variadic:c}},o;for(;o=t.exec(e);)n.push(s(o));let i;for(;i=r.exec(e);)n.push(s(i));return n},RS=e=>{let t={alias:{},boolean:[]};for(let[r,n]of e.entries())n.names.length>1&&(t.alias[n.names[0]]=n.names.slice(1)),n.isBoolean&&(n.negated&&e.some((o,i)=>i!==r&&o.names.some(a=>n.names.includes(a))&&typeof o.required=="boolean")||t.boolean.push(n.names[0]));return t},zc=e=>e.sort((t,r)=>t.length>r.length?-1:1)[0],Wc=(e,t)=>e.length>=t?e:`${e}${" ".repeat(t-e.length)}`,kS=e=>e.replace(/([a-z])-([a-z])/g,(t,r,n)=>r+n.toUpperCase()),CS=(e,t,r)=>{let n=0,s=t.length,o=e,i;for(;n<s;++n)i=o[t[n]],o=o[t[n]]=n===s-1?r:i??(~t[n+1].indexOf(".")||!(+t[n+1]>-1)?{}:[])},AS=(e,t)=>{for(let r of Object.keys(t)){let n=t[r];n.shouldTransform&&(e[r]=Array.prototype.concat.call([],e[r]),typeof n.transformFunction=="function"&&(e[r]=e[r].map(n.transformFunction)))}},IS=e=>{let t=/([^\\\/]+)$/.exec(e);return t?t[1]:""},Yc=e=>e.split(".").map((t,r)=>r===0?kS(t):t).join("."),Cr=class extends Error{constructor(t){super(t),this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack}},Lo=class{constructor(t,r,n){this.rawName=t,this.description=r,this.config=Object.assign({},n),t=t.replace(/\.\*/g,""),this.negated=!1,this.names=Hc(t).split(",").map(s=>{let o=s.trim().replace(/^-{1,2}/,"");return o.startsWith("no-")&&(this.negated=!0,o=o.replace(/^no-/,"")),Yc(o)}).sort((s,o)=>s.length>o.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null&&(this.config.default=!0),t.includes("<")?this.required=!0:t.includes("[")?this.required=!1:this.isBoolean=!0}},$S=process.argv,DS=`${process.platform}-${process.arch} node-${process.version}`,xn=class{constructor(t,r,n={},s){this.rawName=t,this.description=r,this.config=n,this.cli=s,this.options=[],this.aliasNames=[],this.name=Hc(t),this.args=OS(t),this.examples=[]}usage(t){return this.usageText=t,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(t,r="-v, --version"){return this.versionNumber=t,this.option(r,"Display version number"),this}example(t){return this.examples.push(t),this}option(t,r,n){let s=new Lo(t,r,n);return this.options.push(s),this}alias(t){return this.aliasNames.push(t),this}action(t){return this.commandAction=t,this}isMatched(t){return this.name===t||this.aliasNames.includes(t)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof vn}hasOption(t){return t=t.split(".")[0],this.options.find(r=>r.names.includes(t))}outputHelp(){let{name:t,commands:r}=this.cli,{versionNumber:n,options:s,helpCallback:o}=this.cli.globalCommand,i=[{body:`${t}${n?`/${n}`:""}`}];if(i.push({title:"Usage",body:` $ ${t} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&r.length>0){let u=zc(r.map(l=>l.rawName));i.push({title:"Commands",body:r.map(l=>` ${Wc(l.rawName,u.length)} ${l.description}`).join(`
|
7
7
|
`)}),i.push({title:"For more info, run any command with the `--help` flag",body:r.map(l=>` $ ${t}${l.name===""?"":` ${l.name}`} --help`).join(`
|
8
8
|
`)})}let c=this.isGlobalCommand?s:[...this.options,...s||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand&&(c=c.filter(u=>u.name!=="version")),c.length>0){let u=zc(c.map(l=>l.rawName));i.push({title:"Options",body:c.map(l=>` ${Wc(l.rawName,u.length)} ${l.description} ${l.config.default===void 0?"":`(default: ${l.config.default})`}`).join(`
|
9
9
|
`)})}this.examples.length>0&&i.push({title:"Examples",body:this.examples.map(u=>typeof u=="function"?u(t):u).join(`
|
@@ -52,11 +52,11 @@ For example, you can use the \`pathToFileURL()\` method of the \`url\` core modu
|
|
52
52
|
`,LF:`
|
53
53
|
`,concatBytes:Di},PE=(e,t)=>{let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r},ME={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:PE};var rp=require("node:buffer");var np=(e,t)=>e?void 0:FE.bind(void 0,t),FE=function*(e,t){if(typeof t!="string"&&!K(t)&&!rp.Buffer.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},sp=(e,t)=>e?jE.bind(void 0,t):BE.bind(void 0,t),jE=function*(e,t){op(e,t),yield t},BE=function*(e,t){if(op(e,t),typeof t!="string"&&!K(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},op=(e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
|
54
54
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
55
|
-
if (condition) { yield value; }`)};var ip=require("node:buffer"),ap=require("node:string_decoder");var ws=(e,t,r)=>{if(r)return;if(e)return{transform:UE.bind(void 0,new TextEncoder)};let n=new ap.StringDecoder(t);return{transform:GE.bind(void 0,n),final:qE.bind(void 0,n)}},UE=function*(e,t){ip.Buffer.isBuffer(t)?yield Xe(t):typeof t=="string"?yield e.encode(t):yield t},GE=function*(e,t){yield K(t)?e.write(t):t},qE=function*(e){let t=e.end();t!==""&&(yield t)};var Ni=require("node:util"),Pi=(0,Ni.callbackify)(async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(let s of t.currentIterable)n.push(s)}finally{delete t.currentIterable}}),Ss=async function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=zE}=t[r];for await(let s of n(e))yield*Ss(s,t,r+1)},cp=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*VE(r,Number(t),e)},VE=async function*(e,t,r){if(e!==void 0)for await(let n of e())yield*Ss(n,r,t+1)},up=(0,Ni.callbackify)(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),zE=function*(e){yield e};var Mi=(e,t,r,n)=>{try{for(let s of e(...t))r.push(s);n()}catch(s){n(s)}},lp=(e,t)=>[...t.flatMap(r=>[...vt(r,e,0)]),...Br(e)],vt=function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=ZE}=t[r];for(let s of n(e))yield*vt(s,t,r+1)},Br=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*WE(r,Number(t),e)},WE=function*(e,t,r){if(e!==void 0)for(let n of e())yield*vt(n,r,t+1)},ZE=function*(e){yield e};var Fi=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:s},optionName:o},{encoding:i})=>{let a={},c=fp(e,i,o),u=xt(t),l=xt(r),f=u?Pi.bind(void 0,Ss,a):Mi.bind(void 0,vt),d=u||l?Pi.bind(void 0,cp,a):Mi.bind(void 0,Br),p=u||l?up.bind(void 0,a):void 0;return{stream:new Ur.Transform({writableObjectMode:n,writableHighWaterMark:(0,Ur.getDefaultHighWaterMark)(n),readableObjectMode:s,readableHighWaterMark:(0,Ur.getDefaultHighWaterMark)(s),transform(T,N,P){f([T,c,0],this,P)},flush(T){d([c],this,T)},destroy:p})}},xs=(e,t,r,n)=>{let s=t.filter(({type:i})=>i==="generator"),o=n?s.reverse():s;for(let{value:i,optionName:a}of o){let c=fp(i,r,a);e=lp(c,e)}return e},fp=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:s,preserveNewlines:o},i,a)=>{let c={};return[{transform:np(n,a)},ws(r,i,n),bs(r,o,n,c),{transform:e,final:t},{transform:sp(s,a)},tp({binary:r,preserveNewlines:o,readableObjectMode:s,state:c})].filter(Boolean)};var dp=(e,t)=>{for(let r of HE(e))YE(e,r,t)},HE=e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),YE=(e,t,r)=>{let{stdioItems:n}=e[t],s=n.filter(({contents:a})=>a!==void 0);if(s.length===0)return;if(t!==0){let[{type:a,optionName:c}]=s;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${lt[a]} with synchronous methods.`)}let i=s.map(({contents:a})=>a).map(a=>XE(a,n));r.input=Ar(i)},XE=(e,t)=>{let r=xs(e,t,"utf8",!0);return KE(r),Ar(r)},KE=e=>{let t=e.find(r=>typeof r!="string"&&!K(r));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)};var _s=require("node:fs");var vs=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>n!=="all"&&Yt(r,n)&&!me.has(t)&&JE(n)&&(e.some(({type:s,value:o})=>s==="native"&&QE.has(o))||e.every(({type:s})=>_e.has(s))),JE=e=>e===1||e===2,QE=new Set(["pipe","overlapped"]),pp=async(e,t,r,n)=>{for await(let s of e)e0(t)||hp(s,r,n)},mp=(e,t,r)=>{for(let n of e)hp(n,t,r)},e0=e=>e._readableState.pipes.length>0,hp=(e,t,r)=>{let n=Ln(e);je({type:"output",verboseMessage:n,fdNumber:t,verboseInfo:r})};var gp=({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:s})=>{if(t===null)return{output:Array.from({length:3})};let o={},i=new Set([]);return{output:t.map((c,u)=>t0({result:c,fileDescriptors:e,fdNumber:u,state:o,outputFiles:i,isMaxBuffer:n,verboseInfo:s},r)),...o}},t0=({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:s,isMaxBuffer:o,verboseInfo:i},{buffer:a,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:f})=>{if(e===null)return;let d=md(e,o,f),p=Xe(d),{stdioItems:b,objectMode:T}=t[r],N=r0([p],b,c,n),{serializedResult:P,finalResult:j=P}=n0({chunks:N,objectMode:T,encoding:c,lines:u,stripFinalNewline:l,fdNumber:r});s0({serializedResult:P,fdNumber:r,state:n,verboseInfo:i,encoding:c,stdioItems:b,objectMode:T});let Y=a[r]?j:void 0;try{return n.error===void 0&&o0(P,b,s),Y}catch(X){return n.error=X,Y}},r0=(e,t,r,n)=>{try{return xs(e,t,r,!1)}catch(s){return n.error=s,e}},n0=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:s,fdNumber:o})=>{if(t)return{serializedResult:e};if(r==="buffer")return{serializedResult:Ar(e)};let i=ru(e,r);return n[o]?{serializedResult:i,finalResult:Li(i,!s[o],t)}:{serializedResult:i}},s0=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:s,stdioItems:o,objectMode:i})=>{if(!vs({stdioItems:o,encoding:s,verboseInfo:n,fdNumber:t}))return;let a=Li(e,!1,i);try{mp(a,t,n)}catch(c){r.error??=c}},o0=(e,t,r)=>{for(let{path:n,append:s}of t.filter(({type:o})=>hs.has(o))){let o=typeof n=="string"?n:n.toString();s||r.has(o)?(0,_s.appendFileSync)(n,e):(r.add(o),(0,_s.writeFileSync)(n,e))}};var yp=([,e,t],r)=>{if(r.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Qe(t,r,"all")]:Array.isArray(t)?[Qe(e,r,"all"),...t]:K(e)&&K(t)?Fo([e,t]):`${e}${t}`};var Es=require("node:events");var bp=async(e,t)=>{let[r,n]=await i0(e);return t.isForcefullyTerminated??=!1,[r,n]},i0=async e=>{let[t,r]=await Promise.allSettled([(0,Es.once)(e,"spawn"),(0,Es.once)(e,"exit")]);return t.status==="rejected"?[]:r.status==="rejected"?wp(e):r.value},wp=async e=>{try{return await(0,Es.once)(e,"exit")}catch{return wp(e)}},Sp=async e=>{let[t,r]=await e;if(!a0(t,r)&&ji(t,r))throw new Le;return[t,r]},a0=(e,t)=>e===void 0&&t===void 0,ji=(e,t)=>e!==0||t!==null;var xp=({error:e,status:t,signal:r,output:n},{maxBuffer:s})=>{let o=c0(e,t,r),i=(o==null?void 0:o.code)==="ETIMEDOUT",a=pd(o,n,s);return{resultError:o,exitCode:t,signal:r,timedOut:i,isMaxBuffer:a}},c0=(e,t,r)=>e!==void 0?e:ji(t,r)?new Le:void 0;var _p=(e,t,r)=>{let{file:n,commandArguments:s,command:o,escapedCommand:i,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=u0(e,t,r),f=d0({file:n,commandArguments:s,options:u,command:o,escapedCommand:i,verboseInfo:c,fileDescriptors:l,startTime:a});return or(f,c,u)},u0=(e,t,r)=>{let{command:n,escapedCommand:s,startTime:o,verboseInfo:i}=Pn(e,t,r),a=l0(r),{file:c,commandArguments:u,options:l}=ns(e,t,a);f0(l);let f=Kd(l,i);return{file:c,commandArguments:u,command:n,escapedCommand:s,startTime:o,verboseInfo:i,options:l,fileDescriptors:f}},l0=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,f0=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&Ts("ipcInput"),e&&Ts("ipc: true"),r&&Ts("detached: true"),n&&Ts("cancelSignal")},Ts=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},d0=({file:e,commandArguments:t,options:r,command:n,escapedCommand:s,verboseInfo:o,fileDescriptors:i,startTime:a})=>{let c=p0({file:e,commandArguments:t,options:r,command:n,escapedCommand:s,fileDescriptors:i,startTime:a});if(c.failed)return c;let{resultError:u,exitCode:l,signal:f,timedOut:d,isMaxBuffer:p}=xp(c,r),{output:b,error:T=u}=gp({fileDescriptors:i,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),N=b.map((j,Y)=>Qe(j,r,Y)),P=Qe(yp(b,r),r,"all");return h0({error:T,exitCode:l,signal:f,timedOut:d,isMaxBuffer:p,stdio:N,all:P,options:r,command:n,escapedCommand:s,startTime:a})},p0=({file:e,commandArguments:t,options:r,command:n,escapedCommand:s,fileDescriptors:o,startTime:i})=>{try{dp(o,r);let a=m0(r);return(0,vp.spawnSync)(e,t,a)}catch(a){return sr({error:a,command:n,escapedCommand:s,fileDescriptors:o,options:r,startTime:i,isSync:!0})}},m0=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:fs(t)}),h0=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:s,stdio:o,all:i,options:a,command:c,escapedCommand:u,startTime:l})=>e===void 0?ds({command:c,escapedCommand:u,stdio:o,all:i,ipcOutput:[],options:a,startTime:l}):jr({error:e,command:c,escapedCommand:u,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:s,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:o,all:i,ipcOutput:[],options:a,startTime:l,isSync:!0});var Im=require("node:events"),$m=require("node:child_process");var Ui=q(require("node:process"),1);var ar=require("node:events");var Ep=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:s=!0,filter:o}={})=>(Qt({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Xn(e)}),g0({anyProcess:e,channel:t,isSubprocess:r,filter:o,reference:s})),g0=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:s})=>{Wn(t,s);let o=ut(e,t,r),i=new AbortController;try{return await Promise.race([y0(o,n,i),b0(o,r,i),w0(o,r,i)])}catch(a){throw er(e),a}finally{i.abort(),Zn(t,s)}},y0=async(e,t,{signal:r})=>{if(t===void 0){let[n]=await(0,ar.once)(e,"message",{signal:r});return n}for await(let[n]of(0,ar.on)(e,"message",{signal:r}))if(t(n))return n},b0=async(e,t,{signal:r})=>{await(0,ar.once)(e,"disconnect",{signal:r}),Wl(t)},w0=async(e,t,{signal:r})=>{let[n]=await(0,ar.once)(e,"strict:error",{signal:r});throw qn(n,t)};var Gr=require("node:events");var Op=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:s=!0}={})=>Bi({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:s}),Bi=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:s,reference:o})=>{Qt({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Xn(e)}),Wn(t,o);let i=ut(e,t,r),a=new AbortController,c={};return S0(e,i,a),x0({ipcEmitter:i,isSubprocess:r,controller:a,state:c}),v0({anyProcess:e,channel:t,ipcEmitter:i,isSubprocess:r,shouldAwait:s,controller:a,state:c,reference:o})},S0=async(e,t,r)=>{try{await(0,Gr.once)(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},x0=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{let[s]=await(0,Gr.once)(e,"strict:error",{signal:r.signal});n.error=qn(s,t),r.abort()}catch{}},v0=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:s,controller:o,state:i,reference:a}){try{for await(let[c]of(0,Gr.on)(r,"message",{signal:o.signal}))Tp(i),yield c}catch{Tp(i)}finally{o.abort(),Zn(t,a),n||er(e),s&&await e}},Tp=({error:e})=>{if(e)throw e};var Rp=(e,{ipc:t})=>{Object.assign(e,Cp(e,!1,t))},kp=()=>{let e=Ui.default,t=!0,r=Ui.default.channel!==void 0;return{...Cp(e,t,r),getCancelSignal:Rf.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}},Cp=(e,t,r)=>({sendMessage:es.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:Ep.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:Op.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})});var Ap=require("node:child_process"),ft=require("node:stream");var Ip=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:s,startTime:o,verboseInfo:i})=>{Ai(n);let a=new Ap.ChildProcess;_0(a,n),Object.assign(a,{readable:E0,writable:T0,duplex:O0});let c=sr({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:s,startTime:o,isSync:!1}),u=R0(c,i,s);return{subprocess:a,promise:u}},_0=(e,t)=>{let r=qr(),n=qr(),s=qr(),o=Array.from({length:t.length-3},qr),i=qr(),a=[r,n,s,...o];Object.assign(e,{stdin:r,stdout:n,stderr:s,all:i,stdio:a})},qr=()=>{let e=new ft.PassThrough;return e.end(),e},E0=()=>new ft.Readable({read(){}}),T0=()=>new ft.Writable({write(){}}),O0=()=>new ft.Duplex({read(){},write(){}}),R0=async(e,t,r)=>or(e,t,r);var cr=require("node:fs"),Dp=require("node:buffer"),Ve=require("node:stream");var Lp=(e,t)=>ys(k0,e,t,!1),Vr=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${lt[e]}.`)},$p={fileNumber:Vr,generator:Fi,asyncGenerator:Fi,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){let n=t||r;return{stream:Ve.Duplex.fromWeb(e,{objectMode:n})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},k0={input:{...$p,fileUrl:({value:e})=>({stream:(0,cr.createReadStream)(e)}),filePath:({value:{file:e}})=>({stream:(0,cr.createReadStream)(e)}),webStream:({value:e})=>({stream:Ve.Readable.fromWeb(e)}),iterable:({value:e})=>({stream:Ve.Readable.from(e)}),asyncIterable:({value:e})=>({stream:Ve.Readable.from(e)}),string:({value:e})=>({stream:Ve.Readable.from(e)}),uint8Array:({value:e})=>({stream:Ve.Readable.from(Dp.Buffer.from(e))})},output:{...$p,fileUrl:({value:e})=>({stream:(0,cr.createWriteStream)(e)}),filePath:({value:{file:e,append:t}})=>({stream:(0,cr.createWriteStream)(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:Ve.Writable.fromWeb(e)}),iterable:Vr,asyncIterable:Vr,string:Vr,uint8Array:Vr}};var zr=require("node:events"),Rs=require("node:stream"),Vi=require("node:stream/promises");function _t(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let s of e)qi(s);let t=e.some(({readableObjectMode:s})=>s),r=C0(e,t),n=new Gi({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let s of e)n.add(s);return n}var C0=(e,t)=>{if(e.length===0)return(0,Rs.getDefaultHighWaterMark)(t);let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Gi=class extends Rs.PassThrough{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#s=new WeakMap;add(t){if(qi(t),this.#t.has(t))return;this.#t.add(t),this.#n??=A0(this,this.#t,this.#o);let r=D0({passThroughStream:this,stream:t,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#s.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(qi(t),!this.#t.has(t))return!1;let r=this.#s.get(t);return r===void 0?!1:(this.#s.delete(t),t.unpipe(this),await r,!0)}},A0=async(e,t,r)=>{Os(e,Np);let n=new AbortController;try{await Promise.race([I0(e,n),$0(e,t,r,n)])}finally{n.abort(),Os(e,-Np)}},I0=async(e,{signal:t})=>{try{await(0,Vi.finished)(e,{signal:t,cleanup:!0})}catch(r){throw Mp(e,r),r}},$0=async(e,t,r,{signal:n})=>{for await(let[s]of(0,zr.on)(e,"unpipe",{signal:n}))t.has(s)&&s.emit(r)},qi=e=>{if(typeof(e==null?void 0:e.pipe)!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},D0=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:s,onFinished:o,unpipeEvent:i})=>{Os(e,Pp);let a=new AbortController;try{await Promise.race([L0(o,t,a),N0({passThroughStream:e,stream:t,streams:r,ended:n,aborted:s,controller:a}),P0({stream:t,streams:r,ended:n,aborted:s,unpipeEvent:i,controller:a})])}finally{a.abort(),Os(e,-Pp)}r.size>0&&r.size===n.size+s.size&&(n.size===0&&s.size>0?zi(e):M0(e))},L0=async(e,t,{signal:r})=>{try{await e,r.aborted||zi(t)}catch(n){r.aborted||Mp(t,n)}},N0=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:s,controller:{signal:o}})=>{try{await(0,Vi.finished)(t,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(i){if(o.aborted||!r.has(t))return;Fp(i)?s.add(t):jp(e,i)}},P0=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:s,controller:{signal:o}})=>{if(await(0,zr.once)(e,s,{signal:o}),!e.readable)return(0,zr.once)(o,"abort",{signal:o});t.delete(e),r.delete(e),n.delete(e)},M0=e=>{e.writable&&e.end()},Mp=(e,t)=>{Fp(t)?zi(e):jp(e,t)},Fp=e=>(e==null?void 0:e.code)==="ERR_STREAM_PREMATURE_CLOSE",zi=e=>{(e.readable||e.writable)&&e.destroy()},jp=(e,t)=>{e.destroyed||(e.once("error",F0),e.destroy(t))},F0=()=>{},Os=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},Np=2,Pp=1;var Wi=require("node:stream/promises");var ur=(e,t)=>{e.pipe(t),j0(e,t),B0(e,t)},j0=async(e,t)=>{if(!(De(e)||De(t))){try{await(0,Wi.finished)(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Zi(t)}},Zi=e=>{e.writable&&e.end()},B0=async(e,t)=>{if(!(De(e)||De(t))){try{await(0,Wi.finished)(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Hi(e)}},Hi=e=>{e.readable&&e.destroy()};var Bp=(e,t,r)=>{let n=new Map;for(let[s,{stdioItems:o,direction:i}]of Object.entries(t)){for(let{stream:a}of o.filter(({type:c})=>_e.has(c)))U0(e,a,i,s);for(let{stream:a}of o.filter(({type:c})=>!_e.has(c)))q0({subprocess:e,stream:a,direction:i,fdNumber:s,pipeGroups:n,controller:r})}for(let[s,o]of n.entries()){let i=o.length===1?o[0]:_t(o);ur(i,s)}},U0=(e,t,r,n)=>{r==="output"?ur(e.stdio[n],t):ur(t,e.stdio[n]);let s=G0[n];s!==void 0&&(e[s]=t),e.stdio[n]=t},G0=["stdin","stdout","stderr"],q0=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:s,controller:o})=>{if(t===void 0)return;V0(t,o);let[i,a]=r==="output"?[t,e.stdio[n]]:[e.stdio[n],t],c=s.get(i)??[];s.set(i,[...c,a])},V0=(e,{signal:t})=>{De(e)&&wt(e,z0,t)},z0=2;var Gp=require("node:events");var Et=[];Et.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Et.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Et.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var ks=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Yi=Symbol.for("signal-exit emitter"),Xi=globalThis,W0=Object.defineProperty.bind(Object),Ki=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Xi[Yi])return Xi[Yi];W0(Xi,Yi,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],s=n.indexOf(r);s!==-1&&(s===0&&n.length===1?n.length=0:n.splice(s,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let s=!1;for(let o of this.listeners[t])s=o(r,n)===!0||s;return t==="exit"&&(s=this.emit("afterExit",r,n)||s),s}},Cs=class{},Z0=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Ji=class extends Cs{onExit(){return()=>{}}load(){}unload(){}},Qi=class extends Cs{#t=ea.platform==="win32"?"SIGINT":"SIGHUP";#r=new Ki;#e;#n;#o;#s={};#i=!1;constructor(t){super(),this.#e=t,this.#s={};for(let r of Et)this.#s[r]=()=>{let n=this.#e.listeners(r),{count:s}=this.#r,o=t;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(s+=o.__signal_exit_emitter__.count),n.length===s){this.unload();let i=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;i||t.kill(t.pid,a)}};this.#o=t.reallyExit,this.#n=t.emit}onExit(t,r){if(!ks(this.#e))return()=>{};this.#i===!1&&this.load();let n=r!=null&&r.alwaysLast?"afterExit":"exit";return this.#r.on(n,t),()=>{this.#r.removeListener(n,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#r.count+=1;for(let t of Et)try{let r=this.#s[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#c(t,...r),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#i&&(this.#i=!1,Et.forEach(t=>{let r=this.#s[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(t){return ks(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(t,...r){let n=this.#n;if(t==="exit"&&ks(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let s=n.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),s}else return n.call(this.#e,t,...r)}},ea=globalThis.process,{onExit:Up,load:Dj,unload:Lj}=Z0(ks(ea)?new Qi(ea):new Ji);var qp=(e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;let s=Up(()=>{e.kill()});(0,Gp.addAbortListener)(n,()=>{s()})};var zp=({source:e,sourcePromise:t,boundOptions:r,createNested:n},...s)=>{let o=Nn(),{destination:i,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=H0(r,n,s),{sourceStream:f,sourceError:d}=X0(e,u),{options:p,fileDescriptors:b}=Ue.get(e);return{sourcePromise:t,sourceStream:f,sourceOptions:p,sourceError:d,destination:i,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:b,startTime:o}},H0=(e,t,r)=>{try{let{destination:n,pipeOptions:{from:s,to:o,unpipeSignal:i}={}}=Y0(e,t,...r),a=zn(n,o);return{destination:n,destinationStream:a,from:s,unpipeSignal:i}}catch(n){return{destinationError:n}}},Y0=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(Vp,e)(r,...n),pipeOptions:e};if(typeof r=="string"||r instanceof URL||Po(r)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[s,o,i]=_n(r,...n);return{destination:t(Vp)(s,o,i),pipeOptions:i}}if(Ue.has(r)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Vp=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),X0=(e,t)=>{try{return{sourceStream:tr(e,t)}}catch(r){return{sourceError:r}}};var Zp=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:s,sourceOptions:o,startTime:i})=>{let a=K0({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(a!==void 0)throw ta({error:a,fileDescriptors:s,sourceOptions:o,startTime:i})},K0=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>{if(t!==void 0&&n!==void 0)return n;if(n!==void 0)return Hi(e),n;if(t!==void 0)return Zi(r),t},ta=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>sr({error:e,command:Wp,escapedCommand:Wp,fileDescriptors:t,options:r,startTime:n,isSync:!1}),Wp="source.pipe(destination)";var Hp=async e=>{let[{status:t,reason:r,value:n=r},{status:s,reason:o,value:i=o}]=await e;if(i.pipedFrom.includes(n)||i.pipedFrom.push(n),s==="rejected")throw i;if(t==="rejected")throw n;return i};var Yp=require("node:stream/promises");var Xp=(e,t,r)=>{let n=As.has(t)?Q0(e,t):J0(e,t);return wt(e,tT,r.signal),wt(t,rT,r.signal),eT(t),n},J0=(e,t)=>{let r=_t([e]);return ur(r,t),As.set(t,r),r},Q0=(e,t)=>{let r=As.get(t);return r.add(e),r},eT=async e=>{try{await(0,Yp.finished)(e,{cleanup:!0,readable:!1,writable:!0})}catch{}As.delete(e)},As=new WeakMap,tT=2,rT=1;var Kp=require("node:util");var Jp=(e,t)=>e===void 0?[]:[nT(e,t)],nT=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:s,startTime:o})=>{await(0,Kp.aborted)(e,t),await r.remove(t);let i=new Error("Pipe canceled by `unpipeSignal` option.");throw ta({error:i,fileDescriptors:n,sourceOptions:s,startTime:o})};var Is=(e,...t)=>{if(W(t[0]))return Is.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...n}=zp(e,...t),s=sT({...n,destination:r});return s.pipe=Is.bind(void 0,{...e,source:r,sourcePromise:s,boundOptions:{}}),s},sT=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:s,destinationStream:o,destinationError:i,unpipeSignal:a,fileDescriptors:c,startTime:u})=>{let l=oT(e,s);Zp({sourceStream:t,sourceError:n,destinationStream:o,destinationError:i,fileDescriptors:c,sourceOptions:r,startTime:u});let f=new AbortController;try{let d=Xp(t,o,f);return await Promise.race([Hp(l),...Jp(a,{sourceStream:t,mergedStream:d,sourceOptions:r,fileDescriptors:c,startTime:u})])}finally{f.abort()}},oT=(e,t)=>Promise.allSettled([e,t]);var nm=require("node:timers/promises");var em=require("node:events"),tm=require("node:stream");var $s=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:s,preserveNewlines:o})=>{let i=new AbortController;return iT(t,i),rm({stream:e,controller:i,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:s,shouldSplit:!e.readableObjectMode,preserveNewlines:o})},iT=async(e,t)=>{try{await e}catch{}finally{t.abort()}},ra=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:s,allMixed:o})=>{let i=new AbortController;aT(t,i,e);let a=e.readableObjectMode&&!o;return rm({stream:e,controller:i,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!s})},aT=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},rm=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i})=>{let a=(0,em.on)(e,"data",{signal:t.signal,highWaterMark:Qp,highWatermark:Qp});return cT({onStdoutChunk:a,controller:t,binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i})},na=(0,tm.getDefaultHighWaterMark)(!0),Qp=na,cT=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i}){let a=uT({binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i});try{for await(let[c]of e)yield*vt(c,a,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*Br(a)}},uT=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:s})=>[ws(e,r,!t),bs(e,s,!n,{})].filter(Boolean);var sm=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:s,maxBuffer:o,lines:i,allMixed:a,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{let f=lT({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:a,verboseInfo:u,streamInfo:l});if(!s){await Promise.all([fT(e),f]);return}let d=$i(c,r),p=ra({stream:e,onStreamEnd:t,lines:i,encoding:n,stripFinalNewline:d,allMixed:a}),[b]=await Promise.all([dT({stream:e,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:i}),f]);return b},lT=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:s,verboseInfo:o,streamInfo:{fileDescriptors:i}})=>{var c;if(!vs({stdioItems:(c=i[r])==null?void 0:c.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=ra({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:s});await pp(a,e,r,o)},fT=async e=>{await(0,nm.setImmediate)(),e.readableFlowing===null&&e.resume()},dT=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:s,maxBuffer:o,lines:i})=>{try{return t||i?await as(r,{maxBuffer:o}):s==="buffer"?new Uint8Array(await cs(r,{maxBuffer:o})):await ls(r,{maxBuffer:o})}catch(a){return om(ld({error:a,stream:e,readableObjectMode:t,lines:i,encoding:s,fdNumber:n}))}},sa=async e=>{try{return await e}catch(t){return om(t)}},om=({bufferedData:e})=>eu(e)?new Uint8Array(e):e;var am=require("node:stream/promises"),Wr=async(e,t,r,{isSameDirection:n,stopOnExit:s=!1}={})=>{let o=pT(e,r),i=new AbortController;try{await Promise.race([...s?[r.exitPromise]:[],(0,am.finished)(e,{cleanup:!0,signal:i.signal})])}catch(a){o.stdinCleanedUp||gT(a,t,r,n)}finally{i.abort()}},pT=(e,{originalStreams:[t],subprocess:r})=>{let n={stdinCleanedUp:!1};return e===t&&mT(e,r,n),n},mT=(e,t,r)=>{let{_destroy:n}=e;e._destroy=(...s)=>{hT(t,r),n.call(e,...s)}},hT=({exitCode:e,signalCode:t},r)=>{(e!==null||t!==null)&&(r.stdinCleanedUp=!0)},gT=(e,t,r,n)=>{if(!yT(e,t,r,n))throw e},yT=(e,t,r,n=!0)=>r.propagating?im(e)||Ds(e):(r.propagating=!0,oa(r,t)===n?im(e):Ds(e)),oa=({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input",Ds=e=>(e==null?void 0:e.code)==="ERR_STREAM_PREMATURE_CLOSE",im=e=>(e==null?void 0:e.code)==="EPIPE";var cm=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:o,verboseInfo:i,streamInfo:a})=>e.stdio.map((c,u)=>ia({stream:c,fdNumber:u,encoding:t,buffer:r[u],maxBuffer:n[u],lines:s[u],allMixed:!1,stripFinalNewline:o,verboseInfo:i,streamInfo:a})),ia=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:s,lines:o,allMixed:i,stripFinalNewline:a,verboseInfo:c,streamInfo:u})=>{if(!e)return;let l=Wr(e,t,u);if(oa(u,t)){await l;return}let[f]=await Promise.all([sm({stream:e,onStreamEnd:l,fdNumber:t,encoding:r,buffer:n,maxBuffer:s,lines:o,allMixed:i,stripFinalNewline:a,verboseInfo:c,streamInfo:u}),l]);return f};var um=({stdout:e,stderr:t},{all:r})=>r&&(e||t)?_t([e,t].filter(Boolean)):void 0,lm=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:o,verboseInfo:i,streamInfo:a})=>ia({...bT(e,r),fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:s[1]||s[2],allMixed:wT(e),stripFinalNewline:o,verboseInfo:i,streamInfo:a}),bT=({stdout:e,stderr:t,all:r},[,n,s])=>{let o=n||s;return o?n?s?{stream:r,buffer:o}:{stream:e,buffer:o}:{stream:t,buffer:o}:{stream:r,buffer:o}},wT=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode;var hm=require("node:events");var fm=e=>Yt(e,"ipc"),dm=(e,t)=>{let r=Ln(e);je({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})};var pm=async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:s,verboseInfo:o})=>{if(!n)return s;let i=fm(o),a=Ke(t,"ipc"),c=Ke(r,"ipc");for await(let u of Bi({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(fd(e,s,c),s.push(u)),i&&dm(u,o);return s},mm=async(e,t)=>(await Promise.allSettled([e]),t);var gm=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:s,timeoutDuration:o,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:u,ipc:l,ipcInput:f},context:d,verboseInfo:p,fileDescriptors:b,originalStreams:T,onInternalError:N,controller:P})=>{let j=bp(e,d),Y={originalStreams:T,fileDescriptors:b,subprocess:e,exitPromise:j,propagating:!1},X=cm({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:u,verboseInfo:p,streamInfo:Y}),Se=lm({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:u,verboseInfo:p,streamInfo:Y}),ce=[],Ae=pm({subprocess:e,buffer:r,maxBuffer:n,ipc:l,ipcOutput:ce,verboseInfo:p}),Ie=ST(T,e,Y),xe=xT(b,Y);try{return await Promise.race([Promise.all([{},Sp(j),Promise.all(X),Se,Ae,Ff(e,f),...Ie,...xe]),N,vT(e,P),...Df(e,o,d,P),...zl({subprocess:e,cancelSignal:i,gracefulCancel:a,context:d,controller:P}),...Af({subprocess:e,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:c,context:d,controller:P})])}catch(kr){return d.terminationReason??="other",Promise.all([{error:kr},j,Promise.all(X.map(bt=>sa(bt))),sa(Se),mm(Ae,ce),Promise.allSettled(Ie),Promise.allSettled(xe)])}},ST=(e,t,r)=>e.map((n,s)=>n===t.stdio[s]?void 0:Wr(n,s,r)),xT=(e,t)=>e.flatMap(({stdioItems:r},n)=>r.filter(({value:s,stream:o=s})=>Pe(o,{checkOpen:!1})&&!De(o)).map(({type:s,value:o,stream:i=o})=>Wr(i,n,t,{isSameDirection:_e.has(s),stopOnExit:s==="native"}))),vT=async(e,{signal:t})=>{let[r]=await(0,hm.once)(e,"error",{signal:t});throw r};var ym=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Zr=(e,t,r)=>{let n=e[r];n.has(t)||n.set(t,[]);let s=n.get(t),o=Be();return s.push(o),{resolve:o.resolve.bind(o),promises:s}},lr=async({resolve:e,promises:t},r)=>{e();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n};var wm=require("node:stream"),Sm=require("node:util");var aa=require("node:stream/promises");var ca=async e=>{if(e!==void 0)try{await ua(e)}catch{}},bm=async e=>{if(e!==void 0)try{await la(e)}catch{}},ua=async e=>{await(0,aa.finished)(e,{cleanup:!0,readable:!1,writable:!0})},la=async e=>{await(0,aa.finished)(e,{cleanup:!0,readable:!0,writable:!1})},Ls=async(e,t)=>{if(await e,t)throw t},Ns=(e,t,r)=>{r&&!Ds(r)?e.destroy(r):t&&e.destroy()};var xm=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:s=!0,preserveNewlines:o=!0}={})=>{let i=s||me.has(r),{subprocessStdout:a,waitReadableDestroy:c}=fa(e,n,t),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:f}=da(a,i),{read:d,onStdoutDataDone:p}=pa({subprocessStdout:a,subprocess:e,binary:i,encoding:r,preserveNewlines:o}),b=new wm.Readable({read:d,destroy:(0,Sm.callbackify)(ha.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:c})),highWaterMark:f,objectMode:l,encoding:u});return ma({subprocessStdout:a,onStdoutDataDone:p,readable:b,subprocess:e}),b},fa=(e,t,r)=>{let n=tr(e,t),s=Zr(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:s}},da=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:na},pa=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:s})=>{let o=Be(),i=$s({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:s});return{read(){_T(this,i,o)},onStdoutDataDone:o}},_T=async(e,t,r)=>{try{let{value:n,done:s}=await t.next();s?r.resolve():e.push(n)}catch{}},ma=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:s})=>{try{await la(e),await n,await ca(s),await t,r.readable&&r.push(null)}catch(o){await ca(s),vm(r,o)}},ha=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await lr(r,t)&&(vm(e,n),await Ls(t,n))},vm=(e,t)=>{Ns(e,e.readable,t)};var _m=require("node:stream"),ga=require("node:util");var Em=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:s,waitWritableDestroy:o}=ya(e,r,t),i=new _m.Writable({...ba(n,e,s),destroy:(0,ga.callbackify)(Sa.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:s,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return wa(n,i),i},ya=(e,t,r)=>{let n=zn(e,t),s=Zr(r,n,"writableFinal"),o=Zr(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:s,waitWritableDestroy:o}},ba=(e,t,r)=>({write:ET.bind(void 0,e),final:(0,ga.callbackify)(TT.bind(void 0,e,t,r))}),ET=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},TT=async(e,t,r)=>{await lr(r,t)&&(e.writable&&e.end(),await t)},wa=async(e,t,r)=>{try{await ua(e),t.writable&&t.end()}catch(n){await bm(r),Tm(t,n)}},Sa=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},s)=>{await lr(r,t),await lr(n,t)&&(Tm(e,s),await Ls(t,s))},Tm=(e,t)=>{Ns(e,e.writable,t)};var Om=require("node:stream"),Rm=require("node:util");var km=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:s,binary:o=!0,preserveNewlines:i=!0}={})=>{let a=o||me.has(r),{subprocessStdout:c,waitReadableDestroy:u}=fa(e,n,t),{subprocessStdin:l,waitWritableFinal:f,waitWritableDestroy:d}=ya(e,s,t),{readableEncoding:p,readableObjectMode:b,readableHighWaterMark:T}=da(c,a),{read:N,onStdoutDataDone:P}=pa({subprocessStdout:c,subprocess:e,binary:a,encoding:r,preserveNewlines:i}),j=new Om.Duplex({read:N,...ba(l,e,f),destroy:(0,Rm.callbackify)(OT.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:e,waitReadableDestroy:u,waitWritableFinal:f,waitWritableDestroy:d})),readableHighWaterMark:T,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:b,writableObjectMode:l.writableObjectMode,encoding:p});return ma({subprocessStdout:c,onStdoutDataDone:P,readable:j,subprocess:e,subprocessStdin:l}),wa(l,j,c),j},OT=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:s,waitWritableDestroy:o},i)=>{await Promise.all([ha({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},i),Sa({subprocessStdin:t,subprocess:r,waitWritableFinal:s,waitWritableDestroy:o},i)])};var xa=(e,t,{from:r,binary:n=!1,preserveNewlines:s=!1}={})=>{let o=n||me.has(t),i=tr(e,r),a=$s({subprocessStdout:i,subprocess:e,binary:o,shouldEncode:!0,encoding:t,preserveNewlines:s});return RT(a,i,e)},RT=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}};var Cm=(e,{encoding:t})=>{let r=ym();e.readable=xm.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=Em.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=km.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=xa.bind(void 0,e,t),e[Symbol.asyncIterator]=xa.bind(void 0,e,t,{})};var Am=(e,t)=>{for(let[r,n]of CT){let s=n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:s})}},kT=(async()=>{})().constructor.prototype,CT=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(kT,e)]);var Dm=(e,t,r,n)=>{let{file:s,commandArguments:o,command:i,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:f}=AT(e,t,r),{subprocess:d,promise:p}=$T({file:s,commandArguments:o,options:l,startTime:c,verboseInfo:u,command:i,escapedCommand:a,fileDescriptors:f});return d.pipe=Is.bind(void 0,{source:d,sourcePromise:p,boundOptions:{},createNested:n}),Am(d,p),Ue.set(d,{options:l,fileDescriptors:f}),d},AT=(e,t,r)=>{let{command:n,escapedCommand:s,startTime:o,verboseInfo:i}=Pn(e,t,r),{file:a,commandArguments:c,options:u}=ns(e,t,r),l=IT(u),f=Lp(l,i);return{file:a,commandArguments:c,command:n,escapedCommand:s,startTime:o,verboseInfo:i,options:l,fileDescriptors:f}},IT=({timeout:e,signal:t,...r})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},$T=({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:s,command:o,escapedCommand:i,fileDescriptors:a})=>{let c;try{c=(0,$m.spawn)(e,t,r)}catch(b){return Ip({error:b,command:o,escapedCommand:i,fileDescriptors:a,options:r,startTime:n,verboseInfo:s})}let u=new AbortController;(0,Im.setMaxListeners)(Number.POSITIVE_INFINITY,u.signal);let l=[...c.stdio];Bp(c,a,u),qp(c,r,u);let f={},d=Be();c.kill=Gl.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:d,context:f,controller:u}),c.all=um(c,r),Cm(c,r),Rp(c,r);let p=DT({subprocess:c,options:r,startTime:n,verboseInfo:s,fileDescriptors:a,originalStreams:l,command:o,escapedCommand:i,context:f,onInternalError:d,controller:u});return{subprocess:c,promise:p}},DT=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:s,originalStreams:o,command:i,escapedCommand:a,context:c,onInternalError:u,controller:l})=>{let[f,[d,p],b,T,N]=await gm({subprocess:e,options:t,context:c,verboseInfo:n,fileDescriptors:s,originalStreams:o,onInternalError:u,controller:l});l.abort(),u.resolve();let P=b.map((X,Se)=>Qe(X,t,Se)),j=Qe(T,t,"all"),Y=LT({errorInfo:f,exitCode:d,signal:p,stdio:P,all:j,ipcOutput:N,context:c,options:t,command:i,escapedCommand:a,startTime:r});return or(Y,n,t)},LT=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:s,ipcOutput:o,context:i,options:a,command:c,escapedCommand:u,startTime:l})=>"error"in e?jr({error:e.error,command:c,escapedCommand:u,timedOut:i.terminationReason==="timeout",isCanceled:i.terminationReason==="cancel"||i.terminationReason==="gracefulCancel",isGracefullyCanceled:i.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof Ge,isForcefullyTerminated:i.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:s,ipcOutput:o,options:a,startTime:l,isSync:!1}):ds({command:c,escapedCommand:u,stdio:n,all:s,ipcOutput:o,options:a,startTime:l});var Ps=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([n,s])=>[n,NT(n,e[n],s)]));return{...e,...r}},NT=(e,t,r)=>PT.has(e)&&W(t)&&W(r)?{...t,...r}:r,PT=new Set(["env",...Uo]);var dt=(e,t,r,n)=>{let s=(i,a,c)=>dt(i,a,r,c),o=(...i)=>MT({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:s},...i);return n!==void 0&&n(o,s,t),o},MT=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:s},o,...i)=>{if(W(o))return s(e,Ps(r,o),n);let{file:a,commandArguments:c,options:u,isSync:l}=FT({mapArguments:e,firstArgument:o,nextArguments:i,deepOptions:t,boundOptions:r});return l?_p(a,c,u):Dm(a,c,u,s)},FT=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:s})=>{let o=au(t)?cu(t,r):[t,...r],[i,a,c]=_n(...o),u=Ps(Ps(n,s),c),{file:l=i,commandArguments:f=a,options:d=u,isSync:p=!1}=e({file:i,commandArguments:a,options:u});return{file:l,commandArguments:f,options:d,isSync:p}};var Lm=({file:e,commandArguments:t})=>Pm(e,t),Nm=({file:e,commandArguments:t})=>({...Pm(e,t),isSync:!0}),Pm=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[r,...n]=jT(e);return{file:r,commandArguments:n}},jT=e=>{if(typeof e!="string")throw new TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t==="")return[];let r=[];for(let n of t.split(BT)){let s=r.at(-1);s&&s.endsWith("\\")?r[r.length-1]=`${s.slice(0,-1)} ${n}`:r.push(n)}return r},BT=/ +/g;var Mm=(e,t,r)=>{e.sync=t(UT,r),e.s=e.sync},Fm=({options:e})=>jm(e),UT=({options:e})=>({...jm(e),isSync:!0}),jm=e=>({options:{...GT(e),...e}}),GT=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},Bm={preferLocal:!0};var Um=dt(()=>({})),oG=dt(()=>({isSync:!0})),iG=dt(Lm),aG=dt(Nm),cG=dt(Lf),uG=dt(Fm,{},Bm,Mm),{sendMessage:lG,getOneMessage:fG,getEachMessage:dG,getCancelSignal:pG}=kp();var Xw=require("fs"),Ao=require("path"),Io=q($g(),1);var M;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{let o={};for(let i of s)o[i]=i;return o},e.getValidEnumValues=s=>{let o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(let a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(let i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(M||(M={}));var Ua;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Ua||(Ua={}));var S=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tt=e=>{switch(typeof e){case"undefined":return S.undefined;case"string":return S.string;case"number":return isNaN(e)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(e)?S.array:e===null?S.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?S.promise:typeof Map<"u"&&e instanceof Map?S.map:typeof Set<"u"&&e instanceof Set?S.set:typeof Date<"u"&&e instanceof Date?S.date:S.object;default:return S.unknown}},m=M.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"]),Fk=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),he=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return s(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};he.create=e=>new he(e);var hr=(e,t)=>{let r;switch(e.code){case m.invalid_type:e.received===S.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case m.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,M.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:r=`Unrecognized key(s) in object: ${M.joinValues(e.keys,", ")}`;break;case m.invalid_union:r="Invalid input";break;case m.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${M.joinValues(e.options)}`;break;case m.invalid_enum_value:r=`Invalid enum value. Expected ${M.joinValues(e.options)}, received '${e.received}'`;break;case m.invalid_arguments:r="Invalid function arguments";break;case m.invalid_return_type:r="Invalid function return type";break;case m.invalid_date:r="Invalid date";break;case m.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:M.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case m.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case m.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case m.custom:r="Invalid input";break;case m.invalid_intersection_types:r="Intersection results could not be merged";break;case m.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case m.not_finite:r="Number must be finite";break;default:r=t.defaultError,M.assertNever(e)}return{message:r}},Pg=hr;function jk(e){Pg=e}function Hs(){return Pg}var Ys=e=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},Bk=[];function y(e,t){let r=Hs(),n=Ys({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===hr?void 0:hr].filter(s=>!!s)});e.common.issues.push(n)}var te=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let s of r){if(s.status==="aborted")return k;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let s of r){let o=await s.key,i=await s.value;n.push({key:o,value:i})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let s of r){let{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return k;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}},k=Object.freeze({status:"aborted"}),mr=e=>({status:"dirty",value:e}),ie=e=>({status:"valid",value:e}),Ga=e=>e.status==="aborted",qa=e=>e.status==="dirty",Ot=e=>e.status==="valid",nn=e=>typeof Promise<"u"&&e instanceof Promise;function Xs(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Mg(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r}var _;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(_||(_={}));var tn,rn,Re=class{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Dg=(e,t)=>{if(Ot(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new he(e.common.issues);return this._error=r,this._error}}};function $(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,a)=>{var c,u;let{message:l}=e;return i.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:(c=l??n)!==null&&c!==void 0?c:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(u=l??r)!==null&&u!==void 0?u:a.defaultError}},description:s}}var D=class{get description(){return this._def.description}_getType(t){return tt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:tt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new te,ctx:{common:t.parent.common,data:t.data,parsedType:tt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(nn(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let s={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tt(t)},o=this._parseSync({data:t,path:s.path,parent:s});return Dg(s,o)}"~validate"(t){var r,n;let s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tt(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:s});return Ot(o)?{value:o.value}:{issues:s.common.issues}}catch(o){!((n=(r=o==null?void 0:o.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:s}).then(o=>Ot(o)?{value:o.value}:{issues:s.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tt(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(nn(s)?s:Promise.resolve(s));return Dg(n,o)}refine(t,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{let i=t(s),a=()=>o.addIssue({code:m.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new ge({schema:this,typeName:R.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:r=>this["~validate"](r)}}optional(){return Oe.create(this,this._def)}nullable(){return Ze.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return nt.create(this)}promise(){return ht.create(this,this._def)}or(t){return Dt.create([this,t],this._def)}and(t){return Lt.create(this,t,this._def)}transform(t){return new ge({...$(this._def),schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new jt({...$(this._def),innerType:this,defaultValue:r,typeName:R.ZodDefault})}brand(){return new sn({typeName:R.ZodBranded,type:this,...$(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Bt({...$(this._def),innerType:this,catchValue:r,typeName:R.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return on.create(this,t)}readonly(){return Ut.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Uk=/^c[^\s-]{8,}$/i,Gk=/^[0-9a-z]+$/,qk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Vk=/^[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,zk=/^[a-z0-9_-]{21}$/i,Wk=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Zk=/^[-+]?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)?)??$/,Hk=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Yk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ba,Xk=/^(?:(?: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])$/,Kk=/^(?:(?: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])$/,Jk=/^(([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]))$/,Qk=/^(([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])$/,eC=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tC=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fg="((\\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])))",rC=new RegExp(`^${Fg}$`);function jg(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function nC(e){return new RegExp(`^${jg(e)}$`)}function Bg(e){let t=`${Fg}T${jg(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function sC(e,t){return!!((t==="v4"||!t)&&Xk.test(e)||(t==="v6"||!t)&&Jk.test(e))}function oC(e,t){if(!Wk.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||!s.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function iC(e,t){return!!((t==="v4"||!t)&&Kk.test(e)||(t==="v6"||!t)&&Qk.test(e))}var pt=class e extends D{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==S.string){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_type,expected:S.string,received:o.parsedType}),k}let n=new te,s;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let i=t.data.length>o.value,a=t.data.length<o.value;(i||a)&&(s=this._getOrReturnCtx(t,s),i?y(s,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&y(s,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Hk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"email",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Ba||(Ba=new RegExp(Yk,"u")),Ba.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"emoji",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Vk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"uuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")zk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"nanoid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")Uk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"cuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Gk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"cuid2",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")qk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"ulid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),y(s,{validation:"url",code:m.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"regex",code:m.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Bg(o).test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?rC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?nC(o).test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Zk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"duration",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?sC(t.data,o.version)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"ip",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?oC(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"jwt",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?iC(t.data,o.version)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"cidr",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?eC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"base64",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?tC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"base64url",code:m.invalid_string,message:o.message}),n.dirty()):M.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:m.invalid_string,..._.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",..._.errToObj(t)})}url(t){return this._addCheck({kind:"url",..._.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",..._.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",..._.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",..._.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",..._.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",..._.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",..._.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",..._.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",..._.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",..._.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",..._.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",..._.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,..._.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,..._.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",..._.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,..._.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,..._.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,..._.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,..._.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,..._.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,..._.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,..._.errToObj(r)})}nonempty(t){return this.min(1,_.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};pt.create=e=>{var t;return new pt({checks:[],typeName:R.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...$(e)})};function aC(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}var Rt=class e extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==S.number){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_type,expected:S.number,received:o.parsedType}),k}let n,s=new te;for(let o of this._def.checks)o.kind==="int"?M.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),y(n,{code:m.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?aC(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),y(n,{code:m.not_finite,message:o.message}),s.dirty()):M.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,_.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:_.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:_.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&M.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Rt.create=e=>new Rt({checks:[],typeName:R.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...$(e)});var kt=class e extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==S.bigint)return this._getInvalidInput(t);let n,s=new te;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):M.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return y(r,{code:m.invalid_type,expected:S.bigint,received:r.parsedType}),k}gte(t,r){return this.setLimit("min",t,!0,_.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};kt.create=e=>{var t;return new kt({checks:[],typeName:R.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...$(e)})};var Ct=class extends D{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==S.boolean){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.boolean,received:n.parsedType}),k}return ie(t.data)}};Ct.create=e=>new Ct({typeName:R.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...$(e)});var At=class e extends D{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==S.date){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_type,expected:S.date,received:o.parsedType}),k}if(isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_date}),k}let n=new te,s;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):M.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:_.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:_.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};At.create=e=>new At({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:R.ZodDate,...$(e)});var gr=class extends D{_parse(t){if(this._getType(t)!==S.symbol){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.symbol,received:n.parsedType}),k}return ie(t.data)}};gr.create=e=>new gr({typeName:R.ZodSymbol,...$(e)});var It=class extends D{_parse(t){if(this._getType(t)!==S.undefined){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.undefined,received:n.parsedType}),k}return ie(t.data)}};It.create=e=>new It({typeName:R.ZodUndefined,...$(e)});var $t=class extends D{_parse(t){if(this._getType(t)!==S.null){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.null,received:n.parsedType}),k}return ie(t.data)}};$t.create=e=>new $t({typeName:R.ZodNull,...$(e)});var mt=class extends D{constructor(){super(...arguments),this._any=!0}_parse(t){return ie(t.data)}};mt.create=e=>new mt({typeName:R.ZodAny,...$(e)});var rt=class extends D{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ie(t.data)}};rt.create=e=>new rt({typeName:R.ZodUnknown,...$(e)});var Me=class extends D{_parse(t){let r=this._getOrReturnCtx(t);return y(r,{code:m.invalid_type,expected:S.never,received:r.parsedType}),k}};Me.create=e=>new Me({typeName:R.ZodNever,...$(e)});var yr=class extends D{_parse(t){if(this._getType(t)!==S.undefined){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.void,received:n.parsedType}),k}return ie(t.data)}};yr.create=e=>new yr({typeName:R.ZodVoid,...$(e)});var nt=class e extends D{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==S.array)return y(r,{code:m.invalid_type,expected:S.array,received:r.parsedType}),k;if(s.exactLength!==null){let i=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(i||a)&&(y(r,{code:i?m.too_big:m.too_small,minimum:a?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(y(r,{code:m.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(y(r,{code:m.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>s.type._parseAsync(new Re(r,i,r.path,a)))).then(i=>te.mergeArray(n,i));let o=[...r.data].map((i,a)=>s.type._parseSync(new Re(r,i,r.path,a)));return te.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:_.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:_.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:_.toString(r)}})}nonempty(t){return this.min(1,t)}};nt.create=(e,t)=>new nt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...$(t)});function pr(e){if(e instanceof le){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Oe.create(pr(n))}return new le({...e._def,shape:()=>t})}else return e instanceof nt?new nt({...e._def,type:pr(e.element)}):e instanceof Oe?Oe.create(pr(e.unwrap())):e instanceof Ze?Ze.create(pr(e.unwrap())):e instanceof We?We.create(e.items.map(t=>pr(t))):e}var le=class e extends D{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=M.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==S.object){let u=this._getOrReturnCtx(t);return y(u,{code:m.invalid_type,expected:S.object,received:u.parsedType}),k}let{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Me&&this._def.unknownKeys==="strip"))for(let u in s.data)i.includes(u)||a.push(u);let c=[];for(let u of i){let l=o[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Re(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Me){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:s.data[l]}});else if(u==="strict")a.length>0&&(y(s,{code:m.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let f=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Re(s,f,s.path,l)),alwaysSet:l in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let f=await l.key,d=await l.value;u.push({key:f,value:d,alwaysSet:l.alwaysSet})}return u}).then(u=>te.mergeObjectSync(n,u)):te.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return _.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,o,i,a;let c=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=_.errToObj(t).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:R.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return M.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return M.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}deepPartial(){return pr(this)}partial(t){let r={};return M.objectKeys(this.shape).forEach(n=>{let s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return M.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Oe;)o=o._def.innerType;r[n]=o}}),new e({...this._def,shape:()=>r})}keyof(){return Ug(M.objectKeys(this.shape))}};le.create=(e,t)=>new le({shape:()=>e,unknownKeys:"strip",catchall:Me.create(),typeName:R.ZodObject,...$(t)});le.strictCreate=(e,t)=>new le({shape:()=>e,unknownKeys:"strict",catchall:Me.create(),typeName:R.ZodObject,...$(t)});le.lazycreate=(e,t)=>new le({shape:e,unknownKeys:"strip",catchall:Me.create(),typeName:R.ZodObject,...$(t)});var Dt=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let i=o.map(a=>new he(a.ctx.common.issues));return y(r,{code:m.invalid_union,unionErrors:i}),k}if(r.common.async)return Promise.all(n.map(async o=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o,i=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=i.map(c=>new he(c));return y(r,{code:m.invalid_union,unionErrors:a}),k}}get options(){return this._def.options}};Dt.create=(e,t)=>new Dt({options:e,typeName:R.ZodUnion,...$(t)});var et=e=>e instanceof Nt?et(e.schema):e instanceof ge?et(e.innerType()):e instanceof Pt?[e.value]:e instanceof Mt?e.options:e instanceof Ft?M.objectValues(e.enum):e instanceof jt?et(e._def.innerType):e instanceof It?[void 0]:e instanceof $t?[null]:e instanceof Oe?[void 0,...et(e.unwrap())]:e instanceof Ze?[null,...et(e.unwrap())]:e instanceof sn||e instanceof Ut?et(e.unwrap()):e instanceof Bt?et(e._def.innerType):[],Ks=class e extends D{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.object)return y(r,{code:m.invalid_type,expected:S.object,received:r.parsedType}),k;let n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(y(r,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),k)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let s=new Map;for(let o of r){let i=et(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new e({typeName:R.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...$(n)})}};function Va(e,t){let r=tt(e),n=tt(t);if(e===t)return{valid:!0,data:e};if(r===S.object&&n===S.object){let s=M.objectKeys(t),o=M.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(let a of o){let c=Va(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===S.array&&n===S.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let i=e[o],a=t[o],c=Va(i,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===S.date&&n===S.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Lt=class extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=(o,i)=>{if(Ga(o)||Ga(i))return k;let a=Va(o.value,i.value);return a.valid?((qa(o)||qa(i))&&r.dirty(),{status:r.value,value:a.data}):(y(n,{code:m.invalid_intersection_types}),k)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Lt.create=(e,t,r)=>new Lt({left:e,right:t,typeName:R.ZodIntersection,...$(r)});var We=class e extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.array)return y(n,{code:m.invalid_type,expected:S.array,received:n.parsedType}),k;if(n.data.length<this._def.items.length)return y(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Re(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>te.mergeArray(r,i)):te.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};We.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new We({items:e,typeName:R.ZodTuple,rest:null,...$(t)})};var Js=class e extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.object)return y(n,{code:m.invalid_type,expected:S.object,received:n.parsedType}),k;let s=[],o=this._def.keyType,i=this._def.valueType;for(let a in n.data)s.push({key:o._parse(new Re(n,a,n.path,a)),value:i._parse(new Re(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?te.mergeObjectAsync(r,s):te.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof D?new e({keyType:t,valueType:r,typeName:R.ZodRecord,...$(n)}):new e({keyType:pt.create(),valueType:t,typeName:R.ZodRecord,...$(r)})}},br=class extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.map)return y(n,{code:m.invalid_type,expected:S.map,received:n.parsedType}),k;let s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([a,c],u)=>({key:s._parse(new Re(n,a,n.path,[u,"key"])),value:o._parse(new Re(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return k;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return k;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};br.create=(e,t,r)=>new br({valueType:t,keyType:e,typeName:R.ZodMap,...$(r)});var wr=class e extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.set)return y(n,{code:m.invalid_type,expected:S.set,received:n.parsedType}),k;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(y(n,{code:m.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(y(n,{code:m.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let o=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return k;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>o._parse(new Re(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:_.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:_.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};wr.create=(e,t)=>new wr({valueType:e,minSize:null,maxSize:null,typeName:R.ZodSet,...$(t)});var Qs=class e extends D{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.function)return y(r,{code:m.invalid_type,expected:S.function,received:r.parsedType}),k;function n(a,c){return Ys({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hs(),hr].filter(u=>!!u),issueData:{code:m.invalid_arguments,argumentsError:c}})}function s(a,c){return Ys({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hs(),hr].filter(u=>!!u),issueData:{code:m.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof ht){let a=this;return ie(async function(...c){let u=new he([]),l=await a._def.args.parseAsync(c,o).catch(p=>{throw u.addIssue(n(c,p)),u}),f=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(f,o).catch(p=>{throw u.addIssue(s(f,p)),u})})}else{let a=this;return ie(function(...c){let u=a._def.args.safeParse(c,o);if(!u.success)throw new he([n(c,u.error)]);let l=Reflect.apply(i,this,u.data),f=a._def.returns.safeParse(l,o);if(!f.success)throw new he([s(l,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:We.create(t).rest(rt.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||We.create([]).rest(rt.create()),returns:r||rt.create(),typeName:R.ZodFunction,...$(n)})}},Nt=class extends D{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Nt.create=(e,t)=>new Nt({getter:e,typeName:R.ZodLazy,...$(t)});var Pt=class extends D{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return y(r,{received:r.data,code:m.invalid_literal,expected:this._def.value}),k}return{status:"valid",value:t.data}}get value(){return this._def.value}};Pt.create=(e,t)=>new Pt({value:e,typeName:R.ZodLiteral,...$(t)});function Ug(e,t){return new Mt({values:e,typeName:R.ZodEnum,...$(t)})}var Mt=class e extends D{constructor(){super(...arguments),tn.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return y(r,{expected:M.joinValues(n),received:r.parsedType,code:m.invalid_type}),k}if(Xs(this,tn,"f")||Mg(this,tn,new Set(this._def.values),"f"),!Xs(this,tn,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return y(r,{received:r.data,code:m.invalid_enum_value,options:n}),k}return ie(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};tn=new WeakMap;Mt.create=Ug;var Ft=class extends D{constructor(){super(...arguments),rn.set(this,void 0)}_parse(t){let r=M.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==S.string&&n.parsedType!==S.number){let s=M.objectValues(r);return y(n,{expected:M.joinValues(s),received:n.parsedType,code:m.invalid_type}),k}if(Xs(this,rn,"f")||Mg(this,rn,new Set(M.getValidEnumValues(this._def.values)),"f"),!Xs(this,rn,"f").has(t.data)){let s=M.objectValues(r);return y(n,{received:n.data,code:m.invalid_enum_value,options:s}),k}return ie(t.data)}get enum(){return this._def.values}};rn=new WeakMap;Ft.create=(e,t)=>new Ft({values:e,typeName:R.ZodNativeEnum,...$(t)});var ht=class extends D{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.promise&&r.common.async===!1)return y(r,{code:m.invalid_type,expected:S.promise,received:r.parsedType}),k;let n=r.parsedType===S.promise?r.data:Promise.resolve(r.data);return ie(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ht.create=(e,t)=>new ht({type:e,typeName:R.ZodPromise,...$(t)});var ge=class extends D{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{y(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return k;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?k:c.status==="dirty"||r.value==="dirty"?mr(c.value):c});{if(r.value==="aborted")return k;let a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?k:a.status==="dirty"||r.value==="dirty"?mr(a.value):a}}if(s.type==="refinement"){let i=a=>{let c=s.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?k:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?k:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ot(i))return i;let a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ot(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:r.value,value:a})):i);M.assertNever(s)}};ge.create=(e,t,r)=>new ge({schema:e,typeName:R.ZodEffects,effect:t,...$(r)});ge.createWithPreprocess=(e,t,r)=>new ge({schema:t,effect:{type:"preprocess",transform:e},typeName:R.ZodEffects,...$(r)});var Oe=class extends D{_parse(t){return this._getType(t)===S.undefined?ie(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Oe.create=(e,t)=>new Oe({innerType:e,typeName:R.ZodOptional,...$(t)});var Ze=class extends D{_parse(t){return this._getType(t)===S.null?ie(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ze.create=(e,t)=>new Ze({innerType:e,typeName:R.ZodNullable,...$(t)});var jt=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===S.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};jt.create=(e,t)=>new jt({innerType:e,typeName:R.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...$(t)});var Bt=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return nn(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new he(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new he(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Bt.create=(e,t)=>new Bt({innerType:e,typeName:R.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...$(t)});var Sr=class extends D{_parse(t){if(this._getType(t)!==S.nan){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.nan,received:n.parsedType}),k}return{status:"valid",value:t.data}}};Sr.create=e=>new Sr({typeName:R.ZodNaN,...$(e)});var cC=Symbol("zod_brand"),sn=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},on=class e extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?k:o.status==="dirty"?(r.dirty(),mr(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?k:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:R.ZodPipeline})}},Ut=class extends D{_parse(t){let r=this._def.innerType._parse(t),n=s=>(Ot(s)&&(s.value=Object.freeze(s.value)),s);return nn(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};Ut.create=(e,t)=>new Ut({innerType:e,typeName:R.ZodReadonly,...$(t)});function Lg(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Gg(e,t={},r){return e?mt.create().superRefine((n,s)=>{var o,i;let a=e(n);if(a instanceof Promise)return a.then(c=>{var u,l;if(!c){let f=Lg(t,n),d=(l=(u=f.fatal)!==null&&u!==void 0?u:r)!==null&&l!==void 0?l:!0;s.addIssue({code:"custom",...f,fatal:d})}});if(!a){let c=Lg(t,n),u=(i=(o=c.fatal)!==null&&o!==void 0?o:r)!==null&&i!==void 0?i:!0;s.addIssue({code:"custom",...c,fatal:u})}}):mt.create()}var uC={object:le.lazycreate},R;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(R||(R={}));var lC=(e,t={message:`Input not instance of ${e.name}`})=>Gg(r=>r instanceof e,t),qg=pt.create,Vg=Rt.create,fC=Sr.create,dC=kt.create,zg=Ct.create,pC=At.create,mC=gr.create,hC=It.create,gC=$t.create,yC=mt.create,bC=rt.create,wC=Me.create,SC=yr.create,xC=nt.create,vC=le.create,_C=le.strictCreate,EC=Dt.create,TC=Ks.create,OC=Lt.create,RC=We.create,kC=Js.create,CC=br.create,AC=wr.create,IC=Qs.create,$C=Nt.create,DC=Pt.create,LC=Mt.create,NC=Ft.create,PC=ht.create,Ng=ge.create,MC=Oe.create,FC=Ze.create,jC=ge.createWithPreprocess,BC=on.create,UC=()=>qg().optional(),GC=()=>Vg().optional(),qC=()=>zg().optional(),VC={string:e=>pt.create({...e,coerce:!0}),number:e=>Rt.create({...e,coerce:!0}),boolean:e=>Ct.create({...e,coerce:!0}),bigint:e=>kt.create({...e,coerce:!0}),date:e=>At.create({...e,coerce:!0})},zC=k,st=Object.freeze({__proto__:null,defaultErrorMap:hr,setErrorMap:jk,getErrorMap:Hs,makeIssue:Ys,EMPTY_PATH:Bk,addIssueToContext:y,ParseStatus:te,INVALID:k,DIRTY:mr,OK:ie,isAborted:Ga,isDirty:qa,isValid:Ot,isAsync:nn,get util(){return M},get objectUtil(){return Ua},ZodParsedType:S,getParsedType:tt,ZodType:D,datetimeRegex:Bg,ZodString:pt,ZodNumber:Rt,ZodBigInt:kt,ZodBoolean:Ct,ZodDate:At,ZodSymbol:gr,ZodUndefined:It,ZodNull:$t,ZodAny:mt,ZodUnknown:rt,ZodNever:Me,ZodVoid:yr,ZodArray:nt,ZodObject:le,ZodUnion:Dt,ZodDiscriminatedUnion:Ks,ZodIntersection:Lt,ZodTuple:We,ZodRecord:Js,ZodMap:br,ZodSet:wr,ZodFunction:Qs,ZodLazy:Nt,ZodLiteral:Pt,ZodEnum:Mt,ZodNativeEnum:Ft,ZodPromise:ht,ZodEffects:ge,ZodTransformer:ge,ZodOptional:Oe,ZodNullable:Ze,ZodDefault:jt,ZodCatch:Bt,ZodNaN:Sr,BRAND:cC,ZodBranded:sn,ZodPipeline:on,ZodReadonly:Ut,custom:Gg,Schema:D,ZodSchema:D,late:uC,get ZodFirstPartyTypeKind(){return R},coerce:VC,any:yC,array:xC,bigint:dC,boolean:zg,date:pC,discriminatedUnion:TC,effect:Ng,enum:LC,function:IC,instanceof:lC,intersection:OC,lazy:$C,literal:DC,map:CC,nan:fC,nativeEnum:NC,never:wC,null:gC,nullable:FC,number:Vg,object:vC,oboolean:qC,onumber:GC,optional:MC,ostring:UC,pipeline:BC,preprocess:jC,promise:PC,record:kC,set:AC,strictObject:_C,string:qg,symbol:mC,transformer:Ng,tuple:RC,undefined:hC,union:EC,unknown:bC,void:SC,NEVER:zC,ZodIssueCode:m,quotelessJson:Fk,ZodError:he});var Wg=st.object({list:st.boolean().optional(),log:st.boolean().optional(),track:st.boolean().optional(),parser:st.enum(["babel","babylon","flow","ts","tsx"]).optional(),extensions:st.string().optional(),ignoreConfig:st.string().optional(),match:st.any().optional()});var wo=q(oy(),1),ho=q(Ha(),1),Ib=require("child_process"),mw=q(Xa(),1),Tr=q(Xa(),1),Bw=require("node:events"),yo=Object.defineProperty,vA=Object.defineProperties,_A=Object.getOwnPropertyDescriptor,EA=Object.getOwnPropertyDescriptors,gc=Object.getOwnPropertyNames,iy=Object.getOwnPropertySymbols,jy=Object.prototype.hasOwnProperty,TA=Object.prototype.propertyIsEnumerable,ay=(e,t,r)=>t in e?yo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ce=(e,t)=>{for(var r in t||(t={}))jy.call(t,r)&&ay(e,r,t[r]);if(iy)for(var r of iy(t))TA.call(t,r)&&ay(e,r,t[r]);return e},un=(e,t)=>vA(e,EA(t)),g=(e,t)=>function(){return e&&(t=(0,e[gc(e)[0]])(e=0)),t},OA=(e,t)=>function(){return t||(0,e[gc(e)[0]])((t={exports:{}}).exports,t),t.exports},H=(e,t)=>{for(var r in t)yo(e,r,{get:t[r],enumerable:!0})},RA=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of gc(t))!jy.call(e,s)&&s!==r&&yo(e,s,{get:()=>t[s],enumerable:!(n=_A(t,s))||n.enumerable});return e},V=e=>RA(yo({},"__esModule",{value:!0}),e),cn=(e,t,r)=>new Promise((n,s)=>{var o=c=>{try{a(r.next(c))}catch(u){s(u)}},i=c=>{try{a(r.throw(c))}catch(u){s(u)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,i);a((r=r.apply(e,t)).next())});function kA(...e){let t=new String(e);return bo.set(t,e),t}function po(e){return e instanceof String&&bo.has(e)}function cy(e){return bo.get(e)||[]}var bo,pn=g({"src/lib/args/pathspec.ts"(){"use strict";bo=new WeakMap}}),it,yt=g({"src/lib/errors/git-error.ts"(){"use strict";it=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),mn,Rr=g({"src/lib/errors/git-response-error.ts"(){"use strict";yt(),mn=class extends it{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),By,Uy=g({"src/lib/errors/task-configuration-error.ts"(){"use strict";yt(),By=class extends it{constructor(e){super(void 0,e)}}}});function Gy(e){return typeof e=="function"?e:Wt}function qy(e){return typeof e=="function"&&e!==Wt}function Vy(e,t){let r=e.indexOf(t);return r<=0?[e,""]:[e.substr(0,r),e.substr(r+1)]}function zy(e,t=0){return Wy(e)&&e.length>t?e[t]:void 0}function zt(e,t=0){if(Wy(e)&&e.length>t)return e[e.length-1-t]}function Wy(e){return!!(e&&typeof e.length=="number")}function hn(e="",t=!0,r=`
|
55
|
+
if (condition) { yield value; }`)};var ip=require("node:buffer"),ap=require("node:string_decoder");var ws=(e,t,r)=>{if(r)return;if(e)return{transform:UE.bind(void 0,new TextEncoder)};let n=new ap.StringDecoder(t);return{transform:GE.bind(void 0,n),final:qE.bind(void 0,n)}},UE=function*(e,t){ip.Buffer.isBuffer(t)?yield Xe(t):typeof t=="string"?yield e.encode(t):yield t},GE=function*(e,t){yield K(t)?e.write(t):t},qE=function*(e){let t=e.end();t!==""&&(yield t)};var Ni=require("node:util"),Pi=(0,Ni.callbackify)(async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(let s of t.currentIterable)n.push(s)}finally{delete t.currentIterable}}),Ss=async function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=zE}=t[r];for await(let s of n(e))yield*Ss(s,t,r+1)},cp=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*VE(r,Number(t),e)},VE=async function*(e,t,r){if(e!==void 0)for await(let n of e())yield*Ss(n,r,t+1)},up=(0,Ni.callbackify)(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),zE=function*(e){yield e};var Mi=(e,t,r,n)=>{try{for(let s of e(...t))r.push(s);n()}catch(s){n(s)}},lp=(e,t)=>[...t.flatMap(r=>[...vt(r,e,0)]),...Br(e)],vt=function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=ZE}=t[r];for(let s of n(e))yield*vt(s,t,r+1)},Br=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*WE(r,Number(t),e)},WE=function*(e,t,r){if(e!==void 0)for(let n of e())yield*vt(n,r,t+1)},ZE=function*(e){yield e};var Fi=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:s},optionName:o},{encoding:i})=>{let a={},c=fp(e,i,o),u=xt(t),l=xt(r),f=u?Pi.bind(void 0,Ss,a):Mi.bind(void 0,vt),d=u||l?Pi.bind(void 0,cp,a):Mi.bind(void 0,Br),p=u||l?up.bind(void 0,a):void 0;return{stream:new Ur.Transform({writableObjectMode:n,writableHighWaterMark:(0,Ur.getDefaultHighWaterMark)(n),readableObjectMode:s,readableHighWaterMark:(0,Ur.getDefaultHighWaterMark)(s),transform(T,N,P){f([T,c,0],this,P)},flush(T){d([c],this,T)},destroy:p})}},xs=(e,t,r,n)=>{let s=t.filter(({type:i})=>i==="generator"),o=n?s.reverse():s;for(let{value:i,optionName:a}of o){let c=fp(i,r,a);e=lp(c,e)}return e},fp=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:s,preserveNewlines:o},i,a)=>{let c={};return[{transform:np(n,a)},ws(r,i,n),bs(r,o,n,c),{transform:e,final:t},{transform:sp(s,a)},tp({binary:r,preserveNewlines:o,readableObjectMode:s,state:c})].filter(Boolean)};var dp=(e,t)=>{for(let r of HE(e))YE(e,r,t)},HE=e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),YE=(e,t,r)=>{let{stdioItems:n}=e[t],s=n.filter(({contents:a})=>a!==void 0);if(s.length===0)return;if(t!==0){let[{type:a,optionName:c}]=s;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${lt[a]} with synchronous methods.`)}let i=s.map(({contents:a})=>a).map(a=>XE(a,n));r.input=Ar(i)},XE=(e,t)=>{let r=xs(e,t,"utf8",!0);return KE(r),Ar(r)},KE=e=>{let t=e.find(r=>typeof r!="string"&&!K(r));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)};var _s=require("node:fs");var vs=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>n!=="all"&&Yt(r,n)&&!me.has(t)&&JE(n)&&(e.some(({type:s,value:o})=>s==="native"&&QE.has(o))||e.every(({type:s})=>_e.has(s))),JE=e=>e===1||e===2,QE=new Set(["pipe","overlapped"]),pp=async(e,t,r,n)=>{for await(let s of e)e0(t)||hp(s,r,n)},mp=(e,t,r)=>{for(let n of e)hp(n,t,r)},e0=e=>e._readableState.pipes.length>0,hp=(e,t,r)=>{let n=Ln(e);je({type:"output",verboseMessage:n,fdNumber:t,verboseInfo:r})};var gp=({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:s})=>{if(t===null)return{output:Array.from({length:3})};let o={},i=new Set([]);return{output:t.map((c,u)=>t0({result:c,fileDescriptors:e,fdNumber:u,state:o,outputFiles:i,isMaxBuffer:n,verboseInfo:s},r)),...o}},t0=({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:s,isMaxBuffer:o,verboseInfo:i},{buffer:a,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:f})=>{if(e===null)return;let d=md(e,o,f),p=Xe(d),{stdioItems:b,objectMode:T}=t[r],N=r0([p],b,c,n),{serializedResult:P,finalResult:j=P}=n0({chunks:N,objectMode:T,encoding:c,lines:u,stripFinalNewline:l,fdNumber:r});s0({serializedResult:P,fdNumber:r,state:n,verboseInfo:i,encoding:c,stdioItems:b,objectMode:T});let Y=a[r]?j:void 0;try{return n.error===void 0&&o0(P,b,s),Y}catch(X){return n.error=X,Y}},r0=(e,t,r,n)=>{try{return xs(e,t,r,!1)}catch(s){return n.error=s,e}},n0=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:s,fdNumber:o})=>{if(t)return{serializedResult:e};if(r==="buffer")return{serializedResult:Ar(e)};let i=ru(e,r);return n[o]?{serializedResult:i,finalResult:Li(i,!s[o],t)}:{serializedResult:i}},s0=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:s,stdioItems:o,objectMode:i})=>{if(!vs({stdioItems:o,encoding:s,verboseInfo:n,fdNumber:t}))return;let a=Li(e,!1,i);try{mp(a,t,n)}catch(c){r.error??=c}},o0=(e,t,r)=>{for(let{path:n,append:s}of t.filter(({type:o})=>hs.has(o))){let o=typeof n=="string"?n:n.toString();s||r.has(o)?(0,_s.appendFileSync)(n,e):(r.add(o),(0,_s.writeFileSync)(n,e))}};var yp=([,e,t],r)=>{if(r.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Qe(t,r,"all")]:Array.isArray(t)?[Qe(e,r,"all"),...t]:K(e)&&K(t)?Fo([e,t]):`${e}${t}`};var Es=require("node:events");var bp=async(e,t)=>{let[r,n]=await i0(e);return t.isForcefullyTerminated??=!1,[r,n]},i0=async e=>{let[t,r]=await Promise.allSettled([(0,Es.once)(e,"spawn"),(0,Es.once)(e,"exit")]);return t.status==="rejected"?[]:r.status==="rejected"?wp(e):r.value},wp=async e=>{try{return await(0,Es.once)(e,"exit")}catch{return wp(e)}},Sp=async e=>{let[t,r]=await e;if(!a0(t,r)&&ji(t,r))throw new Le;return[t,r]},a0=(e,t)=>e===void 0&&t===void 0,ji=(e,t)=>e!==0||t!==null;var xp=({error:e,status:t,signal:r,output:n},{maxBuffer:s})=>{let o=c0(e,t,r),i=(o==null?void 0:o.code)==="ETIMEDOUT",a=pd(o,n,s);return{resultError:o,exitCode:t,signal:r,timedOut:i,isMaxBuffer:a}},c0=(e,t,r)=>e!==void 0?e:ji(t,r)?new Le:void 0;var _p=(e,t,r)=>{let{file:n,commandArguments:s,command:o,escapedCommand:i,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=u0(e,t,r),f=d0({file:n,commandArguments:s,options:u,command:o,escapedCommand:i,verboseInfo:c,fileDescriptors:l,startTime:a});return or(f,c,u)},u0=(e,t,r)=>{let{command:n,escapedCommand:s,startTime:o,verboseInfo:i}=Pn(e,t,r),a=l0(r),{file:c,commandArguments:u,options:l}=ns(e,t,a);f0(l);let f=Kd(l,i);return{file:c,commandArguments:u,command:n,escapedCommand:s,startTime:o,verboseInfo:i,options:l,fileDescriptors:f}},l0=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,f0=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&Ts("ipcInput"),e&&Ts("ipc: true"),r&&Ts("detached: true"),n&&Ts("cancelSignal")},Ts=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},d0=({file:e,commandArguments:t,options:r,command:n,escapedCommand:s,verboseInfo:o,fileDescriptors:i,startTime:a})=>{let c=p0({file:e,commandArguments:t,options:r,command:n,escapedCommand:s,fileDescriptors:i,startTime:a});if(c.failed)return c;let{resultError:u,exitCode:l,signal:f,timedOut:d,isMaxBuffer:p}=xp(c,r),{output:b,error:T=u}=gp({fileDescriptors:i,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),N=b.map((j,Y)=>Qe(j,r,Y)),P=Qe(yp(b,r),r,"all");return h0({error:T,exitCode:l,signal:f,timedOut:d,isMaxBuffer:p,stdio:N,all:P,options:r,command:n,escapedCommand:s,startTime:a})},p0=({file:e,commandArguments:t,options:r,command:n,escapedCommand:s,fileDescriptors:o,startTime:i})=>{try{dp(o,r);let a=m0(r);return(0,vp.spawnSync)(e,t,a)}catch(a){return sr({error:a,command:n,escapedCommand:s,fileDescriptors:o,options:r,startTime:i,isSync:!0})}},m0=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:fs(t)}),h0=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:s,stdio:o,all:i,options:a,command:c,escapedCommand:u,startTime:l})=>e===void 0?ds({command:c,escapedCommand:u,stdio:o,all:i,ipcOutput:[],options:a,startTime:l}):jr({error:e,command:c,escapedCommand:u,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:s,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:o,all:i,ipcOutput:[],options:a,startTime:l,isSync:!0});var Im=require("node:events"),$m=require("node:child_process");var Ui=q(require("node:process"),1);var ar=require("node:events");var Ep=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:s=!0,filter:o}={})=>(Qt({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Xn(e)}),g0({anyProcess:e,channel:t,isSubprocess:r,filter:o,reference:s})),g0=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:s})=>{Wn(t,s);let o=ut(e,t,r),i=new AbortController;try{return await Promise.race([y0(o,n,i),b0(o,r,i),w0(o,r,i)])}catch(a){throw er(e),a}finally{i.abort(),Zn(t,s)}},y0=async(e,t,{signal:r})=>{if(t===void 0){let[n]=await(0,ar.once)(e,"message",{signal:r});return n}for await(let[n]of(0,ar.on)(e,"message",{signal:r}))if(t(n))return n},b0=async(e,t,{signal:r})=>{await(0,ar.once)(e,"disconnect",{signal:r}),Wl(t)},w0=async(e,t,{signal:r})=>{let[n]=await(0,ar.once)(e,"strict:error",{signal:r});throw qn(n,t)};var Gr=require("node:events");var Op=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:s=!0}={})=>Bi({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:s}),Bi=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:s,reference:o})=>{Qt({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Xn(e)}),Wn(t,o);let i=ut(e,t,r),a=new AbortController,c={};return S0(e,i,a),x0({ipcEmitter:i,isSubprocess:r,controller:a,state:c}),v0({anyProcess:e,channel:t,ipcEmitter:i,isSubprocess:r,shouldAwait:s,controller:a,state:c,reference:o})},S0=async(e,t,r)=>{try{await(0,Gr.once)(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},x0=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{let[s]=await(0,Gr.once)(e,"strict:error",{signal:r.signal});n.error=qn(s,t),r.abort()}catch{}},v0=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:s,controller:o,state:i,reference:a}){try{for await(let[c]of(0,Gr.on)(r,"message",{signal:o.signal}))Tp(i),yield c}catch{Tp(i)}finally{o.abort(),Zn(t,a),n||er(e),s&&await e}},Tp=({error:e})=>{if(e)throw e};var Rp=(e,{ipc:t})=>{Object.assign(e,Cp(e,!1,t))},kp=()=>{let e=Ui.default,t=!0,r=Ui.default.channel!==void 0;return{...Cp(e,t,r),getCancelSignal:Rf.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}},Cp=(e,t,r)=>({sendMessage:es.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:Ep.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:Op.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})});var Ap=require("node:child_process"),ft=require("node:stream");var Ip=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:s,startTime:o,verboseInfo:i})=>{Ai(n);let a=new Ap.ChildProcess;_0(a,n),Object.assign(a,{readable:E0,writable:T0,duplex:O0});let c=sr({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:s,startTime:o,isSync:!1}),u=R0(c,i,s);return{subprocess:a,promise:u}},_0=(e,t)=>{let r=qr(),n=qr(),s=qr(),o=Array.from({length:t.length-3},qr),i=qr(),a=[r,n,s,...o];Object.assign(e,{stdin:r,stdout:n,stderr:s,all:i,stdio:a})},qr=()=>{let e=new ft.PassThrough;return e.end(),e},E0=()=>new ft.Readable({read(){}}),T0=()=>new ft.Writable({write(){}}),O0=()=>new ft.Duplex({read(){},write(){}}),R0=async(e,t,r)=>or(e,t,r);var cr=require("node:fs"),Dp=require("node:buffer"),Ve=require("node:stream");var Lp=(e,t)=>ys(k0,e,t,!1),Vr=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${lt[e]}.`)},$p={fileNumber:Vr,generator:Fi,asyncGenerator:Fi,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){let n=t||r;return{stream:Ve.Duplex.fromWeb(e,{objectMode:n})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},k0={input:{...$p,fileUrl:({value:e})=>({stream:(0,cr.createReadStream)(e)}),filePath:({value:{file:e}})=>({stream:(0,cr.createReadStream)(e)}),webStream:({value:e})=>({stream:Ve.Readable.fromWeb(e)}),iterable:({value:e})=>({stream:Ve.Readable.from(e)}),asyncIterable:({value:e})=>({stream:Ve.Readable.from(e)}),string:({value:e})=>({stream:Ve.Readable.from(e)}),uint8Array:({value:e})=>({stream:Ve.Readable.from(Dp.Buffer.from(e))})},output:{...$p,fileUrl:({value:e})=>({stream:(0,cr.createWriteStream)(e)}),filePath:({value:{file:e,append:t}})=>({stream:(0,cr.createWriteStream)(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:Ve.Writable.fromWeb(e)}),iterable:Vr,asyncIterable:Vr,string:Vr,uint8Array:Vr}};var zr=require("node:events"),Rs=require("node:stream"),Vi=require("node:stream/promises");function _t(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let s of e)qi(s);let t=e.some(({readableObjectMode:s})=>s),r=C0(e,t),n=new Gi({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let s of e)n.add(s);return n}var C0=(e,t)=>{if(e.length===0)return(0,Rs.getDefaultHighWaterMark)(t);let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Gi=class extends Rs.PassThrough{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#s=new WeakMap;add(t){if(qi(t),this.#t.has(t))return;this.#t.add(t),this.#n??=A0(this,this.#t,this.#o);let r=D0({passThroughStream:this,stream:t,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#s.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(qi(t),!this.#t.has(t))return!1;let r=this.#s.get(t);return r===void 0?!1:(this.#s.delete(t),t.unpipe(this),await r,!0)}},A0=async(e,t,r)=>{Os(e,Np);let n=new AbortController;try{await Promise.race([I0(e,n),$0(e,t,r,n)])}finally{n.abort(),Os(e,-Np)}},I0=async(e,{signal:t})=>{try{await(0,Vi.finished)(e,{signal:t,cleanup:!0})}catch(r){throw Mp(e,r),r}},$0=async(e,t,r,{signal:n})=>{for await(let[s]of(0,zr.on)(e,"unpipe",{signal:n}))t.has(s)&&s.emit(r)},qi=e=>{if(typeof(e==null?void 0:e.pipe)!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},D0=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:s,onFinished:o,unpipeEvent:i})=>{Os(e,Pp);let a=new AbortController;try{await Promise.race([L0(o,t,a),N0({passThroughStream:e,stream:t,streams:r,ended:n,aborted:s,controller:a}),P0({stream:t,streams:r,ended:n,aborted:s,unpipeEvent:i,controller:a})])}finally{a.abort(),Os(e,-Pp)}r.size>0&&r.size===n.size+s.size&&(n.size===0&&s.size>0?zi(e):M0(e))},L0=async(e,t,{signal:r})=>{try{await e,r.aborted||zi(t)}catch(n){r.aborted||Mp(t,n)}},N0=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:s,controller:{signal:o}})=>{try{await(0,Vi.finished)(t,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(i){if(o.aborted||!r.has(t))return;Fp(i)?s.add(t):jp(e,i)}},P0=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:s,controller:{signal:o}})=>{if(await(0,zr.once)(e,s,{signal:o}),!e.readable)return(0,zr.once)(o,"abort",{signal:o});t.delete(e),r.delete(e),n.delete(e)},M0=e=>{e.writable&&e.end()},Mp=(e,t)=>{Fp(t)?zi(e):jp(e,t)},Fp=e=>(e==null?void 0:e.code)==="ERR_STREAM_PREMATURE_CLOSE",zi=e=>{(e.readable||e.writable)&&e.destroy()},jp=(e,t)=>{e.destroyed||(e.once("error",F0),e.destroy(t))},F0=()=>{},Os=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},Np=2,Pp=1;var Wi=require("node:stream/promises");var ur=(e,t)=>{e.pipe(t),j0(e,t),B0(e,t)},j0=async(e,t)=>{if(!(De(e)||De(t))){try{await(0,Wi.finished)(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Zi(t)}},Zi=e=>{e.writable&&e.end()},B0=async(e,t)=>{if(!(De(e)||De(t))){try{await(0,Wi.finished)(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Hi(e)}},Hi=e=>{e.readable&&e.destroy()};var Bp=(e,t,r)=>{let n=new Map;for(let[s,{stdioItems:o,direction:i}]of Object.entries(t)){for(let{stream:a}of o.filter(({type:c})=>_e.has(c)))U0(e,a,i,s);for(let{stream:a}of o.filter(({type:c})=>!_e.has(c)))q0({subprocess:e,stream:a,direction:i,fdNumber:s,pipeGroups:n,controller:r})}for(let[s,o]of n.entries()){let i=o.length===1?o[0]:_t(o);ur(i,s)}},U0=(e,t,r,n)=>{r==="output"?ur(e.stdio[n],t):ur(t,e.stdio[n]);let s=G0[n];s!==void 0&&(e[s]=t),e.stdio[n]=t},G0=["stdin","stdout","stderr"],q0=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:s,controller:o})=>{if(t===void 0)return;V0(t,o);let[i,a]=r==="output"?[t,e.stdio[n]]:[e.stdio[n],t],c=s.get(i)??[];s.set(i,[...c,a])},V0=(e,{signal:t})=>{De(e)&&wt(e,z0,t)},z0=2;var Gp=require("node:events");var Et=[];Et.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Et.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Et.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var ks=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Yi=Symbol.for("signal-exit emitter"),Xi=globalThis,W0=Object.defineProperty.bind(Object),Ki=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Xi[Yi])return Xi[Yi];W0(Xi,Yi,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],s=n.indexOf(r);s!==-1&&(s===0&&n.length===1?n.length=0:n.splice(s,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let s=!1;for(let o of this.listeners[t])s=o(r,n)===!0||s;return t==="exit"&&(s=this.emit("afterExit",r,n)||s),s}},Cs=class{},Z0=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Ji=class extends Cs{onExit(){return()=>{}}load(){}unload(){}},Qi=class extends Cs{#t=ea.platform==="win32"?"SIGINT":"SIGHUP";#r=new Ki;#e;#n;#o;#s={};#i=!1;constructor(t){super(),this.#e=t,this.#s={};for(let r of Et)this.#s[r]=()=>{let n=this.#e.listeners(r),{count:s}=this.#r,o=t;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(s+=o.__signal_exit_emitter__.count),n.length===s){this.unload();let i=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;i||t.kill(t.pid,a)}};this.#o=t.reallyExit,this.#n=t.emit}onExit(t,r){if(!ks(this.#e))return()=>{};this.#i===!1&&this.load();let n=r!=null&&r.alwaysLast?"afterExit":"exit";return this.#r.on(n,t),()=>{this.#r.removeListener(n,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#r.count+=1;for(let t of Et)try{let r=this.#s[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#c(t,...r),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#i&&(this.#i=!1,Et.forEach(t=>{let r=this.#s[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(t){return ks(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(t,...r){let n=this.#n;if(t==="exit"&&ks(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let s=n.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),s}else return n.call(this.#e,t,...r)}},ea=globalThis.process,{onExit:Up,load:Dj,unload:Lj}=Z0(ks(ea)?new Qi(ea):new Ji);var qp=(e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;let s=Up(()=>{e.kill()});(0,Gp.addAbortListener)(n,()=>{s()})};var zp=({source:e,sourcePromise:t,boundOptions:r,createNested:n},...s)=>{let o=Nn(),{destination:i,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=H0(r,n,s),{sourceStream:f,sourceError:d}=X0(e,u),{options:p,fileDescriptors:b}=Ue.get(e);return{sourcePromise:t,sourceStream:f,sourceOptions:p,sourceError:d,destination:i,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:b,startTime:o}},H0=(e,t,r)=>{try{let{destination:n,pipeOptions:{from:s,to:o,unpipeSignal:i}={}}=Y0(e,t,...r),a=zn(n,o);return{destination:n,destinationStream:a,from:s,unpipeSignal:i}}catch(n){return{destinationError:n}}},Y0=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(Vp,e)(r,...n),pipeOptions:e};if(typeof r=="string"||r instanceof URL||Po(r)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[s,o,i]=_n(r,...n);return{destination:t(Vp)(s,o,i),pipeOptions:i}}if(Ue.has(r)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Vp=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),X0=(e,t)=>{try{return{sourceStream:tr(e,t)}}catch(r){return{sourceError:r}}};var Zp=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:s,sourceOptions:o,startTime:i})=>{let a=K0({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(a!==void 0)throw ta({error:a,fileDescriptors:s,sourceOptions:o,startTime:i})},K0=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>{if(t!==void 0&&n!==void 0)return n;if(n!==void 0)return Hi(e),n;if(t!==void 0)return Zi(r),t},ta=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>sr({error:e,command:Wp,escapedCommand:Wp,fileDescriptors:t,options:r,startTime:n,isSync:!1}),Wp="source.pipe(destination)";var Hp=async e=>{let[{status:t,reason:r,value:n=r},{status:s,reason:o,value:i=o}]=await e;if(i.pipedFrom.includes(n)||i.pipedFrom.push(n),s==="rejected")throw i;if(t==="rejected")throw n;return i};var Yp=require("node:stream/promises");var Xp=(e,t,r)=>{let n=As.has(t)?Q0(e,t):J0(e,t);return wt(e,tT,r.signal),wt(t,rT,r.signal),eT(t),n},J0=(e,t)=>{let r=_t([e]);return ur(r,t),As.set(t,r),r},Q0=(e,t)=>{let r=As.get(t);return r.add(e),r},eT=async e=>{try{await(0,Yp.finished)(e,{cleanup:!0,readable:!1,writable:!0})}catch{}As.delete(e)},As=new WeakMap,tT=2,rT=1;var Kp=require("node:util");var Jp=(e,t)=>e===void 0?[]:[nT(e,t)],nT=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:s,startTime:o})=>{await(0,Kp.aborted)(e,t),await r.remove(t);let i=new Error("Pipe canceled by `unpipeSignal` option.");throw ta({error:i,fileDescriptors:n,sourceOptions:s,startTime:o})};var Is=(e,...t)=>{if(W(t[0]))return Is.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...n}=zp(e,...t),s=sT({...n,destination:r});return s.pipe=Is.bind(void 0,{...e,source:r,sourcePromise:s,boundOptions:{}}),s},sT=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:s,destinationStream:o,destinationError:i,unpipeSignal:a,fileDescriptors:c,startTime:u})=>{let l=oT(e,s);Zp({sourceStream:t,sourceError:n,destinationStream:o,destinationError:i,fileDescriptors:c,sourceOptions:r,startTime:u});let f=new AbortController;try{let d=Xp(t,o,f);return await Promise.race([Hp(l),...Jp(a,{sourceStream:t,mergedStream:d,sourceOptions:r,fileDescriptors:c,startTime:u})])}finally{f.abort()}},oT=(e,t)=>Promise.allSettled([e,t]);var nm=require("node:timers/promises");var em=require("node:events"),tm=require("node:stream");var $s=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:s,preserveNewlines:o})=>{let i=new AbortController;return iT(t,i),rm({stream:e,controller:i,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:s,shouldSplit:!e.readableObjectMode,preserveNewlines:o})},iT=async(e,t)=>{try{await e}catch{}finally{t.abort()}},ra=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:s,allMixed:o})=>{let i=new AbortController;aT(t,i,e);let a=e.readableObjectMode&&!o;return rm({stream:e,controller:i,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!s})},aT=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},rm=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i})=>{let a=(0,em.on)(e,"data",{signal:t.signal,highWaterMark:Qp,highWatermark:Qp});return cT({onStdoutChunk:a,controller:t,binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i})},na=(0,tm.getDefaultHighWaterMark)(!0),Qp=na,cT=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i}){let a=uT({binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i});try{for await(let[c]of e)yield*vt(c,a,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*Br(a)}},uT=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:s})=>[ws(e,r,!t),bs(e,s,!n,{})].filter(Boolean);var sm=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:s,maxBuffer:o,lines:i,allMixed:a,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{let f=lT({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:a,verboseInfo:u,streamInfo:l});if(!s){await Promise.all([fT(e),f]);return}let d=$i(c,r),p=ra({stream:e,onStreamEnd:t,lines:i,encoding:n,stripFinalNewline:d,allMixed:a}),[b]=await Promise.all([dT({stream:e,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:i}),f]);return b},lT=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:s,verboseInfo:o,streamInfo:{fileDescriptors:i}})=>{var c;if(!vs({stdioItems:(c=i[r])==null?void 0:c.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=ra({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:s});await pp(a,e,r,o)},fT=async e=>{await(0,nm.setImmediate)(),e.readableFlowing===null&&e.resume()},dT=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:s,maxBuffer:o,lines:i})=>{try{return t||i?await as(r,{maxBuffer:o}):s==="buffer"?new Uint8Array(await cs(r,{maxBuffer:o})):await ls(r,{maxBuffer:o})}catch(a){return om(ld({error:a,stream:e,readableObjectMode:t,lines:i,encoding:s,fdNumber:n}))}},sa=async e=>{try{return await e}catch(t){return om(t)}},om=({bufferedData:e})=>eu(e)?new Uint8Array(e):e;var am=require("node:stream/promises"),Wr=async(e,t,r,{isSameDirection:n,stopOnExit:s=!1}={})=>{let o=pT(e,r),i=new AbortController;try{await Promise.race([...s?[r.exitPromise]:[],(0,am.finished)(e,{cleanup:!0,signal:i.signal})])}catch(a){o.stdinCleanedUp||gT(a,t,r,n)}finally{i.abort()}},pT=(e,{originalStreams:[t],subprocess:r})=>{let n={stdinCleanedUp:!1};return e===t&&mT(e,r,n),n},mT=(e,t,r)=>{let{_destroy:n}=e;e._destroy=(...s)=>{hT(t,r),n.call(e,...s)}},hT=({exitCode:e,signalCode:t},r)=>{(e!==null||t!==null)&&(r.stdinCleanedUp=!0)},gT=(e,t,r,n)=>{if(!yT(e,t,r,n))throw e},yT=(e,t,r,n=!0)=>r.propagating?im(e)||Ds(e):(r.propagating=!0,oa(r,t)===n?im(e):Ds(e)),oa=({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input",Ds=e=>(e==null?void 0:e.code)==="ERR_STREAM_PREMATURE_CLOSE",im=e=>(e==null?void 0:e.code)==="EPIPE";var cm=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:o,verboseInfo:i,streamInfo:a})=>e.stdio.map((c,u)=>ia({stream:c,fdNumber:u,encoding:t,buffer:r[u],maxBuffer:n[u],lines:s[u],allMixed:!1,stripFinalNewline:o,verboseInfo:i,streamInfo:a})),ia=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:s,lines:o,allMixed:i,stripFinalNewline:a,verboseInfo:c,streamInfo:u})=>{if(!e)return;let l=Wr(e,t,u);if(oa(u,t)){await l;return}let[f]=await Promise.all([sm({stream:e,onStreamEnd:l,fdNumber:t,encoding:r,buffer:n,maxBuffer:s,lines:o,allMixed:i,stripFinalNewline:a,verboseInfo:c,streamInfo:u}),l]);return f};var um=({stdout:e,stderr:t},{all:r})=>r&&(e||t)?_t([e,t].filter(Boolean)):void 0,lm=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:o,verboseInfo:i,streamInfo:a})=>ia({...bT(e,r),fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:s[1]||s[2],allMixed:wT(e),stripFinalNewline:o,verboseInfo:i,streamInfo:a}),bT=({stdout:e,stderr:t,all:r},[,n,s])=>{let o=n||s;return o?n?s?{stream:r,buffer:o}:{stream:e,buffer:o}:{stream:t,buffer:o}:{stream:r,buffer:o}},wT=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode;var hm=require("node:events");var fm=e=>Yt(e,"ipc"),dm=(e,t)=>{let r=Ln(e);je({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})};var pm=async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:s,verboseInfo:o})=>{if(!n)return s;let i=fm(o),a=Ke(t,"ipc"),c=Ke(r,"ipc");for await(let u of Bi({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(fd(e,s,c),s.push(u)),i&&dm(u,o);return s},mm=async(e,t)=>(await Promise.allSettled([e]),t);var gm=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:s,timeoutDuration:o,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:u,ipc:l,ipcInput:f},context:d,verboseInfo:p,fileDescriptors:b,originalStreams:T,onInternalError:N,controller:P})=>{let j=bp(e,d),Y={originalStreams:T,fileDescriptors:b,subprocess:e,exitPromise:j,propagating:!1},X=cm({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:u,verboseInfo:p,streamInfo:Y}),Se=lm({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:u,verboseInfo:p,streamInfo:Y}),ce=[],Ae=pm({subprocess:e,buffer:r,maxBuffer:n,ipc:l,ipcOutput:ce,verboseInfo:p}),Ie=ST(T,e,Y),xe=xT(b,Y);try{return await Promise.race([Promise.all([{},Sp(j),Promise.all(X),Se,Ae,Ff(e,f),...Ie,...xe]),N,vT(e,P),...Df(e,o,d,P),...zl({subprocess:e,cancelSignal:i,gracefulCancel:a,context:d,controller:P}),...Af({subprocess:e,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:c,context:d,controller:P})])}catch(kr){return d.terminationReason??="other",Promise.all([{error:kr},j,Promise.all(X.map(bt=>sa(bt))),sa(Se),mm(Ae,ce),Promise.allSettled(Ie),Promise.allSettled(xe)])}},ST=(e,t,r)=>e.map((n,s)=>n===t.stdio[s]?void 0:Wr(n,s,r)),xT=(e,t)=>e.flatMap(({stdioItems:r},n)=>r.filter(({value:s,stream:o=s})=>Pe(o,{checkOpen:!1})&&!De(o)).map(({type:s,value:o,stream:i=o})=>Wr(i,n,t,{isSameDirection:_e.has(s),stopOnExit:s==="native"}))),vT=async(e,{signal:t})=>{let[r]=await(0,hm.once)(e,"error",{signal:t});throw r};var ym=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Zr=(e,t,r)=>{let n=e[r];n.has(t)||n.set(t,[]);let s=n.get(t),o=Be();return s.push(o),{resolve:o.resolve.bind(o),promises:s}},lr=async({resolve:e,promises:t},r)=>{e();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n};var wm=require("node:stream"),Sm=require("node:util");var aa=require("node:stream/promises");var ca=async e=>{if(e!==void 0)try{await ua(e)}catch{}},bm=async e=>{if(e!==void 0)try{await la(e)}catch{}},ua=async e=>{await(0,aa.finished)(e,{cleanup:!0,readable:!1,writable:!0})},la=async e=>{await(0,aa.finished)(e,{cleanup:!0,readable:!0,writable:!1})},Ls=async(e,t)=>{if(await e,t)throw t},Ns=(e,t,r)=>{r&&!Ds(r)?e.destroy(r):t&&e.destroy()};var xm=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:s=!0,preserveNewlines:o=!0}={})=>{let i=s||me.has(r),{subprocessStdout:a,waitReadableDestroy:c}=fa(e,n,t),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:f}=da(a,i),{read:d,onStdoutDataDone:p}=pa({subprocessStdout:a,subprocess:e,binary:i,encoding:r,preserveNewlines:o}),b=new wm.Readable({read:d,destroy:(0,Sm.callbackify)(ha.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:c})),highWaterMark:f,objectMode:l,encoding:u});return ma({subprocessStdout:a,onStdoutDataDone:p,readable:b,subprocess:e}),b},fa=(e,t,r)=>{let n=tr(e,t),s=Zr(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:s}},da=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:na},pa=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:s})=>{let o=Be(),i=$s({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:s});return{read(){_T(this,i,o)},onStdoutDataDone:o}},_T=async(e,t,r)=>{try{let{value:n,done:s}=await t.next();s?r.resolve():e.push(n)}catch{}},ma=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:s})=>{try{await la(e),await n,await ca(s),await t,r.readable&&r.push(null)}catch(o){await ca(s),vm(r,o)}},ha=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await lr(r,t)&&(vm(e,n),await Ls(t,n))},vm=(e,t)=>{Ns(e,e.readable,t)};var _m=require("node:stream"),ga=require("node:util");var Em=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:s,waitWritableDestroy:o}=ya(e,r,t),i=new _m.Writable({...ba(n,e,s),destroy:(0,ga.callbackify)(Sa.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:s,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return wa(n,i),i},ya=(e,t,r)=>{let n=zn(e,t),s=Zr(r,n,"writableFinal"),o=Zr(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:s,waitWritableDestroy:o}},ba=(e,t,r)=>({write:ET.bind(void 0,e),final:(0,ga.callbackify)(TT.bind(void 0,e,t,r))}),ET=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},TT=async(e,t,r)=>{await lr(r,t)&&(e.writable&&e.end(),await t)},wa=async(e,t,r)=>{try{await ua(e),t.writable&&t.end()}catch(n){await bm(r),Tm(t,n)}},Sa=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},s)=>{await lr(r,t),await lr(n,t)&&(Tm(e,s),await Ls(t,s))},Tm=(e,t)=>{Ns(e,e.writable,t)};var Om=require("node:stream"),Rm=require("node:util");var km=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:s,binary:o=!0,preserveNewlines:i=!0}={})=>{let a=o||me.has(r),{subprocessStdout:c,waitReadableDestroy:u}=fa(e,n,t),{subprocessStdin:l,waitWritableFinal:f,waitWritableDestroy:d}=ya(e,s,t),{readableEncoding:p,readableObjectMode:b,readableHighWaterMark:T}=da(c,a),{read:N,onStdoutDataDone:P}=pa({subprocessStdout:c,subprocess:e,binary:a,encoding:r,preserveNewlines:i}),j=new Om.Duplex({read:N,...ba(l,e,f),destroy:(0,Rm.callbackify)(OT.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:e,waitReadableDestroy:u,waitWritableFinal:f,waitWritableDestroy:d})),readableHighWaterMark:T,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:b,writableObjectMode:l.writableObjectMode,encoding:p});return ma({subprocessStdout:c,onStdoutDataDone:P,readable:j,subprocess:e,subprocessStdin:l}),wa(l,j,c),j},OT=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:s,waitWritableDestroy:o},i)=>{await Promise.all([ha({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},i),Sa({subprocessStdin:t,subprocess:r,waitWritableFinal:s,waitWritableDestroy:o},i)])};var xa=(e,t,{from:r,binary:n=!1,preserveNewlines:s=!1}={})=>{let o=n||me.has(t),i=tr(e,r),a=$s({subprocessStdout:i,subprocess:e,binary:o,shouldEncode:!0,encoding:t,preserveNewlines:s});return RT(a,i,e)},RT=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}};var Cm=(e,{encoding:t})=>{let r=ym();e.readable=xm.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=Em.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=km.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=xa.bind(void 0,e,t),e[Symbol.asyncIterator]=xa.bind(void 0,e,t,{})};var Am=(e,t)=>{for(let[r,n]of CT){let s=n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:s})}},kT=(async()=>{})().constructor.prototype,CT=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(kT,e)]);var Dm=(e,t,r,n)=>{let{file:s,commandArguments:o,command:i,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:f}=AT(e,t,r),{subprocess:d,promise:p}=$T({file:s,commandArguments:o,options:l,startTime:c,verboseInfo:u,command:i,escapedCommand:a,fileDescriptors:f});return d.pipe=Is.bind(void 0,{source:d,sourcePromise:p,boundOptions:{},createNested:n}),Am(d,p),Ue.set(d,{options:l,fileDescriptors:f}),d},AT=(e,t,r)=>{let{command:n,escapedCommand:s,startTime:o,verboseInfo:i}=Pn(e,t,r),{file:a,commandArguments:c,options:u}=ns(e,t,r),l=IT(u),f=Lp(l,i);return{file:a,commandArguments:c,command:n,escapedCommand:s,startTime:o,verboseInfo:i,options:l,fileDescriptors:f}},IT=({timeout:e,signal:t,...r})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},$T=({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:s,command:o,escapedCommand:i,fileDescriptors:a})=>{let c;try{c=(0,$m.spawn)(e,t,r)}catch(b){return Ip({error:b,command:o,escapedCommand:i,fileDescriptors:a,options:r,startTime:n,verboseInfo:s})}let u=new AbortController;(0,Im.setMaxListeners)(Number.POSITIVE_INFINITY,u.signal);let l=[...c.stdio];Bp(c,a,u),qp(c,r,u);let f={},d=Be();c.kill=Gl.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:d,context:f,controller:u}),c.all=um(c,r),Cm(c,r),Rp(c,r);let p=DT({subprocess:c,options:r,startTime:n,verboseInfo:s,fileDescriptors:a,originalStreams:l,command:o,escapedCommand:i,context:f,onInternalError:d,controller:u});return{subprocess:c,promise:p}},DT=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:s,originalStreams:o,command:i,escapedCommand:a,context:c,onInternalError:u,controller:l})=>{let[f,[d,p],b,T,N]=await gm({subprocess:e,options:t,context:c,verboseInfo:n,fileDescriptors:s,originalStreams:o,onInternalError:u,controller:l});l.abort(),u.resolve();let P=b.map((X,Se)=>Qe(X,t,Se)),j=Qe(T,t,"all"),Y=LT({errorInfo:f,exitCode:d,signal:p,stdio:P,all:j,ipcOutput:N,context:c,options:t,command:i,escapedCommand:a,startTime:r});return or(Y,n,t)},LT=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:s,ipcOutput:o,context:i,options:a,command:c,escapedCommand:u,startTime:l})=>"error"in e?jr({error:e.error,command:c,escapedCommand:u,timedOut:i.terminationReason==="timeout",isCanceled:i.terminationReason==="cancel"||i.terminationReason==="gracefulCancel",isGracefullyCanceled:i.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof Ge,isForcefullyTerminated:i.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:s,ipcOutput:o,options:a,startTime:l,isSync:!1}):ds({command:c,escapedCommand:u,stdio:n,all:s,ipcOutput:o,options:a,startTime:l});var Ps=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([n,s])=>[n,NT(n,e[n],s)]));return{...e,...r}},NT=(e,t,r)=>PT.has(e)&&W(t)&&W(r)?{...t,...r}:r,PT=new Set(["env",...Uo]);var dt=(e,t,r,n)=>{let s=(i,a,c)=>dt(i,a,r,c),o=(...i)=>MT({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:s},...i);return n!==void 0&&n(o,s,t),o},MT=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:s},o,...i)=>{if(W(o))return s(e,Ps(r,o),n);let{file:a,commandArguments:c,options:u,isSync:l}=FT({mapArguments:e,firstArgument:o,nextArguments:i,deepOptions:t,boundOptions:r});return l?_p(a,c,u):Dm(a,c,u,s)},FT=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:s})=>{let o=au(t)?cu(t,r):[t,...r],[i,a,c]=_n(...o),u=Ps(Ps(n,s),c),{file:l=i,commandArguments:f=a,options:d=u,isSync:p=!1}=e({file:i,commandArguments:a,options:u});return{file:l,commandArguments:f,options:d,isSync:p}};var Lm=({file:e,commandArguments:t})=>Pm(e,t),Nm=({file:e,commandArguments:t})=>({...Pm(e,t),isSync:!0}),Pm=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[r,...n]=jT(e);return{file:r,commandArguments:n}},jT=e=>{if(typeof e!="string")throw new TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t==="")return[];let r=[];for(let n of t.split(BT)){let s=r.at(-1);s&&s.endsWith("\\")?r[r.length-1]=`${s.slice(0,-1)} ${n}`:r.push(n)}return r},BT=/ +/g;var Mm=(e,t,r)=>{e.sync=t(UT,r),e.s=e.sync},Fm=({options:e})=>jm(e),UT=({options:e})=>({...jm(e),isSync:!0}),jm=e=>({options:{...GT(e),...e}}),GT=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},Bm={preferLocal:!0};var Um=dt(()=>({})),oG=dt(()=>({isSync:!0})),iG=dt(Lm),aG=dt(Nm),cG=dt(Lf),uG=dt(Fm,{},Bm,Mm),{sendMessage:lG,getOneMessage:fG,getEachMessage:dG,getCancelSignal:pG}=kp();var Xw=require("fs"),Ao=require("path"),Io=q($g());var M;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{let o={};for(let i of s)o[i]=i;return o},e.getValidEnumValues=s=>{let o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(let a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(let i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(M||(M={}));var Ua;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Ua||(Ua={}));var S=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tt=e=>{switch(typeof e){case"undefined":return S.undefined;case"string":return S.string;case"number":return isNaN(e)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(e)?S.array:e===null?S.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?S.promise:typeof Map<"u"&&e instanceof Map?S.map:typeof Set<"u"&&e instanceof Set?S.set:typeof Date<"u"&&e instanceof Date?S.date:S.object;default:return S.unknown}},m=M.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"]),Fk=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),he=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return s(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};he.create=e=>new he(e);var hr=(e,t)=>{let r;switch(e.code){case m.invalid_type:e.received===S.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case m.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,M.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:r=`Unrecognized key(s) in object: ${M.joinValues(e.keys,", ")}`;break;case m.invalid_union:r="Invalid input";break;case m.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${M.joinValues(e.options)}`;break;case m.invalid_enum_value:r=`Invalid enum value. Expected ${M.joinValues(e.options)}, received '${e.received}'`;break;case m.invalid_arguments:r="Invalid function arguments";break;case m.invalid_return_type:r="Invalid function return type";break;case m.invalid_date:r="Invalid date";break;case m.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:M.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case m.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case m.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case m.custom:r="Invalid input";break;case m.invalid_intersection_types:r="Intersection results could not be merged";break;case m.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case m.not_finite:r="Number must be finite";break;default:r=t.defaultError,M.assertNever(e)}return{message:r}},Pg=hr;function jk(e){Pg=e}function Hs(){return Pg}var Ys=e=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},Bk=[];function y(e,t){let r=Hs(),n=Ys({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===hr?void 0:hr].filter(s=>!!s)});e.common.issues.push(n)}var te=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let s of r){if(s.status==="aborted")return k;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let s of r){let o=await s.key,i=await s.value;n.push({key:o,value:i})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let s of r){let{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return k;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}},k=Object.freeze({status:"aborted"}),mr=e=>({status:"dirty",value:e}),ie=e=>({status:"valid",value:e}),Ga=e=>e.status==="aborted",qa=e=>e.status==="dirty",Ot=e=>e.status==="valid",nn=e=>typeof Promise<"u"&&e instanceof Promise;function Xs(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Mg(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r}var _;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(_||(_={}));var tn,rn,Re=class{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Dg=(e,t)=>{if(Ot(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new he(e.common.issues);return this._error=r,this._error}}};function $(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,a)=>{var c,u;let{message:l}=e;return i.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:(c=l??n)!==null&&c!==void 0?c:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(u=l??r)!==null&&u!==void 0?u:a.defaultError}},description:s}}var D=class{get description(){return this._def.description}_getType(t){return tt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:tt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new te,ctx:{common:t.parent.common,data:t.data,parsedType:tt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(nn(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let s={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tt(t)},o=this._parseSync({data:t,path:s.path,parent:s});return Dg(s,o)}"~validate"(t){var r,n;let s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tt(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:s});return Ot(o)?{value:o.value}:{issues:s.common.issues}}catch(o){!((n=(r=o==null?void 0:o.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:s}).then(o=>Ot(o)?{value:o.value}:{issues:s.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tt(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(nn(s)?s:Promise.resolve(s));return Dg(n,o)}refine(t,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{let i=t(s),a=()=>o.addIssue({code:m.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new ge({schema:this,typeName:R.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:r=>this["~validate"](r)}}optional(){return Oe.create(this,this._def)}nullable(){return Ze.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return nt.create(this)}promise(){return ht.create(this,this._def)}or(t){return Dt.create([this,t],this._def)}and(t){return Lt.create(this,t,this._def)}transform(t){return new ge({...$(this._def),schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new jt({...$(this._def),innerType:this,defaultValue:r,typeName:R.ZodDefault})}brand(){return new sn({typeName:R.ZodBranded,type:this,...$(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Bt({...$(this._def),innerType:this,catchValue:r,typeName:R.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return on.create(this,t)}readonly(){return Ut.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Uk=/^c[^\s-]{8,}$/i,Gk=/^[0-9a-z]+$/,qk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Vk=/^[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,zk=/^[a-z0-9_-]{21}$/i,Wk=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Zk=/^[-+]?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)?)??$/,Hk=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Yk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ba,Xk=/^(?:(?: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])$/,Kk=/^(?:(?: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])$/,Jk=/^(([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]))$/,Qk=/^(([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])$/,eC=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tC=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fg="((\\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])))",rC=new RegExp(`^${Fg}$`);function jg(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function nC(e){return new RegExp(`^${jg(e)}$`)}function Bg(e){let t=`${Fg}T${jg(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function sC(e,t){return!!((t==="v4"||!t)&&Xk.test(e)||(t==="v6"||!t)&&Jk.test(e))}function oC(e,t){if(!Wk.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||!s.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function iC(e,t){return!!((t==="v4"||!t)&&Kk.test(e)||(t==="v6"||!t)&&Qk.test(e))}var pt=class e extends D{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==S.string){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_type,expected:S.string,received:o.parsedType}),k}let n=new te,s;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let i=t.data.length>o.value,a=t.data.length<o.value;(i||a)&&(s=this._getOrReturnCtx(t,s),i?y(s,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&y(s,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Hk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"email",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Ba||(Ba=new RegExp(Yk,"u")),Ba.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"emoji",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Vk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"uuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")zk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"nanoid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")Uk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"cuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Gk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"cuid2",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")qk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"ulid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),y(s,{validation:"url",code:m.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"regex",code:m.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Bg(o).test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?rC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?nC(o).test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Zk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"duration",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?sC(t.data,o.version)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"ip",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?oC(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"jwt",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?iC(t.data,o.version)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"cidr",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?eC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"base64",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?tC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"base64url",code:m.invalid_string,message:o.message}),n.dirty()):M.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:m.invalid_string,..._.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",..._.errToObj(t)})}url(t){return this._addCheck({kind:"url",..._.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",..._.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",..._.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",..._.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",..._.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",..._.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",..._.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",..._.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",..._.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",..._.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",..._.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",..._.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,..._.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,..._.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",..._.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,..._.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,..._.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,..._.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,..._.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,..._.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,..._.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,..._.errToObj(r)})}nonempty(t){return this.min(1,_.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};pt.create=e=>{var t;return new pt({checks:[],typeName:R.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...$(e)})};function aC(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}var Rt=class e extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==S.number){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_type,expected:S.number,received:o.parsedType}),k}let n,s=new te;for(let o of this._def.checks)o.kind==="int"?M.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),y(n,{code:m.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?aC(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),y(n,{code:m.not_finite,message:o.message}),s.dirty()):M.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,_.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:_.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:_.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&M.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Rt.create=e=>new Rt({checks:[],typeName:R.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...$(e)});var kt=class e extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==S.bigint)return this._getInvalidInput(t);let n,s=new te;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):M.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return y(r,{code:m.invalid_type,expected:S.bigint,received:r.parsedType}),k}gte(t,r){return this.setLimit("min",t,!0,_.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};kt.create=e=>{var t;return new kt({checks:[],typeName:R.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...$(e)})};var Ct=class extends D{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==S.boolean){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.boolean,received:n.parsedType}),k}return ie(t.data)}};Ct.create=e=>new Ct({typeName:R.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...$(e)});var At=class e extends D{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==S.date){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_type,expected:S.date,received:o.parsedType}),k}if(isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_date}),k}let n=new te,s;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):M.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:_.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:_.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};At.create=e=>new At({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:R.ZodDate,...$(e)});var gr=class extends D{_parse(t){if(this._getType(t)!==S.symbol){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.symbol,received:n.parsedType}),k}return ie(t.data)}};gr.create=e=>new gr({typeName:R.ZodSymbol,...$(e)});var It=class extends D{_parse(t){if(this._getType(t)!==S.undefined){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.undefined,received:n.parsedType}),k}return ie(t.data)}};It.create=e=>new It({typeName:R.ZodUndefined,...$(e)});var $t=class extends D{_parse(t){if(this._getType(t)!==S.null){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.null,received:n.parsedType}),k}return ie(t.data)}};$t.create=e=>new $t({typeName:R.ZodNull,...$(e)});var mt=class extends D{constructor(){super(...arguments),this._any=!0}_parse(t){return ie(t.data)}};mt.create=e=>new mt({typeName:R.ZodAny,...$(e)});var rt=class extends D{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ie(t.data)}};rt.create=e=>new rt({typeName:R.ZodUnknown,...$(e)});var Me=class extends D{_parse(t){let r=this._getOrReturnCtx(t);return y(r,{code:m.invalid_type,expected:S.never,received:r.parsedType}),k}};Me.create=e=>new Me({typeName:R.ZodNever,...$(e)});var yr=class extends D{_parse(t){if(this._getType(t)!==S.undefined){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.void,received:n.parsedType}),k}return ie(t.data)}};yr.create=e=>new yr({typeName:R.ZodVoid,...$(e)});var nt=class e extends D{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==S.array)return y(r,{code:m.invalid_type,expected:S.array,received:r.parsedType}),k;if(s.exactLength!==null){let i=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(i||a)&&(y(r,{code:i?m.too_big:m.too_small,minimum:a?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(y(r,{code:m.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(y(r,{code:m.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>s.type._parseAsync(new Re(r,i,r.path,a)))).then(i=>te.mergeArray(n,i));let o=[...r.data].map((i,a)=>s.type._parseSync(new Re(r,i,r.path,a)));return te.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:_.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:_.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:_.toString(r)}})}nonempty(t){return this.min(1,t)}};nt.create=(e,t)=>new nt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...$(t)});function pr(e){if(e instanceof le){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Oe.create(pr(n))}return new le({...e._def,shape:()=>t})}else return e instanceof nt?new nt({...e._def,type:pr(e.element)}):e instanceof Oe?Oe.create(pr(e.unwrap())):e instanceof Ze?Ze.create(pr(e.unwrap())):e instanceof We?We.create(e.items.map(t=>pr(t))):e}var le=class e extends D{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=M.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==S.object){let u=this._getOrReturnCtx(t);return y(u,{code:m.invalid_type,expected:S.object,received:u.parsedType}),k}let{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Me&&this._def.unknownKeys==="strip"))for(let u in s.data)i.includes(u)||a.push(u);let c=[];for(let u of i){let l=o[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Re(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Me){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:s.data[l]}});else if(u==="strict")a.length>0&&(y(s,{code:m.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let f=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Re(s,f,s.path,l)),alwaysSet:l in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let f=await l.key,d=await l.value;u.push({key:f,value:d,alwaysSet:l.alwaysSet})}return u}).then(u=>te.mergeObjectSync(n,u)):te.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return _.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,o,i,a;let c=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=_.errToObj(t).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:R.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return M.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return M.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}deepPartial(){return pr(this)}partial(t){let r={};return M.objectKeys(this.shape).forEach(n=>{let s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return M.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Oe;)o=o._def.innerType;r[n]=o}}),new e({...this._def,shape:()=>r})}keyof(){return Ug(M.objectKeys(this.shape))}};le.create=(e,t)=>new le({shape:()=>e,unknownKeys:"strip",catchall:Me.create(),typeName:R.ZodObject,...$(t)});le.strictCreate=(e,t)=>new le({shape:()=>e,unknownKeys:"strict",catchall:Me.create(),typeName:R.ZodObject,...$(t)});le.lazycreate=(e,t)=>new le({shape:e,unknownKeys:"strip",catchall:Me.create(),typeName:R.ZodObject,...$(t)});var Dt=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let i=o.map(a=>new he(a.ctx.common.issues));return y(r,{code:m.invalid_union,unionErrors:i}),k}if(r.common.async)return Promise.all(n.map(async o=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o,i=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=i.map(c=>new he(c));return y(r,{code:m.invalid_union,unionErrors:a}),k}}get options(){return this._def.options}};Dt.create=(e,t)=>new Dt({options:e,typeName:R.ZodUnion,...$(t)});var et=e=>e instanceof Nt?et(e.schema):e instanceof ge?et(e.innerType()):e instanceof Pt?[e.value]:e instanceof Mt?e.options:e instanceof Ft?M.objectValues(e.enum):e instanceof jt?et(e._def.innerType):e instanceof It?[void 0]:e instanceof $t?[null]:e instanceof Oe?[void 0,...et(e.unwrap())]:e instanceof Ze?[null,...et(e.unwrap())]:e instanceof sn||e instanceof Ut?et(e.unwrap()):e instanceof Bt?et(e._def.innerType):[],Ks=class e extends D{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.object)return y(r,{code:m.invalid_type,expected:S.object,received:r.parsedType}),k;let n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(y(r,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),k)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let s=new Map;for(let o of r){let i=et(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new e({typeName:R.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...$(n)})}};function Va(e,t){let r=tt(e),n=tt(t);if(e===t)return{valid:!0,data:e};if(r===S.object&&n===S.object){let s=M.objectKeys(t),o=M.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(let a of o){let c=Va(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===S.array&&n===S.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let i=e[o],a=t[o],c=Va(i,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===S.date&&n===S.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Lt=class extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=(o,i)=>{if(Ga(o)||Ga(i))return k;let a=Va(o.value,i.value);return a.valid?((qa(o)||qa(i))&&r.dirty(),{status:r.value,value:a.data}):(y(n,{code:m.invalid_intersection_types}),k)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Lt.create=(e,t,r)=>new Lt({left:e,right:t,typeName:R.ZodIntersection,...$(r)});var We=class e extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.array)return y(n,{code:m.invalid_type,expected:S.array,received:n.parsedType}),k;if(n.data.length<this._def.items.length)return y(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Re(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>te.mergeArray(r,i)):te.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};We.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new We({items:e,typeName:R.ZodTuple,rest:null,...$(t)})};var Js=class e extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.object)return y(n,{code:m.invalid_type,expected:S.object,received:n.parsedType}),k;let s=[],o=this._def.keyType,i=this._def.valueType;for(let a in n.data)s.push({key:o._parse(new Re(n,a,n.path,a)),value:i._parse(new Re(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?te.mergeObjectAsync(r,s):te.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof D?new e({keyType:t,valueType:r,typeName:R.ZodRecord,...$(n)}):new e({keyType:pt.create(),valueType:t,typeName:R.ZodRecord,...$(r)})}},br=class extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.map)return y(n,{code:m.invalid_type,expected:S.map,received:n.parsedType}),k;let s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([a,c],u)=>({key:s._parse(new Re(n,a,n.path,[u,"key"])),value:o._parse(new Re(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return k;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return k;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};br.create=(e,t,r)=>new br({valueType:t,keyType:e,typeName:R.ZodMap,...$(r)});var wr=class e extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.set)return y(n,{code:m.invalid_type,expected:S.set,received:n.parsedType}),k;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(y(n,{code:m.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(y(n,{code:m.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let o=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return k;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>o._parse(new Re(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:_.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:_.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};wr.create=(e,t)=>new wr({valueType:e,minSize:null,maxSize:null,typeName:R.ZodSet,...$(t)});var Qs=class e extends D{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.function)return y(r,{code:m.invalid_type,expected:S.function,received:r.parsedType}),k;function n(a,c){return Ys({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hs(),hr].filter(u=>!!u),issueData:{code:m.invalid_arguments,argumentsError:c}})}function s(a,c){return Ys({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hs(),hr].filter(u=>!!u),issueData:{code:m.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof ht){let a=this;return ie(async function(...c){let u=new he([]),l=await a._def.args.parseAsync(c,o).catch(p=>{throw u.addIssue(n(c,p)),u}),f=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(f,o).catch(p=>{throw u.addIssue(s(f,p)),u})})}else{let a=this;return ie(function(...c){let u=a._def.args.safeParse(c,o);if(!u.success)throw new he([n(c,u.error)]);let l=Reflect.apply(i,this,u.data),f=a._def.returns.safeParse(l,o);if(!f.success)throw new he([s(l,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:We.create(t).rest(rt.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||We.create([]).rest(rt.create()),returns:r||rt.create(),typeName:R.ZodFunction,...$(n)})}},Nt=class extends D{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Nt.create=(e,t)=>new Nt({getter:e,typeName:R.ZodLazy,...$(t)});var Pt=class extends D{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return y(r,{received:r.data,code:m.invalid_literal,expected:this._def.value}),k}return{status:"valid",value:t.data}}get value(){return this._def.value}};Pt.create=(e,t)=>new Pt({value:e,typeName:R.ZodLiteral,...$(t)});function Ug(e,t){return new Mt({values:e,typeName:R.ZodEnum,...$(t)})}var Mt=class e extends D{constructor(){super(...arguments),tn.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return y(r,{expected:M.joinValues(n),received:r.parsedType,code:m.invalid_type}),k}if(Xs(this,tn,"f")||Mg(this,tn,new Set(this._def.values),"f"),!Xs(this,tn,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return y(r,{received:r.data,code:m.invalid_enum_value,options:n}),k}return ie(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};tn=new WeakMap;Mt.create=Ug;var Ft=class extends D{constructor(){super(...arguments),rn.set(this,void 0)}_parse(t){let r=M.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==S.string&&n.parsedType!==S.number){let s=M.objectValues(r);return y(n,{expected:M.joinValues(s),received:n.parsedType,code:m.invalid_type}),k}if(Xs(this,rn,"f")||Mg(this,rn,new Set(M.getValidEnumValues(this._def.values)),"f"),!Xs(this,rn,"f").has(t.data)){let s=M.objectValues(r);return y(n,{received:n.data,code:m.invalid_enum_value,options:s}),k}return ie(t.data)}get enum(){return this._def.values}};rn=new WeakMap;Ft.create=(e,t)=>new Ft({values:e,typeName:R.ZodNativeEnum,...$(t)});var ht=class extends D{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.promise&&r.common.async===!1)return y(r,{code:m.invalid_type,expected:S.promise,received:r.parsedType}),k;let n=r.parsedType===S.promise?r.data:Promise.resolve(r.data);return ie(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ht.create=(e,t)=>new ht({type:e,typeName:R.ZodPromise,...$(t)});var ge=class extends D{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{y(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return k;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?k:c.status==="dirty"||r.value==="dirty"?mr(c.value):c});{if(r.value==="aborted")return k;let a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?k:a.status==="dirty"||r.value==="dirty"?mr(a.value):a}}if(s.type==="refinement"){let i=a=>{let c=s.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?k:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?k:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ot(i))return i;let a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ot(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:r.value,value:a})):i);M.assertNever(s)}};ge.create=(e,t,r)=>new ge({schema:e,typeName:R.ZodEffects,effect:t,...$(r)});ge.createWithPreprocess=(e,t,r)=>new ge({schema:t,effect:{type:"preprocess",transform:e},typeName:R.ZodEffects,...$(r)});var Oe=class extends D{_parse(t){return this._getType(t)===S.undefined?ie(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Oe.create=(e,t)=>new Oe({innerType:e,typeName:R.ZodOptional,...$(t)});var Ze=class extends D{_parse(t){return this._getType(t)===S.null?ie(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ze.create=(e,t)=>new Ze({innerType:e,typeName:R.ZodNullable,...$(t)});var jt=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===S.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};jt.create=(e,t)=>new jt({innerType:e,typeName:R.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...$(t)});var Bt=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return nn(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new he(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new he(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Bt.create=(e,t)=>new Bt({innerType:e,typeName:R.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...$(t)});var Sr=class extends D{_parse(t){if(this._getType(t)!==S.nan){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.nan,received:n.parsedType}),k}return{status:"valid",value:t.data}}};Sr.create=e=>new Sr({typeName:R.ZodNaN,...$(e)});var cC=Symbol("zod_brand"),sn=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},on=class e extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?k:o.status==="dirty"?(r.dirty(),mr(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?k:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:R.ZodPipeline})}},Ut=class extends D{_parse(t){let r=this._def.innerType._parse(t),n=s=>(Ot(s)&&(s.value=Object.freeze(s.value)),s);return nn(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};Ut.create=(e,t)=>new Ut({innerType:e,typeName:R.ZodReadonly,...$(t)});function Lg(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Gg(e,t={},r){return e?mt.create().superRefine((n,s)=>{var o,i;let a=e(n);if(a instanceof Promise)return a.then(c=>{var u,l;if(!c){let f=Lg(t,n),d=(l=(u=f.fatal)!==null&&u!==void 0?u:r)!==null&&l!==void 0?l:!0;s.addIssue({code:"custom",...f,fatal:d})}});if(!a){let c=Lg(t,n),u=(i=(o=c.fatal)!==null&&o!==void 0?o:r)!==null&&i!==void 0?i:!0;s.addIssue({code:"custom",...c,fatal:u})}}):mt.create()}var uC={object:le.lazycreate},R;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(R||(R={}));var lC=(e,t={message:`Input not instance of ${e.name}`})=>Gg(r=>r instanceof e,t),qg=pt.create,Vg=Rt.create,fC=Sr.create,dC=kt.create,zg=Ct.create,pC=At.create,mC=gr.create,hC=It.create,gC=$t.create,yC=mt.create,bC=rt.create,wC=Me.create,SC=yr.create,xC=nt.create,vC=le.create,_C=le.strictCreate,EC=Dt.create,TC=Ks.create,OC=Lt.create,RC=We.create,kC=Js.create,CC=br.create,AC=wr.create,IC=Qs.create,$C=Nt.create,DC=Pt.create,LC=Mt.create,NC=Ft.create,PC=ht.create,Ng=ge.create,MC=Oe.create,FC=Ze.create,jC=ge.createWithPreprocess,BC=on.create,UC=()=>qg().optional(),GC=()=>Vg().optional(),qC=()=>zg().optional(),VC={string:e=>pt.create({...e,coerce:!0}),number:e=>Rt.create({...e,coerce:!0}),boolean:e=>Ct.create({...e,coerce:!0}),bigint:e=>kt.create({...e,coerce:!0}),date:e=>At.create({...e,coerce:!0})},zC=k,st=Object.freeze({__proto__:null,defaultErrorMap:hr,setErrorMap:jk,getErrorMap:Hs,makeIssue:Ys,EMPTY_PATH:Bk,addIssueToContext:y,ParseStatus:te,INVALID:k,DIRTY:mr,OK:ie,isAborted:Ga,isDirty:qa,isValid:Ot,isAsync:nn,get util(){return M},get objectUtil(){return Ua},ZodParsedType:S,getParsedType:tt,ZodType:D,datetimeRegex:Bg,ZodString:pt,ZodNumber:Rt,ZodBigInt:kt,ZodBoolean:Ct,ZodDate:At,ZodSymbol:gr,ZodUndefined:It,ZodNull:$t,ZodAny:mt,ZodUnknown:rt,ZodNever:Me,ZodVoid:yr,ZodArray:nt,ZodObject:le,ZodUnion:Dt,ZodDiscriminatedUnion:Ks,ZodIntersection:Lt,ZodTuple:We,ZodRecord:Js,ZodMap:br,ZodSet:wr,ZodFunction:Qs,ZodLazy:Nt,ZodLiteral:Pt,ZodEnum:Mt,ZodNativeEnum:Ft,ZodPromise:ht,ZodEffects:ge,ZodTransformer:ge,ZodOptional:Oe,ZodNullable:Ze,ZodDefault:jt,ZodCatch:Bt,ZodNaN:Sr,BRAND:cC,ZodBranded:sn,ZodPipeline:on,ZodReadonly:Ut,custom:Gg,Schema:D,ZodSchema:D,late:uC,get ZodFirstPartyTypeKind(){return R},coerce:VC,any:yC,array:xC,bigint:dC,boolean:zg,date:pC,discriminatedUnion:TC,effect:Ng,enum:LC,function:IC,instanceof:lC,intersection:OC,lazy:$C,literal:DC,map:CC,nan:fC,nativeEnum:NC,never:wC,null:gC,nullable:FC,number:Vg,object:vC,oboolean:qC,onumber:GC,optional:MC,ostring:UC,pipeline:BC,preprocess:jC,promise:PC,record:kC,set:AC,strictObject:_C,string:qg,symbol:mC,transformer:Ng,tuple:RC,undefined:hC,union:EC,unknown:bC,void:SC,NEVER:zC,ZodIssueCode:m,quotelessJson:Fk,ZodError:he});var Wg=st.object({list:st.boolean().optional(),log:st.boolean().optional(),track:st.boolean().optional(),parser:st.enum(["babel","babylon","flow","ts","tsx"]).optional(),extensions:st.string().optional(),ignoreConfig:st.string().optional(),match:st.any().optional()});var wo=q(oy(),1),ho=q(Ha(),1),Ib=require("child_process"),mw=q(Xa(),1),Tr=q(Xa(),1),Bw=require("node:events"),yo=Object.defineProperty,vA=Object.defineProperties,_A=Object.getOwnPropertyDescriptor,EA=Object.getOwnPropertyDescriptors,gc=Object.getOwnPropertyNames,iy=Object.getOwnPropertySymbols,jy=Object.prototype.hasOwnProperty,TA=Object.prototype.propertyIsEnumerable,ay=(e,t,r)=>t in e?yo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ce=(e,t)=>{for(var r in t||(t={}))jy.call(t,r)&&ay(e,r,t[r]);if(iy)for(var r of iy(t))TA.call(t,r)&&ay(e,r,t[r]);return e},un=(e,t)=>vA(e,EA(t)),g=(e,t)=>function(){return e&&(t=(0,e[gc(e)[0]])(e=0)),t},OA=(e,t)=>function(){return t||(0,e[gc(e)[0]])((t={exports:{}}).exports,t),t.exports},H=(e,t)=>{for(var r in t)yo(e,r,{get:t[r],enumerable:!0})},RA=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of gc(t))!jy.call(e,s)&&s!==r&&yo(e,s,{get:()=>t[s],enumerable:!(n=_A(t,s))||n.enumerable});return e},V=e=>RA(yo({},"__esModule",{value:!0}),e),cn=(e,t,r)=>new Promise((n,s)=>{var o=c=>{try{a(r.next(c))}catch(u){s(u)}},i=c=>{try{a(r.throw(c))}catch(u){s(u)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,i);a((r=r.apply(e,t)).next())});function kA(...e){let t=new String(e);return bo.set(t,e),t}function po(e){return e instanceof String&&bo.has(e)}function cy(e){return bo.get(e)||[]}var bo,pn=g({"src/lib/args/pathspec.ts"(){"use strict";bo=new WeakMap}}),it,yt=g({"src/lib/errors/git-error.ts"(){"use strict";it=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),mn,Rr=g({"src/lib/errors/git-response-error.ts"(){"use strict";yt(),mn=class extends it{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),By,Uy=g({"src/lib/errors/task-configuration-error.ts"(){"use strict";yt(),By=class extends it{constructor(e){super(void 0,e)}}}});function Gy(e){return typeof e=="function"?e:Wt}function qy(e){return typeof e=="function"&&e!==Wt}function Vy(e,t){let r=e.indexOf(t);return r<=0?[e,""]:[e.substr(0,r),e.substr(r+1)]}function zy(e,t=0){return Wy(e)&&e.length>t?e[t]:void 0}function zt(e,t=0){if(Wy(e)&&e.length>t)return e[e.length-1-t]}function Wy(e){return!!(e&&typeof e.length=="number")}function hn(e="",t=!0,r=`
|
56
56
|
`){return e.split(r).reduce((n,s)=>{let o=t?s.trim():s;return o&&n.push(o),n},[])}function yc(e,t){return hn(e,!0).map(r=>t(r))}function bc(e){return(0,wo.exists)(e,wo.FOLDER)}function F(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Zy(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function So(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function He(e){return Array.isArray(e)?e:[e]}function Hy(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function Yy(e){return He(e).map(String)}function U(e,t=0){if(e==null)return t;let r=parseInt(e,10);return isNaN(r)?t:r}function ln(e,t){let r=[];for(let n=0,s=e.length;n<s;n++)r.push(t,e[n]);return r}function fn(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function Xy(e,t){return Object.assign({},...t.map(r=>r in e?{[r]:e[r]}:{}))}function nc(e=0){return new Promise(t=>setTimeout(t,e))}function sc(e){if(e!==!1)return e}var Or,Wt,gn,xo=g({"src/lib/utils/util.ts"(){"use strict";Or="\0",Wt=()=>{},gn=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Ye(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function wc(e,t){let r=po(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function Sc(e){return!!e&&gn(e)==="[object Object]"}function Ky(e){return typeof e=="function"}var yn,re,Jy,mo,xc,Qy=g({"src/lib/utils/argument-filters.ts"(){"use strict";xo(),pn(),yn=e=>Array.isArray(e),re=e=>typeof e=="string",Jy=e=>Array.isArray(e)&&e.every(re),mo=e=>re(e)||Array.isArray(e)&&e.every(re),xc=e=>e==null||"number|boolean|function".includes(typeof e)?!1:Array.isArray(e)||typeof e=="string"||typeof e.length=="number"}}),oc,CA=g({"src/lib/utils/exit-codes.ts"(){"use strict";oc=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(oc||{})}}),dn,AA=g({"src/lib/utils/git-output-streams.ts"(){"use strict";dn=class{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new dn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),I,gt,IA=g({"src/lib/utils/line-parser.ts"(){"use strict";I=class{constructor(e,t){this.matches=[],this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((s,o)=>this.addMatch(s,o,r(o)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}useMatches(e,t){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let n=r&&e.exec(r);return n&&this.pushMatch(t,n),!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},gt=class extends I{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function eb(...e){let t=process.cwd(),r=Object.assign(Ce({baseDir:t},tb),...e.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var tb,$A=g({"src/lib/utils/simple-git-options.ts"(){"use strict";tb={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function vc(e,t=[]){return Sc(e)?Object.keys(e).reduce((r,n)=>{let s=e[n];return po(s)?r.push(s):wc(s,["boolean"])?r.push(n+"="+s):r.push(n),r},t):t}function fe(e,t=0,r=!1){let n=[];for(let s=0,o=t<0?e.length:t;s<o;s++)"string|number".includes(typeof e[s])&&n.push(String(e[s]));return vc(_c(e),n),r||n.push(...DA(e)),n}function DA(e){let t=typeof zt(e)=="function";return Ye(zt(e,t?1:0),yn,[])}function _c(e){let t=Ky(zt(e));return Ye(zt(e,t?1:0),Sc)}function z(e,t=!0){let r=Gy(zt(e));return t||qy(r)?r:void 0}var LA=g({"src/lib/utils/task-options.ts"(){"use strict";Qy(),xo(),pn()}});function ic(e,t){return e(t.stdOut,t.stdErr)}function pe(e,t,r,n=!0){return He(r).forEach(s=>{for(let o=hn(s,n),i=0,a=o.length;i<a;i++){let c=(u=0)=>{if(!(i+u>=a))return o[i+u]};t.some(({parse:u})=>u(c,e))}}),e}var NA=g({"src/lib/utils/task-parser.ts"(){"use strict";xo()}}),rb={};H(rb,{ExitCodes:()=>oc,GitOutputStreams:()=>dn,LineParser:()=>I,NOOP:()=>Wt,NULL:()=>Or,RemoteLineParser:()=>gt,append:()=>F,appendTaskOptions:()=>vc,asArray:()=>He,asCamelCase:()=>Hy,asFunction:()=>Gy,asNumber:()=>U,asStringArray:()=>Yy,bufferToString:()=>fn,callTaskParser:()=>ic,createInstanceConfig:()=>eb,delay:()=>nc,filterArray:()=>yn,filterFunction:()=>Ky,filterHasLength:()=>xc,filterPlainObject:()=>Sc,filterPrimitives:()=>wc,filterString:()=>re,filterStringArray:()=>Jy,filterStringOrStringArray:()=>mo,filterType:()=>Ye,first:()=>zy,folderExists:()=>bc,forEachLineWithContent:()=>yc,getTrailingOptions:()=>fe,including:()=>Zy,isUserFunction:()=>qy,last:()=>zt,objectToString:()=>gn,orVoid:()=>sc,parseStringResponse:()=>pe,pick:()=>Xy,prefixedArray:()=>ln,remove:()=>So,splitOn:()=>Vy,toLinesWithContent:()=>hn,trailingFunctionArgument:()=>z,trailingOptionsArgument:()=>_c});var C=g({"src/lib/utils/index.ts"(){"use strict";Qy(),CA(),AA(),IA(),$A(),LA(),NA(),xo()}}),nb={};H(nb,{CheckRepoActions:()=>ac,checkIsBareRepoTask:()=>ob,checkIsRepoRootTask:()=>sb,checkIsRepoTask:()=>PA});function PA(e){switch(e){case"bare":return ob();case"root":return sb()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:vo,parser:Ec}}function sb(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:vo,parser(t){return/^\.(git)?$/.test(t.trim())}}}function ob(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:vo,parser:Ec}}function MA(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var ac,vo,Ec,ib=g({"src/lib/tasks/check-is-repo.ts"(){"use strict";C(),ac=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(ac||{}),vo=({exitCode:e},t,r,n)=>{if(e===128&&MA(t))return r(Buffer.from("false"));n(t)},Ec=e=>e.trim()==="true"}});function FA(e,t){let r=new ab(e),n=e?ub:cb;return hn(t).forEach(s=>{let o=s.replace(n,"");r.paths.push(o),(lb.test(o)?r.folders:r.files).push(o)}),r}var ab,cb,ub,lb,jA=g({"src/lib/responses/CleanSummary.ts"(){"use strict";C(),ab=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},cb=/^[a-z]+\s*/i,ub=/^[a-z]+\s+[a-z]+\s*/i,lb=/\/$/}}),cc={};H(cc,{EMPTY_COMMANDS:()=>_o,adhocExecTask:()=>fb,configurationErrorTask:()=>de,isBufferTask:()=>pb,isEmptyTask:()=>mb,straightThroughBufferTask:()=>db,straightThroughStringTask:()=>ae});function fb(e){return{commands:_o,format:"empty",parser:e}}function de(e){return{commands:_o,format:"empty",parser(){throw typeof e=="string"?new By(e):e}}}function ae(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function db(e){return{commands:e,format:"buffer",parser(t){return t}}}function pb(e){return e.format==="buffer"}function mb(e){return e.format==="empty"||!e.commands.length}var _o,Z=g({"src/lib/tasks/task.ts"(){"use strict";Uy(),_o=[]}}),hb={};H(hb,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Tc,CONFIG_ERROR_MODE_REQUIRED:()=>Oc,CONFIG_ERROR_UNKNOWN_OPTION:()=>Rc,CleanOptions:()=>co,cleanTask:()=>gb,cleanWithOptionsTask:()=>BA,isCleanOptionsArray:()=>UA});function BA(e,t){let{cleanMode:r,options:n,valid:s}=GA(e);return r?s.options?(n.push(...t),n.some(zA)?de(Tc):gb(r,n)):de(Rc+JSON.stringify(e)):de(Oc)}function gb(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(n){return FA(e==="n",n)}}}function UA(e){return Array.isArray(e)&&e.every(t=>kc.has(t))}function GA(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(s=>{qA(s)?(t=s,n.cleanMode=!0):n.options=n.options&&VA(r[r.length]=`-${s}`)}),{cleanMode:t,options:r,valid:n}}function qA(e){return e==="f"||e==="n"}function VA(e){return/^-[a-z]$/i.test(e)&&kc.has(e.charAt(1))}function zA(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}var Tc,Oc,Rc,co,kc,yb=g({"src/lib/tasks/clean.ts"(){"use strict";jA(),C(),Z(),Tc="Git clean interactive mode is not supported",Oc='Git clean mode parameter ("n" or "f") is required',Rc="Git clean unknown option found in: ",co=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(co||{}),kc=new Set(["i",...Yy(Object.values(co))])}});function WA(e){let t=new wb;for(let r of bb(e))t.addValue(r.file,String(r.key),r.value);return t}function ZA(e,t){let r=null,n=[],s=new Map;for(let o of bb(e,t))o.key===t&&(n.push(r=o.value),s.has(o.file)||s.set(o.file,[]),s.get(o.file).push(r));return{key:t,paths:Array.from(s.keys()),scopes:s,value:r,values:n}}function HA(e){return e.replace(/^(file):/,"")}function*bb(e,t=null){let r=e.split("\0");for(let n=0,s=r.length-1;n<s;){let o=HA(r[n++]),i=r[n++],a=t;if(i.includes(`
|
57
57
|
`)){let c=Vy(i,`
|
58
58
|
`);a=c[0],i=c[1]}yield{file:o,key:a,value:i}}}var wb,YA=g({"src/lib/responses/ConfigList.ts"(){"use strict";C(),wb=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=zt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let n=this.addFile(e);n.hasOwnProperty(t)?Array.isArray(n[t])?n[t].push(r):n[t]=[n[t],r]:n[t]=r,this._all=void 0}}}});function Ka(e,t){return typeof e=="string"&&uc.hasOwnProperty(e)?e:t}function XA(e,t,r,n){let s=["config",`--${n}`];return r&&s.push("--add"),s.push(e,t),{commands:s,format:"utf-8",parser(o){return o}}}function KA(e,t){let r=["config","--null","--show-origin","--get-all",e];return t&&r.splice(1,0,`--${t}`),{commands:r,format:"utf-8",parser(n){return ZA(n,e)}}}function JA(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return WA(r)}}}function QA(){return{addConfig(e,t,...r){return this._runTask(XA(e,t,r[0]===!0,Ka(r[1],"local")),z(arguments))},getConfig(e,t){return this._runTask(KA(e,Ka(t,void 0)),z(arguments))},listConfig(...e){return this._runTask(JA(Ka(e[0],void 0)),z(arguments))}}}var uc,Sb=g({"src/lib/tasks/config.ts"(){"use strict";YA(),C(),uc=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(uc||{})}});function eI(e){return xb.has(e)}var Ja,xb,vb=g({"src/lib/tasks/diff-name-status.ts"(){"use strict";Ja=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(Ja||{}),xb=new Set(Object.values(Ja))}});function tI(...e){return new Eb().param(...e)}function rI(e){let t=new Set,r={};return yc(e,n=>{let[s,o,i]=n.split(Or);t.add(s),(r[s]=r[s]||[]).push({line:U(o),path:s,preview:i})}),{paths:t,results:r}}function nI(){return{grep(e){let t=z(arguments),r=fe(arguments);for(let s of _b)if(r.includes(s))return this._runTask(de(`git.grep: use of "${s}" is not supported.`),t);typeof e=="string"&&(e=tI().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(s){return rI(s)}},t)}}}var _b,an,uy,Eb,Tb=g({"src/lib/tasks/grep.ts"(){"use strict";C(),Z(),_b=["-h"],an=Symbol("grepQuery"),Eb=class{constructor(){this[uy]=[]}*[(uy=an,Symbol.iterator)](){for(let e of this[an])yield e}and(...e){return e.length&&this[an].push("--and","(",...ln(e,"-e"),")"),this}param(...e){return this[an].push(...ln(e,"-e")),this}}}}),Ob={};H(Ob,{ResetMode:()=>uo,getResetMode:()=>oI,resetTask:()=>sI});function sI(e,t){let r=["reset"];return Rb(e)&&r.push(`--${e}`),r.push(...t),ae(r)}function oI(e){if(Rb(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function Rb(e){return kb.includes(e)}var uo,kb,Cb=g({"src/lib/tasks/reset.ts"(){"use strict";Z(),uo=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(uo||{}),kb=Array.from(Object.values(uo))}});function iI(){return(0,ho.default)("simple-git")}function ly(e,t,r){return!t||!String(t).replace(/\s*/,"")?r?(n,...s)=>{e(n,...s),r(n,...s)}:e:(n,...s)=>{e(`%s ${n}`,t,...s),r&&r(n,...s)}}function aI(e,t,{namespace:r}){if(typeof e=="string")return e;let n=t&&t.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function Cc(e,t,r,n=iI()){let s=e&&`[${e}]`||"",o=[],i=typeof t=="string"?n.extend(t):t,a=aI(Ye(t,re),i,n);return u(r);function c(l,f){return F(o,Cc(e,a.replace(/^[^:]+/,l),f,n))}function u(l){let f=l&&`[${l}]`||"",d=i&&ly(i,f)||Wt,p=ly(n,`${s} ${f}`,d);return Object.assign(i?d:p,{label:e,sibling:c,info:p,step:u})}}var Ab=g({"src/lib/git-logger.ts"(){"use strict";C(),ho.default.formatters.L=e=>String(xc(e)?e.length:"-"),ho.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):gn(e)}}),io,lc,cI=g({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";yt(),Ab(),io=class{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let t=io.getName(e.commands[0]),r=Cc(this.logLabel,t);return{task:e,logger:r,name:t}}push(e){let t=this.createProgress(e);return t.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:r}]of Array.from(this._queue.entries()))t===e.task?(r.info("Failed %o",e),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(t);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new it(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"),t}static getName(e="empty"){return`task:${e}:${++io.counter}`}},lc=io,lc.counter=0}});function Vt(e,t){return{method:zy(e.commands)||"",commands:t}}function uI(e,t){return r=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function fy(e,t,r,n){return s=>{r("%s received %L bytes",t,s),n("%B",s),e.push(s)}}var fc,lI=g({"src/lib/runners/git-executor-chain.ts"(){"use strict";yt(),Z(),C(),cI(),fc=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new lc}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}attemptTask(e){return cn(this,null,function*(){let t=yield this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:n}=this._queue.attempt(e);return yield mb(e)?this.attemptEmptyTask(e,n):this.attemptRemoteTask(e,n)}catch(n){throw this.onFatalException(e,n)}finally{r(),t()}})}onFatalException(e,t){let r=t instanceof it?Object.assign(t,{task:e}):new it(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}attemptRemoteTask(e,t){return cn(this,null,function*(){let r=this._plugins.exec("spawn.binary","",Vt(e,e.commands)),n=this._plugins.exec("spawn.args",[...e.commands],Vt(e,e.commands)),s=yield this.gitResponse(e,r,n,this.outputHandler,t.step("SPAWN")),o=yield this.handleTaskData(e,n,s,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),pb(e)?ic(e.parser,o):ic(e.parser,o.asStrings())})}attemptEmptyTask(e,t){return cn(this,null,function*(){return t("empty task bypassing child process to call to task's parser"),e.parser(this)})}handleTaskData(e,t,r,n){let{exitCode:s,rejection:o,stdOut:i,stdErr:a}=r;return new Promise((c,u)=>{n("Preparing to handle process response exitCode=%d stdOut=",s);let{error:l}=this._plugins.exec("task.error",{error:o},Ce(Ce({},Vt(e,t)),r));if(l&&e.onError)return n.info("exitCode=%s handling with custom error handler"),e.onError(r,l,f=>{n.info("custom error handler treated as success"),n("custom error returned a %s",gn(f)),c(new dn(Array.isArray(f)?Buffer.concat(f):f,Buffer.concat(a)))},u);if(l)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,a.length,o),u(l);n.info("retrieving task output complete"),c(new dn(Buffer.concat(i),Buffer.concat(a)))})}gitResponse(e,t,r,n,s){return cn(this,null,function*(){let o=s.sibling("output"),i=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Vt(e,e.commands));return new Promise(a=>{let c=[],u=[];s.info("%s %o",t,r),s("%O",i);let l=this._beforeSpawn(e,r);if(l)return a({stdOut:c,stdErr:u,exitCode:9901,rejection:l});this._plugins.exec("spawn.before",void 0,un(Ce({},Vt(e,r)),{kill(d){l=d||l}}));let f=(0,Ib.spawn)(t,r,i);f.stdout.on("data",fy(c,"stdOut",s,o.step("stdOut"))),f.stderr.on("data",fy(u,"stdErr",s,o.step("stdErr"))),f.on("error",uI(u,s)),n&&(s("Passing child process stdOut/stdErr to custom outputHandler"),n(t,f.stdout,f.stderr,[...r])),this._plugins.exec("spawn.after",void 0,un(Ce({},Vt(e,r)),{spawned:f,close(d,p){a({stdOut:c,stdErr:u,exitCode:d,rejection:l||p})},kill(d){f.killed||(l=d,f.kill("SIGINT"))}}))})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,un(Ce({},Vt(e,t)),{kill(n){r=n||r}})),r}}}}),$b={};H($b,{GitExecutor:()=>Db});var Db,fI=g({"src/lib/runners/git-executor.ts"(){"use strict";lI(),Db=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new fc(this,this._scheduler,this._plugins)}chain(){return new fc(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function dI(e,t,r=Wt){let n=o=>{r(null,o)},s=o=>{(o==null?void 0:o.task)===e&&r(o instanceof mn?pI(o):o,void 0)};t.then(n,s)}function pI(e){let t=n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),t=Wt};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(n,s){return s in e||(n[s]={enumerable:!1,configurable:!1,get(){return t(s),e.git[s]}}),n}}var mI=g({"src/lib/task-callback.ts"(){"use strict";Rr(),C()}});function dy(e,t){return fb(r=>{if(!bc(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var hI=g({"src/lib/tasks/change-working-directory.ts"(){"use strict";C(),Z()}});function Qa(e){let t=["checkout",...e];return t[1]==="-b"&&t.includes("-B")&&(t[1]=So(t,"-B")),ae(t)}function gI(){return{checkout(){return this._runTask(Qa(fe(arguments,1)),z(arguments))},checkoutBranch(e,t){return this._runTask(Qa(["-b",e,t,...fe(arguments)]),z(arguments))},checkoutLocalBranch(e){return this._runTask(Qa(["-b",e,...fe(arguments)]),z(arguments))}}}var yI=g({"src/lib/tasks/checkout.ts"(){"use strict";C(),Z()}});function bI(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function wI(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return pe(bI(),[Lb],e)}})}}}var Lb,SI=g({"src/lib/tasks/count-objects.ts"(){"use strict";C(),Lb=new I(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let n=Hy(t);e.hasOwnProperty(n)&&(e[n]=U(r))})}});function xI(e){return pe({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},Nb,e)}var Nb,vI=g({"src/lib/parsers/parse-commit.ts"(){"use strict";C(),Nb=[new I(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new I(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),n=r.pop();!n||!n.includes("@")||(e.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new I(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(n,10)||0}),new I(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0;let s=parseInt(r,10)||0;n==="-"?e.summary.deletions=s:n==="+"&&(e.summary.insertions=s)})]}});function _I(e,t,r){return{commands:["-c","core.abbrev=40","commit",...ln(e,"-m"),...t,...r],format:"utf-8",parser:xI}}function EI(){return{commit(t,...r){let n=z(arguments),s=e(t)||_I(He(t),He(Ye(r[0],mo,[])),[...Ye(r[1],yn,[]),...fe(arguments,0,!0)]);return this._runTask(s,n)}};function e(t){return!mo(t)&&de("git.commit: requires the commit message to be supplied as a string/string[]")}}var TI=g({"src/lib/tasks/commit.ts"(){"use strict";vI(),C(),Z()}});function OI(){return{firstCommit(){return this._runTask(ae(["rev-list","--max-parents=0","HEAD"],!0),z(arguments))}}}var RI=g({"src/lib/tasks/first-commit.ts"(){"use strict";C(),Z()}});function kI(e,t){let r=["hash-object",e];return t&&r.push("-w"),ae(r,!0)}var CI=g({"src/lib/tasks/hash-object.ts"(){"use strict";Z()}});function AI(e,t,r){let n=String(r).trim(),s;if(s=Pb.exec(n))return new lo(e,t,!1,s[1]);if(s=Mb.exec(n))return new lo(e,t,!0,s[1]);let o="",i=n.split(" ");for(;i.length;)if(i.shift()==="in"){o=i.join(" ");break}return new lo(e,t,/^re/i.test(n),o)}var lo,Pb,Mb,II=g({"src/lib/responses/InitSummary.ts"(){"use strict";lo=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},Pb=/^Init.+ repository in (.+)$/,Mb=/^Rein.+ in (.+)$/}});function $I(e){return e.includes(Ac)}function DI(e=!1,t,r){let n=["init",...r];return e&&!$I(n)&&n.splice(1,0,Ac),{commands:n,format:"utf-8",parser(s){return AI(n.includes("--bare"),t,s)}}}var Ac,LI=g({"src/lib/tasks/init.ts"(){"use strict";II(),Ac="--bare"}});function Ic(e){for(let t=0;t<e.length;t++){let r=$c.exec(e[t]);if(r)return`--${r[1]}`}return""}function NI(e){return $c.test(e)}var $c,bn=g({"src/lib/args/log-format.ts"(){"use strict";$c=/^--(stat|numstat|name-only|name-status)(=|$)/}}),Fb,PI=g({"src/lib/responses/DiffSummary.ts"(){"use strict";Fb=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function jb(e=""){let t=Bb[e];return r=>pe(new Fb,t,r,!1)}var ec,py,my,hy,Bb,Ub=g({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";bn(),PI(),vb(),C(),ec=[new I(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:U(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new I(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:U(r),after:U(n),binary:!0})}),new I(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let n=/(\d+) i/.exec(r),s=/(\d+) d/.exec(r);e.changed=U(t),e.insertions=U(n==null?void 0:n[1]),e.deletions=U(s==null?void 0:s[1])})],py=[new I(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{let s=U(t),o=U(r);e.changed++,e.insertions+=s,e.deletions+=o,e.files.push({file:n,changes:s+o,insertions:s,deletions:o,binary:!1})}),new I(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],my=[new I(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],hy=[new I(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,n,s,o])=>{e.changed++,e.files.push({file:o??n,changes:0,insertions:0,deletions:0,binary:!1,status:sc(eI(t)&&t),from:sc(!!o&&n!==o&&n),similarity:U(r)})})],Bb={"":ec,"--stat":ec,"--numstat":py,"--name-status":hy,"--name-only":my}}});function MI(e,t){return t.reduce((r,n,s)=>(r[n]=e[s]||"",r),Object.create({diff:null}))}function Gb(e=Nc,t=qb,r=""){let n=jb(r);return function(s){let o=hn(s.trim(),!1,Dc).map(function(i){let a=i.split(Lc),c=MI(a[0].split(e),t);return a.length>1&&a[1].trim()&&(c.diff=n(a[1])),c});return{all:o,latest:o.length&&o[0]||null,total:o.length}}}var Dc,Lc,Nc,qb,Vb=g({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";C(),Ub(),bn(),Dc="\xF2\xF2\xF2\xF2\xF2\xF2 ",Lc=" \xF2\xF2",Nc=" \xF2 ",qb=["hash","date","message","refs","author_name","author_email"]}}),zb={};H(zb,{diffSummaryTask:()=>FI,validateLogFormatConfig:()=>Eo});function FI(e){let t=Ic(e),r=["diff"];return t===""&&(t="--stat",r.push("--stat=4096")),r.push(...e),Eo(r)||{commands:r,format:"utf-8",parser:jb(t)}}function Eo(e){let t=e.filter(NI);if(t.length>1)return de(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return de(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var Pc=g({"src/lib/tasks/diff.ts"(){"use strict";bn(),Ub(),Z()}});function jI(e,t){let r=[],n=[];return Object.keys(e).forEach(s=>{r.push(s),n.push(String(e[s]))}),[r,n.join(t)]}function BI(e){return Object.keys(e).reduce((t,r)=>(r in dc||(t[r]=e[r]),t),{})}function Wb(e={},t=[]){let r=Ye(e.splitter,re,Nc),n=!wc(e.format)&&e.format?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[s,o]=jI(n,r),i=[],a=[`--pretty=format:${Dc}${o}${Lc}`,...t],c=e.n||e["max-count"]||e.maxCount;if(c&&a.push(`--max-count=${c}`),e.from||e.to){let u=e.symmetric!==!1?"...":"..";i.push(`${e.from||""}${u}${e.to||""}`)}return re(e.file)&&a.push("--follow",kA(e.file)),vc(BI(e),a),{fields:s,splitter:r,commands:[...a,...i]}}function UI(e,t,r){let n=Gb(e,t,Ic(r));return{commands:["log",...r],format:"utf-8",parser:n}}function GI(){return{log(...r){let n=z(arguments),s=Wb(_c(arguments),Ye(arguments[0],yn)),o=t(...r)||Eo(s.commands)||e(s);return this._runTask(o,n)}};function e(r){return UI(r.splitter,r.fields,r.commands)}function t(r,n){return re(r)&&re(n)&&de("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var dc,Zb=g({"src/lib/tasks/log.ts"(){"use strict";bn(),pn(),Vb(),C(),Z(),Pc(),dc=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(dc||{})}}),fo,Hb,qI=g({"src/lib/responses/MergeSummary.ts"(){"use strict";fo=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},Hb=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),pc,Yb,VI=g({"src/lib/responses/PullSummary.ts"(){"use strict";pc=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Yb=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function tc(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function gy(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:U(t&&t[1]||"0"),delta:U(r&&r[1]||"0")}}var Xb,zI=g({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";C(),Xb=[new gt(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=tc(e.remoteMessages);Object.assign(s,{[n]:U(r)})}),new gt(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=tc(e.remoteMessages);Object.assign(s,{[n]:U(r)})}),new gt(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{let s=tc(e.remoteMessages);s.total=gy(t),s.reused=gy(r),s.packReused=U(n)})]}});function Kb(e,t){return pe({remoteMessages:new Qb},Jb,t)}var Jb,Qb,ew=g({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";C(),zI(),Jb=[new gt(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Xb,new gt([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new gt([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:U(t),summary:r,url:n}})],Qb=class{constructor(){this.all=[]}}}});function WI(e,t){let r=pe(new Yb,tw,[e,t]);return r.message&&r}var yy,by,wy,Sy,tw,xy,Mc,rw=g({"src/lib/parsers/parse-pull.ts"(){"use strict";VI(),C(),ew(),yy=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,by=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,wy=/^(create|delete) mode \d+ (.+)/,Sy=[new I(yy,(e,[t,r,n])=>{e.files.push(t),r&&(e.insertions[t]=r.length),n&&(e.deletions[t]=n.length)}),new I(by,(e,[t,,r,,n])=>r!==void 0||n!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+n||0,!0):!1),new I(wy,(e,[t,r])=>{F(e.files,r),F(t==="create"?e.created:e.deleted,r)})],tw=[new I(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new I(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new I(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,n,s])=>{e.branch.local=n,e.hash.local=t,e.branch.remote=s,e.hash.remote=r})],xy=(e,t)=>pe(new pc,Sy,[e,t]),Mc=(e,t)=>Object.assign(new pc,xy(e,t),Kb(e,t))}}),vy,nw,_y,ZI=g({"src/lib/parsers/parse-merge.ts"(){"use strict";qI(),C(),rw(),vy=[new I(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new I(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new fo(t,r))}),new I(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new fo(t,r,{deleteRef:n}))}),new I(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new fo(t,null))}),new I(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],nw=(e,t)=>Object.assign(_y(e,t),Mc(e,t)),_y=e=>pe(new Hb,vy,e)}});function Ey(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(t,r){let n=nw(t,r);if(n.failed)throw new mn(n);return n}}:de("Git.merge requires at least one option")}var HI=g({"src/lib/tasks/merge.ts"(){"use strict";Rr(),ZI(),Z()}});function YI(e,t,r){let n=r.includes("deleted"),s=r.includes("tag")||/^refs\/tags/.test(e),o=!r.includes("new");return{deleted:n,tag:s,branch:!s,new:!o,alreadyUpdated:o,local:e,remote:t}}var Ty,sw,Oy,XI=g({"src/lib/parsers/parse-push.ts"(){"use strict";C(),ew(),Ty=[new I(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new I(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref=un(Ce({},e.ref||{}),{local:t})}),new I(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(YI(t,r,n))}),new I(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch=un(Ce({},e.branch||{}),{local:t,remote:r,remoteName:n})}),new I(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,n,s])=>{e.update={head:{local:t,remote:r},hash:{from:n,to:s}}})],sw=(e,t)=>{let r=Oy(e,t),n=Kb(e,t);return Ce(Ce({},r),n)},Oy=(e,t)=>pe({pushed:[]},Ty,[e,t])}}),ow={};H(ow,{pushTagsTask:()=>KI,pushTask:()=>Fc});function KI(e={},t){return F(t,"--tags"),Fc(e,t)}function Fc(e={},t){let r=["push",...t];return e.branch&&r.splice(1,0,e.branch),e.remote&&r.splice(1,0,e.remote),So(r,"-v"),F(r,"--verbose"),F(r,"--porcelain"),{commands:r,format:"utf-8",parser:sw}}var iw=g({"src/lib/tasks/push.ts"(){"use strict";XI(),C()}});function JI(){return{showBuffer(){let e=["show",...fe(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(db(e),z(arguments))},show(){let e=["show",...fe(arguments,1)];return this._runTask(ae(e),z(arguments))}}}var QI=g({"src/lib/tasks/show.ts"(){"use strict";C(),Z()}}),Ry,aw,e1=g({"src/lib/responses/FileStatusSummary.ts"(){"use strict";Ry=/^(.+)\0(.+)$/,aw=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let n=Ry.exec(e)||[null,e,e];this.from=n[2]||"",this.path=n[1]||""}}}}});function ky(e){let[t,r]=e.split(Or);return{from:r||t,to:t}}function we(e,t,r){return[`${e}${t}`,r]}function rc(e,...t){return t.map(r=>we(e,r,(n,s)=>F(n.conflicted,s)))}function t1(e,t){let r=t.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return n(" ",r.charAt(0),r.substr(2));default:return}function n(s,o,i){let a=`${s}${o}`,c=cw.get(a);c&&c(e,i),a!=="##"&&a!=="!!"&&e.files.push(new aw(i,s,o))}}var Cy,cw,uw,r1=g({"src/lib/responses/StatusSummary.ts"(){"use strict";C(),e1(),Cy=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},cw=new Map([we(" ","A",(e,t)=>F(e.created,t)),we(" ","D",(e,t)=>F(e.deleted,t)),we(" ","M",(e,t)=>F(e.modified,t)),we("A"," ",(e,t)=>F(e.created,t)&&F(e.staged,t)),we("A","M",(e,t)=>F(e.created,t)&&F(e.staged,t)&&F(e.modified,t)),we("D"," ",(e,t)=>F(e.deleted,t)&&F(e.staged,t)),we("M"," ",(e,t)=>F(e.modified,t)&&F(e.staged,t)),we("M","M",(e,t)=>F(e.modified,t)&&F(e.staged,t)),we("R"," ",(e,t)=>{F(e.renamed,ky(t))}),we("R","M",(e,t)=>{let r=ky(t);F(e.renamed,r),F(e.modified,r.to)}),we("!","!",(e,t)=>{F(e.ignored=e.ignored||[],t)}),we("?","?",(e,t)=>F(e.not_added,t)),...rc("A","A","U"),...rc("D","D","U"),...rc("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,s=/^(.+?(?=(?:\.{3}|\s|$)))/,o=/\.{3}(\S*)/,i=/\son\s([\S]+)$/,a;a=r.exec(t),e.ahead=a&&+a[1]||0,a=n.exec(t),e.behind=a&&+a[1]||0,a=s.exec(t),e.current=a&&a[1],a=o.exec(t),e.tracking=a&&a[1],a=i.exec(t),e.current=a&&a[1]||e.current,e.detached=/\(no branch\)/.test(t)}]]),uw=function(e){let t=e.split(Or),r=new Cy;for(let n=0,s=t.length;n<s;){let o=t[n++].trim();o&&(o.charAt(0)==="R"&&(o+=Or+(t[n++]||"")),t1(r,o))}return r}}});function n1(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(r=>!lw.includes(r))],parser(r){return uw(r)}}}var lw,s1=g({"src/lib/tasks/status.ts"(){"use strict";r1(),lw=["--null","-z"]}});function go(e=0,t=0,r=0,n="",s=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:n,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function o1(){return go(0,0,0,"",!1)}function i1(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:a1,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(jc));n(t)}})}}}function a1(e){return e===jc?o1():pe(go(0,0,0,e),fw,e)}var jc,fw,c1=g({"src/lib/tasks/version.ts"(){"use strict";C(),jc="installed=false",fw=[new I(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,s=""])=>{Object.assign(e,go(U(t),U(r),U(n),s))}),new I(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,s=""])=>{Object.assign(e,go(U(t),U(r),n,s))})]}}),dw={};H(dw,{SimpleGitApi:()=>mc});var mc,u1=g({"src/lib/simple-git-api.ts"(){"use strict";mI(),hI(),yI(),SI(),TI(),Sb(),RI(),Tb(),CI(),LI(),Zb(),HI(),iw(),QI(),s1(),Z(),c1(),C(),mc=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);return t&&dI(e,n,t),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(e){return this._runTask(ae(["add",...He(e)]),z(arguments))}cwd(e){let t=z(arguments);return typeof e=="string"?this._runTask(dy(e,this._executor),t):typeof(e==null?void 0:e.path)=="string"?this._runTask(dy(e.path,e.root&&this._executor||void 0),t):this._runTask(de("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(kI(e,t===!0),z(arguments))}init(e){return this._runTask(DI(e===!0,this._executor.cwd,fe(arguments)),z(arguments))}merge(){return this._runTask(Ey(fe(arguments)),z(arguments))}mergeFromTo(e,t){return re(e)&&re(t)?this._runTask(Ey([e,t,...fe(arguments)]),z(arguments,!1)):this._runTask(de("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=Fc({remote:Ye(arguments[0],re),branch:Ye(arguments[1],re)},fe(arguments));return this._runTask(e,z(arguments))}stash(){return this._runTask(ae(["stash",...fe(arguments)]),z(arguments))}status(){return this._runTask(n1(fe(arguments)),z(arguments))}},Object.assign(mc.prototype,gI(),EI(),QA(),wI(),OI(),nI(),GI(),JI(),i1())}}),pw={};H(pw,{Scheduler:()=>hw});var Ay,hw,l1=g({"src/lib/runners/scheduler.ts"(){"use strict";C(),Ab(),Ay=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=(0,mw.createDeferred)();return{promise:t,done:r,id:e}}})(),hw=class{constructor(e=2){this.concurrency=e,this.logger=Cc("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=F(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),So(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=F(this.pending,Ay());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),gw={};H(gw,{applyPatchTask:()=>f1});function f1(e,t){return ae(["apply",...t,...e])}var d1=g({"src/lib/tasks/apply-patch.ts"(){"use strict";Z()}});function p1(e,t){return{branch:e,hash:t,success:!0}}function m1(e){return{branch:e,hash:null,success:!1}}var yw,h1=g({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";yw=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function bw(e,t){return t===1&&hc.test(e)}var Iy,hc,$y,To,g1=g({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";h1(),C(),Iy=/(\S+)\s+\(\S+\s([^)]+)\)/,hc=/^error[^']+'([^']+)'/m,$y=[new I(Iy,(e,[t,r])=>{let n=p1(t,r);e.all.push(n),e.branches[t]=n}),new I(hc,(e,[t])=>{let r=m1(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],To=(e,t)=>pe(new yw,$y,[e,t])}}),ww,y1=g({"src/lib/responses/BranchSummary.ts"(){"use strict";ww=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,n,s){e==="*"&&(this.detached=t,this.current=r),this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:n,label:s}}}}});function Dy(e){return e?e.charAt(0):""}function Sw(e){return pe(new ww,xw,e)}var xw,b1=g({"src/lib/parsers/parse-branch.ts"(){"use strict";y1(),C(),xw=[new I(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,s])=>{e.push(Dy(t),!0,r,n,s)}),new I(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),(e,[t,r,n,s])=>{e.push(Dy(t),!1,r,n,s)})]}}),vw={};H(vw,{branchLocalTask:()=>S1,branchTask:()=>w1,containsDeleteBranchCommand:()=>_w,deleteBranchTask:()=>v1,deleteBranchesTask:()=>x1});function _w(e){let t=["-d","-D","--delete"];return e.some(r=>t.includes(r))}function w1(e){let t=_w(e),r=["branch",...e];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(n,s){return t?To(n,s).all[0]:Sw(n)}}}function S1(){return{format:"utf-8",commands:["branch","-v"],parser:Sw}}function x1(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,n){return To(r,n)},onError({exitCode:r,stdOut:n},s,o,i){if(!bw(String(s),r))return i(s);o(n)}}}function v1(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(n,s){return To(n,s).branches[e]},onError({exitCode:n,stdErr:s,stdOut:o},i,a,c){if(!bw(String(i),n))return c(i);throw new mn(r.parser(fn(o),fn(s)),String(i))}};return r}var _1=g({"src/lib/tasks/branch.ts"(){"use strict";Rr(),g1(),b1(),C()}}),Ew,E1=g({"src/lib/responses/CheckIgnore.ts"(){"use strict";Ew=e=>e.split(/\n/g).map(t=>t.trim()).filter(t=>!!t)}}),Tw={};H(Tw,{checkIgnoreTask:()=>T1});function T1(e){return{commands:["check-ignore",...e],format:"utf-8",parser:Ew}}var O1=g({"src/lib/tasks/check-ignore.ts"(){"use strict";E1()}}),Ow={};H(Ow,{cloneMirrorTask:()=>k1,cloneTask:()=>Rw});function R1(e){return/^--upload-pack(=|$)/.test(e)}function Rw(e,t,r){let n=["clone",...r];return re(e)&&n.push(e),re(t)&&n.push(t),n.find(R1)?de("git.fetch: potential exploit argument blocked."):ae(n)}function k1(e,t,r){return F(r,"--mirror"),Rw(e,t,r)}var C1=g({"src/lib/tasks/clone.ts"(){"use strict";Z(),C()}});function A1(e,t){return pe({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},kw,[e,t])}var kw,I1=g({"src/lib/parsers/parse-fetch.ts"(){"use strict";C(),kw=[new I(/From (.+)$/,(e,[t])=>{e.remote=t}),new I(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new I(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new I(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new I(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,s])=>{e.updated.push({name:n,tracking:s,to:r,from:t})})]}}),Cw={};H(Cw,{fetchTask:()=>D1});function $1(e){return/^--upload-pack(=|$)/.test(e)}function D1(e,t,r){let n=["fetch",...r];return e&&t&&n.push(e,t),n.find($1)?de("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:A1}}var L1=g({"src/lib/tasks/fetch.ts"(){"use strict";I1(),Z()}});function N1(e){return pe({moves:[]},Aw,e)}var Aw,P1=g({"src/lib/parsers/parse-move.ts"(){"use strict";C(),Aw=[new I(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),Iw={};H(Iw,{moveTask:()=>M1});function M1(e,t){return{commands:["mv","-v",...He(e),t],format:"utf-8",parser:N1}}var F1=g({"src/lib/tasks/move.ts"(){"use strict";P1(),C()}}),$w={};H($w,{pullTask:()=>j1});function j1(e,t,r){let n=["pull",...r];return e&&t&&n.splice(1,0,e,t),{commands:n,format:"utf-8",parser(s,o){return Mc(s,o)},onError(s,o,i,a){let c=WI(fn(s.stdOut),fn(s.stdErr));if(c)return a(new mn(c));a(o)}}}var B1=g({"src/lib/tasks/pull.ts"(){"use strict";Rr(),rw(),C()}});function U1(e){let t={};return Dw(e,([r])=>t[r]={name:r}),Object.values(t)}function G1(e){let t={};return Dw(e,([r,n,s])=>{t.hasOwnProperty(r)||(t[r]={name:r,refs:{fetch:"",push:""}}),s&&n&&(t[r].refs[s.replace(/[^a-z]/g,"")]=n)}),Object.values(t)}function Dw(e,t){yc(e,r=>t(r.split(/\s+/)))}var q1=g({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";C()}}),Lw={};H(Lw,{addRemoteTask:()=>V1,getRemotesTask:()=>z1,listRemotesTask:()=>W1,remoteTask:()=>Z1,removeRemoteTask:()=>H1});function V1(e,t,r){return ae(["remote","add",...r,e,t])}function z1(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?G1:U1}}function W1(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),ae(t)}function Z1(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),ae(t)}function H1(e){return ae(["remote","remove",e])}var Y1=g({"src/lib/tasks/remote.ts"(){"use strict";q1(),Z()}}),Nw={};H(Nw,{stashListTask:()=>X1});function X1(e={},t){let r=Wb(e),n=["stash","list",...r.commands,...t],s=Gb(r.splitter,r.fields,Ic(n));return Eo(n)||{commands:n,format:"utf-8",parser:s}}var K1=g({"src/lib/tasks/stash-list.ts"(){"use strict";bn(),Vb(),Pc(),Zb()}}),Pw={};H(Pw,{addSubModuleTask:()=>J1,initSubModuleTask:()=>Q1,subModuleTask:()=>Oo,updateSubModuleTask:()=>e$});function J1(e,t){return Oo(["add",e,t])}function Q1(e){return Oo(["init",...e])}function Oo(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),ae(t)}function e$(e){return Oo(["update",...e])}var t$=g({"src/lib/tasks/sub-module.ts"(){"use strict";Z()}});function r$(e,t){let r=isNaN(e),n=isNaN(t);return r!==n?r?1:-1:r?Mw(e,t):0}function Mw(e,t){return e===t?0:e>t?1:-1}function n$(e){return e.trim()}function ao(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var Ly,Fw,s$=g({"src/lib/responses/TagList.ts"(){"use strict";Ly=class{constructor(e,t){this.all=e,this.latest=t}},Fw=function(e,t=!1){let r=e.split(`
|
59
|
-
`).map(n$).filter(Boolean);t||r.sort(function(s,o){let i=s.split("."),a=o.split(".");if(i.length===1||a.length===1)return r$(ao(i[0]),ao(a[0]));for(let c=0,u=Math.max(i.length,a.length);c<u;c++){let l=Mw(ao(i[c]),ao(a[c]));if(l)return l}return 0});let n=t?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new Ly(r,n)}}}),jw={};H(jw,{addAnnotatedTagTask:()=>a$,addTagTask:()=>i$,tagListTask:()=>o$});function o$(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return Fw(r,t)}}}function i$(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function a$(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var c$=g({"src/lib/tasks/tag.ts"(){"use strict";s$()}}),u$=OA({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(fI(),V($b)),{SimpleGitApi:n}=(u1(),V(dw)),{Scheduler:s}=(l1(),V(pw)),{configurationErrorTask:o}=(Z(),V(cc)),{asArray:i,filterArray:a,filterPrimitives:c,filterString:u,filterStringOrStringArray:l,filterType:f,getTrailingOptions:d,trailingFunctionArgument:p,trailingOptionsArgument:b}=(C(),V(rb)),{applyPatchTask:T}=(d1(),V(gw)),{branchTask:N,branchLocalTask:P,deleteBranchesTask:j,deleteBranchTask:Y}=(_1(),V(vw)),{checkIgnoreTask:X}=(O1(),V(Tw)),{checkIsRepoTask:Se}=(ib(),V(nb)),{cloneTask:ce,cloneMirrorTask:Ae}=(C1(),V(Ow)),{cleanWithOptionsTask:Ie,isCleanOptionsArray:xe}=(yb(),V(hb)),{diffSummaryTask:kr}=(Pc(),V(zb)),{fetchTask:bt}=(L1(),V(Cw)),{moveTask:Qw}=(F1(),V(Iw)),{pullTask:eS}=(B1(),V($w)),{pushTagsTask:tS}=(iw(),V(ow)),{addRemoteTask:rS,getRemotesTask:nS,listRemotesTask:sS,remoteTask:oS,removeRemoteTask:iS}=(Y1(),V(Lw)),{getResetMode:aS,resetTask:cS}=(Cb(),V(Ob)),{stashListTask:uS}=(K1(),V(Nw)),{addSubModuleTask:lS,initSubModuleTask:fS,subModuleTask:dS,updateSubModuleTask:pS}=(t$(),V(Pw)),{addAnnotatedTagTask:mS,addTagTask:hS,tagListTask:gS}=(c$(),V(jw)),{straightThroughBufferTask:yS,straightThroughStringTask:Fe}=(Z(),V(cc));function O(h,E){this._plugins=E,this._executor=new r(h.baseDir,new s(h.maxConcurrentProcesses),E),this._trimmed=h.trimmed}(O.prototype=Object.create(n.prototype)).constructor=O,O.prototype.customBinary=function(h){return this._plugins.reconfigure("binary",h),this},O.prototype.env=function(h,E){return arguments.length===1&&typeof h=="object"?this._executor.env=h:(this._executor.env=this._executor.env||{})[h]=E,this},O.prototype.stashList=function(h){return this._runTask(uS(b(arguments)||{},a(h)&&h||[]),p(arguments))};function qc(h,E,B,ne){return typeof B!="string"?o(`git.${h}() requires a string 'repoPath'`):E(B,f(ne,u),d(arguments))}O.prototype.clone=function(){return this._runTask(qc("clone",ce,...arguments),p(arguments))},O.prototype.mirror=function(){return this._runTask(qc("mirror",Ae,...arguments),p(arguments))},O.prototype.mv=function(h,E){return this._runTask(Qw(h,E),p(arguments))},O.prototype.checkoutLatestTag=function(h){var E=this;return this.pull(function(){E.tags(function(B,ne){E.checkout(ne.latest,h)})})},O.prototype.pull=function(h,E,B,ne){return this._runTask(eS(f(h,u),f(E,u),d(arguments)),p(arguments))},O.prototype.fetch=function(h,E){return this._runTask(bt(f(h,u),f(E,u),d(arguments)),p(arguments))},O.prototype.silent=function(h){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},O.prototype.tags=function(h,E){return this._runTask(gS(d(arguments)),p(arguments))},O.prototype.rebase=function(){return this._runTask(Fe(["rebase",...d(arguments)]),p(arguments))},O.prototype.reset=function(h){return this._runTask(cS(aS(h),d(arguments)),p(arguments))},O.prototype.revert=function(h){let E=p(arguments);return typeof h!="string"?this._runTask(o("Commit must be a string"),E):this._runTask(Fe(["revert",...d(arguments,0,!0),h]),E)},O.prototype.addTag=function(h){let E=typeof h=="string"?hS(h):o("Git.addTag requires a tag name");return this._runTask(E,p(arguments))},O.prototype.addAnnotatedTag=function(h,E){return this._runTask(mS(h,E),p(arguments))},O.prototype.deleteLocalBranch=function(h,E,B){return this._runTask(Y(h,typeof E=="boolean"?E:!1),p(arguments))},O.prototype.deleteLocalBranches=function(h,E,B){return this._runTask(j(h,typeof E=="boolean"?E:!1),p(arguments))},O.prototype.branch=function(h,E){return this._runTask(N(d(arguments)),p(arguments))},O.prototype.branchLocal=function(h){return this._runTask(P(),p(arguments))},O.prototype.raw=function(h){let E=!Array.isArray(h),B=[].slice.call(E?arguments:h,0);for(let $e=0;$e<B.length&&E;$e++)if(!c(B[$e])){B.splice($e,B.length-$e);break}B.push(...d(arguments,0,!0));var ne=p(arguments);return B.length?this._runTask(Fe(B,this._trimmed),ne):this._runTask(o("Raw: must supply one or more command to execute"),ne)},O.prototype.submoduleAdd=function(h,E,B){return this._runTask(lS(h,E),p(arguments))},O.prototype.submoduleUpdate=function(h,E){return this._runTask(pS(d(arguments,!0)),p(arguments))},O.prototype.submoduleInit=function(h,E){return this._runTask(fS(d(arguments,!0)),p(arguments))},O.prototype.subModule=function(h,E){return this._runTask(dS(d(arguments)),p(arguments))},O.prototype.listRemote=function(){return this._runTask(sS(d(arguments)),p(arguments))},O.prototype.addRemote=function(h,E,B){return this._runTask(rS(h,E,d(arguments)),p(arguments))},O.prototype.removeRemote=function(h,E){return this._runTask(iS(h),p(arguments))},O.prototype.getRemotes=function(h,E){return this._runTask(nS(h===!0),p(arguments))},O.prototype.remote=function(h,E){return this._runTask(oS(d(arguments)),p(arguments))},O.prototype.tag=function(h,E){let B=d(arguments);return B[0]!=="tag"&&B.unshift("tag"),this._runTask(Fe(B),p(arguments))},O.prototype.updateServerInfo=function(h){return this._runTask(Fe(["update-server-info"]),p(arguments))},O.prototype.pushTags=function(h,E){let B=tS({remote:f(h,u)},d(arguments));return this._runTask(B,p(arguments))},O.prototype.rm=function(h){return this._runTask(Fe(["rm","-f",...i(h)]),p(arguments))},O.prototype.rmKeepLocal=function(h){return this._runTask(Fe(["rm","--cached",...i(h)]),p(arguments))},O.prototype.catFile=function(h,E){return this._catFile("utf-8",arguments)},O.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},O.prototype._catFile=function(h,E){var B=p(E),ne=["cat-file"],$e=E[0];if(typeof $e=="string")return this._runTask(o("Git.catFile: options must be supplied as an array of strings"),B);Array.isArray($e)&&ne.push.apply(ne,$e);let $o=h==="buffer"?yS(ne):Fe(ne);return this._runTask($o,B)},O.prototype.diff=function(h,E){let B=u(h)?o("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Fe(["diff",...d(arguments)]);return this._runTask(B,p(arguments))},O.prototype.diffSummary=function(){return this._runTask(kr(d(arguments,1)),p(arguments))},O.prototype.applyPatch=function(h){let E=l(h)?T(i(h),d([].slice.call(arguments,1))):o("git.applyPatch requires one or more string patches as the first argument");return this._runTask(E,p(arguments))},O.prototype.revparse=function(){let h=["rev-parse",...d(arguments,!0)];return this._runTask(Fe(h,!0),p(arguments))},O.prototype.clean=function(h,E,B){let ne=xe(h),$e=ne&&h.join("")||f(h,u)||"",$o=d([].slice.call(arguments,ne?1:0));return this._runTask(Ie($e,$o),p(arguments))},O.prototype.exec=function(h){let E={commands:[],format:"utf-8",parser(){typeof h=="function"&&h()}};return this._runTask(E)},O.prototype.clearQueue=function(){return this},O.prototype.checkIgnore=function(h,E){return this._runTask(X(i(f(h,l,[]))),p(arguments))},O.prototype.checkIsRepo=function(h,E){return this._runTask(Se(f(h,u)),p(arguments))},t.exports=O}});pn();yt();var l$=class extends it{constructor(e,t){super(void 0,t),this.config=e}};yt();yt();var ot=class extends it{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};Rr();Uy();ib();yb();Sb();vb();Tb();Cb();function f$(e){return e?[{type:"spawn.before",action(n,s){e.aborted&&s.kill(new ot(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function o(){s.kill(new ot(void 0,"abort","Abort signal received"))}e.addEventListener("abort",o),s.spawned.on("close",()=>e.removeEventListener("abort",o))}}]:void 0}function d$(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function p$(e,t){if(d$(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new ot(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function m$(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new ot(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(t==="clone"&&/^\s*-u\b/.test(e))throw new ot(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(t==="push"&&/^\s*--exec\b/.test(e))throw new ot(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function h$({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,o)=>{let i=o<r.length?r[o+1]:"";e||p$(s,i),t||m$(s,n.method)}),r}}}C();function g$(e){let t=ln(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}C();var Ny=(0,Tr.deferred)().promise;function y$({onClose:e=!0,onExit:t=50}={}){function r(){let s=-1,o={close:(0,Tr.deferred)(),closeTimeout:(0,Tr.deferred)(),exit:(0,Tr.deferred)(),exitTimeout:(0,Tr.deferred)()},i=Promise.race([e===!1?Ny:o.closeTimeout.promise,t===!1?Ny:o.exitTimeout.promise]);return n(e,o.close,o.closeTimeout),n(t,o.exit,o.exitTimeout),{close(a){s=a,o.close.done()},exit(a){s=a,o.exit.done()},get exitCode(){return s},result:i}}function n(s,o,i){s!==!1&&(s===!0?o.promise:o.promise.then(()=>nc(s))).then(i.done)}return{type:"spawn.after",action(s,o){return cn(this,arguments,function*(i,{spawned:a,close:c}){var u,l;let f=r(),d=!0,p=()=>void(d=!1);(u=a.stdout)==null||u.on("data",p),(l=a.stderr)==null||l.on("data",p),a.on("error",p),a.on("close",b=>f.close(b)),a.on("exit",b=>f.exit(b));try{yield f.result,d&&(yield nc(50)),c(f.exitCode)}catch(b){c(f.exitCode,b)}})}}}C();var b$="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",Py="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function w$(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function My(e,t){if(e.length<1||e.length>2)throw new ot(void 0,"binary",b$);if(e.some(w$))if(t)console.warn(Py);else throw new ot(void 0,"binary",Py);let[n,s]=e;return{binary:n,prefix:s}}function S$(e,t=["git"],r=!1){let n=My(He(t),r);e.on("binary",s=>{n=My(He(s),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}yt();function x$(e){return!!(e.exitCode&&e.stdErr.length)}function v$(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function _$(e=!1,t=x$,r=v$){return(n,s)=>!e&&n||!t(s)?n:r(s)}function Fy(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new it(void 0,n.toString("utf-8"))}:{error:n}}}}C();var E$=class{constructor(){this.plugins=new Set,this.events=new Bw.EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=F(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return He(e).forEach(r=>r&&this.plugins.add(F(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,s=Object.freeze(Object.create(r));for(let o of this.plugins)o.type===e&&(n=o.action(n,s));return n}};C();function T$(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,i){return r.includes(i.method)?Zy(o,t):o}},{type:"spawn.after",action(o,i){var a;i.commands.includes(t)&&((a=i.spawned.stderr)==null||a.on("data",c=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));u&&e({method:i.method,stage:O$(u[1]),progress:U(u[2]),processed:U(u[3]),total:U(u[4])})}))}}]}function O$(e){return String(e.toLowerCase().split(" ",1))||"unknown"}C();function R$(e){let t=Xy(e,["uid","gid"]);return{type:"spawn.options",action(r){return Ce(Ce({},t),r)}}}function k$({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){var o,i;let a;function c(){a&&clearTimeout(a),a=setTimeout(l,e)}function u(){var f,d;(f=s.spawned.stdout)==null||f.off("data",c),(d=s.spawned.stderr)==null||d.off("data",c),s.spawned.off("exit",u),s.spawned.off("close",u),a&&clearTimeout(a)}function l(){u(),s.kill(new ot(void 0,"timeout","block timeout reached"))}r&&((o=s.spawned.stdout)==null||o.on("data",c)),t&&((i=s.spawned.stderr)==null||i.on("data",c)),s.spawned.on("exit",u),s.spawned.on("close",u),c()}}}pn();function C$(){return{type:"spawn.args",action(e){let t=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<e.length;s++){let o=e[s];if(po(o)){n(cy(o));continue}if(o==="--"){n(e.slice(s+1).flatMap(i=>po(i)&&cy(i)||i));break}t.push(o)}return r?[...t,"--",...r.map(String)]:t}}}C();var A$=u$();function I$(e,t){var r;let n=new E$,s=eb(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!bc(s.baseDir))throw new l$(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(g$(s.config)),n.add(h$(s.unsafe)),n.add(C$()),n.add(y$(s.completion)),s.abort&&n.add(f$(s.abort)),s.progress&&n.add(T$(s.progress)),s.timeout&&n.add(k$(s.timeout)),s.spawnOptions&&n.add(R$(s.spawnOptions)),n.add(Fy(_$(!0))),s.errors&&n.add(Fy(s.errors)),S$(n,s.binary,(r=s.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new A$(s,n)}Rr();var Uw=I$;async function Gw(){let e=Uw();try{let{current:t}=await e.branchLocal(),r=(await e.getRemotes(!0)).map(({name:o,refs:{fetch:i}})=>({name:o,url:i})),n=r.find(({name:o})=>o==="origin")??r[0];return{possibleRepositoryName:n?n.url.split("/").slice(-2).join("/").replace(/\.git$/,""):(await e.revparse(["--show-toplevel"])).split("/").pop(),branch:t,remotes:r}}catch{return null}}var Ww=q(zw(),1),Uc=Ww.default.bold("@seed-design/codemod"),Zw=e=>({event:t,properties:r})=>console.log(Uc,t,r,e);var Kw=(0,Ao.resolve)(__dirname,"transforms"),Yw=Xc(),Co=Hw(),wn=null,Jw=null;function P$(){Gw().then(e=>{Jw=e,wn=Zw({...e}),M$(wn)})}function M$(e){F$(),Yw.version(Co.version).help().command("[transformName] [...paths]","\uCF54\uB4DC \uBCC0\uD658 (codemod)").option("-l, --list","\uC0AC\uC6A9 \uAC00\uB2A5\uD55C transform \uBAA9\uB85D\uC744 \uBCF4\uC5EC\uC918\uC694").option("--log","\uB85C\uADF8\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--no-track","\uC0AC\uC6A9 \uD1B5\uACC4\uB97C \uC218\uC9D1\uD558\uC9C0 \uC54A\uC544\uC694").option("-p, --parser <parser>","jscodeshift\uAC00 \uC0AC\uC6A9\uD560 \uD30C\uC11C\uB97C \uC9C0\uC815\uD574\uC694 (babel|babylon|flow|ts|tsx)",{default:"tsx"}).option("--extensions <extensions>","\uBCC0\uD658\uD560 \uD30C\uC77C \uD655\uC7A5\uC790").option("--ignore-config <ignoreConfig>","Ignore config").example(" $ npx @seed-design/codemod replace-react-icon src/ui").action(async(t,r,n)=>{let s=Wg.parse(n);s.track&&(e==null||e({event:"\uC2E4\uD589",properties:{transformName:t,paths:r}}));let o=U$();s.list&&(Gc(o),process.exit(0)),t||(console.error("transform \uC774\uB984\uC744 \uC785\uB825\uD574\uC8FC\uC138\uC694"),Gc(o),process.exit(1)),o.includes(t)||(console.error(`\uC774\uB984\uC774 ${t}\uC778 transform\uC774 \uC5C6\uC5B4\uC694`),Gc(o),process.exit(1)),r.length===0&&(console.error("\uD30C\uC77C \uACBD\uB85C\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694"),process.exit(1));let i=(0,Ao.resolve)(Kw,t,"index.js");console.log(Uc,`${r.join(", ")}\uC5D0 ${t} transform\uC744 \uC2E4\uD589\uD574\uC694.`),await B$(i,t,r,s)}),Yw.parse()}function F$(){(0,Io.satisfies)(process.versions.node,Co.engines.node)===!1&&(console.error(`Node.js \uBC84\uC804 \uC694\uAD6C\uC0AC\uD56D\uC744 \uB9CC\uC871\uC2DC\uD0A4\uC9C0 \uC54A\uC544\uC694: "${Co.engines.node}"
|
59
|
+
`).map(n$).filter(Boolean);t||r.sort(function(s,o){let i=s.split("."),a=o.split(".");if(i.length===1||a.length===1)return r$(ao(i[0]),ao(a[0]));for(let c=0,u=Math.max(i.length,a.length);c<u;c++){let l=Mw(ao(i[c]),ao(a[c]));if(l)return l}return 0});let n=t?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new Ly(r,n)}}}),jw={};H(jw,{addAnnotatedTagTask:()=>a$,addTagTask:()=>i$,tagListTask:()=>o$});function o$(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return Fw(r,t)}}}function i$(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function a$(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var c$=g({"src/lib/tasks/tag.ts"(){"use strict";s$()}}),u$=OA({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(fI(),V($b)),{SimpleGitApi:n}=(u1(),V(dw)),{Scheduler:s}=(l1(),V(pw)),{configurationErrorTask:o}=(Z(),V(cc)),{asArray:i,filterArray:a,filterPrimitives:c,filterString:u,filterStringOrStringArray:l,filterType:f,getTrailingOptions:d,trailingFunctionArgument:p,trailingOptionsArgument:b}=(C(),V(rb)),{applyPatchTask:T}=(d1(),V(gw)),{branchTask:N,branchLocalTask:P,deleteBranchesTask:j,deleteBranchTask:Y}=(_1(),V(vw)),{checkIgnoreTask:X}=(O1(),V(Tw)),{checkIsRepoTask:Se}=(ib(),V(nb)),{cloneTask:ce,cloneMirrorTask:Ae}=(C1(),V(Ow)),{cleanWithOptionsTask:Ie,isCleanOptionsArray:xe}=(yb(),V(hb)),{diffSummaryTask:kr}=(Pc(),V(zb)),{fetchTask:bt}=(L1(),V(Cw)),{moveTask:Qw}=(F1(),V(Iw)),{pullTask:eS}=(B1(),V($w)),{pushTagsTask:tS}=(iw(),V(ow)),{addRemoteTask:rS,getRemotesTask:nS,listRemotesTask:sS,remoteTask:oS,removeRemoteTask:iS}=(Y1(),V(Lw)),{getResetMode:aS,resetTask:cS}=(Cb(),V(Ob)),{stashListTask:uS}=(K1(),V(Nw)),{addSubModuleTask:lS,initSubModuleTask:fS,subModuleTask:dS,updateSubModuleTask:pS}=(t$(),V(Pw)),{addAnnotatedTagTask:mS,addTagTask:hS,tagListTask:gS}=(c$(),V(jw)),{straightThroughBufferTask:yS,straightThroughStringTask:Fe}=(Z(),V(cc));function O(h,E){this._plugins=E,this._executor=new r(h.baseDir,new s(h.maxConcurrentProcesses),E),this._trimmed=h.trimmed}(O.prototype=Object.create(n.prototype)).constructor=O,O.prototype.customBinary=function(h){return this._plugins.reconfigure("binary",h),this},O.prototype.env=function(h,E){return arguments.length===1&&typeof h=="object"?this._executor.env=h:(this._executor.env=this._executor.env||{})[h]=E,this},O.prototype.stashList=function(h){return this._runTask(uS(b(arguments)||{},a(h)&&h||[]),p(arguments))};function qc(h,E,B,ne){return typeof B!="string"?o(`git.${h}() requires a string 'repoPath'`):E(B,f(ne,u),d(arguments))}O.prototype.clone=function(){return this._runTask(qc("clone",ce,...arguments),p(arguments))},O.prototype.mirror=function(){return this._runTask(qc("mirror",Ae,...arguments),p(arguments))},O.prototype.mv=function(h,E){return this._runTask(Qw(h,E),p(arguments))},O.prototype.checkoutLatestTag=function(h){var E=this;return this.pull(function(){E.tags(function(B,ne){E.checkout(ne.latest,h)})})},O.prototype.pull=function(h,E,B,ne){return this._runTask(eS(f(h,u),f(E,u),d(arguments)),p(arguments))},O.prototype.fetch=function(h,E){return this._runTask(bt(f(h,u),f(E,u),d(arguments)),p(arguments))},O.prototype.silent=function(h){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},O.prototype.tags=function(h,E){return this._runTask(gS(d(arguments)),p(arguments))},O.prototype.rebase=function(){return this._runTask(Fe(["rebase",...d(arguments)]),p(arguments))},O.prototype.reset=function(h){return this._runTask(cS(aS(h),d(arguments)),p(arguments))},O.prototype.revert=function(h){let E=p(arguments);return typeof h!="string"?this._runTask(o("Commit must be a string"),E):this._runTask(Fe(["revert",...d(arguments,0,!0),h]),E)},O.prototype.addTag=function(h){let E=typeof h=="string"?hS(h):o("Git.addTag requires a tag name");return this._runTask(E,p(arguments))},O.prototype.addAnnotatedTag=function(h,E){return this._runTask(mS(h,E),p(arguments))},O.prototype.deleteLocalBranch=function(h,E,B){return this._runTask(Y(h,typeof E=="boolean"?E:!1),p(arguments))},O.prototype.deleteLocalBranches=function(h,E,B){return this._runTask(j(h,typeof E=="boolean"?E:!1),p(arguments))},O.prototype.branch=function(h,E){return this._runTask(N(d(arguments)),p(arguments))},O.prototype.branchLocal=function(h){return this._runTask(P(),p(arguments))},O.prototype.raw=function(h){let E=!Array.isArray(h),B=[].slice.call(E?arguments:h,0);for(let $e=0;$e<B.length&&E;$e++)if(!c(B[$e])){B.splice($e,B.length-$e);break}B.push(...d(arguments,0,!0));var ne=p(arguments);return B.length?this._runTask(Fe(B,this._trimmed),ne):this._runTask(o("Raw: must supply one or more command to execute"),ne)},O.prototype.submoduleAdd=function(h,E,B){return this._runTask(lS(h,E),p(arguments))},O.prototype.submoduleUpdate=function(h,E){return this._runTask(pS(d(arguments,!0)),p(arguments))},O.prototype.submoduleInit=function(h,E){return this._runTask(fS(d(arguments,!0)),p(arguments))},O.prototype.subModule=function(h,E){return this._runTask(dS(d(arguments)),p(arguments))},O.prototype.listRemote=function(){return this._runTask(sS(d(arguments)),p(arguments))},O.prototype.addRemote=function(h,E,B){return this._runTask(rS(h,E,d(arguments)),p(arguments))},O.prototype.removeRemote=function(h,E){return this._runTask(iS(h),p(arguments))},O.prototype.getRemotes=function(h,E){return this._runTask(nS(h===!0),p(arguments))},O.prototype.remote=function(h,E){return this._runTask(oS(d(arguments)),p(arguments))},O.prototype.tag=function(h,E){let B=d(arguments);return B[0]!=="tag"&&B.unshift("tag"),this._runTask(Fe(B),p(arguments))},O.prototype.updateServerInfo=function(h){return this._runTask(Fe(["update-server-info"]),p(arguments))},O.prototype.pushTags=function(h,E){let B=tS({remote:f(h,u)},d(arguments));return this._runTask(B,p(arguments))},O.prototype.rm=function(h){return this._runTask(Fe(["rm","-f",...i(h)]),p(arguments))},O.prototype.rmKeepLocal=function(h){return this._runTask(Fe(["rm","--cached",...i(h)]),p(arguments))},O.prototype.catFile=function(h,E){return this._catFile("utf-8",arguments)},O.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},O.prototype._catFile=function(h,E){var B=p(E),ne=["cat-file"],$e=E[0];if(typeof $e=="string")return this._runTask(o("Git.catFile: options must be supplied as an array of strings"),B);Array.isArray($e)&&ne.push.apply(ne,$e);let $o=h==="buffer"?yS(ne):Fe(ne);return this._runTask($o,B)},O.prototype.diff=function(h,E){let B=u(h)?o("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Fe(["diff",...d(arguments)]);return this._runTask(B,p(arguments))},O.prototype.diffSummary=function(){return this._runTask(kr(d(arguments,1)),p(arguments))},O.prototype.applyPatch=function(h){let E=l(h)?T(i(h),d([].slice.call(arguments,1))):o("git.applyPatch requires one or more string patches as the first argument");return this._runTask(E,p(arguments))},O.prototype.revparse=function(){let h=["rev-parse",...d(arguments,!0)];return this._runTask(Fe(h,!0),p(arguments))},O.prototype.clean=function(h,E,B){let ne=xe(h),$e=ne&&h.join("")||f(h,u)||"",$o=d([].slice.call(arguments,ne?1:0));return this._runTask(Ie($e,$o),p(arguments))},O.prototype.exec=function(h){let E={commands:[],format:"utf-8",parser(){typeof h=="function"&&h()}};return this._runTask(E)},O.prototype.clearQueue=function(){return this},O.prototype.checkIgnore=function(h,E){return this._runTask(X(i(f(h,l,[]))),p(arguments))},O.prototype.checkIsRepo=function(h,E){return this._runTask(Se(f(h,u)),p(arguments))},t.exports=O}});pn();yt();var l$=class extends it{constructor(e,t){super(void 0,t),this.config=e}};yt();yt();var ot=class extends it{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};Rr();Uy();ib();yb();Sb();vb();Tb();Cb();function f$(e){return e?[{type:"spawn.before",action(n,s){e.aborted&&s.kill(new ot(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function o(){s.kill(new ot(void 0,"abort","Abort signal received"))}e.addEventListener("abort",o),s.spawned.on("close",()=>e.removeEventListener("abort",o))}}]:void 0}function d$(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function p$(e,t){if(d$(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new ot(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function m$(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new ot(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(t==="clone"&&/^\s*-u\b/.test(e))throw new ot(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(t==="push"&&/^\s*--exec\b/.test(e))throw new ot(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function h$({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,o)=>{let i=o<r.length?r[o+1]:"";e||p$(s,i),t||m$(s,n.method)}),r}}}C();function g$(e){let t=ln(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}C();var Ny=(0,Tr.deferred)().promise;function y$({onClose:e=!0,onExit:t=50}={}){function r(){let s=-1,o={close:(0,Tr.deferred)(),closeTimeout:(0,Tr.deferred)(),exit:(0,Tr.deferred)(),exitTimeout:(0,Tr.deferred)()},i=Promise.race([e===!1?Ny:o.closeTimeout.promise,t===!1?Ny:o.exitTimeout.promise]);return n(e,o.close,o.closeTimeout),n(t,o.exit,o.exitTimeout),{close(a){s=a,o.close.done()},exit(a){s=a,o.exit.done()},get exitCode(){return s},result:i}}function n(s,o,i){s!==!1&&(s===!0?o.promise:o.promise.then(()=>nc(s))).then(i.done)}return{type:"spawn.after",action(s,o){return cn(this,arguments,function*(i,{spawned:a,close:c}){var u,l;let f=r(),d=!0,p=()=>void(d=!1);(u=a.stdout)==null||u.on("data",p),(l=a.stderr)==null||l.on("data",p),a.on("error",p),a.on("close",b=>f.close(b)),a.on("exit",b=>f.exit(b));try{yield f.result,d&&(yield nc(50)),c(f.exitCode)}catch(b){c(f.exitCode,b)}})}}}C();var b$="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",Py="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function w$(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function My(e,t){if(e.length<1||e.length>2)throw new ot(void 0,"binary",b$);if(e.some(w$))if(t)console.warn(Py);else throw new ot(void 0,"binary",Py);let[n,s]=e;return{binary:n,prefix:s}}function S$(e,t=["git"],r=!1){let n=My(He(t),r);e.on("binary",s=>{n=My(He(s),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}yt();function x$(e){return!!(e.exitCode&&e.stdErr.length)}function v$(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function _$(e=!1,t=x$,r=v$){return(n,s)=>!e&&n||!t(s)?n:r(s)}function Fy(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new it(void 0,n.toString("utf-8"))}:{error:n}}}}C();var E$=class{constructor(){this.plugins=new Set,this.events=new Bw.EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=F(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return He(e).forEach(r=>r&&this.plugins.add(F(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,s=Object.freeze(Object.create(r));for(let o of this.plugins)o.type===e&&(n=o.action(n,s));return n}};C();function T$(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,i){return r.includes(i.method)?Zy(o,t):o}},{type:"spawn.after",action(o,i){var a;i.commands.includes(t)&&((a=i.spawned.stderr)==null||a.on("data",c=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));u&&e({method:i.method,stage:O$(u[1]),progress:U(u[2]),processed:U(u[3]),total:U(u[4])})}))}}]}function O$(e){return String(e.toLowerCase().split(" ",1))||"unknown"}C();function R$(e){let t=Xy(e,["uid","gid"]);return{type:"spawn.options",action(r){return Ce(Ce({},t),r)}}}function k$({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){var o,i;let a;function c(){a&&clearTimeout(a),a=setTimeout(l,e)}function u(){var f,d;(f=s.spawned.stdout)==null||f.off("data",c),(d=s.spawned.stderr)==null||d.off("data",c),s.spawned.off("exit",u),s.spawned.off("close",u),a&&clearTimeout(a)}function l(){u(),s.kill(new ot(void 0,"timeout","block timeout reached"))}r&&((o=s.spawned.stdout)==null||o.on("data",c)),t&&((i=s.spawned.stderr)==null||i.on("data",c)),s.spawned.on("exit",u),s.spawned.on("close",u),c()}}}pn();function C$(){return{type:"spawn.args",action(e){let t=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<e.length;s++){let o=e[s];if(po(o)){n(cy(o));continue}if(o==="--"){n(e.slice(s+1).flatMap(i=>po(i)&&cy(i)||i));break}t.push(o)}return r?[...t,"--",...r.map(String)]:t}}}C();var A$=u$();function I$(e,t){var r;let n=new E$,s=eb(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!bc(s.baseDir))throw new l$(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(g$(s.config)),n.add(h$(s.unsafe)),n.add(C$()),n.add(y$(s.completion)),s.abort&&n.add(f$(s.abort)),s.progress&&n.add(T$(s.progress)),s.timeout&&n.add(k$(s.timeout)),s.spawnOptions&&n.add(R$(s.spawnOptions)),n.add(Fy(_$(!0))),s.errors&&n.add(Fy(s.errors)),S$(n,s.binary,(r=s.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new A$(s,n)}Rr();var Uw=I$;async function Gw(){let e=Uw();try{let{current:t}=await e.branchLocal(),r=(await e.getRemotes(!0)).map(({name:o,refs:{fetch:i}})=>({name:o,url:i})),n=r.find(({name:o})=>o==="origin")??r[0];return{possibleRepositoryName:n?n.url.split("/").slice(-2).join("/").replace(/\.git$/,""):(await e.revparse(["--show-toplevel"])).split("/").pop(),branch:t,remotes:r}}catch{return null}}var Ww=q(zw()),Uc=Ww.default.bold("@seed-design/codemod"),Zw=e=>({event:t,properties:r})=>console.log(Uc,t,r,e);var Kw=(0,Ao.resolve)(__dirname,"transforms"),Yw=Xc(),Co=Hw(),wn=null,Jw=null;function P$(){Gw().then(e=>{Jw=e,wn=Zw({...e}),M$(wn)})}function M$(e){F$(),Yw.version(Co.version).help().command("[transformName] [...paths]","\uCF54\uB4DC \uBCC0\uD658 (codemod)").option("-l, --list","\uC0AC\uC6A9 \uAC00\uB2A5\uD55C transform \uBAA9\uB85D\uC744 \uBCF4\uC5EC\uC918\uC694").option("--log","\uB85C\uADF8\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--no-track","\uC0AC\uC6A9 \uD1B5\uACC4\uB97C \uC218\uC9D1\uD558\uC9C0 \uC54A\uC544\uC694").option("-p, --parser <parser>","jscodeshift\uAC00 \uC0AC\uC6A9\uD560 \uD30C\uC11C\uB97C \uC9C0\uC815\uD574\uC694 (babel|babylon|flow|ts|tsx)",{default:"tsx"}).option("--extensions <extensions>","\uBCC0\uD658\uD560 \uD30C\uC77C \uD655\uC7A5\uC790").option("--ignore-config <ignoreConfig>","Ignore config").example(" $ npx @seed-design/codemod replace-react-icon src/ui").action(async(t,r,n)=>{let s=Wg.parse(n);s.track&&(e==null||e({event:"\uC2E4\uD589",properties:{transformName:t,paths:r}}));let o=U$();s.list&&(Gc(o),process.exit(0)),t||(console.error("transform \uC774\uB984\uC744 \uC785\uB825\uD574\uC8FC\uC138\uC694"),Gc(o),process.exit(1)),o.includes(t)||(console.error(`\uC774\uB984\uC774 ${t}\uC778 transform\uC774 \uC5C6\uC5B4\uC694`),Gc(o),process.exit(1)),r.length===0&&(console.error("\uD30C\uC77C \uACBD\uB85C\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694"),process.exit(1));let i=(0,Ao.resolve)(Kw,t,"index.js");console.log(Uc,`${r.join(", ")}\uC5D0 ${t} transform\uC744 \uC2E4\uD589\uD574\uC694.`),await B$(i,t,r,s)}),Yw.parse()}function F$(){(0,Io.satisfies)(process.versions.node,Co.engines.node)===!1&&(console.error(`Node.js \uBC84\uC804 \uC694\uAD6C\uC0AC\uD56D\uC744 \uB9CC\uC871\uC2DC\uD0A4\uC9C0 \uC54A\uC544\uC694: "${Co.engines.node}"
|
60
60
|
Node.js \uBC84\uC804\uC744 \uC5C5\uADF8\uB808\uC774\uB4DC\uD574\uC8FC\uC138\uC694.
|
61
61
|
\uD604\uC7AC \uBC84\uC804: ${process.versions.node}
|
62
62
|
|