@doubao-dev/cli 1.0.0-rc.0 → 1.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +1 -0
  2. package/bin/run.js +1 -6
  3. package/dist/691.js +128 -0
  4. package/dist/691.js.LICENSE.txt +13 -0
  5. package/dist/categories.js +1 -1
  6. package/dist/command.js +3 -2
  7. package/dist/command~1.js +4 -4
  8. package/dist/command~2.js +1 -1
  9. package/dist/command~3.js +1 -1
  10. package/dist/command~4.js +1 -1
  11. package/dist/command~5.js +5 -2
  12. package/dist/draft.js +2 -2
  13. package/dist/index.d.ts +8 -5
  14. package/dist/index.js +1 -1
  15. package/dist/main.d.ts +8 -5
  16. package/dist/main.js +1 -1
  17. package/dist/mcp-apps-inspector.js +1 -0
  18. package/dist/multipart-parser.js +2 -0
  19. package/dist/open.js +2 -0
  20. package/dist/plugin.js +3 -1
  21. package/dist/plugin.js.LICENSE.txt +58 -0
  22. package/dist/preview.js +9 -0
  23. package/dist/progress.js +1 -0
  24. package/dist/ratatui-ui.js +1 -1
  25. package/dist/rslib-runtime.js +1 -0
  26. package/dist/schema.js +1 -1
  27. package/dist/session.js +2 -1
  28. package/dist/session.js.LICENSE.txt +1 -0
  29. package/dist/skills/doubao-plugin-cli/SKILL.md +2 -2
  30. package/dist/skills/doubao-plugin-cli/references/upload.md +13 -7
  31. package/dist/uninstall.js +1 -1
  32. package/dist/versions.js +1 -1
  33. package/dist/versions~1.js +1 -0
  34. package/dist/web/index.html +1 -0
  35. package/dist/web/sandbox-proxy.html +101 -0
  36. package/dist/web/static/css/index.b3102f16b9.css +1 -0
  37. package/dist/web/static/js/155.747f5232dc.js +69 -0
  38. package/dist/web/static/js/async/970.86106314b5.js +1 -0
  39. package/dist/web/static/js/index.c1186260b9.js +4 -0
  40. package/dist/web/static/js/lib-react.00514652bf.js +2 -0
  41. package/dist/web/static/js/lib-react.00514652bf.js.LICENSE.txt +39 -0
  42. package/dist/xdg-open +1267 -0
  43. package/package.json +17 -14
  44. package/dist/472.js +0 -9
package/dist/691.js ADDED
@@ -0,0 +1,128 @@
1
+ /*! LICENSE: 691.js.LICENSE.txt */
2
+ let e,t,r,n,o,a;import{EventEmitter as u,addAbortListener as s,on as l,once as c,setMaxListeners as d}from"node:events";import D,{ChildProcess as p,execFile as h,spawn as f,spawnSync as m}from"node:child_process";import g,{basename as b,dirname as y,join as _,resolve as F}from"node:path";import C,{appendFileSync as E,createReadStream as v,createWriteStream as w,promises as S,readFileSync as A,statSync as T,writeFileSync as B}from"node:fs";import x,{execArgv as O,execPath as $,hrtime as R,platform as k,stdin as P,stdout as j}from"node:process";import{aborted as I,callbackify as z,debuglog as L,deprecate as M,inspect as U,promisify as N,stripVTControlCharacters as W,types as q}from"node:util";import H from"node:assert/strict";import{fileURLToPath as V,format as G,pathToFileURL as Z}from"node:url";import{StringDecoder as J}from"node:string_decoder";import K from"node:tty";import{scheduler as Y,setImmediate as Q,setTimeout as X}from"node:timers/promises";import ee,{constants as et,homedir as er}from"node:os";import{serialize as en}from"node:v8";import ei,{Duplex as eo,PassThrough as ea,Readable as eu,Transform as es,Writable as el,getDefaultHighWaterMark as ec,pipeline as ed}from"node:stream";import{Buffer as eD}from"node:buffer";import{finished as ep}from"node:stream/promises";import eh from"node:crypto";import ef from"node:http";import em from"node:https";import eg from"node:zlib";import{isIP as eb}from"node:net";import ey from"node:readline";import{createRequire as e_,createRequire as eF}from"node:module";import{__webpack_require__ as eC}from"./rslib-runtime.js";let eE=eF(import.meta.url);import*as ev from"node:fs";eC.add({"../../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/index.js"(e,t,r){let n=Object.assign({},r("../../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json")),o=Object.keys(n);Object.defineProperty(n,"random",{get(){let e=Math.floor(Math.random()*o.length);return n[o[e]]}}),e.exports=n},"../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(e,t,r){let n=r("child_process"),o=r("../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"),a=r("../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js");function u(e,t,r){let u=o(e,t,r),s=n.spawn(u.command,u.args,u.options);return a.hookChildProcess(s,u),s}e.exports=u,e.exports.spawn=u,e.exports.sync=function(e,t,r){let u=o(e,t,r),s=n.spawnSync(u.command,u.args,u.options);return s.error=s.error||a.verifyENOENTSync(s.status,u),s},e.exports._parse=o,e.exports._enoent=a},"../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(e){let t="win32"===process.platform;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function n(e,n){return t&&1===e&&!n.file?r(n.original,"spawn"):null}e.exports={hookChildProcess:function(e,r){if(!t)return;let o=e.emit;e.emit=function(t,a){if("exit"===t){let t=n(a,r);if(t)return o.call(e,"error",t)}return o.apply(e,arguments)}},verifyENOENT:n,verifyENOENTSync:function(e,n){return t&&1===e&&!n.file?r(n.original,"spawnSync"):null},notFoundError:r}},"../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(e,t,r){let n=r("path"),o=r("../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"),a=r("../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"),u=r("../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"),s="win32"===process.platform,l=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;e.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);let d={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?d:function(e){let t;if(!s)return e;let r=(e.file=o(e),(t=e.file&&u(e.file))?(e.args.unshift(e.file),e.command=t,o(e)):e.file),d=!l.test(r);if(e.options.forceShell||d){let t=c.test(r);e.command=n.normalize(e.command),e.command=a.command(e.command),e.args=e.args.map(e=>a.argument(e,t));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(d)}},"../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(e){let t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e.replace(t,"^$1")},e.exports.argument=function(e,r){return e=(e=(e=`${e}`).replace(/(?=(\\+?)?)\1"/g,'$1$1\\"')).replace(/(?=(\\+?)?)\1$/,"$1$1"),e=(e=`"${e}"`).replace(t,"^$1"),r&&(e=e.replace(t,"^$1")),e}},"../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(e,t,r){let n=r("fs"),o=r("../../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js");e.exports=function(e){let t,r=Buffer.alloc(150);try{t=n.openSync(e,"r"),n.readSync(t,r,0,150,0),n.closeSync(t)}catch(e){}return o(r.toString())}},"../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(e,t,r){let n=r("path"),o=r("../../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"),a=r("../../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js");function u(e,t){let r,u=e.options.env||process.env,s=process.cwd(),l=null!=e.options.cwd,c=l&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}try{r=o.sync(e.command,{path:u[a({env:u})],pathExt:t?n.delimiter:void 0})}catch(e){}finally{c&&process.chdir(s)}return r&&(r=n.resolve(l?e.options.cwd:"",r)),r}e.exports=function(e){return u(e)||u(e,!0)}},"../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(e,t,r){var n;function o(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(r,n){o(e,t||{},function(e,t){e?n(e):r(t)})})}n(e,t||{},function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)})}r("fs"),n="win32"===process.platform||global.TESTING_WINDOWS?r("../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"):r("../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"),e.exports=o,o.sync=function(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},"../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(e,t,r){e.exports=o,o.sync=function(e,t){return a(n.statSync(e),t)};var n=r("fs");function o(e,t,r){n.stat(e,function(e,n){r(e,!e&&a(n,t))})}function a(e,t){var r,n,o,a,u,s,l,c,d;return e.isFile()&&(r=e,n=t,o=r.mode,a=r.uid,u=r.gid,s=void 0!==n.uid?n.uid:process.getuid&&process.getuid(),l=void 0!==n.gid?n.gid:process.getgid&&process.getgid(),c=parseInt("100",8),d=parseInt("010",8),o&parseInt("001",8)||o&d&&u===l||o&c&&a===s||o&(c|d)&&0===s)}},"../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(e,t,r){e.exports=a,a.sync=function(e,t){return o(n.statSync(e),e,t)};var n=r("fs");function o(e,t,r){if(!e.isSymbolicLink()&&!e.isFile())return!1;var n=void 0!==r.pathExt?r.pathExt:process.env.PATHEXT;if(!n||-1!==(n=n.split(";")).indexOf(""))return!0;for(var o=0;o<n.length;o++){var a=n[o].toLowerCase();if(a&&t.substr(-a.length).toLowerCase()===a)return!0}return!1}function a(e,t,r){n.stat(e,function(n,a){r(n,!n&&o(a,e,t))})}},"../../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(e){let t=(e={})=>{let t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"};e.exports=t,e.exports.default=t},"../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(e){let t=process||{},r=t.argv||[],n=t.env||{},o=!(n.NO_COLOR||r.includes("--no-color"))&&(!!n.FORCE_COLOR||r.includes("--color")||"win32"===t.platform||(t.stdout||{}).isTTY&&"dumb"!==n.TERM||!!n.CI),a=(e,t,r=e)=>n=>{let o=""+n,a=o.indexOf(t,e.length);return~a?e+u(o,t,r,a)+t:e+o+t},u=(e,t,r,n)=>{let o="",a=0;do o+=e.substring(a,n)+r,a=n+t.length,n=e.indexOf(t,a);while(~n);return o+e.substring(a)},s=(e=o)=>{let t=e?a:()=>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")}};e.exports=s(),e.exports.createColors=s},"../../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(e,t,r){let n=r("../../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js");e.exports=(e="")=>{let t=e.match(n);if(!t)return null;let[r,o]=t[0].replace(/#! ?/,"").split(" "),a=r.split("/").pop();return"env"===a?o:o?`${a} ${o}`:a}},"../../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(e){e.exports=/^#!(.*)/},"../../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(e){let t={to:(e,t)=>t?`[${t+1};${e+1}H`:`[${e+1}G`,move(e,t){let r="";return e<0?r+=`[${-e}D`:e>0&&(r+=`[${e}C`),t<0?r+=`[${-t}A`:t>0&&(r+=`[${t}B`),r},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>"\x1b[E".repeat(e),prevLine:(e=1)=>"\x1b[F".repeat(e),left:"\x1b[G",hide:"\x1b[?25l",show:"\x1b[?25h",save:"\x1b7",restore:"\x1b8"},r={screen:"\x1b[2J",up:(e=1)=>"\x1b[1J".repeat(e),down:(e=1)=>"\x1b[J".repeat(e),line:"\x1b[2K",lineEnd:"\x1b[K",lineStart:"\x1b[1K",lines(e){let r="";for(let n=0;n<e;n++)r+=this.line+(n<e-1?t.up():"");return e&&(r+=t.left),r}};e.exports={cursor:t,scroll:{up:(e=1)=>"\x1b[S".repeat(e),down:(e=1)=>"\x1b[T".repeat(e)},erase:r,beep:"\x07"}},"../../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(e,t,r){let n="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,o=r("path"),a=n?";":":",u=r("../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"),s=e=>Object.assign(Error(`not found: ${e}`),{code:"ENOENT"}),l=(e,t)=>{let r=t.colon||a,o=e.match(/\//)||n&&e.match(/\\/)?[""]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],u=n?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=n?u.split(r):[""];return n&&-1!==e.indexOf(".")&&""!==s[0]&&s.unshift(""),{pathEnv:o,pathExt:s,pathExtExe:u}},c=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:a,pathExtExe:c}=l(e,t),d=[],D=r=>new Promise((a,u)=>{if(r===n.length)return t.all&&d.length?a(d):u(s(e));let l=n[r],c=/^".*"$/.test(l)?l.slice(1,-1):l,D=o.join(c,e);a(p(!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+D:D,r,0))}),p=(e,r,n)=>new Promise((o,s)=>{if(n===a.length)return o(D(r+1));let l=a[n];u(e+l,{pathExt:c},(a,u)=>{if(!a&&u)if(!t.all)return o(e+l);else d.push(e+l);return o(p(e,r,n+1))})});return r?D(0).then(e=>r(null,e),r):D(0)};e.exports=c,c.sync=(e,t)=>{let{pathEnv:r,pathExt:n,pathExtExe:a}=l(e,t=t||{}),c=[];for(let s=0;s<r.length;s++){let l=r[s],d=/^".*"$/.test(l)?l.slice(1,-1):l,D=o.join(d,e),p=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+D:D;for(let e=0;e<n.length;e++){let r=p+n[e];try{if(u.sync(r,{pathExt:a}))if(!t.all)return r;else c.push(r)}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw s(e)}},assert(e){e.exports=eE("assert")},buffer(e){e.exports=eE("buffer")},child_process(e){e.exports=eE("child_process")},constants(e){e.exports=eE("constants")},events(e){e.exports=eE("events")},fs(e){e.exports=eE("fs")},"node:events?5dda"(e){e.exports=eE("node:events")},"node:fs?31c0"(e){e.exports=eE("node:fs")},"node:fs/promises?3333"(e){e.exports=eE("node:fs/promises")},"node:path?815c"(e){e.exports=eE("node:path")},"node:stream?be04"(e){e.exports=eE("node:stream")},"node:string_decoder?ed86"(e){e.exports=eE("node:string_decoder")},"node:url?5295"(e){e.exports=eE("node:url")},path(e){e.exports=eE("path")},stream(e){e.exports=eE("stream")},util(e){e.exports=eE("util")},zlib(e){e.exports=eE("zlib")},"../../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json"(e){e.exports=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots13":{"interval":80,"frames":["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"sand":{"interval":80,"frames":["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","\xb4","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","\xb0","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"binary":{"interval":80,"frames":["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["\uD83D\uDE04 ","\uD83D\uDE1D "]},"monkey":{"interval":300,"frames":["\uD83D\uDE48 ","\uD83D\uDE48 ","\uD83D\uDE49 ","\uD83D\uDE4A "]},"hearts":{"interval":100,"frames":["\uD83D\uDC9B ","\uD83D\uDC99 ","\uD83D\uDC9C ","\uD83D\uDC9A ","❤️ "]},"clock":{"interval":100,"frames":["\uD83D\uDD5B ","\uD83D\uDD50 ","\uD83D\uDD51 ","\uD83D\uDD52 ","\uD83D\uDD53 ","\uD83D\uDD54 ","\uD83D\uDD55 ","\uD83D\uDD56 ","\uD83D\uDD57 ","\uD83D\uDD58 ","\uD83D\uDD59 ","\uD83D\uDD5A "]},"earth":{"interval":180,"frames":["\uD83C\uDF0D ","\uD83C\uDF0E ","\uD83C\uDF0F "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["\uD83C\uDF11 ","\uD83C\uDF12 ","\uD83C\uDF13 ","\uD83C\uDF14 ","\uD83C\uDF15 ","\uD83C\uDF16 ","\uD83C\uDF17 ","\uD83C\uDF18 "]},"runner":{"interval":140,"frames":["\uD83D\uDEB6 ","\uD83C\uDFC3 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","\uD83C\uDF24 ","⛅️ ","\uD83C\uDF25 ","☁️ ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","⛈ ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","☁️ ","\uD83C\uDF25 ","⛅️ ","\uD83C\uDF24 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["\uD83C\uDF32","\uD83C\uDF84"]},"grenade":{"interval":80,"frames":["، ","′ "," \xb4 "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["\uD83E\uDD18 ","\uD83E\uDD1F ","\uD83D\uDD96 ","✋ ","\uD83E\uDD1A ","\uD83D\uDC46 "]},"fistBump":{"interval":80,"frames":["\uD83E\uDD1C    \uD83E\uDD1B ","\uD83E\uDD1C    \uD83E\uDD1B ","\uD83E\uDD1C    \uD83E\uDD1B "," \uD83E\uDD1C  \uD83E\uDD1B  ","  \uD83E\uDD1C\uD83E\uDD1B   "," \uD83E\uDD1C✨\uD83E\uDD1B   ","\uD83E\uDD1C ✨ \uD83E\uDD1B  "]},"soccerHeader":{"interval":80,"frames":[" \uD83E\uDDD1⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️\uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 "]},"mindblown":{"interval":160,"frames":["\uD83D\uDE10 ","\uD83D\uDE10 ","\uD83D\uDE2E ","\uD83D\uDE2E ","\uD83D\uDE26 ","\uD83D\uDE26 ","\uD83D\uDE27 ","\uD83D\uDE27 ","\uD83E\uDD2F ","\uD83D\uDCA5 ","✨ ","  ","  ","  "]},"speaker":{"interval":160,"frames":["\uD83D\uDD08 ","\uD83D\uDD09 ","\uD83D\uDD0A ","\uD83D\uDD09 "]},"orangePulse":{"interval":100,"frames":["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 "]},"bluePulse":{"interval":100,"frames":["\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},"orangeBluePulse":{"interval":100,"frames":["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 ","\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},"timeTravel":{"interval":100,"frames":["\uD83D\uDD5B ","\uD83D\uDD5A ","\uD83D\uDD59 ","\uD83D\uDD58 ","\uD83D\uDD57 ","\uD83D\uDD56 ","\uD83D\uDD55 ","\uD83D\uDD54 ","\uD83D\uDD53 ","\uD83D\uDD52 ","\uD83D\uDD51 ","\uD83D\uDD50 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},"dwarfFortress":{"interval":80,"frames":[" ██████\xa3\xa3\xa3 ","☺██████\xa3\xa3\xa3 ","☺██████\xa3\xa3\xa3 ","☺▓█████\xa3\xa3\xa3 ","☺▓█████\xa3\xa3\xa3 ","☺▒█████\xa3\xa3\xa3 ","☺▒█████\xa3\xa3\xa3 ","☺░█████\xa3\xa3\xa3 ","☺░█████\xa3\xa3\xa3 ","☺ █████\xa3\xa3\xa3 "," ☺█████\xa3\xa3\xa3 "," ☺█████\xa3\xa3\xa3 "," ☺▓████\xa3\xa3\xa3 "," ☺▓████\xa3\xa3\xa3 "," ☺▒████\xa3\xa3\xa3 "," ☺▒████\xa3\xa3\xa3 "," ☺░████\xa3\xa3\xa3 "," ☺░████\xa3\xa3\xa3 "," ☺ ████\xa3\xa3\xa3 "," ☺████\xa3\xa3\xa3 "," ☺████\xa3\xa3\xa3 "," ☺▓███\xa3\xa3\xa3 "," ☺▓███\xa3\xa3\xa3 "," ☺▒███\xa3\xa3\xa3 "," ☺▒███\xa3\xa3\xa3 "," ☺░███\xa3\xa3\xa3 "," ☺░███\xa3\xa3\xa3 "," ☺ ███\xa3\xa3\xa3 "," ☺███\xa3\xa3\xa3 "," ☺███\xa3\xa3\xa3 "," ☺▓██\xa3\xa3\xa3 "," ☺▓██\xa3\xa3\xa3 "," ☺▒██\xa3\xa3\xa3 "," ☺▒██\xa3\xa3\xa3 "," ☺░██\xa3\xa3\xa3 "," ☺░██\xa3\xa3\xa3 "," ☺ ██\xa3\xa3\xa3 "," ☺██\xa3\xa3\xa3 "," ☺██\xa3\xa3\xa3 "," ☺▓█\xa3\xa3\xa3 "," ☺▓█\xa3\xa3\xa3 "," ☺▒█\xa3\xa3\xa3 "," ☺▒█\xa3\xa3\xa3 "," ☺░█\xa3\xa3\xa3 "," ☺░█\xa3\xa3\xa3 "," ☺ █\xa3\xa3\xa3 "," ☺█\xa3\xa3\xa3 "," ☺█\xa3\xa3\xa3 "," ☺▓\xa3\xa3\xa3 "," ☺▓\xa3\xa3\xa3 "," ☺▒\xa3\xa3\xa3 "," ☺▒\xa3\xa3\xa3 "," ☺░\xa3\xa3\xa3 "," ☺░\xa3\xa3\xa3 "," ☺ \xa3\xa3\xa3 "," ☺\xa3\xa3\xa3 "," ☺\xa3\xa3\xa3 "," ☺▓\xa3\xa3 "," ☺▓\xa3\xa3 "," ☺▒\xa3\xa3 "," ☺▒\xa3\xa3 "," ☺░\xa3\xa3 "," ☺░\xa3\xa3 "," ☺ \xa3\xa3 "," ☺\xa3\xa3 "," ☺\xa3\xa3 "," ☺▓\xa3 "," ☺▓\xa3 "," ☺▒\xa3 "," ☺▒\xa3 "," ☺░\xa3 "," ☺░\xa3 "," ☺ \xa3 "," ☺\xa3 "," ☺\xa3 "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & \xa3 "," & ░\xa3 "," & ▒\xa3 "," & ▓\xa3 "," & \xa3\xa3 "," & ░\xa3\xa3 "," & ▒\xa3\xa3 ","& ▓\xa3\xa3 ","& \xa3\xa3\xa3 "," ░\xa3\xa3\xa3 "," ▒\xa3\xa3\xa3 "," ▓\xa3\xa3\xa3 "," █\xa3\xa3\xa3 "," ░█\xa3\xa3\xa3 "," ▒█\xa3\xa3\xa3 "," ▓█\xa3\xa3\xa3 "," ██\xa3\xa3\xa3 "," ░██\xa3\xa3\xa3 "," ▒██\xa3\xa3\xa3 "," ▓██\xa3\xa3\xa3 "," ███\xa3\xa3\xa3 "," ░███\xa3\xa3\xa3 "," ▒███\xa3\xa3\xa3 "," ▓███\xa3\xa3\xa3 "," ████\xa3\xa3\xa3 "," ░████\xa3\xa3\xa3 "," ▒████\xa3\xa3\xa3 "," ▓████\xa3\xa3\xa3 "," █████\xa3\xa3\xa3 "," ░█████\xa3\xa3\xa3 "," ▒█████\xa3\xa3\xa3 "," ▓█████\xa3\xa3\xa3 "," ██████\xa3\xa3\xa3 "," ██████\xa3\xa3\xa3 "]}}')}});class ew extends Error{constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}class eS extends ew{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}class eA{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?(t.push(e),t):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new eS(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function eT(e){let t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"}class eB{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),r=e._getHelpCommand();return r&&!r._hidden&&t.push(r),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let r=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),r=e._getHelpOption();if(r&&!r.hidden){let n=r.short&&e._findOption(r.short),o=r.long&&e._findOption(r.long);n||o?r.long&&!o?t.push(e.createOption(r.long,r.description)):r.short&&!n&&t.push(e.createOption(r.short,r.description)):t.push(r)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let e=r.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return(e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(e=>e.description))?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(e=>eT(e)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,r)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(r)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,r)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(r)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,r)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(r)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,r)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(r)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let t=e.parent;t;t=t.parent)r=t.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatItemList(e,t,r){return 0===t.length?[]:[r.styleTitle(e),...t,""]}groupItems(e,t,r){let n=new Map;return e.forEach(e=>{let t=r(e);n.has(t)||n.set(t,[])}),t.forEach(e=>{let t=r(e);n.has(t)||n.set(t,[]),n.get(t).push(e)}),n}formatHelp(e,t){let r=t.padWidth(e,t),n=t.helpWidth??80;function o(e,n){return t.formatItem(e,r,n,t)}let a=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],u=t.commandDescription(e);u.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(u),n),""]));let s=t.visibleArguments(e).map(e=>o(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList("Arguments:",s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??"Options:").forEach((e,r)=>{let n=e.map(e=>o(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(r,n,t))}),t.showGlobalOptions){let r=t.visibleGlobalOptions(e).map(e=>o(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList("Global Options:",r,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||"Commands:").forEach((e,r)=>{let n=e.map(e=>o(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(r,n,t))}),a.join("\n")}displayWidth(e){return W(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(e=>"[options]"===e?this.styleOptionText(e):"[command]"===e?this.styleSubcommandText(e):"["===e[0]||"<"===e[0]?this.styleArgumentText(e):this.styleCommandText(e)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(e=>"[options]"===e?this.styleOptionText(e):"["===e[0]||"<"===e[0]?this.styleArgumentText(e):this.styleSubcommandText(e)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,r,n){let o,a=" ".repeat(2);if(!r)return a+e;let u=e.padEnd(t+e.length-n.displayWidth(e)),s=(this.helpWidth??80)-t-2-2;return o=s<this.minWidthToWrap||n.preformatted(r)?r:n.boxWrap(r,s).replace(/\n/g,"\n"+" ".repeat(t+2)),a+u+" ".repeat(2)+o.replace(/\n/g,`
3
+ ${a}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let r=e.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,o=[];return r.forEach(e=>{let r=e.match(n);if(null===r)return void o.push("");let a=[r.shift()],u=this.displayWidth(a[0]);r.forEach(e=>{let r=this.displayWidth(e);if(u+r<=t){a.push(e),u+=r;return}o.push(a.join(""));let n=e.trimStart();a=[n],u=this.displayWidth(n)}),o.push(a.join(""))}),o.join("\n")}}class ex{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let r=function(e){let t,r,n=/^-[^-]$/,o=/^--[^-]/,a=e.split(/[ |,]+/).concat("guard");if(n.test(a[0])&&(t=a.shift()),o.test(a[0])&&(r=a.shift()),!t&&n.test(a[0])&&(t=a.shift()),!t&&o.test(a[0])&&(t=r,r=a.shift()),a[0].startsWith("-")){let t=a[0],r=`option creation failed due to '${t}' in option flags '${e}'`;if(/^-[^-][^-]/.test(t))throw Error(`${r}
4
+ - a short flag is a single dash and a single character
5
+ - either use a single dash and a single character (for a short flag)
6
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(n.test(t))throw Error(`${r}
7
+ - too many short flags`);if(o.test(t))throw Error(`${r}
8
+ - too many long flags`);throw Error(`${r}
9
+ - unrecognised flag format`)}if(void 0===t&&void 0===r)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}(e);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return"string"==typeof e&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?(t.push(e),t):[e]}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new eS(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?e$(this.name().replace(/^no-/,"")):e$(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class eO{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let r=t.attributeName();if(!this.dualOptions.has(r))return!0;let n=this.negativeOptions.get(r).presetArg;return t.negate===((void 0!==n&&n)===e)}}function e$(e){return e.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function eR(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let n=[],o=3;return(t.forEach(t=>{if(t.length<=1)return;let r=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let t=0;t<=e.length;t++)r[t]=[t];for(let e=0;e<=t.length;e++)r[0][e]=e;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++){let a;a=+(e[o-1]!==t[n-1]),r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+a),o>1&&n>1&&e[o-1]===t[n-2]&&e[o-2]===t[n-1]&&(r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1))}return r[e.length][t.length]}(e,t),a=Math.max(e.length,t.length);(a-r)/a>.4&&(r<o?(o=r,n=[t]):r===o&&n.push(t))}),n.sort((e,t)=>e.localeCompare(t)),r&&(n=n.map(e=>`--${e}`)),n.length>1)?`
10
+ (Did you mean one of ${n.join(", ")}?)`:1===n.length?`
11
+ (Did you mean ${n[0]}?)`:""}class ek extends u{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>x.stdout.write(e),writeErr:e=>x.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>x.stdout.isTTY?x.stdout.columns:void 0,getErrHelpWidth:()=>x.stderr.isTTY?x.stderr.columns:void 0,getOutHasColors:()=>ej()??(x.stdout.isTTY&&x.stdout.hasColors?.()),getErrHasColors:()=>ej()??(x.stderr.isTTY&&x.stderr.hasColors?.()),stripColor:e=>W(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,r){let n=t,o=r;"object"==typeof n&&null!==n&&(o=n,n=null),o=o||{};let[,a,u]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return(n&&(s.description(n),s._executableHandler=!0),o.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(o.noHelp||o.hidden),s._executableFile=o.executableFile||null,u&&s.arguments(u),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),n)?this:s}createCommand(e){return new ek(e)}createHelp(){return Object.assign(new eB,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
12
+ - specify the name in Command constructor or using .name()`);return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new eA(e,t)}argument(e,t,r,n){let o=this.createArgument(e,t);return"function"==typeof r?o.default(n).argParser(r):o.default(r),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if("boolean"==typeof e)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let[,r,n]=(e??"help [command]").match(/([^ ]+) *(.*)/),o=t??"display help for command",a=this.createCommand(r);return a.helpOption(!1),n&&a.arguments(n),o&&a.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return"object"!=typeof e?this.helpCommand(e,t):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e)),this}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(void 0===this._helpCommand&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let r=["preSubcommand","preAction","postAction"];if(!r.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
13
+ Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=e=>{if("commander.executeSubCommandAsync"!==e.code)throw e},this}_exit(e,t,r){this._exitCallback&&this._exitCallback(new ew(e,t,r)),x.exit(e)}action(e){let t=t=>{let r=this.registeredArguments.length,n=t.slice(0,r);return this._storeOptionsAsProperties?n[r]=this:n[r]=this.opts(),n.push(this),e.apply(this,n)};return this._actionHandler=t,this}createOption(e,t){return new ex(e,t)}_callParseArg(e,t,r,n){try{return e.parseArg(t,r)}catch(e){if("commander.invalidArgument"===e.code){let t=`${n} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let r=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
14
+ - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),r=t(e).find(e=>this._findCommand(e));if(r){let n=t(this._findCommand(r)).join("|"),o=t(e).join("|");throw Error(`cannot add command '${o}' as already have command '${n}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),r=e.attributeName();void 0!==e.defaultValue&&this.setOptionValueWithSource(r,e.defaultValue,"default");let n=(t,n,o)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);let a=this.getOptionValue(r);null!==t&&e.parseArg?t=this._callParseArg(e,t,a,n):null!==t&&e.variadic&&(t=e._collectValue(t,a)),null==t&&(t=!e.negate&&(!!e.isBoolean()||!!e.optional||"")),this.setOptionValueWithSource(r,t,o)};return this.on("option:"+t,t=>{let r=`error: option '${e.flags}' argument '${t}' is invalid.`;n(t,r,"cli")}),e.envVar&&this.on("optionEnv:"+t,t=>{let r=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;n(t,r,"env")}),this}_optionEx(e,t,r,n,o){if("object"==typeof t&&t instanceof ex)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(t,r);if(a.makeOptionMandatory(!!e.mandatory),"function"==typeof n)a.default(o).argParser(n);else if(n instanceof RegExp){let e=n;n=(t,r)=>{let n=e.exec(t);return n?n[0]:r},a.default(o).argParser(n)}else a.default(n);return this.addOption(a)}option(e,t,r,n){return this._optionEx({},e,t,r,n)}requiredOption(e,t,r,n){return this._optionEx({mandatory:!0},e,t,r,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,r){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(r=>{void 0!==r.getOptionValueSource(e)&&(t=r.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){let r;if(void 0!==e&&!Array.isArray(e))throw Error("first parameter to parse must be array or undefined");if(t=t||{},void 0===e&&void 0===t.from){x.versions?.electron&&(t.from="electron");let e=x.execArgv??[];(e.includes("-e")||e.includes("--eval")||e.includes("-p")||e.includes("--print"))&&(t.from="eval")}switch(void 0===e&&(e=x.argv),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":x.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;case"eval":r=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_prepareForParse(){null===this._savedState?(this.options.filter(e=>e.negate&&void 0===e.defaultValue&&void 0===this.getOptionValue(e.attributeName())).forEach(e=>{let t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(e.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
15
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,r){if(C.existsSync(e))return;let n=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";throw Error(`'${e}' does not exist
16
+ - if '${r}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
17
+ - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
18
+ - ${n}`)}_executeSubCommand(e,t){let r;t=t.slice();let n=[".js",".ts",".tsx",".mjs",".cjs"];function o(e,t){let r=g.resolve(e,t);if(C.existsSync(r))return r;if(n.includes(g.extname(t)))return;let o=n.find(e=>C.existsSync(`${r}${e}`));if(o)return`${r}${o}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let a=e._executableFile||`${this._name}-${e._name}`,u=this._executableDir||"";if(this._scriptPath){let e;try{e=C.realpathSync(this._scriptPath)}catch{e=this._scriptPath}u=g.resolve(g.dirname(e),u)}if(u){let t=o(u,a);if(!t&&!e._executableFile&&this._scriptPath){let r=g.basename(this._scriptPath,g.extname(this._scriptPath));r!==this._name&&(t=o(u,`${r}-${e._name}`))}a=t||a}let s=n.includes(g.extname(a));"win32"!==x.platform?s?(t.unshift(a),t=eP(x.execArgv).concat(t),r=D.spawn(x.argv["0"],t,{stdio:"inherit"})):r=D.spawn(a,t,{stdio:"inherit"}):(this._checkForMissingExecutable(a,u,e._name),t.unshift(a),t=eP(x.execArgv).concat(t),r=D.spawn(x.execPath,t,{stdio:"inherit"})),r.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(e=>{x.on(e,()=>{!1===r.killed&&null===r.exitCode&&r.kill(e)})});let l=this._exitCallback;r.on("close",e=>{e=e??1,l?l(new ew(e,"commander.executeSubCommandAsync","(close)")):x.exit(e)}),r.on("error",t=>{if("ENOENT"===t.code)this._checkForMissingExecutable(a,u,e._name);else if("EACCES"===t.code)throw Error(`'${a}' not executable`);if(l){let e=new ew(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,l(e)}else x.exit(1)}),this.runningCommand=r}_dispatchSubcommand(e,t,r){let n,o=this._findCommand(e);return o||this.help({error:!0}),o._prepareForParse(),n=this._chainOrCallSubCommandHook(n,o,"preSubcommand"),n=this._chainOrCall(n,()=>{if(!o._executableHandler)return o._parseCommand(t,r);this._executeSubCommand(o,t.concat(r))})}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic||this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,r)=>{let n=t;if(null!==t&&e.parseArg){let o=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;n=this._callParseArg(e,t,r,o)}return n};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((r,n)=>{let o=r.defaultValue;r.variadic?n<this.args.length?(o=this.args.slice(n),r.parseArg&&(o=o.reduce((t,n)=>e(r,n,t),r.defaultValue))):void 0===o&&(o=[]):n<this.args.length&&(o=this.args[n],r.parseArg&&(o=e(r,o,r.defaultValue))),t[n]=o}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&"function"==typeof e.then?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let r=e,n=[];return this._getCommandAndAncestors().reverse().filter(e=>void 0!==e._lifeCycleHooks[t]).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{n.push({hookedCommand:e,callback:t})})}),"postAction"===t&&n.reverse(),n.forEach(e=>{r=this._chainOrCall(r,()=>e.callback(e.hookedCommand,this))}),r}_chainOrCallSubCommandHook(e,t,r){let n=e;return void 0!==this._lifeCycleHooks[r]&&this._lifeCycleHooks[r].forEach(e=>{n=this._chainOrCall(n,()=>e(this,t))}),n}_parseCommand(e,t){let r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){let r;return n(),this._processArguments(),r=this._chainOrCallHooks(r,"preAction"),r=this._chainOrCall(r,()=>this._actionHandler(this.processedArgs)),this.parent&&(r=this._chainOrCall(r,()=>{this.parent.emit(o,e,t)})),r=this._chainOrCallHooks(r,"postAction")}if(this.parent?.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let r=e.find(e=>t.conflictsWith.includes(e.attributeName()));r&&this._conflictingOption(t,r)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],r=[],n=t;function o(e){return e.length>1&&"-"===e[0]}let a=e=>!!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)&&!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))),u=null,s=null,l=0;for(;l<e.length||s;){let c=s??e[l++];if(s=null,"--"===c){n===r&&n.push(c),n.push(...e.slice(l));break}if(u&&(!o(c)||a(c))){this.emit(`option:${u.name()}`,c);continue}if(u=null,o(c)){let t=this._findOption(c);if(t){if(t.required){let r=e[l++];void 0===r&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,r)}else if(t.optional){let r=null;l<e.length&&(!o(e[l])||a(e[l]))&&(r=e[l++]),this.emit(`option:${t.name()}`,r)}else this.emit(`option:${t.name()}`);u=t.variadic?t:null;continue}}if(c.length>2&&"-"===c[0]&&"-"!==c[1]){let e=this._findOption(`-${c[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,c.slice(2)):(this.emit(`option:${e.name()}`),s=`-${c.slice(2)}`);continue}}if(/^--[^=]+=/.test(c)){let e=c.indexOf("="),t=this._findOption(c.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,c.slice(e+1));continue}}if(n===t&&o(c)&&!(0===this.commands.length&&a(c))&&(n=r),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===r.length){if(this._findCommand(c)){t.push(c),r.push(...e.slice(l));break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){t.push(c,...e.slice(l));break}else if(this._defaultCommandName){r.push(c,...e.slice(l));break}}if(this._passThroughOptions){n.push(c,...e.slice(l));break}n.push(c)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let r=0;r<t;r++){let t=this.options[r].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
19
+ `,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
20
+ `):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));let r=t||{},n=r.exitCode||1,o=r.code||"commander.error";this._exit(n,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in x.env){let t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,x.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new eO(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter(r=>void 0!==r.implied&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let r=e=>{let t=e.attributeName(),r=this.getOptionValue(t),n=this.options.find(e=>e.negate&&t===e.attributeName()),o=this.options.find(e=>!e.negate&&t===e.attributeName());return n&&(void 0===n.presetArg&&!1===r||void 0!==n.presetArg&&r===n.presetArg)?n:o||e},n=e=>{let t=r(e),n=t.attributeName();return"env"===this.getOptionValueSource(n)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},o=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let r=[],n=this;do{let e=n.createHelp().visibleOptions(n).filter(e=>e.long).map(e=>e.long);r=r.concat(e),n=n.parent}while(n&&!n._enablePositionalOptions);t=eR(e,r)}let r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,r=e.length,n=this.parent?` for '${this.name()}'`:"",o=e.join(", "),a=`error: too many arguments${n}. Expected ${t} argument${1===t?"":"s"} but got ${r}: ${o}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let r=[];this.createHelp().visibleCommands(this).forEach(e=>{r.push(e.name()),e.alias()&&r.push(e.alias())}),t=eR(e,r)}let r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";let n=this.createOption(t,r);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
21
+ `),this._exit(0,"commander.version",e)}),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(e);if(r){let t=[r.name()].concat(r.aliases()).join("|");throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>eT(e));return[].concat(this.options.length||null!==this._helpOption?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}helpGroup(e){return void 0===e?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return void 0===e?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return void 0===e?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=g.basename(e,g.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),r=this._getOutputContext(e);t.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let n=t.formatHelp(this,t);return r.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(e){let t,r,n,o=!!(e=e||{}).error;return o?(t=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),n=this._outputConfiguration.getErrHelpWidth()):(t=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),n=this._outputConfiguration.getOutHelpWidth()),{error:o,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),t(e)),hasColors:r,helpWidth:n}}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);let r=this._getOutputContext(e),n={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let o=this.helpInformation({error:r.error});if(t&&"string"!=typeof(o=t(o))&&!Buffer.isBuffer(o))throw Error("outputHelp callback must return a string or a Buffer");r.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(e=>e.emit("afterAllHelp",n))}helpOption(e,t){return"boolean"==typeof e?e?(null===this._helpOption&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null:(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),(e||t)&&this._initOptionGroup(this._helpOption)),this}_getHelpOption(){return void 0===this._helpOption&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(x.exitCode??0);0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw Error(`Unexpected value for position to addHelpText.
22
+ Expecting one of '${r.join("', '")}'`);let n=`${e}Help`;return this.on(n,e=>{let r;(r="function"==typeof t?t({error:e.error,command:e.command}):t)&&e.write(`${r}
23
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function eP(e){return e.map(e=>{let t,r;if(!e.startsWith("--inspect"))return e;let n="127.0.0.1",o="9229";return(null!==(r=e.match(/^(--inspect(-brk)?)$/))?t=r[1]:null!==(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=r[1],/^\d+$/.test(r[3])?o=r[3]:n=r[3]):null!==(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=r[1],n=r[3],o=r[4]),t&&"0"!==o)?`${t}=${n}:${parseInt(o)+1}`:e})}function ej(){return!x.env.NO_COLOR&&"0"!==x.env.FORCE_COLOR&&"false"!==x.env.FORCE_COLOR&&(!!x.env.FORCE_COLOR||void 0!==x.env.CLICOLOR_FORCE||void 0)}function eI(e){return e instanceof Error?e.message:String(e)}async function ez(e){let t=new Set;for(let{name:r}of e)H(r.trim()&&!t.has(r),`插件名称为空或重复:${r}`),t.add(r);let r={setup:[],initOptions:[],prepareTemplates:[],afterCreate:[],provideSkills:[],exclude:[],uploadSuccess:[],devTargets:[]};for(let t of e)try{await t.setup(function(e,t){return{cli:{onSetup:r=>t.setup.push({pluginName:e,callback:r})},init:{addOption:e=>t.initOptions.push(e),onPrepareTemplates:r=>t.prepareTemplates.push({pluginName:e,callback:r}),onAfterCreate:r=>t.afterCreate.push({pluginName:e,callback:r})},skills:{onProvide:r=>t.provideSkills.push({pluginName:e,callback:r})},package:{onExclude:r=>t.exclude.push({pluginName:e,callback:r})},upload:{onSuccess:r=>t.uploadSuccess.push({pluginName:e,callback:r})},dev:{addTarget:r=>{H(r.name.trim()&&!t.devTargets.some(e=>e.target.name===r.name),`开发目标名称为空或重复:${r.name}`);let n=r.option&&new ex(r.option.flags).attributeName();t.devTargets.push({pluginName:e,target:r,attribute:n})}}}}(t.name,r))}catch(e){throw Error(`[${t.name}] 注册失败:${eI(e)}`,{cause:e})}return r}async function eL(e,t){let r=await ez(t);for(let t of r.setup)await eM(t,{program:e,hooks:r})}async function eM({pluginName:e,callback:t},...r){try{return await t(...r)}catch(t){throw Error(`[${e}] ${eI(t)}`,{cause:t})}}async function eU(e,...t){let r=[];for(let n of e)r.push(...await eM(n,...t));return r}function eN(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}new ek;let eW=(e,t)=>{let r=eV(eq(e));if("string"!=typeof r)throw TypeError(`${t} must be a string or a file URL: ${r}.`);return r},eq=e=>eH(e)?e.toString():e,eH=e=>"string"!=typeof e&&e&&Object.getPrototypeOf(e)===String.prototype,eV=e=>e instanceof URL?V(e):e,eG=(e,t=[],r={})=>{let n=eW(e,"First argument"),[o,a]=eN(t)?[[],t]:[t,r];if(!Array.isArray(o))throw TypeError(`Second argument must be either an array of arguments or an options object: ${o}`);if(o.some(e=>"object"==typeof e&&null!==e))throw TypeError(`Second argument must be an array of strings: ${o}`);let u=o.map(String),s=u.find(e=>e.includes("\0"));if(void 0!==s)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!eN(a))throw TypeError(`Last argument must be an options object: ${a}`);return[n,u,a]},{toString:eZ}=Object.prototype,eJ=e=>"[object Uint8Array]"===eZ.call(e),eK=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),eY=new TextEncoder,eQ=new TextDecoder,eX=e=>1===e.length&&eJ(e[0])?e[0]:e2(e0(e)),e0=e=>e.map(e=>"string"==typeof e?eY.encode(e):e),e2=e=>{let t=new Uint8Array(e1(e)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t},e1=e=>{let t=0;for(let r of e)t+=r.length;return t},e8=({templates:e,expressions:t,tokens:r,index:n,template:o})=>{if(void 0===o)throw TypeError(`Invalid backslash sequence: ${e.raw[n]}`);let{nextTokens:a,leadingWhitespaces:u,trailingWhitespaces:s}=e3(o,e.raw[n]),l=e7(r,a,u);if(n===t.length)return l;let c=t[n];return e7(l,Array.isArray(c)?c.map(e=>e4(e)):[e4(c)],s)},e3=(e,t)=>{if(0===t.length)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,o=e6.has(t[0]);for(let o=0,a=0;o<e.length;o+=1,a+=1){let u=t[a];if(e6.has(u))n!==o&&r.push(e.slice(n,o)),n=o+1;else if("\\"===u){let e=t[a+1];"\n"===e?(o-=1,a+=1):"u"===e&&"{"===t[a+2]?a=t.indexOf("}",a+3):a+=e9[e]??1}}let a=n===e.length;return a||r.push(e.slice(n)),{nextTokens:r,leadingWhitespaces:o,trailingWhitespaces:a}},e6=new Set([" "," ","\r","\n"]),e9={x:3,u:5},e7=(e,t,r)=>r||0===e.length||0===t.length?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],e4=e=>{let t=typeof e;if("string"===t)return e;if("number"===t)return String(e);if(eN(e)&&("stdout"in e||"isMaxBuffer"in e))return e5(e);if(e instanceof p||"[object Promise]"===Object.prototype.toString.call(e))throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${t}" in template expression`)},e5=({stdout:e})=>{if("string"==typeof e)return e;if(eJ(e))return eQ.decode(e);if(void 0===e)throw TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\' "stdout" option.');throw TypeError(`Unexpected "${typeof e}" stdout in template expression`)},te=e=>tt.includes(e),tt=[x.stdin,x.stdout,x.stderr],tr=["stdin","stdout","stderr"],tn=e=>tr[e]??`stdio[${e}]`,ti=(e,t)=>{let r=Array.from({length:to(e)+1});return tp(ta(e[t],r,t),t)},to=({stdio:e})=>Array.isArray(e)?Math.max(e.length,tr.length):tr.length,ta=(e,t,r)=>eN(e)?tu(e,t,r):t.fill(e),tu=(e,t,r)=>{for(let n of Object.keys(e).sort(ts))for(let o of tc(n,r,t))t[o]=e[n];return t},ts=(e,t)=>tl(e)<tl(t)?1:-1,tl=e=>"stdout"===e||"stderr"===e?0:"all"===e?2:1,tc=(e,t,r)=>{if("ipc"===e)return[r.length-1];let n=td(e);if(void 0===n||0===n)throw TypeError(`"${t}.${e}" is invalid.
24
+ It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(n>=r.length)throw TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
25
+ Please set the "stdio" option to ensure that file descriptor exists.`);return"all"===n?[1,2]:[n]},td=e=>{if("all"===e)return e;if(tr.includes(e))return tr.indexOf(e);let t=tD.exec(e);if(null!==t)return Number(t[1])},tD=/^fd(\d+)$/,tp=(e,t)=>e.map(e=>void 0===e?th[t]:e),th={lines:!1,buffer:!0,maxBuffer:1e8,verbose:L("execa").enabled?"full":"none",stripFinalNewline:!0},tf=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],tm=(e,t)=>"ipc"===t?e.at(-1):e[t],tg=({verbose:e},t)=>!["none","short"].includes(tb(e,t)),tb=(e,t)=>void 0===t?ty(e):tm(e,t),ty=e=>e.find(e=>t_(e))??tF.findLast(t=>e.includes(t)),t_=e=>"function"==typeof e,tF=["none","short","full"],tC=e=>W(e).split("\n").map(e=>tE(e)).join("\n"),tE=e=>e.replaceAll(tw,e=>tv(e)),tv=e=>{let t=tS[e];if(void 0!==t)return t;let r=e.codePointAt(0),n=r.toString(16);return r<=tA?`\\u${n.padStart(4,"0")}`:`\\U${n}`},tw=(()=>{try{return RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),tS={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},tA=65535,tT=/^[\w./-]+$/;function tB(){let{env:e}=x,{TERM:t,TERM_PROGRAM:r}=e;return"win32"!==x.platform?"linux"!==t:!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===r||"vscode"===r||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}let tx={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"\xbd",oneThird:"⅓",oneQuarter:"\xbc",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"\xbe",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},tO={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},t$={...tx,...tO},tR={...tx,tick:"√",info:"i",warning:"‼",cross:"\xd7",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(\xd7)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xd7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xd7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},tk=tB()?t$:tR;Object.entries(tO);let tP=K?.WriteStream?.prototype?.hasColors?.()??!1,tj=(e,t)=>{if(!tP)return e=>e;let r=`\u001B[${e}m`,n=`\u001B[${t}m`;return e=>{let o=e+"",a=o.indexOf(n);if(-1===a)return r+o+n;let u=r,s=0,l=(22===t?n:"")+r;for(;-1!==a;)u+=o.slice(s,a)+l,s=a+n.length,a=o.indexOf(n,s);return u+(o.slice(s)+n)}};tj(0,0);let tI=tj(1,22);tj(2,22),tj(3,23),tj(4,24),tj(53,55),tj(7,27),tj(8,28),tj(9,29),tj(30,39),tj(31,39),tj(32,39),tj(33,39),tj(34,39),tj(35,39),tj(36,39),tj(37,39);let tz=tj(90,39);tj(40,49),tj(41,49),tj(42,49),tj(43,49),tj(44,49),tj(45,49),tj(46,49),tj(47,49),tj(100,49);let tL=tj(91,39);tj(92,39);let tM=tj(93,39);tj(94,39),tj(95,39),tj(96,39),tj(97,39),tj(101,49),tj(102,49),tj(103,49),tj(104,49),tj(105,49),tj(106,49),tj(107,49);let tU=(e,t)=>String(e).padStart(t,"0"),tN=({failed:e,reject:t})=>e?t?tk.cross:tk.warning:tk.tick,tW={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:tN,duration:tN},tq=e=>e,tH={command:()=>tI,output:()=>tq,ipc:()=>tq,error:({reject:e})=>e?tL:tM,duration:()=>tz},tV=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:n,result:o})=>{var a;let u,s=(a=tZ(t,tG({type:e,result:o,verboseInfo:n})),u=(({verbose:e},t)=>{let r=tb(e,t);return t_(r)?r:void 0})(n,r),a.map(({verboseLine:e,verboseObject:t})=>((e,t,r)=>{if(void 0===r)return e;let n=r(e,t);if("string"==typeof n)return n})(e,t,u)).filter(e=>void 0!==e).map(e=>{let t;return(t=e).endsWith("\n")?t:`${t}
26
+ `}).join(""));""!==s&&console.warn(s.slice(0,-1))},tG=({type:e,result:t,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:o=!1,...a}}})=>({type:e,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:o,result:t,options:a}),tZ=(e,t)=>e.split("\n").map(e=>tJ({...t,message:e})),tJ=e=>({verboseLine:(({type:e,message:t,timestamp:r,piped:n,commandId:o,result:{failed:a=!1}={},options:{reject:u=!0}})=>{let s,l=(s=r,`${tU(s.getHours(),2)}:${tU(s.getMinutes(),2)}:${tU(s.getSeconds(),2)}.${tU(s.getMilliseconds(),3)}`),c=tW[e]({failed:a,reject:u,piped:n}),d=tH[e]({reject:u});return`${tz(`[${l}]`)} ${tz(`[${o}]`)} ${d(c)} ${d(t)}`})(e),verboseObject:e}),tK=e=>tC("string"==typeof e?e:U(e)).replaceAll(" "," ".repeat(tY)),tY=2,tQ=0n,tX=e=>Number(R.bigint()-e)/1e6,t0=(e,t,r)=>{var n,o;let a,u,s=R.bigint(),{command:l,escapedCommand:c}={command:(a=[e,...t]).join(" "),escapedCommand:a.map(e=>{let t;return tT.test(t=tE(e))?t:"win32"===k?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`}).join(" ")},d=(n=ti(r,"verbose"),o={...r},(e=>{for(let t of e){if(!1===t)throw TypeError('The "verbose: false" option was renamed to "verbose: \'none\'".');if(!0===t)throw TypeError('The "verbose: true" option was renamed to "verbose: \'short\'".');if(!tF.includes(t)&&!t_(t)){let e=tF.map(e=>`'${e}'`).join(", ");throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}})(n),u=(({verbose:e})=>"none"!==tb(e,void 0))({verbose:n})?tQ++:void 0,{verbose:n,escapedCommand:c,commandId:u,rawOptions:o});return(({verbose:e})=>"none"!==tb(e,void 0))(d)&&tV({type:"command",verboseMessage:c,verboseInfo:d}),{command:l,escapedCommand:c,startTime:s,verboseInfo:d}};function t2(e={}){let{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"}function t1(e){return e instanceof URL?V(e):e}N(h);class t8 extends Error{}let t3=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,t6,{value:!0,writable:!1,enumerable:!1,configurable:!1})},t6=Symbol("isExecaError"),t9=e=>"[object Error]"===Object.prototype.toString.call(e);class t7 extends Error{}t3(t7,t7.name);class t4 extends Error{}t3(t4,t4.name);let t5=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],re=(e,t)=>({name:`SIGRT${t+1}`,number:rt+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),rt=34,rr=()=>[...t5,...Array.from({length:64-rt+1},re)].map(rn),rn=({name:e,number:t,description:r,action:n,forced:o=!1,standard:a})=>{let{signals:{[e]:u}}=et,s=void 0!==u;return{name:e,number:s?u:t,description:r,supported:s,action:n,forced:o,standard:a}},ri=Object.fromEntries(rr().map(({name:e,number:t,description:r,supported:n,action:o,forced:a,standard:u})=>[e,{name:e,number:t,description:r,supported:n,action:o,forced:a,standard:u}])),ro=(e,t)=>{let r=t.find(({name:t})=>et.signals[t]===e);return void 0!==r?r:t.find(t=>t.number===e)};t=rr(),Object.assign({},...Array.from({length:65},(e,r)=>((e,t)=>{let r=ro(e,t);if(void 0===r)return{};let{name:n,description:o,supported:a,action:u,forced:s,standard:l}=r;return{[e]:{name:n,number:e,description:o,supported:a,action:u,forced:s,standard:l}}})(r,t)));let ra=(e,t)=>{if(Number.isInteger(e))return ru(e,t);if("string"==typeof e)return rl(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
27
+ ${rc()}`)},ru=(e,t)=>{if(rs.has(e))return rs.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
28
+ ${rc()}`)},rs=new Map(Object.entries(et.signals).reverse().map(([e,t])=>[t,e])),rl=(e,t)=>{if(e in et.signals)return e;if(e.toUpperCase()in et.signals)throw TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`);throw TypeError(`Invalid ${t} '${e}': this signal name does not exist.
29
+ ${rc()}`)},rc=()=>`Available signal names: ${rd()}.
30
+ Available signal numbers: ${rD()}.`,rd=()=>Object.keys(et.signals).sort().map(e=>`'${e}'`).join(", "),rD=()=>[...new Set(Object.values(et.signals).sort((e,t)=>e-t))].join(", "),rp=e=>ri[e].description,rh=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:o,controller:a},u,s)=>{let{signal:l,error:c}=rf(u,s,r);rm(c,n);let d=e(l);return rg({kill:e,signal:l,forceKillAfterDelay:t,killSignal:r,killResult:d,context:o,controller:a}),d},rf=(e,t,r)=>{let[n=r,o]=t9(e)?[void 0,e]:[e,t];if("string"!=typeof n&&!Number.isInteger(n))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(void 0!==o&&!t9(o))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:0===n?n:ra(n,"`subprocess.kill()`'s argument"),error:o}},rm=(e,t)=>{void 0!==e&&t.reject(e)},rg=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:o,context:a,controller:u})=>{t===n&&o&&rb({kill:e,forceKillAfterDelay:r,context:a,controllerSignal:u.signal})},rb=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(!1!==t)try{await X(t,void 0,{signal:n}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}},ry=async(e,t)=>{e.aborted||await c(e,"abort",{signal:t})},r_=async(e,t,r,{signal:n})=>{throw await ry(t,n),r.terminationReason??="cancel",e.kill(),t.reason},rF=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{rC(e,t,r),rE(e,t,n)},rC=(e,t,r)=>{if(!r)throw Error(`${rA(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},rE=(e,t,r)=>{if(!r)throw Error(`${rA(e,t)} cannot be used: the ${rB(t)} has already exited or disconnected.`)},rv=(e,t)=>Error(`${rA("sendMessage",t)} failed when sending an acknowledgment response to the ${rB(t)}.`,{cause:e}),rw=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),rS=["could not be cloned","circular structure","call stack size exceeded"],rA=(e,t,r="")=>"cancelSignal"===e?"`cancelSignal`'s `controller.abort()`":`${rT(t)}${e}(${r})`,rT=e=>e?"":"subprocess.",rB=e=>e?"parent process":"subprocess",rx=e=>{e.connected&&e.disconnect()},rO=()=>{let e={};return Object.assign(new Promise((t,r)=>{Object.assign(e,{resolve:t,reject:r})}),e)},r$=(e,t="stdin")=>{let{options:r,fileDescriptors:n}=rk.get(e),o=rP(n,t,!0),a=e.stdio[o];if(null===a)throw TypeError(rz(o,t,r,!0));return a},rR=(e,t="stdout")=>{let{options:r,fileDescriptors:n}=rk.get(e),o=rP(n,t,!1),a="all"===o?e.all:e.stdio[o];if(null==a)throw TypeError(rz(o,t,r,!1));return a},rk=new WeakMap,rP=(e,t,r)=>{let n=rj(t,r);return rI(n,t,r,e),n},rj=(e,t)=>{let r=td(e);if(void 0!==r)return r;let{validOptions:n,defaultValue:o}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${rU(t)}" must not be "${e}".
31
+ It must be ${n} or "fd3", "fd4" (and so on).
32
+ It is optional and defaults to "${o}".`)},rI=(e,t,r,n)=>{let o=n[rM(e)];if(void 0===o)throw TypeError(`"${rU(r)}" must not be ${t}. That file descriptor does not exist.
33
+ Please set the "stdio" option to ensure that file descriptor exists.`);if("input"===o.direction&&!r)throw TypeError(`"${rU(r)}" must not be ${t}. It must be a readable stream, not writable.`);if("input"!==o.direction&&r)throw TypeError(`"${rU(r)}" must not be ${t}. It must be a writable stream, not readable.`)},rz=(e,t,r,n)=>{if("all"===e&&!r.all)return'The "all" option must be true to use "from: \'all\'".';let{optionName:o,optionValue:a}=rL(e,r);return`The "${o}: ${rN(a)}" option is incompatible with using "${rU(n)}: ${rN(t)}".
34
+ Please set this option with "pipe" instead.`},rL=(e,{stdin:t,stdout:r,stderr:n,stdio:o})=>{let a=rM(e);return 0===a&&void 0!==t?{optionName:"stdin",optionValue:t}:1===a&&void 0!==r?{optionName:"stdout",optionValue:r}:2===a&&void 0!==n?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${a}]`,optionValue:o[a]}},rM=e=>"all"===e?1:e,rU=e=>e?"to":"from",rN=e=>"string"==typeof e?`'${e}'`:"number"==typeof e?`${e}`:"Stream",rW=(e,t,r)=>{let n=e.getMaxListeners();0!==n&&n!==1/0&&(e.setMaxListeners(n+t),s(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},rq=(e,t)=>{t&&rH(e)},rH=e=>{e.refCounted()},rV=(e,t)=>{t&&rG(e)},rG=e=>{e.unrefCounted()},rZ=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},o)=>{if(r3(o)||nD(o))return;rK.has(e)||rK.set(e,[]);let a=rK.get(e);if(a.push(o),!(a.length>1))for(;a.length>0;){await ne(e,n,o),await Y.yield();let u=await r8({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});a.shift(),n.emit("message",u),n.emit("message:done")}},rJ=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:o})=>{nh();let a=rK.get(e);for(;a?.length>0;)await c(n,"message:done");e.removeListener("message",o),r&&(rH(t),rH(t)),n.connected=!1,n.emit("disconnect")},rK=new WeakMap,rY=(e,t,r)=>{if(rQ.has(e))return rQ.get(e);let n=new u;return n.connected=!0,rQ.set(e,n),rX({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},rQ=new WeakMap,rX=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{let o=rZ.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",o),t.once("disconnect",rJ.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:o})),n&&(rG(r),rG(r))},r0=e=>{let t=rQ.get(e);return void 0===t?null!==e.channel:t.connected},r2=0n,r1=(e,t)=>{if(t?.type===r4&&!t.hasListeners)for(let{id:t}of e)void 0!==t&&r9[t].resolve({isDeadlock:!0,hasListeners:!1})},r8=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:o})=>{if(e?.type!==r4||!t.connected)return e;let{id:a,message:u}=e,s={id:a,type:r5,message:nr(t,o)};try{await ni({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},s)}catch(e){o.emit("strict:error",e)}return u},r3=e=>{if(e?.type!==r5)return!1;let{id:t,message:r}=e;return r9[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},r6=async(e,t,r)=>{if(e?.type!==r4)return;let n=rO();r9[e.id]=n;let o=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([n,r7(t,r,o)]);e&&(e=>{throw Error(`${rA("sendMessage",e)} failed: the ${rB(e)} is sending a message too, instead of listening to incoming messages.
35
+ This can be fixed by both sending a message and listening to incoming messages at the same time:
36
+
37
+ const [receivedMessage] = await Promise.all([
38
+ ${rA("getOneMessage",e)},
39
+ ${rA("sendMessage",e,"message, {strict: true}")},
40
+ ]);`)})(r),a||(e=>{throw Error(`${rA("sendMessage",e)} failed: the ${rB(e)} is not listening to incoming messages.`)})(r)}finally{o.abort(),delete r9[e.id]}},r9={},r7=async(e,t,{signal:r})=>{rW(e,1,r),await c(e,"disconnect",{signal:r});throw Error(`${rA("sendMessage",t)} failed: the ${rB(t)} exited without listening to incoming messages.`)},r4="execa:ipc:request",r5="execa:ipc:response",ne=async(e,t,r)=>{for(;!nr(e,t)&&nt.get(e)?.size>0;){let t=[...nt.get(e)];r1(t,r),await Promise.all(t.map(({onMessageSent:e})=>e))}},nt=new WeakMap,nr=(e,t)=>t.listenerCount("message")>nn(e),nn=e=>rk.has(e)&&!tm(rk.get(e).options.buffer,"ipc")?1:0,ni=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},o,{strict:a=!1}={})=>{let u="sendMessage";return rF({methodName:u,isSubprocess:r,ipc:n,isConnected:e.connected}),no({anyProcess:e,channel:t,methodName:u,isSubprocess:r,message:o,strict:a})},no=async({anyProcess:e,channel:t,methodName:r,isSubprocess:n,message:o,strict:a})=>{let u,s,l=(({anyProcess:e,channel:t,isSubprocess:r,message:n,strict:o})=>{if(!o)return n;let a=rY(e,t,r),u=nr(e,a);return{id:r2++,type:r4,message:n,hasListeners:u}})({anyProcess:e,channel:t,isSubprocess:n,message:o,strict:a}),c=(nt.has(e)||nt.set(e,new Set),u=nt.get(e),s={onMessageSent:rO(),id:a?l.id:void 0},u.add(s),{outgoingMessages:u,outgoingMessage:s});try{await na({anyProcess:e,methodName:r,isSubprocess:n,wrappedMessage:l,message:o})}catch(t){throw rx(e),t}finally{(({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()})(c)}},na=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:n,message:o})=>{let a=nu(e);try{await Promise.all([r6(n,e,r),a(n)])}catch(e){throw(({error:e,methodName:t,isSubprocess:r})=>{if("EPIPE"===e.code)throw Error(`${rA(t,r)} cannot be used: the ${rB(r)} is disconnecting.`,{cause:e})})({error:e,methodName:t,isSubprocess:r}),(({error:e,methodName:t,isSubprocess:r,message:n})=>{if((({code:e,message:t})=>rw.has(e)||rS.some(e=>t.includes(e)))(e))throw Error(`${rA(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:e})})({error:e,methodName:t,isSubprocess:r,message:o}),e}},nu=e=>{if(ns.has(e))return ns.get(e);let t=N(e.send.bind(e));return ns.set(e,t),t},ns=new WeakMap,nl=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>(await nc({anyProcess:e,channel:t,isSubprocess:r,ipc:n}),nf.signal),nc=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>{if(!nd){if(nd=!0,!n)return void(()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")})();if(null===t)return void nh();rY(e,t,r),await Y.yield()}},nd=!1,nD=e=>e?.type===np&&(nf.abort(e.message),!0),np="execa:ipc:cancel",nh=()=>{nf.abort(Error(`\`cancelSignal\` aborted: the ${rB(!0)} disconnected.`))},nf=new AbortController,nm=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:n,controller:{signal:o}})=>{let a;await ry(t,o);let u=ng(t);throw await (rE(a="cancelSignal",!1,e.connected),na({anyProcess:e,methodName:a,isSubprocess:!1,wrappedMessage:{type:np,message:u},message:u})),rb({kill:e.kill,forceKillAfterDelay:r,context:n,controllerSignal:o}),n.terminationReason??="gracefulCancel",t.reason},ng=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},nb=async(e,t,r,{signal:n})=>{throw await X(t,void 0,{signal:n}),r.terminationReason??="timeout",e.kill(),new t8},ny={advanced:e=>{try{en(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},n_=async(e,t)=>{void 0!==t&&await e.sendMessage(t)},nF=new Set(["utf8","utf16le"]),nC=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),nE=new Set([...nF,...nC]),nv={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},nw=e=>"string"==typeof e?`"${e}"`:String(e),nS=()=>{try{return x.cwd()}catch(e){throw e.message=`The current directory does not exist.
41
+ ${e.message}`,e}},nA=eC("../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"),nT=(e,t,r)=>{r.cwd=((e=nS())=>{let t=eW(e,'The "cwd" option');return g.resolve(t)})(r.cwd);let[n,o,a]=((e,t,{node:r=!1,nodePath:n=$,nodeOptions:o=O.filter(e=>!e.startsWith("--inspect")),cwd:a,execPath:u,...s})=>{if(void 0!==u)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let l=eW(n,'The "nodePath" option'),c=g.resolve(a,l),d={...s,nodePath:c,node:r,cwd:a};if(!r)return[e,t,d];if("node"===g.basename(e,".exe"))throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[c,[...o,e,...t],{ipc:!0,...d,shell:!1}]})(e,t,r),{command:u,args:s,options:l}=nA._parse(n,o,a),c=nB((e=>{let t={...e};for(let r of tf)t[r]=ti(e,r);return t})(l));return(({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)})(c),(({encoding:e})=>{if(nE.has(e))return;let t=(e=>{if(null===e)return"buffer";if("string"!=typeof e)return;let t=e.toLowerCase();return t in nv?nv[t]:nE.has(t)?t:void 0})(e);if(void 0!==t)throw TypeError(`Invalid option \`encoding: ${nw(e)}\`.
42
+ Please rename it to ${nw(t)}.`);let r=[...nE].map(e=>nw(e)).join(", ");throw TypeError(`Invalid option \`encoding: ${nw(e)}\`.
43
+ Please rename it to one of: ${r}.`)})(c),(({ipcInput:e,ipc:t,serialization:r})=>{if(void 0!==e){if(!t)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");ny[r](e)}})(c),(({cancelSignal:e})=>{if(void 0!==e&&"[object AbortSignal]"!==Object.prototype.toString.call(e))throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)})(c),(({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:n})=>{if(e){if(void 0===t)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if("json"===n)throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}})(c),c.shell=eV(c.shell),c.env=nx(c),c.killSignal=(e=>{let t="option `killSignal`";if(0===e)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return ra(e,t)})(c.killSignal),c.forceKillAfterDelay=(e=>{if(!1===e)return e;if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e})(c.forceKillAfterDelay),c.lines=c.lines.map((e,t)=>e&&!nC.has(c.encoding)&&c.buffer[t]),"win32"===x.platform&&"cmd"===g.basename(u,".exe")&&s.unshift("/q"),{file:u,commandArguments:s,options:c}},nB=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:n=r,encoding:o="utf8",reject:a=!0,cleanup:u=!0,all:s=!1,windowsHide:l=!0,killSignal:c="SIGTERM",forceKillAfterDelay:d=!0,gracefulCancel:D=!1,ipcInput:p,ipc:h=void 0!==p||D,serialization:f="advanced",...m})=>({...m,extendEnv:e,preferLocal:t,cwd:r,localDirectory:n,encoding:o,reject:a,cleanup:u,all:s,windowsHide:l,killSignal:c,forceKillAfterDelay:d,gracefulCancel:D,ipcInput:p,ipc:h,serialization:f}),nx=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:o,nodePath:a})=>{let u=t?{...x.env,...e}:e;return r||n?(({env:e=x.env,...t}={})=>{let r=t2({env:e={...e}});return t.path=e[r],e[r]=(({cwd:e=x.cwd(),path:t=x.env[t2()],preferLocal:r=!0,execPath:n=x.execPath,addExecPath:o=!0}={})=>{var a,u,s,l;let c,d=g.resolve(t1(e)),D=[],p=t.split(g.delimiter);return r&&((e,t,r)=>{for(let n of{*[Symbol.iterator](){let e,t=g.resolve(t1(r));for(;e!==t;)yield t,e=t,t=g.resolve(t,"..")}}){let r=g.join(n,"node_modules/.bin");t.includes(r)||e.push(r)}})(D,p,d),o&&(a=D,u=p,s=n,l=d,c=g.resolve(l,t1(s),".."),u.includes(c)||a.push(c)),""===t||t===g.delimiter?`${D.join(g.delimiter)}${t}`:[...D,t].join(g.delimiter)})(t),e})({env:u,cwd:o,execPath:a,preferLocal:r,addExecPath:n}):u},nO=(e,t,r)=>r.shell&&t.length>0?[[e,...t].join(" "),[],r]:[e,t,r];function n$(e){if("string"==typeof e)return nR(e);if(!(ArrayBuffer.isView(e)&&1===e.BYTES_PER_ELEMENT))throw Error("Input must be a string or a Uint8Array");return nk(e)}let nR=e=>e.at(-1)===nP?e.slice(0,e.at(-2)===nI?-2:-1):e,nk=e=>e.at(-1)===nj?e.subarray(0,e.at(-2)===nz?-2:-1):e,nP="\n",nj=nP.codePointAt(0),nI="\r",nz=nI.codePointAt(0);function nL(e,{checkOpen:t=!0}={}){return null!==e&&"object"==typeof e&&(e.writable||e.readable||!t||void 0===e.writable&&void 0===e.readable)&&"function"==typeof e.pipe}function nM(e,{checkOpen:t=!0}={}){return nL(e,{checkOpen:t})&&(e.writable||!t)&&"function"==typeof e.write&&"function"==typeof e.end&&"boolean"==typeof e.writable&&"boolean"==typeof e.writableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function nU(e,{checkOpen:t=!0}={}){return nL(e,{checkOpen:t})&&(e.readable||!t)&&"function"==typeof e.read&&"boolean"==typeof e.readable&&"boolean"==typeof e.readableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function nN(e,t){return nM(e,t)&&nU(e,t)}let nW=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class nq{#e;#t;#r=!1;#n=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){let e=()=>this.#i();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let t=()=>this.#o(e);return this.#n?this.#n.then(t,t):t()}async #i(){let e;if(this.#r)return{done:!0,value:void 0};try{e=await this.#e.read()}catch(e){throw this.#n=void 0,this.#r=!0,this.#e.releaseLock(),e}return e.done&&(this.#n=void 0,this.#r=!0,this.#e.releaseLock()),e}async #o(e){if(this.#r)return{done:!0,value:e};if(this.#r=!0,!this.#t){let t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}}let nH=Symbol();function nV(){return this[nH].next()}function nG(e){return this[nH].return(e)}Object.defineProperty(nV,"name",{value:"next"}),Object.defineProperty(nG,"name",{value:"return"});let nZ=Object.create(nW,{next:{enumerable:!0,configurable:!0,writable:!0,value:nV},return:{enumerable:!0,configurable:!0,writable:!0,value:nG}});function nJ({preventCancel:e=!1}={}){let t=new nq(this.getReader(),e),r=Object.create(nZ);return r[nH]=t,r}let{toString:nK}=Object.prototype,nY=async function*(e){let t=new AbortController,r={};nQ(e,t,r);try{for await(let[r]of nX.on(e,"data",{signal:t.signal}))yield r}catch(e){if(void 0!==r.error)throw r.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},nQ=async(e,t,r)=>{try{await nX.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){r.error=e}finally{t.abort()}},nX={},n0=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:o,addChunk:a,getFinalChunk:u,finalize:s},{maxBuffer:l=1/0}={})=>{let c=(e=>{if(nU(e,{checkOpen:!1})&&void 0!==nX.on)return nY(e);if("function"==typeof e?.[Symbol.asyncIterator])return e;if("[object ReadableStream]"===nK.call(e))return nJ.call(e);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")})(e),d=t();d.length=0;try{for await(let e of c){let t=r[n3(e)](e,d);n1({convertedChunk:t,state:d,getSize:n,truncateChunk:o,addChunk:a,maxBuffer:l})}return n2({state:d,convertChunk:r,getSize:n,truncateChunk:o,addChunk:a,getFinalChunk:u,maxBuffer:l}),s(d)}catch(t){let e="object"==typeof t&&null!==t?t:Error(t);throw e.bufferedData=s(d),e}},n2=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:a})=>{let u=o(e);void 0!==u&&n1({convertedChunk:u,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:a})},n1=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:a})=>{let u=r(e),s=t.length+u;if(s<=a)return void n8(e,t,o,s);let l=n(e,a-t.length);throw void 0!==l&&n8(l,t,o,a),new n9},n8=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},n3=e=>{let t=typeof e;if("string"===t)return"string";if("object"!==t||null===e)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=n6.call(e);return"[object ArrayBuffer]"===r?"arrayBuffer":"[object DataView]"===r?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&"[object ArrayBuffer]"===n6.call(e.buffer)?"typedArray":"others"},{toString:n6}=Object.prototype;class n9 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}let n7=(e,t,r)=>{if(t.length!==r)return;let n=new n9;throw n.maxBufferInfo={fdNumber:"ipc"},n},n4=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",n5=e=>{if("string"==typeof e)return e;if(eJ(e))return eQ.decode(e);return""},ie=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:o,options:{cwd:a},startTime:u})=>io({command:e,escapedCommand:t,cwd:a,durationMs:tX(u),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:o,pipedFrom:[]}),it=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:a,isSync:u})=>ir({error:e,command:t,escapedCommand:r,startTime:a,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:o,isSync:u}),ir=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:a,isGracefullyCanceled:u,isMaxBuffer:s,isForcefullyTerminated:l,exitCode:c,signal:d,stdio:D,all:p,ipcOutput:h,options:{timeoutDuration:f,timeout:m=f,forceKillAfterDelay:g,killSignal:b,cwd:y,maxBuffer:_},isSync:F})=>{let{exitCode:C,signal:E,signalDescription:v}=ia(c,d),{originalMessage:w,shortMessage:S,message:A}=(({stdio:e,all:t,ipcOutput:r,originalError:n,signal:o,signalDescription:a,exitCode:u,escapedCommand:s,timedOut:l,isCanceled:c,isGracefullyCanceled:d,isMaxBuffer:D,isForcefullyTerminated:p,forceKillAfterDelay:h,killSignal:f,maxBuffer:m,timeout:g,cwd:b})=>{let y=n?.code,_=(({originalError:e,timedOut:t,timeout:r,isMaxBuffer:n,maxBuffer:o,errorCode:a,signal:u,signalDescription:s,exitCode:l,isCanceled:c,isGracefullyCanceled:d,isForcefullyTerminated:D,forceKillAfterDelay:p,killSignal:h})=>{let f=n4(D,p);return t?`Command timed out after ${r} milliseconds${f}`:d?void 0===u?`Command was gracefully canceled with exit code ${l}`:D?`Command was gracefully canceled${f}`:`Command was gracefully canceled with ${u} (${s})`:c?`Command was canceled${f}`:n?`${((e,t)=>{let{streamName:r,threshold:n,unit:o}=((e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=e;delete e.maxBufferInfo;let o=tm(t,r);return"ipc"===r?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:tn(r),threshold:o,unit:n}})(e,t);return`Command's ${r} was larger than ${n} ${o}`})(e,o)}${f}`:void 0!==a?`Command failed with ${a}${f}`:D?`Command was killed with ${h} (${rp(h)})${f}`:void 0!==u?`Command was killed with ${u} (${s})`:void 0!==l?`Command failed with exit code ${l}`:"Command failed"})({originalError:n,timedOut:l,timeout:g,isMaxBuffer:D,maxBuffer:m,errorCode:y,signal:o,signalDescription:a,exitCode:u,isCanceled:c,isGracefullyCanceled:d,isForcefullyTerminated:p,forceKillAfterDelay:h,killSignal:f}),F=((e,t)=>{if(e instanceof t8)return;let r=tC(((e,t)=>{let r;if(t===nS())return e;try{r=T(t)}catch(r){return`The "cwd" option is invalid: ${t}.
44
+ ${r.message}
45
+ ${e}`}return r.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
46
+ ${e}`})(t9(e)&&t6 in e?e.originalMessage:String(e?.message??e),t));return""===r?void 0:r})(n,b),C=void 0===F?"":`
47
+ ${F}`,E=`${_}: ${s}${C}`,v=[E,...void 0===t?[e[2],e[1]]:[t],...e.slice(3),r.map(e=>{let t;return"string"==typeof(t=e)?t:U(t)}).join("\n")].map(e=>{let t;return tC(n$(Array.isArray(t=e)?t.map(e=>n$(n5(e))).filter(Boolean).join("\n"):n5(t)))}).filter(Boolean).join("\n\n");return{originalMessage:F,shortMessage:E,message:v}})({stdio:D,all:p,ipcOutput:h,originalError:e,signal:E,signalDescription:v,exitCode:C,escapedCommand:r,timedOut:o,isCanceled:a,isGracefullyCanceled:u,isMaxBuffer:s,isForcefullyTerminated:l,forceKillAfterDelay:g,killSignal:b,maxBuffer:_,timeout:m,cwd:y}),B=new(F?t4:t7)(A,e instanceof t8?{}:{cause:e});return Object.assign(B,ii({error:B,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:a,isGracefullyCanceled:u,isMaxBuffer:s,isForcefullyTerminated:l,exitCode:C,signal:E,signalDescription:v,stdio:D,all:p,ipcOutput:h,cwd:y,originalMessage:w,shortMessage:S})),B},ii=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:a,isGracefullyCanceled:u,isMaxBuffer:s,isForcefullyTerminated:l,exitCode:c,signal:d,signalDescription:D,stdio:p,all:h,ipcOutput:f,cwd:m,originalMessage:g,shortMessage:b})=>io({shortMessage:b,originalMessage:g,command:t,escapedCommand:r,cwd:m,durationMs:tX(n),failed:!0,timedOut:o,isCanceled:a,isGracefullyCanceled:u,isTerminated:void 0!==d,isMaxBuffer:s,isForcefullyTerminated:l,exitCode:c,signal:d,signalDescription:D,code:e.cause?.code,stdout:p[1],stderr:p[2],all:h,stdio:p,ipcOutput:f,pipedFrom:[]}),io=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e)),ia=(e,t)=>{let r=null===t?void 0:t,n=void 0===r?void 0:rp(t);return{exitCode:null===e?void 0:e,signal:r,signalDescription:n}},iu=e=>Number.isFinite(e)?e:0,is=24n*60n*60n*1000n,il=(e,t,{reject:r})=>{if((({verbose:e})=>"none"!==tb(e,void 0))(t)){var n,o;e.failed&&tV({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e}),n=e,o=t,tV({type:"duration",verboseMessage:`(done in ${function(e,t){let r="bigint"==typeof e;if(!r&&!Number.isFinite(e))throw TypeError("Expected a finite number or bigint");t={...t};let n=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let o=[],a=(e,r,n,a)=>{if(!((0===o.length||!t.colonNotation)&&(0===e||0n===e))||t.colonNotation&&"m"===n){if(a??=String(e),t.colonNotation){let e=a.includes(".")?a.split(".")[0].length:a.length,t=o.length>0?2:1;a="0".repeat(Math.max(0,t-e))+a}else a+=t.verbose?" "+(1===e||1n===e?r:`${r}s`):n;o.push(a)}},u=function(e){switch(typeof e){case"number":if(Number.isFinite(e))return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(iu(1e3*e)%1e3),nanoseconds:Math.trunc(iu(1e6*e)%1e3)};break;case"bigint":return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}throw TypeError("Expected a finite number or bigint")}(e),s=BigInt(u.days);if(t.hideYearAndDays?a(24n*BigInt(s)+BigInt(u.hours),"hour","h"):(t.hideYear?a(s,"day","d"):(a(s/365n,"year","y"),a(s%365n,"day","d")),a(Number(u.hours),"hour","h")),a(Number(u.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let e=Number(u.seconds),r=Number(u.milliseconds),n=Number(u.microseconds),o=Number(u.nanoseconds);if(a(e,"second","s"),t.formatSubMilliseconds)a(r,"millisecond","ms"),a(n,"microsecond","\xb5s"),a(o,"nanosecond","ns");else{let e=r+n/1e3+o/1e6,u="number"==typeof t.millisecondsDecimalDigits?t.millisecondsDecimalDigits:0,s=e>=1?Math.round(e):Math.ceil(e),l=u?e.toFixed(u):s;a(Number.parseFloat(l),"millisecond","ms",l)}}else{let n=(r?Number(e%is):e)/1e3%60,o="number"==typeof t.secondsDecimalDigits?t.secondsDecimalDigits:1,u=(Math.round(Math.floor(n*10**o+1e-7))/10**o).toFixed(o),s=t.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");a(Number.parseFloat(s),"second","s",s)}if(0===o.length)return n+"0"+(t.verbose?" milliseconds":"ms");let l=t.colonNotation?":":" ";return"number"==typeof t.unitCount&&(o=o.slice(0,Math.max(t.unitCount,1))),n+o.join(l)}(n.durationMs)})`,verboseInfo:o,result:n})}if(e.failed&&r)throw e;return e},ic=(e,t)=>(iD(e,t,"Duplex stream"),"duplex"),id=(e,t)=>(iD(e,t,"web TransformStream"),"webTransform"),iD=({final:e,binary:t,objectMode:r},n,o)=>{ip(e,`${n}.final`,o),ip(t,`${n}.binary`,o),im(r,`${n}.objectMode`)},ip=(e,t,r)=>{if(void 0!==e)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},ih=({transform:e,final:t,binary:r,objectMode:n},o)=>{if(void 0!==e&&!ig(e))throw TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(nN(t,{checkOpen:!1}))throw TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(iS(t))throw TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(void 0!==t&&!ig(t))throw TypeError(`The \`${o}.final\` option must be a generator.`);return im(r,`${o}.binary`),im(n,`${o}.objectMode`),ib(e)||ib(t)?"asyncGenerator":"generator"},im=(e,t)=>{if(void 0!==e&&"boolean"!=typeof e)throw TypeError(`The \`${t}\` option must use a boolean.`)},ig=e=>ib(e)||iy(e),ib=e=>"[object AsyncGeneratorFunction]"===Object.prototype.toString.call(e),iy=e=>"[object GeneratorFunction]"===Object.prototype.toString.call(e),i_=e=>"[object URL]"===Object.prototype.toString.call(e),iF=new Set(["file","append"]),iC=e=>"string"==typeof e,iE=new Set(["ipc","ignore","inherit","overlapped","pipe"]),iv=e=>"[object ReadableStream]"===Object.prototype.toString.call(e),iw=e=>"[object WritableStream]"===Object.prototype.toString.call(e),iS=e=>iv(e?.readable)&&iw(e?.writable),iA=e=>"object"==typeof e&&null!==e,iT=new Set(["generator","asyncGenerator","duplex","webTransform"]),iB=new Set(["fileUrl","filePath","fileNumber"]),ix=new Set(["fileUrl","filePath"]),iO=new Set([...ix,"webStream","nodeStream"]),i$=new Set(["webTransform","duplex"]),iR={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"},ik=(e,t,r,n)=>"output"===n?iP(e,t,r):ij(e,t,r),iP=(e,t,r)=>{let n=0!==t&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:e??n}},ij=(e,t,r)=>{let n=0===t?!0===e:r[t-1].value.readableObjectMode,o=t!==r.length-1&&(e??n);return{writableObjectMode:n,readableObjectMode:o}},iI=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:o,direction:a,encoding:u})=>"duplex"===t?iz({stdioItem:e,optionName:o}):"webTransform"===t?iL({stdioItem:e,index:r,newTransforms:n,direction:a}):iM({stdioItem:e,index:r,newTransforms:n,direction:a,encoding:u}),iz=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:o=n}},optionName:a})=>{if(o&&!n)throw TypeError(`The \`${a}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&n)throw TypeError(`The \`${a}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:r,readableObjectMode:n}}},iL=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o})=>{let{transform:a,objectMode:u}=eN(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:l}=ik(u,r,n,o);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:l}}},iM=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o,encoding:a})=>{let{transform:u,final:s,binary:l=!1,preserveNewlines:c=!1,objectMode:d}=eN(t)?t:{transform:t},D=l||nC.has(a),{writableObjectMode:p,readableObjectMode:h}=ik(d,r,n,o);return{...e,value:{transform:u,final:s,binary:D,preserveNewlines:c,writableObjectMode:p,readableObjectMode:h}}},iU=(e,t)=>"input"===t?e.reverse():e,iN=["input","output","output"],iW=()=>void 0,iq=()=>"input",iH={generator:iW,asyncGenerator:iW,fileUrl:iW,filePath:iW,iterable:iq,asyncIterable:iq,uint8Array:iq,webStream:e=>iw(e)?"output":"input",nodeStream:e=>nU(e,{checkOpen:!1})?nM(e,{checkOpen:!1})?void 0:"input":"output",webTransform:iW,duplex:iW,native(e){let t=iV(e);return void 0!==t?t:nL(e,{checkOpen:!1})?iH.nodeStream(e):void 0}},iV=e=>[0,x.stdin].includes(e)?"input":[1,2,x.stdout,x.stderr].includes(e)?"output":void 0,iG=e=>tr.some(t=>void 0!==e[t]),iZ=(e,t)=>Array.isArray(e)?e.map(e=>iZ(e,t)):null==e?t>=tr.length?"ignore":"pipe":e,iJ=e=>"pipe"===e||Array.isArray(e)&&e.every(e=>"pipe"===e),iK=({value:e,optionName:t,fdNumber:r,direction:n})=>{let o=iY(e,r);if(void 0!==o){if("output"===n)return{type:"fileNumber",value:o,optionName:t};if(K.isatty(o))throw TypeError(`The \`${t}: ${rN(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:eK(A(o)),optionName:t}}},iY=(e,t)=>{if("inherit"===e)return t;if("number"==typeof e)return e;let r=tt.indexOf(e);if(-1!==r)return r},iQ=(e,t,r)=>{let n=tt[e];if(void 0===n)throw TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n},iX=e=>{if(nU(e,{checkOpen:!1}))return"nodeStream";if("string"==typeof e)return"string";if(eJ(e))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},i0=e=>{if(i_(e))return{type:"fileUrl",value:e};if(iC(e))return{type:"filePath",value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},i2=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{let a=e.filter(e=>i1(e,r));if(0!==a.length)return i8(a.find(e=>e.direction!==o),n,t),"output"===o?a[0].stream:void 0},i1=({type:e,value:t},r)=>"filePath"===e?t.file===r.file:"fileUrl"===e?t.href===r.href:t===r,i8=(e,t,r)=>{if(void 0!==e)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${iR[r]} that is the same.`)},i3=(e,t,r,n)=>{let o=on({initialFileDescriptors:(({stdio:e,ipc:t,buffer:r,...n},o,a)=>{let u,s,l,c=((e,t)=>{if(void 0===e)return tr.map(e=>t[e]);if(iG(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${tr.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeof e)return[e,e,e];if(!Array.isArray(e))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);return Array.from({length:Math.max(e.length,tr.length)},(t,r)=>e[r])})(e,n).map((e,t)=>iZ(e,t));return a?(u=c,s=r,l=o,u.map((e,t)=>!s[t]&&0!==t&&!tg(l,t)&&iJ(e)?"ignore":e)):t&&!c.includes("ipc")?[...c,"ipc"]:c})(t,r,n).map((e,r)=>i6({stdioOption:e,fdNumber:r,options:t,isSync:n})),addProperties:e,options:t,isSync:n});return t.stdio=o.map(({stdioItems:e})=>ou(e)),o},i6=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{let o,a,u=tn(t),{stdioItems:s,isStdioArray:l}=i9({stdioOption:e,fdNumber:t,options:r,optionName:u}),c=((e,t,r)=>{let n=e.map(e=>(({type:e,value:t},r)=>iN[r]??iH[e](t))(e,t));if(n.includes("input")&&n.includes("output"))throw TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??"output"})(s,t,u),d=(o=s.map(e=>(({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:n,direction:o,isSync:a})=>r&&"native"===t?a?(({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n,direction:o})=>{let a=iK({value:t,optionName:r,fdNumber:n,direction:o});if(void 0!==a)return a;if(nL(t,{checkOpen:!1}))throw TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e})({stdioItem:e,fdNumber:n,direction:o}):(({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n})=>"inherit"===t?{type:"nodeStream",value:iQ(n,t,r),optionName:r}:"number"==typeof t?{type:"nodeStream",value:iQ(t,t,r),optionName:r}:nL(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e)({stdioItem:e,fdNumber:n}):e)({stdioItem:e,isStdioArray:l,fdNumber:t,direction:c,isSync:n})),[...o.filter(({type:e})=>!iT.has(e)),...((e,t,r,{encoding:n})=>{let o=e.filter(({type:e})=>iT.has(e)),a=Array.from({length:o.length});for(let[e,u]of Object.entries(o))a[e]=iI({stdioItem:u,index:Number(e),newTransforms:a,optionName:t,direction:r,encoding:n});return iU(a,r)})(o,u,c,r)]),D=void 0!==(a=d.findLast(({type:e})=>iT.has(e)))&&("input"===c?a.value.writableObjectMode:a.value.readableObjectMode);return or(d,D),{direction:c,objectMode:D,stdioItems:d}},i9=({stdioOption:e,fdNumber:t,options:r,optionName:n})=>{let o,a=(o=[...(Array.isArray(e)?e:[e]).map(e=>i7(e,n)),...(({input:e,inputFile:t},r)=>{let n,o;return 0===r?[...void 0===(n=e)?[]:[{type:iX(n),value:n,optionName:"input"}],...void 0===(o=t)?[]:[{...i0(o),optionName:"inputFile"}]]:[]})(r,t)]).filter((e,t)=>o.every((r,n)=>e.value!==r.value||t>=n||"generator"===e.type||"asyncGenerator"===e.type)),u=a.length>1;return i4(a,u,n),oe(a),{stdioItems:a,isStdioArray:u}},i7=(e,t)=>{let r,n,o,a,u,s,l;return{type:ib(e)?"asyncGenerator":iy(e)?"generator":i_(e)?"fileUrl":eN(r=e)&&Object.keys(r).length>0&&Object.keys(r).every(e=>iF.has(e))&&iC(r.file)?"filePath":iv(n=e)||iw(n)?"webStream":nL(e,{checkOpen:!1})?"native":eJ(e)?"uint8Array":iA(o=e)&&"function"==typeof o[Symbol.asyncIterator]?"asyncIterable":iA(a=e)&&"function"==typeof a[Symbol.iterator]?"iterable":iS(e)?id({transform:e},t):eN(u=e)&&(void 0!==u.transform||void 0!==u.final)?(s=e,l=t,nN(s.transform,{checkOpen:!1})?ic(s,l):iS(s.transform)?id(s,l):ih(s,l)):"native",value:e,optionName:t}},i4=(e,t,r)=>{if(0===e.length)throw TypeError(`The \`${r}\` option must not be an empty array.`);if(t){for(let{value:t,optionName:r}of e)if(i5.has(t))throw Error(`The \`${r}\` option must not include \`${t}\`.`)}},i5=new Set(["ignore","ipc"]),oe=e=>{for(let t of e)ot(t)},ot=({type:e,value:t,optionName:r})=>{if(i_(t)&&"file:"!==t.protocol)throw TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
48
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if("native"===e&&"string"==typeof t&&!iE.has(t))throw TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},or=(e,t)=>{if(!t)return;let r=e.find(({type:e})=>iB.has(e));if(void 0!==r)throw TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},on=({initialFileDescriptors:e,addProperties:t,options:r,isSync:n})=>{let o=[];try{for(let a of e)o.push(oi({fileDescriptor:a,fileDescriptors:o,addProperties:t,options:r,isSync:n}));return o}catch(e){throw oa(o),e}},oi=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:n,addProperties:o,options:a,isSync:u})=>{let s=r.map(t=>oo({stdioItem:t,addProperties:o,direction:e,options:a,fileDescriptors:n,isSync:u}));return{direction:e,objectMode:t,stdioItems:s}},oo=({stdioItem:e,addProperties:t,direction:r,options:n,fileDescriptors:o,isSync:a})=>{let u=(({stdioItem:{type:e,value:t,optionName:r},direction:n,fileDescriptors:o,isSync:a})=>{let u,s,l=(u=o,s=e,u.flatMap(({direction:e,stdioItems:t})=>t.filter(e=>e.type===s).map(t=>({...t,direction:e}))));if(0!==l.length){if(a)return void(({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{ix.has(t)&&i2({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})})({otherStdioItems:l,type:e,value:t,optionName:r,direction:n});if(iO.has(e))return i2({otherStdioItems:l,type:e,value:t,optionName:r,direction:n});i$.has(e)&&(({otherStdioItems:e,type:t,value:r,optionName:n})=>{i8(e.find(({value:{transform:e}})=>e===r.transform),n,t)})({otherStdioItems:l,type:e,value:t,optionName:r})}})({stdioItem:e,direction:r,fileDescriptors:o,isSync:a});return void 0!==u?{...e,stream:u}:{...e,...t[r][e.type](e,n)}},oa=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)void 0===e||te(e)||e.destroy()},ou=e=>{if(e.length>1)return e.some(({value:e})=>"overlapped"===e)?"overlapped":"pipe";let[{type:t,value:r}]=e;return"native"===t?r:"pipe"},os=({type:e,optionName:t})=>{ol(t,iR[e])},ol=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},oc={generator(){},asyncGenerator:os,webStream:os,nodeStream:os,webTransform:os,duplex:os,asyncIterable:os,native:({optionName:e,value:t})=>(("ipc"===t||"overlapped"===t)&&ol(e,`"${t}"`),{})},od={input:{...oc,fileUrl:({value:e})=>({contents:[eK(A(e))]}),filePath:({value:{file:e}})=>({contents:[eK(A(e))]}),fileNumber:os,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...oc,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:os,string:os,uint8Array:os}},oD=(e,{stripFinalNewline:t},r)=>op(t,r)&&void 0!==e&&!Array.isArray(e)?n$(e):e,op=(e,t)=>"all"===t?e[1]||e[2]:e[t],oh=(e,t,r,n)=>e||r?void 0:og(t,n),of=(e,t,r)=>r?e.flatMap(e=>om(e,t)):om(e,t),om=(e,t)=>{let{transform:r,final:n}=og(t,{});return[...r(e),...n()]},og=(e,t)=>(t.previousChunks="",{transform:ob.bind(void 0,t,e),final:o_.bind(void 0,t)}),ob=function*(e,t,r){if("string"!=typeof r)return void(yield r);let{previousChunks:n}=e,o=-1;for(let a=0;a<r.length;a+=1)if("\n"===r[a]){let u=oy(r,a,t,e),s=r.slice(o+1,a+1-u);n.length>0&&(s=oC(n,s),n=""),yield s,o=a}o!==r.length-1&&(n=oC(n,r.slice(o+1))),e.previousChunks=n},oy=(e,t,r,n)=>r?0:(n.isWindowsNewline=0!==t&&"\r"===e[t-1],n.isWindowsNewline?2:1),o_=function*({previousChunks:e}){e.length>0&&(yield e)},oF=function*({isWindowsNewline:e=!1},t){let{unixNewline:r,windowsNewline:n,LF:o,concatBytes:a}="string"==typeof t?oE:ov;t.at(-1)===o?yield t:yield a(t,e?n:r)},oC=(e,t)=>`${e}${t}`,oE={windowsNewline:"\r\n",unixNewline:"\n",LF:"\n",concatBytes:oC},ov={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}},ow=function*(e,t){if("string"!=typeof t&&!eJ(t)&&!eD.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},oS=function*(e,t){oT(e,t),yield t},oA=function*(e,t){if(oT(e,t),"string"!=typeof t&&!eJ(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},oT=(e,t)=>{if(null==t)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
49
+ Instead, \`yield\` should either be called with a value, or not be called at all. For example:
50
+ if (condition) { yield value; }`)},oB=(e,t,r)=>{if(r)return;if(e)return{transform:ox.bind(void 0,new TextEncoder)};let n=new J(t);return{transform:oO.bind(void 0,n),final:o$.bind(void 0,n)}},ox=function*(e,t){eD.isBuffer(t)?yield eK(t):"string"==typeof t?yield e.encode(t):yield t},oO=function*(e,t){yield eJ(t)?e.write(t):t},o$=function*(e){let t=e.end();""!==t&&(yield t)},oR=z(async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(let e of t.currentIterable)n.push(e)}finally{delete t.currentIterable}}),ok=async function*(e,t,r){if(r===t.length)return void(yield e);let{transform:n=oz}=t[r];for await(let o of n(e))yield*ok(o,t,r+1)},oP=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*oj(r,Number(t),e)},oj=async function*(e,t,r){if(void 0!==e)for await(let n of e())yield*ok(n,r,t+1)},oI=z(async({currentIterable:e},t)=>{if(void 0!==e)return void await (t?e.throw(t):e.return());if(t)throw t}),oz=function*(e){yield e},oL=(e,t,r,n)=>{try{for(let n of e(...t))r.push(n);n()}catch(e){n(e)}},oM=(e,t)=>[...t.flatMap(t=>[...oU(t,e,0)]),...oN(e)],oU=function*(e,t,r){if(r===t.length)return void(yield e);let{transform:n=oq}=t[r];for(let o of n(e))yield*oU(o,t,r+1)},oN=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*oW(r,Number(t),e)},oW=function*(e,t,r){if(void 0!==e)for(let n of e())yield*oU(n,r,t+1)},oq=function*(e){yield e},oH=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:o},optionName:a},{encoding:u})=>{let s={},l=oG(e,u,a),c=ib(t),d=ib(r),D=c?oR.bind(void 0,ok,s):oL.bind(void 0,oU),p=c||d?oR.bind(void 0,oP,s):oL.bind(void 0,oN),h=c||d?oI.bind(void 0,s):void 0;return{stream:new es({writableObjectMode:n,writableHighWaterMark:ec(n),readableObjectMode:o,readableHighWaterMark:ec(o),transform(e,t,r){D([e,l,0],this,r)},flush(e){p([l],this,e)},destroy:h})}},oV=(e,t,r,n)=>{let o=t.filter(({type:e})=>"generator"===e);for(let{value:t,optionName:a}of n?o.reverse():o)e=oM(oG(t,r,a),e);return e},oG=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:a},u,s)=>{let l={};return[{transform:n?void 0:ow.bind(void 0,s)},oB(r,u,n),oh(r,a,n,l),{transform:e,final:t},{transform:o?oS.bind(void 0,s):oA.bind(void 0,s)},(({binary:e,preserveNewlines:t,readableObjectMode:r,state:n})=>e||t||r?void 0:{transform:oF.bind(void 0,n)})({binary:r,preserveNewlines:a,readableObjectMode:o,state:l})].filter(Boolean)},oZ=(e,t,r)=>{let{stdioItems:n}=e[t],o=n.filter(({contents:e})=>void 0!==e);if(0!==o.length){if(0!==t){let[{type:e,optionName:t}]=o;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${iR[e]} with synchronous methods.`)}r.input=eX(o.map(({contents:e})=>e).map(e=>oJ(e,n)))}},oJ=(e,t)=>{let r=oV(e,t,"utf8",!0);return oK(r),eX(r)},oK=e=>{let t=e.find(e=>"string"!=typeof e&&!eJ(e));if(void 0!==t)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},oY=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>"all"!==n&&tg(r,n)&&!nC.has(t)&&oQ(n)&&(e.some(({type:e,value:t})=>"native"===e&&oX.has(t))||e.every(({type:e})=>iT.has(e))),oQ=e=>1===e||2===e,oX=new Set(["pipe","overlapped"]),o0=async(e,t,r,n)=>{for await(let o of e)o2(t)||o1(o,r,n)},o2=e=>e._readableState.pipes.length>0,o1=(e,t,r)=>{tV({type:"output",verboseMessage:tK(e),fdNumber:t,verboseInfo:r})},o8=(e,t,r,n)=>{try{return oV(e,t,r,!1)}catch(t){return n.error=t,e}},o3=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:o,fdNumber:a})=>{if(t)return{serializedResult:e};if("buffer"===r)return{serializedResult:eX(e)};let u=((e,t)=>{if("utf8"===t&&e.every(e=>"string"==typeof e))return e;let r=new J(t),n=e.map(e=>"string"==typeof e?eY.encode(e):e).map(e=>r.write(e)),o=r.end();return""===o?n:[...n,o]})(e,r).join("");return n[a]?{serializedResult:u,finalResult:of(u,!o[a],t)}:{serializedResult:u}},o6=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:o,stdioItems:a,objectMode:u})=>{if(!oY({stdioItems:a,encoding:o,verboseInfo:n,fdNumber:t}))return;let s=of(e,!1,u);try{for(let e of s)o1(e,t,n)}catch(e){r.error??=e}},o9=(e,t,r)=>{for(let{path:n,append:o}of t.filter(({type:e})=>iB.has(e))){let t="string"==typeof n?n:n.toString();o||r.has(t)?E(n,e):(r.add(t),B(n,e))}},o7=async(e,t)=>{let[r,n]=await o4(e);return t.isForcefullyTerminated??=!1,[r,n]},o4=async e=>{let[t,r]=await Promise.allSettled([c(e,"spawn"),c(e,"exit")]);return"rejected"===t.status?[]:"rejected"===r.status?o5(e):r.value},o5=async e=>{try{return await c(e,"exit")}catch{return o5(e)}},ae=async e=>{let[t,r]=await e;if(!at(t,r)&&ar(t,r))throw new t8;return[t,r]},at=(e,t)=>void 0===e&&void 0===t,ar=(e,t)=>0!==e||null!==t,an=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,ai=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&ao("ipcInput"),e&&ao("ipc: true"),r&&ao("detached: true"),n&&ao("cancelSignal")},ao=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},aa=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:a,startTime:u})=>{try{let n;for(let e of(n=a,new Set(Object.entries(n).filter(([,{direction:e}])=>"input"===e).map(([e])=>Number(e)))))oZ(a,e,r);let o=au(r);return m(...nO(e,t,o))}catch(e){return it({error:e,command:n,escapedCommand:o,fileDescriptors:a,options:r,startTime:u,isSync:!0})}},au=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:(([,e])=>e)(t)}),as=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:o,stdio:a,all:u,options:s,command:l,escapedCommand:c,startTime:d})=>void 0===e?ie({command:l,escapedCommand:c,stdio:a,all:u,ipcOutput:[],options:s,startTime:d}):ir({error:e,command:l,escapedCommand:c,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:a,all:u,ipcOutput:[],options:s,startTime:d,isSync:!0}),al=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0,filter:a}={})=>(rF({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:r0(e)}),ac({anyProcess:e,channel:t,isSubprocess:r,filter:a,reference:o})),ac=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:o})=>{rq(t,o);let a=rY(e,t,r),u=new AbortController;try{return await Promise.race([ad(a,n,u),aD(a,r,u),ap(a,r,u)])}catch(t){throw rx(e),t}finally{u.abort(),rV(t,o)}},ad=async(e,t,{signal:r})=>{if(void 0===t){let[t]=await c(e,"message",{signal:r});return t}for await(let[n]of l(e,"message",{signal:r}))if(t(n))return n},aD=async(e,t,{signal:r})=>{await c(e,"disconnect",{signal:r});throw Error(`${rA("getOneMessage",t)} could not complete: the ${rB(t)} exited or disconnected.`)},ap=async(e,t,{signal:r})=>{let[n]=await c(e,"strict:error",{signal:r});throw rv(n,t)},ah=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0}={})=>af({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),af=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:o,reference:a})=>{rF({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:r0(e)}),rq(t,a);let u=rY(e,t,r),s=new AbortController,l={};return am(e,u,s),ag({ipcEmitter:u,isSubprocess:r,controller:s,state:l}),ab({anyProcess:e,channel:t,ipcEmitter:u,isSubprocess:r,shouldAwait:o,controller:s,state:l,reference:a})},am=async(e,t,r)=>{try{await c(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},ag=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{let[o]=await c(e,"strict:error",{signal:r.signal});n.error=rv(o,t),r.abort()}catch{}},ab=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:a,state:u,reference:s}){try{for await(let[e]of l(r,"message",{signal:a.signal}))ay(u),yield e}catch{ay(u)}finally{a.abort(),rV(t,s),n||rx(e),o&&await e}},ay=({error:e})=>{if(e)throw e},a_=(e,t,r)=>({sendMessage:ni.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:al.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:ah.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}),aF=()=>{let e=new ea;return e.end(),e},aC=()=>new eu({read(){}}),aE=()=>new el({write(){}}),av=()=>new eo({read(){},write(){}}),aw=async(e,t,r)=>il(e,t,r),aS=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${iR[e]}.`)},aA={fileNumber:aS,generator:oH,asyncGenerator:oH,nodeStream:({value:e})=>({stream:e}),webTransform:({value:{transform:e,writableObjectMode:t,readableObjectMode:r}})=>({stream:eo.fromWeb(e,{objectMode:t||r})}),duplex:({value:{transform:e}})=>({stream:e}),native(){}},aT={input:{...aA,fileUrl:({value:e})=>({stream:v(e)}),filePath:({value:{file:e}})=>({stream:v(e)}),webStream:({value:e})=>({stream:eu.fromWeb(e)}),iterable:({value:e})=>({stream:eu.from(e)}),asyncIterable:({value:e})=>({stream:eu.from(e)}),string:({value:e})=>({stream:eu.from(e)}),uint8Array:({value:e})=>({stream:eu.from(eD.from(e))})},output:{...aA,fileUrl:({value:e})=>({stream:w(e)}),filePath:({value:{file:e,append:t}})=>({stream:w(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:el.fromWeb(e)}),iterable:aS,asyncIterable:aS,string:aS,uint8Array:aS}};function aB(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)aP(t);let t=e.some(({readableObjectMode:e})=>e),r=ax(e,t),n=new aO({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let t of e)n.add(t);return n}let ax=(e,t)=>0===e.length?ec(t):Math.max(...e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e));class aO extends ea{#a=new Set([]);#u=new Set([]);#s=new Set([]);#l;#c=Symbol("unpipe");#d=new WeakMap;add(e){if(aP(e),this.#a.has(e))return;this.#a.add(e),this.#l??=a$(this,this.#a,this.#c);let t=aj({passThroughStream:this,stream:e,streams:this.#a,ended:this.#u,aborted:this.#s,onFinished:this.#l,unpipeEvent:this.#c});this.#d.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(aP(e),!this.#a.has(e))return!1;let t=this.#d.get(e);return void 0!==t&&(this.#d.delete(e),e.unpipe(this),await t,!0)}}let a$=async(e,t,r)=>{aV(e,aG);let n=new AbortController;try{await Promise.race([aR(e,n),ak(e,t,r,n)])}finally{n.abort(),aV(e,-aG)}},aR=async(e,{signal:t})=>{try{await ep(e,{signal:t,cleanup:!0})}catch(t){throw aU(e,t),t}},ak=async(e,t,r,{signal:n})=>{for await(let[o]of l(e,"unpipe",{signal:n}))t.has(o)&&o.emit(r)},aP=e=>{if("function"!=typeof e?.pipe)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},aj=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:a,unpipeEvent:u})=>{aV(e,aZ);let s=new AbortController;try{await Promise.race([aI(a,t,s),az({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:s}),aL({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:u,controller:s})])}finally{s.abort(),aV(e,-aZ)}r.size>0&&r.size===n.size+o.size&&(0===n.size&&o.size>0?aW(e):aM(e))},aI=async(e,t,{signal:r})=>{try{await e,r.aborted||aW(t)}catch(e){r.aborted||aU(t,e)}},az=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:a}})=>{try{await ep(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(n){if(a.aborted||!r.has(t))return;aN(n)?o.add(t):aq(e,n)}},aL=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:a}})=>{if(await c(e,o,{signal:a}),!e.readable)return c(a,"abort",{signal:a});t.delete(e),r.delete(e),n.delete(e)},aM=e=>{e.writable&&e.end()},aU=(e,t)=>{aN(t)?aW(e):aq(e,t)},aN=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",aW=e=>{(e.readable||e.writable)&&e.destroy()},aq=(e,t)=>{e.destroyed||(e.once("error",aH),e.destroy(t))},aH=()=>{},aV=(e,t)=>{let r=e.getMaxListeners();0!==r&&r!==1/0&&e.setMaxListeners(r+t)},aG=2,aZ=1,aJ=(e,t)=>{e.pipe(t),aK(e,t),aQ(e,t)},aK=async(e,t)=>{if(!(te(e)||te(t))){try{await ep(e,{cleanup:!0,readable:!0,writable:!1})}catch{}aY(t)}},aY=e=>{e.writable&&e.end()},aQ=async(e,t)=>{if(!(te(e)||te(t))){try{await ep(t,{cleanup:!0,readable:!1,writable:!0})}catch{}aX(e)}},aX=e=>{e.readable&&e.destroy()},a0=(e,t,r,n)=>{"output"===r?aJ(e.stdio[n],t):aJ(t,e.stdio[n]);let o=a2[n];void 0!==o&&(e[o]=t),e.stdio[n]=t},a2=["stdin","stdout","stderr"],a1=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:o,controller:a})=>{if(void 0===t)return;a8(t,a);let[u,s]="output"===r?[t,e.stdio[n]]:[e.stdio[n],t],l=o.get(u)??[];o.set(u,[...l,s])},a8=(e,{signal:t})=>{te(e)&&rW(e,a3,t)},a3=2,a6=[];a6.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&a6.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&a6.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");let a9=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,a7=Symbol.for("signal-exit emitter"),a4=globalThis,a5=Object.defineProperty.bind(Object);class ue{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(a4[a7])return a4[a7];a5(a4,a7,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let r=this.listeners[e],n=r.indexOf(t);-1!==n&&(0===n&&1===r.length?r.length=0:r.splice(n,1))}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(let o of this.listeners[e])n=!0===o(t,r)||n;return"exit"===e&&(n=this.emit("afterExit",t,r)||n),n}}class ut{}class ur extends ut{#D="win32"===un.platform?"SIGINT":"SIGHUP";#p=new ue;#h;#f;#m;#g={};#b=!1;constructor(e){for(let t of(super(),this.#h=e,this.#g={},a6))this.#g[t]=()=>{let r=this.#h.listeners(t),{count:n}=this.#p;if("object"==typeof e.__signal_exit_emitter__&&"number"==typeof e.__signal_exit_emitter__.count&&(n+=e.__signal_exit_emitter__.count),r.length===n){this.unload();let r=this.#p.emit("exit",null,t),n="SIGHUP"===t?this.#D:t;r||e.kill(e.pid,n)}};this.#m=e.reallyExit,this.#f=e.emit}onExit(e,t){if(!a9(this.#h))return()=>{};!1===this.#b&&this.load();let r=t?.alwaysLast?"afterExit":"exit";return this.#p.on(r,e),()=>{this.#p.removeListener(r,e),0===this.#p.listeners.exit.length&&0===this.#p.listeners.afterExit.length&&this.unload()}}load(){if(!this.#b){for(let e of(this.#b=!0,this.#p.count+=1,a6))try{let t=this.#g[e];t&&this.#h.on(e,t)}catch(e){}this.#h.emit=(e,...t)=>this.#y(e,...t),this.#h.reallyExit=e=>this.#_(e)}}unload(){this.#b&&(this.#b=!1,a6.forEach(e=>{let t=this.#g[e];if(!t)throw Error("Listener not defined for signal: "+e);try{this.#h.removeListener(e,t)}catch(e){}}),this.#h.emit=this.#f,this.#h.reallyExit=this.#m,this.#p.count-=1)}#_(e){return a9(this.#h)?(this.#h.exitCode=e||0,this.#p.emit("exit",this.#h.exitCode,null),this.#m.call(this.#h,this.#h.exitCode)):0}#y(e,...t){let r=this.#f;if(!("exit"===e&&a9(this.#h)))return r.call(this.#h,e,...t);{"number"==typeof t[0]&&(this.#h.exitCode=t[0]);let n=r.call(this.#h,e,...t);return this.#p.emit("exit",this.#h.exitCode,null),n}}}let un=globalThis.process,{onExit:ui,load:uo,unload:ua}=(r=a9(un)?new ur(un):new class extends ut{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>r.onExit(e,t),load:()=>r.load(),unload:()=>r.unload()}),uu=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(us,e)(r,...n),pipeOptions:e};if("string"==typeof r||r instanceof URL||eH(r)){if(Object.keys(e).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[o,a,u]=eG(r,...n);return{destination:t(us)(o,a,u),pipeOptions:u}}if(rk.has(r)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},us=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),ul=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>it({error:e,command:uc,escapedCommand:uc,fileDescriptors:t,options:r,startTime:n,isSync:!1}),uc="source.pipe(destination)",ud=async e=>{let[{status:t,reason:r,value:n=r},{status:o,reason:a,value:u=a}]=await e;if(u.pipedFrom.includes(n)||u.pipedFrom.push(n),"rejected"===o)throw u;if("rejected"===t)throw n;return u},uD=async e=>{try{await ep(e,{cleanup:!0,readable:!1,writable:!0})}catch{}up.delete(e)},up=new WeakMap,uh=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:a})=>{throw await I(e,t),await r.remove(t),ul({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:n,sourceOptions:o,startTime:a})},uf=(e,...t)=>{if(eN(t[0]))return uf.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...n}=(({source:e,sourcePromise:t,boundOptions:r,createNested:n},...o)=>{let a=R.bigint(),{destination:u,destinationStream:s,destinationError:l,from:c,unpipeSignal:d}=((e,t,r)=>{try{let{destination:n,pipeOptions:{from:o,to:a,unpipeSignal:u}={}}=uu(e,t,...r),s=r$(n,a);return{destination:n,destinationStream:s,from:o,unpipeSignal:u}}catch(e){return{destinationError:e}}})(r,n,o),{sourceStream:D,sourceError:p}=((e,t)=>{try{return{sourceStream:rR(e,t)}}catch(e){return{sourceError:e}}})(e,c),{options:h,fileDescriptors:f}=rk.get(e);return{sourcePromise:t,sourceStream:D,sourceOptions:h,sourceError:p,destination:u,destinationStream:s,destinationError:l,unpipeSignal:d,fileDescriptors:f,startTime:a}})(e,...t),o=um({...n,destination:r});return o.pipe=uf.bind(void 0,{...e,source:r,sourcePromise:o,boundOptions:{}}),o},um=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:o,destinationStream:a,destinationError:u,unpipeSignal:s,fileDescriptors:l,startTime:c})=>{let d=ug(e,o);(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:a,startTime:u})=>{let s=(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>void 0!==t&&void 0!==n?n:void 0!==n?(aX(e),n):void 0!==t?(aY(r),t):void 0)({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(void 0!==s)throw ul({error:s,fileDescriptors:o,sourceOptions:a,startTime:u})})({sourceStream:t,sourceError:n,destinationStream:a,destinationError:u,fileDescriptors:l,sourceOptions:r,startTime:c});let D=new AbortController;try{var p,h,f,m;let e,n,o,u,g=(o=up.has(a)?(p=t,h=a,(e=up.get(h)).add(p),e):(f=t,m=a,n=aB([f]),aJ(n,m),up.set(m,n),n),rW(t,2,D.signal),rW(a,1,D.signal),uD(a),o);return await Promise.race([ud(d),...(u={sourceStream:t,mergedStream:g,sourceOptions:r,fileDescriptors:l,startTime:c},void 0===s?[]:[uh(s,u)])])}finally{D.abort()}},ug=(e,t)=>Promise.allSettled([e,t]),ub=e=>e,uy=()=>void 0,u_=({contents:e})=>e,uF=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},uC=e=>e.length;async function uE(e,t){return n0(e,uv,t)}let uv={init:()=>({contents:[]}),convertChunk:{string:ub,buffer:ub,arrayBuffer:ub,dataView:ub,typedArray:ub,others:ub},getSize:()=>1,truncateChunk:uy,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:uy,finalize:u_};async function uw(e,t){return n0(e,uO,t)}let uS=new TextEncoder,uA=e=>new Uint8Array(e),uT=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),uB=e=>ux**Math.ceil(Math.log(e)/Math.log(ux)),ux=2,uO={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:e=>uS.encode(e),buffer:uA,arrayBuffer:uA,dataView:uT,typedArray:uT,others:uF},getSize:uC,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t,length:r},n)=>{let o="resize"in ArrayBuffer.prototype?((e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:uB(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r})(t,n):((e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(uB(t));return new Uint8Array(r).set(new Uint8Array(e),0),r})(t,n);return new Uint8Array(o).set(e,r),o},getFinalChunk:uy,finalize:({contents:e,length:t})=>"resize"in ArrayBuffer.prototype?e:e.slice(0,t)};async function u$(e,t){return n0(e,uk,t)}let uR=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),uk={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:ub,buffer:uR,arrayBuffer:uR,dataView:uR,typedArray:uR,others:uF},getSize:uC,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return""===t?void 0:t},finalize:u_},uP=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:o,preserveNewlines:a})=>{let u=new AbortController;return uj(t,u),uL({stream:e,controller:u,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:o,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},uj=async(e,t)=>{try{await e}catch{}finally{t.abort()}},uI=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:o,allMixed:a})=>{let u=new AbortController;uz(t,u,e);let s=e.readableObjectMode&&!a;return uL({stream:e,controller:u,binary:"buffer"===n,shouldEncode:!s,encoding:n,shouldSplit:!s&&r,preserveNewlines:!o})},uz=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},uL=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:a,preserveNewlines:u})=>uN({onStdoutChunk:l(e,"data",{signal:t.signal,highWaterMark:uU,highWatermark:uU}),controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:a,preserveNewlines:u}),uM=ec(!0),uU=uM,uN=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:a,preserveNewlines:u}){let s=uW({binary:r,shouldEncode:n,encoding:o,shouldSplit:a,preserveNewlines:u});try{for await(let[t]of e)yield*oU(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*oN(s)}},uW=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:o})=>[oB(e,r,!t),oh(e,o,!n,{})].filter(Boolean),uq=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:o,maxBuffer:a,lines:u,allMixed:s,stripFinalNewline:l,verboseInfo:c,streamInfo:d})=>{let D=uH({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:s,verboseInfo:c,streamInfo:d});if(!o)return void await Promise.all([uV(e),D]);let p=uI({stream:e,onStreamEnd:t,lines:u,encoding:n,stripFinalNewline:op(l,r),allMixed:s}),[h]=await Promise.all([uG({stream:e,iterable:p,fdNumber:r,encoding:n,maxBuffer:a,lines:u}),D]);return h},uH=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:o,verboseInfo:a,streamInfo:{fileDescriptors:u}})=>{if(!oY({stdioItems:u[r]?.stdioItems,encoding:n,verboseInfo:a,fdNumber:r}))return;let s=uI({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await o0(s,e,r,a)},uV=async e=>{await Q(),null===e.readableFlowing&&e.resume()},uG=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:o,maxBuffer:a,lines:u})=>{try{if(t||u)return await uE(r,{maxBuffer:a});if("buffer"===o)return new Uint8Array(await uw(r,{maxBuffer:a}));return await u$(r,{maxBuffer:a})}catch(r){return uJ((({error:e,stream:t,readableObjectMode:r,lines:n,encoding:o,fdNumber:a})=>{let u,s,l;if(!(e instanceof n9))throw e;if("all"===a)return e;throw e.maxBufferInfo={fdNumber:a,unit:(u=r,s=n,l=o,u?"objects":s?"lines":"buffer"===l?"bytes":"characters")},t.destroy(),e})({error:r,stream:e,readableObjectMode:t,lines:u,encoding:o,fdNumber:n}))}},uZ=async e=>{try{return await e}catch(e){return uJ(e)}},uJ=({bufferedData:e})=>"[object ArrayBuffer]"===eZ.call(e)?new Uint8Array(e):e,uK=async(e,t,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{let a=uY(e,r),u=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],ep(e,{cleanup:!0,signal:u.signal})])}catch(e){a.stdinCleanedUp||u0(e,t,r,n)}finally{u.abort()}},uY=(e,{originalStreams:[t],subprocess:r})=>{let n={stdinCleanedUp:!1};return e===t&&uQ(e,r,n),n},uQ=(e,t,r)=>{let{_destroy:n}=e;e._destroy=(...o)=>{uX(t,r),n.call(e,...o)}},uX=({exitCode:e,signalCode:t},r)=>{(null!==e||null!==t)&&(r.stdinCleanedUp=!0)},u0=(e,t,r,n)=>{if(!u2(e,t,r,n))throw e},u2=(e,t,r,n=!0)=>r.propagating?u3(e)||u8(e):(r.propagating=!0,u1(r,t)===n?u3(e):u8(e)),u1=({fileDescriptors:e},t)=>"all"!==t&&"input"===e[t].direction,u8=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",u3=e=>e?.code==="EPIPE",u6=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:a,allMixed:u,stripFinalNewline:s,verboseInfo:l,streamInfo:c})=>{if(!e)return;let d=uK(e,t,c);if(u1(c,t))return void await d;let[D]=await Promise.all([uq({stream:e,onStreamEnd:d,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:a,allMixed:u,stripFinalNewline:s,verboseInfo:l,streamInfo:c}),d]);return D},u9=(e,t)=>{tV({type:"ipc",verboseMessage:tK(e),fdNumber:"ipc",verboseInfo:t})},u7=async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:a})=>{if(!n)return o;let u=tg(a,"ipc"),s=tm(t,"ipc"),l=tm(r,"ipc");for await(let t of af({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))s&&(n7(e,o,l),o.push(t)),u&&u9(t,a);return o},u4=async(e,t)=>(await Promise.allSettled([e]),t),u5=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:o,timeoutDuration:a,cancelSignal:u,gracefulCancel:s,forceKillAfterDelay:l,stripFinalNewline:c,ipc:d,ipcInput:D},context:p,verboseInfo:h,fileDescriptors:f,originalStreams:m,onInternalError:g,controller:b})=>{let y=o7(e,p),_={originalStreams:m,fileDescriptors:f,subprocess:e,exitPromise:y,propagating:!1},F=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:a,verboseInfo:u,streamInfo:s})=>e.stdio.map((e,l)=>u6({stream:e,fdNumber:l,encoding:t,buffer:r[l],maxBuffer:n[l],lines:o[l],allMixed:!1,stripFinalNewline:a,verboseInfo:u,streamInfo:s})))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:h,streamInfo:_}),C=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:a,verboseInfo:u,streamInfo:s})=>u6({...(({stdout:e,stderr:t,all:r},[,n,o])=>{let a=n||o;return a?n?o?{stream:r,buffer:a}:{stream:e,buffer:a}:{stream:t,buffer:a}:{stream:r,buffer:a}})(e,r),fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:(({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode)(e),stripFinalNewline:a,verboseInfo:u,streamInfo:s}))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:h,streamInfo:_}),E=[],v=u7({subprocess:e,buffer:r,maxBuffer:n,ipc:d,ipcOutput:E,verboseInfo:h}),w=se(m,e,_),S=st(f,_);try{return await Promise.race([Promise.all([{},ae(y),Promise.all(F),C,v,n_(e,D),...w,...S]),g,sr(e,b),...0===a||void 0===a?[]:[nb(e,a,p,b)],...(({subprocess:e,cancelSignal:t,gracefulCancel:r,context:n,controller:o})=>void 0===t||r?[]:[r_(e,t,n,o)])({subprocess:e,cancelSignal:u,gracefulCancel:s,context:p,controller:b}),...(({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:n,context:o,controller:a})=>r?[nm({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:o,controller:a})]:[])({subprocess:e,cancelSignal:u,gracefulCancel:s,forceKillAfterDelay:l,context:p,controller:b})])}catch(e){return p.terminationReason??="other",Promise.all([{error:e},y,Promise.all(F.map(e=>uZ(e))),uZ(C),u4(v,E),Promise.allSettled(w),Promise.allSettled(S)])}},se=(e,t,r)=>e.map((e,n)=>e===t.stdio[n]?void 0:uK(e,n,r)),st=(e,t)=>e.flatMap(({stdioItems:e},r)=>e.filter(({value:e,stream:t=e})=>nL(t,{checkOpen:!1})&&!te(t)).map(({type:e,value:n,stream:o=n})=>uK(o,r,t,{isSameDirection:iT.has(e),stopOnExit:"native"===e}))),sr=async(e,{signal:t})=>{let[r]=await c(e,"error",{signal:t});throw r},sn=(e,t,r)=>{let n=e[r];n.has(t)||n.set(t,[]);let o=n.get(t),a=rO();return o.push(a),{resolve:a.resolve.bind(a),promises:o}},si=async({resolve:e,promises:t},r)=>{e();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n},so=async e=>{if(void 0!==e)try{await su(e)}catch{}},sa=async e=>{if(void 0!==e)try{await ss(e)}catch{}},su=async e=>{await ep(e,{cleanup:!0,readable:!1,writable:!0})},ss=async e=>{await ep(e,{cleanup:!0,readable:!0,writable:!1})},sl=async(e,t)=>{if(await e,t)throw t},sc=(e,t,r)=>{r&&!u8(r)?e.destroy(r):t&&e.destroy()},sd=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:o=!0,preserveNewlines:a=!0}={})=>{let u=o||nC.has(r),{subprocessStdout:s,waitReadableDestroy:l}=sD(e,n,t),{readableEncoding:c,readableObjectMode:d,readableHighWaterMark:D}=sp(s,u),{read:p,onStdoutDataDone:h}=sh({subprocessStdout:s,subprocess:e,binary:u,encoding:r,preserveNewlines:a}),f=new eu({read:p,destroy:z(sg.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:l})),highWaterMark:D,objectMode:d,encoding:c});return sm({subprocessStdout:s,onStdoutDataDone:h,readable:f,subprocess:e}),f},sD=(e,t,r)=>{let n=rR(e,t),o=sn(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:o}},sp=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:uM},sh=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:o})=>{let a=rO(),u=uP({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){sf(this,u,a)},onStdoutDataDone:a}},sf=async(e,t,r)=>{try{let{value:n,done:o}=await t.next();o?r.resolve():e.push(n)}catch{}},sm=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:o})=>{try{await ss(e),await n,await so(o),await t,r.readable&&r.push(null)}catch(e){await so(o),sb(r,e)}},sg=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await si(r,t)&&(sb(e,n),await sl(t,n))},sb=(e,t)=>{sc(e,e.readable,t)},sy=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:a}=s_(e,r,t),u=new el({...sF(n,e,o),destroy:z(sw.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:o,waitWritableDestroy:a})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return sv(n,u),u},s_=(e,t,r)=>{let n=r$(e,t),o=sn(r,n,"writableFinal"),a=sn(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:a}},sF=(e,t,r)=>({write:sC.bind(void 0,e),final:z(sE.bind(void 0,e,t,r))}),sC=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},sE=async(e,t,r)=>{await si(r,t)&&(e.writable&&e.end(),await t)},sv=async(e,t,r)=>{try{await su(e),t.writable&&t.end()}catch(e){await sa(r),sS(t,e)}},sw=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await si(r,t),await si(n,t)&&(sS(e,o),await sl(t,o))},sS=(e,t)=>{sc(e,e.writable,t)},sA=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:o,binary:a=!0,preserveNewlines:u=!0}={})=>{let s=a||nC.has(r),{subprocessStdout:l,waitReadableDestroy:c}=sD(e,n,t),{subprocessStdin:d,waitWritableFinal:D,waitWritableDestroy:p}=s_(e,o,t),{readableEncoding:h,readableObjectMode:f,readableHighWaterMark:m}=sp(l,s),{read:g,onStdoutDataDone:b}=sh({subprocessStdout:l,subprocess:e,binary:s,encoding:r,preserveNewlines:u}),y=new eo({read:g,...sF(d,e,D),destroy:z(sT.bind(void 0,{subprocessStdout:l,subprocessStdin:d,subprocess:e,waitReadableDestroy:c,waitWritableFinal:D,waitWritableDestroy:p})),readableHighWaterMark:m,writableHighWaterMark:d.writableHighWaterMark,readableObjectMode:f,writableObjectMode:d.writableObjectMode,encoding:h});return sm({subprocessStdout:l,onStdoutDataDone:b,readable:y,subprocess:e,subprocessStdin:d}),sv(d,y,l),y},sT=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:a},u)=>{await Promise.all([sg({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},u),sw({subprocessStdin:t,subprocess:r,waitWritableFinal:o,waitWritableDestroy:a},u)])},sB=(e,t,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{let a=n||nC.has(t),u=rR(e,r);return sx(uP({subprocessStdout:u,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:o}),u,e)},sx=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}},sO=(async()=>{})().constructor.prototype,s$=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(sO,e)]),sR=({timeout:e,signal:t,...r})=>{if(void 0!==t)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},sk=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:a,command:u,escapedCommand:s,context:l,onInternalError:c,controller:d})=>{let[D,[p,h],f,m,g]=await u5({subprocess:e,options:t,context:l,verboseInfo:n,fileDescriptors:o,originalStreams:a,onInternalError:c,controller:d});d.abort(),c.resolve();let b=sP({errorInfo:D,exitCode:p,signal:h,stdio:f.map((e,r)=>oD(e,t,r)),all:oD(m,t,"all"),ipcOutput:g,context:l,options:t,command:u,escapedCommand:s,startTime:r});return il(b,n,t)},sP=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:a,context:u,options:s,command:l,escapedCommand:c,startTime:d})=>"error"in e?ir({error:e.error,command:l,escapedCommand:c,timedOut:"timeout"===u.terminationReason,isCanceled:"cancel"===u.terminationReason||"gracefulCancel"===u.terminationReason,isGracefullyCanceled:"gracefulCancel"===u.terminationReason,isMaxBuffer:e.error instanceof n9,isForcefullyTerminated:u.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:a,options:s,startTime:d,isSync:!1}):ie({command:l,escapedCommand:c,stdio:n,all:o,ipcOutput:a,options:s,startTime:d}),sj=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([t,r])=>[t,sI(t,e[t],r)]));return{...e,...r}},sI=(e,t,r)=>sz.has(e)&&eN(t)&&eN(r)?{...t,...r}:r,sz=new Set(["env",...tf]),sL=(e,t,r,n)=>{let o=(e,t,n)=>sL(e,t,r,n),a=(...a)=>sM({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:o},...a);return void 0!==n&&n(a,o,t),a},sM=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:o},a,...u)=>{if(eN(a))return o(e,sj(r,a),n);let{file:l,commandArguments:c,options:D,isSync:h}=sU({mapArguments:e,firstArgument:a,nextArguments:u,deepOptions:t,boundOptions:r});return h?((e,t,r)=>{let{file:n,commandArguments:o,command:a,escapedCommand:u,startTime:s,verboseInfo:l,options:c,fileDescriptors:d}=((e,t,r)=>{let{command:n,escapedCommand:o,startTime:a,verboseInfo:u}=t0(e,t,r),{file:s,commandArguments:l,options:c}=nT(e,t,an(r));ai(c);let d=i3(od,c,u,!0);return{file:s,commandArguments:l,command:n,escapedCommand:o,startTime:a,verboseInfo:u,options:c,fileDescriptors:d}})(e,t,r);return il((({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,verboseInfo:a,fileDescriptors:u,startTime:s})=>{let l=aa({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:u,startTime:s});if(l.failed)return l;let{resultError:c,exitCode:d,signal:D,timedOut:p,isMaxBuffer:h}=(({error:e,status:t,signal:r,output:n},{maxBuffer:o})=>{let a,u,s,l=(a=e,u=t,s=r,void 0!==a?a:ar(u,s)?new t8:void 0),c=l?.code==="ETIMEDOUT",d=l?.code==="ENOBUFS"&&null!==n&&n.some(e=>null!==e&&e.length>(([,e])=>e)(o));return{resultError:l,exitCode:t,signal:r,timedOut:c,isMaxBuffer:d}})(l,r),{output:f,error:m=c}=(({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(null===t)return{output:Array.from({length:3})};let a={},u=new Set([]);return{output:t.map((t,s)=>(({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:a,verboseInfo:u},{buffer:s,encoding:l,lines:c,stripFinalNewline:d,maxBuffer:D})=>{if(null===e)return;let p=eK(((e,t,r)=>{if(!t)return e;let n=(([,e])=>e)(r);return e.length>n?e.slice(0,n):e})(e,a,D)),{stdioItems:h,objectMode:f}=t[r],{serializedResult:m,finalResult:g=m}=o3({chunks:o8([p],h,l,n),objectMode:f,encoding:l,lines:c,stripFinalNewline:d,fdNumber:r});o6({serializedResult:m,fdNumber:r,state:n,verboseInfo:u,encoding:l,stdioItems:h,objectMode:f});let b=s[r]?g:void 0;try{return void 0===n.error&&o9(m,h,o),b}catch(e){return n.error=e,b}})({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:u,isMaxBuffer:n,verboseInfo:o},r)),...a}})({fileDescriptors:u,syncResult:l,options:r,isMaxBuffer:h,verboseInfo:a});return as({error:m,exitCode:d,signal:D,timedOut:p,isMaxBuffer:h,stdio:f.map((e,t)=>oD(e,r,t)),all:oD((([,e,t],r)=>{if(r.all)return void 0===e?t:void 0===t?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,oD(t,r,"all")]:Array.isArray(t)?[oD(e,r,"all"),...t]:eJ(e)&&eJ(t)?e2([e,t]):`${e}${t}`})(f,r),r,"all"),options:r,command:n,escapedCommand:o,startTime:s})})({file:n,commandArguments:o,options:c,command:a,escapedCommand:u,verboseInfo:l,fileDescriptors:d,startTime:s}),l,c)})(l,c,D):((e,t,r,n)=>{let{file:o,commandArguments:a,command:u,escapedCommand:l,startTime:c,verboseInfo:D,options:h,fileDescriptors:m}=((e,t,r)=>{let{command:n,escapedCommand:o,startTime:a,verboseInfo:u}=t0(e,t,r),{file:s,commandArguments:l,options:c}=nT(e,t,r),d=sR(c),D=i3(aT,d,u,!1);return{file:s,commandArguments:l,command:n,escapedCommand:o,startTime:a,verboseInfo:u,options:d,fileDescriptors:D}})(e,t,r),{subprocess:g,promise:b}=(({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:o,command:a,escapedCommand:u,fileDescriptors:l})=>{let c;try{c=f(...nO(e,t,r))}catch(e){return(({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:a,verboseInfo:u})=>{var s,l;let c,d,D,h,f,m;oa(n);let g=new p;return s=g,l=n,c=aF(),d=aF(),D=aF(),h=Array.from({length:l.length-3},aF),f=aF(),m=[c,d,D,...h],Object.assign(s,{stdin:c,stdout:d,stderr:D,all:f,stdio:m}),Object.assign(g,{readable:aC,writable:aE,duplex:av}),{subprocess:g,promise:aw(it({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:a,isSync:!1}),u,o)}})({error:e,command:a,escapedCommand:u,fileDescriptors:l,options:r,startTime:n,verboseInfo:o})}let D=new AbortController;d(1/0,D.signal);let h=[...c.stdio];var m=c;let g=new Map;for(let[e,{stdioItems:t,direction:r}]of Object.entries(l)){for(let{stream:n}of t.filter(({type:e})=>iT.has(e)))a0(m,n,r,e);for(let{stream:n}of t.filter(({type:e})=>!iT.has(e)))a1({subprocess:m,stream:n,direction:r,fdNumber:e,pipeGroups:g,controller:D})}for(let[e,t]of g.entries())aJ(1===t.length?t[0]:aB(t),e);((e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;let o=ui(()=>{e.kill()});s(n,()=>{o()})})(c,r,D);let b={},y=rO();c.kill=rh.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:y,context:b,controller:D}),c.all=(({stdout:e,stderr:t},{all:r})=>r&&(e||t)?aB([e,t].filter(Boolean)):void 0)(c,r),((e,{encoding:t})=>{let r={readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap};e.readable=sd.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=sy.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=sA.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=sB.bind(void 0,e,t),e[Symbol.asyncIterator]=sB.bind(void 0,e,t,{})})(c,r),((e,{ipc:t})=>{Object.assign(e,a_(e,!1,t))})(c,r);let _=sk({subprocess:c,options:r,startTime:n,verboseInfo:o,fileDescriptors:l,originalStreams:h,command:a,escapedCommand:u,context:b,onInternalError:y,controller:D});return{subprocess:c,promise:_}})({file:o,commandArguments:a,options:h,startTime:c,verboseInfo:D,command:u,escapedCommand:l,fileDescriptors:m});g.pipe=uf.bind(void 0,{source:g,sourcePromise:b,boundOptions:{},createNested:n});for(let[e,t]of s$){let r=t.value.bind(b);Reflect.defineProperty(g,e,{...t,value:r})}return rk.set(g,{options:h,fileDescriptors:m}),g})(l,c,D,o)},sU=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:o})=>{let[a,u,s]=eG(...Array.isArray(t)&&Array.isArray(t.raw)?((e,t)=>{let r=[];for(let[n,o]of e.entries())r=e8({templates:e,expressions:t,tokens:r,index:n,template:o});if(0===r.length)throw TypeError("Template script must not be empty");let[n,...o]=r;return[n,o,{}]})(t,r):[t,...r]),l=sj(sj(n,o),s),{file:c=a,commandArguments:d=u,options:D=l,isSync:p=!1}=e({file:a,commandArguments:u,options:l});return{file:c,commandArguments:d,options:D,isSync:p}},sN=(e,t)=>{if(t.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[r,...n]=sW(e);return{file:r,commandArguments:n}},sW=e=>{if("string"!=typeof e)throw TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(""===t)return[];let r=[];for(let e of t.split(sq)){let t=r.at(-1);t&&t.endsWith("\\")?r[r.length-1]=`${t.slice(0,-1)} ${e}`:r.push(e)}return r},sq=/ +/g,sH=({options:e})=>({...sV(e),isSync:!0}),sV=e=>({options:{...sG(e),...e}}),sG=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},sZ=sL(()=>({}));sL(()=>({isSync:!0})),sL(({file:e,commandArguments:t})=>sN(e,t)),sL(({file:e,commandArguments:t})=>({...sN(e,t),isSync:!0})),sL(({options:e})=>{if(!1===e.node)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}}),sL(({options:e})=>sV(e),{},{preferLocal:!0},(e,t,r)=>{e.sync=t(sH,r),e.s=e.sync});let{sendMessage:sJ,getOneMessage:sK,getEachMessage:sY,getCancelSignal:sQ}=(n=void 0!==x.channel,{...a_(x,!0,n),getCancelSignal:nl.bind(void 0,{anyProcess:x,channel:x.channel,isSubprocess:!0,ipc:n})});function sX(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:u,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);let o=u.prototype,a=Object.keys(o);for(let e=0;e<a.length;e++){let t=a[e];t in r||(r[t]=o[t].bind(r))}}let o=r?.Parent??Object;class a extends o{}function u(e){var t;let o=r?.Parent?new a:this;for(let r of(n(o,e),(t=o._zod).deferred??(t.deferred=[]),o._zod.deferred))r();return o}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(u,"init",{value:n}),Object.defineProperty(u,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}Object.freeze({status:"aborted"}),Symbol("zod_brand");class s0 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class s2 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}let s1={};function s8(e){return e&&Object.assign(s1,e),s1}function s3(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function s6(e,t="|"){return e.map(e=>lp(e)).join(t)}function s9(e,t){return"bigint"==typeof t?t.toString():t}function s7(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function s4(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}let s5=Symbol("evaluating");function le(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==s5)return void 0===n&&(n=s5,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function lt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function lr(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function ln(e){return JSON.stringify(e)}let li="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function lo(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let la=s7(()=>{if("u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function lu(e){if(!1===lo(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==lo(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function ls(e){return lu(e)?{...e}:Array.isArray(e)?[...e]:e}let ll=new Set(["string","number","symbol"]);function lc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ld(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function lD(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function lp(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function lh(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function lf(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function lm(e){return"string"==typeof e?e:e?.message}function lg(e,t,r){let n={...e,path:e.path??[]};return e.message||(n.message=lm(e.inst?._zod.def?.error?.(e))??lm(t?.error?.(e))??lm(r.customError?.(e))??lm(r.localeError?.(e))??"Invalid input"),delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function lb(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ly(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}let l_=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,s9,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},lF=sX("$ZodError",l_),lC=sX("$ZodError",l_,{Parent:Error}),lE=e=>(t,r,n,o)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},u=t._zod.run({value:r,issues:[]},a);if(u instanceof Promise)throw new s0;if(u.issues.length){let t=new(o?.Err??e)(u.issues.map(e=>lg(e,a,s8())));throw li(t,o?.callee),t}return u.value},lv=e=>async(t,r,n,o)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},a);if(u instanceof Promise&&(u=await u),u.issues.length){let t=new(o?.Err??e)(u.issues.map(e=>lg(e,a,s8())));throw li(t,o?.callee),t}return u.value},lw=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new s0;return a.issues.length?{success:!1,error:new(e??lF)(a.issues.map(e=>lg(e,o,s8())))}:{success:!0,data:a.value}},lS=lw(lC),lA=e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>lg(e,o,s8())))}:{success:!0,data:a.value}},lT=lA(lC),lB=/^[cC][^\s-]{8,}$/,lx=/^[0-9a-z]+$/,lO=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,l$=/^[0-9a-vA-V]{20}$/,lR=/^[A-Za-z0-9]{27}$/,lk=/^[a-zA-Z0-9_-]{21}$/,lP=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,lj=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,lI=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,lz=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lL=/^(?:(?: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])$/,lM=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,lU=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,lN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lW=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,lq=/^[A-Za-z0-9_-]*$/,lH=/^\+(?:[0-9]){6,14}[0-9]$/,lV="(?:(?:\\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])))",lG=RegExp(`^${lV}$`);function lZ(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let lJ=/^[^A-Z]*$/,lK=/^[^a-z]*$/,lY=sX("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),lQ=sX("$ZodCheckMaxLength",(e,t)=>{var r;lY.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let o=lb(n);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),lX=sX("$ZodCheckMinLength",(e,t)=>{var r;lY.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let o=lb(n);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),l0=sX("$ZodCheckLengthEquals",(e,t)=>{var r;lY.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let n=r.value,o=n.length;if(o===t.length)return;let a=lb(n),u=o>t.length;r.issues.push({origin:a,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),l2=sX("$ZodCheckStringFormat",(e,t)=>{var r,n;lY.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),l1=sX("$ZodCheckRegex",(e,t)=>{l2.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),l8=sX("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=lJ),l2.init(e,t)}),l3=sX("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=lK),l2.init(e,t)}),l6=sX("$ZodCheckIncludes",(e,t)=>{lY.init(e,t);let r=lc(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),l9=sX("$ZodCheckStartsWith",(e,t)=>{lY.init(e,t);let r=RegExp(`^${lc(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),l7=sX("$ZodCheckEndsWith",(e,t)=>{lY.init(e,t);let r=RegExp(`.*${lc(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),l4=sX("$ZodCheckOverwrite",(e,t)=>{lY.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class l5{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let ce={major:4,minor:2,patch:0},ct=sX("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ce;let n=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&n.unshift(e),n))for(let r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let n,o=lh(e);for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(o)continue;let t=e.issues.length,u=a._zod.check(e);if(u instanceof Promise&&r?.async===!1)throw new s0;if(n||u instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await u,e.issues.length!==t&&(o||(o=lh(e,t)))});else{if(e.issues.length===t)continue;o||(o=lh(e,t))}}return n?n.then(()=>e):e},r=(r,o,a)=>{if(lh(r))return r.aborted=!0,r;let u=t(o,n,a);if(u instanceof Promise){if(!1===a.async)throw new s0;return u.then(t=>e._zod.parse(t,a))}return e._zod.parse(u,a)};e._zod.run=(o,a)=>{if(a.skipChecks)return e._zod.parse(o,a);if("backward"===a.direction){let t=e._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,o,a)):r(t,o,a)}let u=e._zod.parse(o,a);if(u instanceof Promise){if(!1===a.async)throw new s0;return u.then(e=>t(e,n,a))}return t(u,n,a)}}e["~standard"]={validate:t=>{try{let r=lS(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return lT(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),cr=sX("$ZodString",(e,t)=>{var r;let n;ct.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=(r=e._zod.bag)?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*",RegExp(`^${n}$`)),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),cn=sX("$ZodStringFormat",(e,t)=>{l2.init(e,t),cr.init(e,t)}),ci=sX("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=lj),cn.init(e,t)}),co=sX("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=lI(e))}else t.pattern??(t.pattern=lI());cn.init(e,t)}),ca=sX("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=lz),cn.init(e,t)}),cu=sX("$ZodURL",(e,t)=>{cn.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),cs=sX("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),cn.init(e,t)}),cl=sX("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=lk),cn.init(e,t)}),cc=sX("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lB),cn.init(e,t)}),cd=sX("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=lx),cn.init(e,t)}),cD=sX("$ZodULID",(e,t)=>{t.pattern??(t.pattern=lO),cn.init(e,t)}),cp=sX("$ZodXID",(e,t)=>{t.pattern??(t.pattern=l$),cn.init(e,t)}),ch=sX("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=lR),cn.init(e,t)}),cf=sX("$ZodISODateTime",(e,t)=>{let r,n,o;t.pattern??(r=lZ({precision:t.precision}),n=["Z"],t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),o=`${r}(?:${n.join("|")})`,t.pattern=RegExp(`^${lV}T(?:${o})$`)),cn.init(e,t)}),cm=sX("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=lG),cn.init(e,t)}),cg=sX("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${lZ(t)}$`)),cn.init(e,t)}),cb=sX("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=lP),cn.init(e,t)}),cy=sX("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=lL),cn.init(e,t),e._zod.bag.format="ipv4"}),c_=sX("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=lM),cn.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),cF=sX("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=lU),cn.init(e,t)}),cC=sX("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=lN),cn.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(2!==n.length)throw Error();let[e,t]=n;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function cE(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let cv=sX("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=lW),cn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{cE(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),cw=sX("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=lq),cn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{!function(e){if(!lq.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return cE(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),cS=sX("$ZodE164",(e,t)=>{t.pattern??(t.pattern=lH),cn.init(e,t)}),cA=sX("$ZodJWT",(e,t)=>{cn.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));if("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),cT=sX("$ZodUnknown",(e,t)=>{ct.init(e,t),e._zod.parse=e=>e}),cB=sX("$ZodNever",(e,t)=>{ct.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function cx(e,t,r){e.issues.length&&t.issues.push(...lf(r,e.issues)),t.value[r]=e.value}let cO=sX("$ZodArray",(e,t)=>{ct.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let a=[];for(let e=0;e<o.length;e++){let u=o[e],s=t.element._zod.run({value:u,issues:[]},n);s instanceof Promise?a.push(s.then(t=>cx(t,r,e))):cx(s,r,e)}return a.length?Promise.all(a).then(()=>r):r}});function c$(e,t,r,n){e.issues.length&&t.issues.push(...lf(r,e.issues)),void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function cR(e){var t;let r=Object.keys(e.shape);for(let t of r)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${t}": expected a Zod schema`);let n=Object.keys(t=e.shape).filter(e=>"optional"===t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(n)}}function ck(e,t,r,n,o,a){let u=[],s=o.keySet,l=o.catchall._zod,c=l.def.type;for(let o in t){if(s.has(o))continue;if("never"===c){u.push(o);continue}let a=l.run({value:t[o],issues:[]},n);a instanceof Promise?e.push(a.then(e=>c$(e,r,o,t))):c$(a,r,o,t)}return(u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:a}),e.length)?Promise.all(e).then(()=>r):r}let cP=sX("$ZodObject",(e,t)=>{let r;ct.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let o=s7(()=>cR(t));le(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let n=e[t]._zod;if(n.values)for(let e of(r[t]??(r[t]=new Set),n.values))r[t].add(e)}return r});let a=t.catchall;e._zod.parse=(t,n)=>{r??(r=o.value);let u=t.value;if(!lo(u))return t.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),t;t.value={};let s=[],l=r.shape;for(let e of r.keys){let r=l[e]._zod.run({value:u[e],issues:[]},n);r instanceof Promise?s.push(r.then(r=>c$(r,t,e,u))):c$(r,t,e,u)}return a?ck(s,u,t,n,o.value,e):s.length?Promise.all(s).then(()=>t):t}}),cj=sX("$ZodObjectJIT",(e,t)=>{let r,n;cP.init(e,t);let o=e._zod.parse,a=s7(()=>cR(t)),u=!s1.jitless,s=u&&la.value,l=t.catchall;e._zod.parse=(c,d)=>{n??(n=a.value);let D=c.value;return lo(D)?u&&s&&d?.async===!1&&!0!==d.jitless?(r||(r=(e=>{let t=new l5(["shape","payload","ctx"]),r=a.value,n=e=>{let t=ln(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let o=Object.create(null),u=0;for(let e of r.keys)o[e]=`key_${u++}`;for(let e of(t.write("const newResult = {};"),r.keys)){let r=o[e],a=ln(e);t.write(`const ${r} = ${n(e)};`),t.write(`
51
+ if (${r}.issues.length) {
52
+ payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
53
+ ...iss,
54
+ path: iss.path ? [${a}, ...iss.path] : [${a}]
55
+ })));
56
+ }
57
+
58
+
59
+ if (${r}.value === undefined) {
60
+ if (${a} in input) {
61
+ newResult[${a}] = undefined;
62
+ }
63
+ } else {
64
+ newResult[${a}] = ${r}.value;
65
+ }
66
+
67
+ `)}t.write("payload.value = newResult;"),t.write("return payload;");let s=t.compile();return(t,r)=>s(e,t,r)})(t.shape)),c=r(c,d),l)?ck([],D,c,d,n,e):c:o(c,d):(c.issues.push({expected:"object",code:"invalid_type",input:D,inst:e}),c)}});function cI(e,t,r,n){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let o=e.filter(e=>!lh(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>lg(e,n,s8())))}),t)}let cz=sX("$ZodUnion",(e,t)=>{ct.init(e,t),le(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),le(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),le(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),le(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>s4(e.source)).join("|")})$`)}});let r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(o,a)=>{if(r)return n(o,a);let u=!1,s=[];for(let e of t.options){let t=e._zod.run({value:o.value,issues:[]},a);if(t instanceof Promise)s.push(t),u=!0;else{if(0===t.issues.length)return t;s.push(t)}}return u?Promise.all(s).then(t=>cI(t,o,e,a)):cI(s,o,e,a)}}),cL=sX("$ZodIntersection",(e,t)=>{ct.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,o=t.left._zod.run({value:n,issues:[]},r),a=t.right._zod.run({value:n,issues:[]},r);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([t,r])=>cM(e,t,r)):cM(e,o,a)}});function cM(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),lh(e))return e;let n=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(lu(t)&&lu(r)){let n=Object.keys(r),o=Object.keys(t).filter(e=>-1!==n.indexOf(e)),a={...t,...r};for(let n of o){let o=e(t[n],r[n]);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};a[n]=o.data}return{valid:!0,data:a}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<t.length;o++){let a=e(t[o],r[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!n.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}let cU=sX("$ZodRecord",(e,t)=>{ct.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!lu(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let a=[],u=t.keyType._zod.values;if(u){let s;r.value={};let l=new Set;for(let e of u)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){l.add("number"==typeof e?e.toString():e);let u=t.valueType._zod.run({value:o[e],issues:[]},n);u instanceof Promise?a.push(u.then(t=>{t.issues.length&&r.issues.push(...lf(e,t.issues)),r.value[e]=t.value})):(u.issues.length&&r.issues.push(...lf(e,u.issues)),r.value[e]=u.value)}for(let e in o)l.has(e)||(s=s??[]).push(e);s&&s.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:s})}else for(let u of(r.value={},Reflect.ownKeys(o))){if("__proto__"===u)continue;let s=t.keyType._zod.run({value:u,issues:[]},n);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){"loose"===t.mode?r.value[u]=o[u]:r.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>lg(e,n,s8())),input:u,path:[u],inst:e});continue}let l=t.valueType._zod.run({value:o[u],issues:[]},n);l instanceof Promise?a.push(l.then(e=>{e.issues.length&&r.issues.push(...lf(u,e.issues)),r.value[s.value]=e.value})):(l.issues.length&&r.issues.push(...lf(u,l.issues)),r.value[s.value]=l.value)}return a.length?Promise.all(a).then(()=>r):r}}),cN=sX("$ZodEnum",(e,t)=>{ct.init(e,t);let r=s3(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=RegExp(`^(${r.filter(e=>ll.has(typeof e)).map(e=>"string"==typeof e?lc(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{let a=t.value;return n.has(a)||t.issues.push({code:"invalid_value",values:r,input:a,inst:e}),t}}),cW=sX("$ZodTransform",(e,t)=>{ct.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new s2(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(r.value=e,r));if(o instanceof Promise)throw new s0;return r.value=o,r}});function cq(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}let cH=sX("$ZodOptional",(e,t)=>{ct.init(e,t),e._zod.optin="optional",e._zod.optout="optional",le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),le(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${s4(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>cq(t,e.value)):cq(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),cV=sX("$ZodNullable",(e,t)=>{ct.init(e,t),le(e._zod,"optin",()=>t.innerType._zod.optin),le(e._zod,"optout",()=>t.innerType._zod.optout),le(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${s4(e.source)}|null)$`):void 0}),le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),cG=sX("$ZodDefault",(e,t)=>{ct.init(e,t),e._zod.optin="optional",le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>cZ(e,t)):cZ(n,t)}});function cZ(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let cJ=sX("$ZodPrefault",(e,t)=>{ct.init(e,t),e._zod.optin="optional",le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),cK=sX("$ZodNonOptional",(e,t)=>{ct.init(e,t),le(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(t=>cY(t,e)):cY(o,e)}});function cY(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let cQ=sX("$ZodCatch",(e,t)=>{ct.init(e,t),le(e._zod,"optin",()=>t.innerType._zod.optin),le(e._zod,"optout",()=>t.innerType._zod.optout),le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>lg(e,r,s8()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>lg(e,r,s8()))},input:e.value}),e.issues=[]),e)}}),cX=sX("$ZodPipe",(e,t)=>{ct.init(e,t),le(e._zod,"values",()=>t.in._zod.values),le(e._zod,"optin",()=>t.in._zod.optin),le(e._zod,"optout",()=>t.out._zod.optout),le(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>c0(e,t.in,r)):c0(n,t.in,r)}let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>c0(e,t.out,r)):c0(n,t.out,r)}});function c0(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}let c2=sX("$ZodReadonly",(e,t)=>{ct.init(e,t),le(e._zod,"propValues",()=>t.innerType._zod.propValues),le(e._zod,"values",()=>t.innerType._zod.values),le(e._zod,"optin",()=>t.innerType?._zod?.optin),le(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(c1):c1(n)}});function c1(e){return e.value=Object.freeze(e.value),e}let c8=sX("$ZodCustom",(e,t)=>{lY.init(e,t),ct.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(t=>c3(t,r,n,e));c3(o,r,n,e)}});function c3(e,t,r,n){if(!e){let e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(ly(e))}}Symbol("ZodOutput"),Symbol("ZodInput");(pv=globalThis).__zod_globalRegistry??(pv.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&"object"==typeof r&&"id"in r){if(this._idmap.has(r.id))throw Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let c6=globalThis.__zod_globalRegistry;function c9(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...lD(t)})}function c7(e,t){return new lQ({check:"max_length",...lD(t),maximum:e})}function c4(e,t){return new lX({check:"min_length",...lD(t),minimum:e})}function c5(e,t){return new l0({check:"length_equals",...lD(t),length:e})}function de(e){return new l4({check:"overwrite",tx:e})}function dt(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??c6,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function dr(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,a=t.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;let u={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,u);let s=e._zod.toJSONSchema?.();if(s)u.schema=s;else{let n={...r,schemaPath:[...r.schemaPath,e],path:r.path},a=e._zod.parent;if(a)u.ref=a,dr(a,t,n),t.seen.get(a).isParent=!0;else if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,n);else{let r=u.schema,a=t.processors[o.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);a(e,t,r,n)}}let l=t.metadataRegistry.get(e);return l&&Object.assign(u.schema,l),"input"===t.io&&function e(t,r){let n=r??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let o=t._zod.def;if("transform"===o.type)return!0;if("array"===o.type)return e(o.element,n);if("set"===o.type)return e(o.valueType,n);if("lazy"===o.type)return e(o.getter(),n);if("promise"===o.type||"optional"===o.type||"nonoptional"===o.type||"nullable"===o.type||"readonly"===o.type||"default"===o.type||"prefault"===o.type)return e(o.innerType,n);if("intersection"===o.type)return e(o.left,n)||e(o.right,n);if("record"===o.type||"map"===o.type)return e(o.keyType,n)||e(o.valueType,n);if("pipe"===o.type)return e(o.in,n)||e(o.out,n);if("object"===o.type){for(let t in o.shape)if(e(o.shape[t],n))return!0;return!1}if("union"===o.type){for(let t of o.options)if(e(t,n))return!0;return!1}if("tuple"===o.type){for(let t of o.items)if(e(t,n))return!0;if(o.rest&&e(o.rest,n))return!0}return!1}(e)&&(delete u.schema.examples,delete u.schema.default),"input"===t.io&&u.schema._prefault&&((n=u.schema).default??(n.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function dn(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{if(t[1].schema.$ref)return;let n=t[1],{ref:o,defId:a}=(t=>{let n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(r)return{ref:o(r)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${o("__shared")}#/${n}/${a}`}}if(t[1]===r)return{ref:"#"};let o=`#/${n}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:o+a}})(t);n.def={...n.schema},a&&(n.defId=a);let u=n.schema;for(let e in u)delete u[e];u.$ref=o};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
68
+
69
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let o=r[1];if(t===r[0]){n(r);continue}if(e.external){let o=e.external.registry.get(r[0])?.id;if(t!==r[0]&&o){n(r);continue}}if(e.metadataRegistry.get(r[0])?.id||o.cycle||o.count>1&&"ref"===e.reused){n(r);continue}}}function di(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{let r=e.seen.get(t),o=r.def??r.schema,a={...o};if(null===r.ref)return;let u=r.ref;if(r.ref=null,u){n(u);let t=e.seen.get(u).schema;t.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(o.allOf=o.allOf??[],o.allOf.push(t)):(Object.assign(o,t),Object.assign(o,a))}r.isParent||e.override({zodSchema:t,jsonSchema:o,path:r.path??[]})};for(let t of[...e.seen.entries()].reverse())n(t[0]);let o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(r)}Object.assign(o,r.def??r.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?o.$defs=a:o.definitions=a);try{let e=JSON.parse(JSON.stringify(o));return Object.defineProperty(e,"~standard",{value:{...t["~standard"],jsonSchema:{input:da(t,"input"),output:da(t,"output")}},enumerable:!1,writable:!1}),e}catch(e){throw Error("Error converting schema to JSON.")}}let da=(e,t)=>r=>{let{libraryOptions:n,target:o}=r??{},a=dt({...n??{},target:o,io:t,processors:{}});return dr(e,a),dn(a,e),di(a,e)},du={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ds=sX("ZodISODateTime",(e,t)=>{cf.init(e,t),dx.init(e,t)}),dl=sX("ZodISODate",(e,t)=>{cm.init(e,t),dx.init(e,t)}),dc=sX("ZodISOTime",(e,t)=>{cg.init(e,t),dx.init(e,t)}),dd=sX("ZodISODuration",(e,t)=>{cb.init(e,t),dx.init(e,t)}),dD=(e,t)=>{lF.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let r={_errors:[]},n=e=>{for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>n({issues:e}));else if("invalid_key"===o.code)n({issues:o.issues});else if("invalid_element"===o.code)n({issues:o.issues});else if(0===o.path.length)r._errors.push(t(o));else{let e=r,n=0;for(;n<o.path.length;){let r=o.path[n];n===o.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(o))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(e),r})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s9,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,s9,2)}},isEmpty:{get:()=>0===e.issues.length}})};sX("ZodError",dD);let dp=sX("ZodError",dD,{Parent:Error}),dh=lE(dp),df=lv(dp),dm=lw(dp),dg=lA(dp),db=(e,t,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return lE(dp)(e,t,n)},dy=(e,t,r)=>lE(dp)(e,t,r),d_=async(e,t,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return lv(dp)(e,t,n)},dF=async(e,t,r)=>lv(dp)(e,t,r),dC=(e,t,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return lw(dp)(e,t,n)},dE=(e,t,r)=>lw(dp)(e,t,r),dv=async(e,t,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return lA(dp)(e,t,n)},dw=async(e,t,r)=>lA(dp)(e,t,r),dS=sX("ZodType",(e,t)=>(ct.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:da(e,"input"),output:da(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{let n=dt({...r,processors:t});return dr(e,n),dn(n,e),di(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(lr(t,{checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(t,r)=>ld(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>dh(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>dm(e,t,r),e.parseAsync=async(t,r)=>df(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>dg(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>db(e,t,r),e.decode=(t,r)=>dy(e,t,r),e.encodeAsync=async(t,r)=>d_(e,t,r),e.decodeAsync=async(t,r)=>dF(e,t,r),e.safeEncode=(t,r)=>dC(e,t,r),e.safeDecode=(t,r)=>dE(e,t,r),e.safeEncodeAsync=async(t,r)=>dv(e,t,r),e.safeDecodeAsync=async(t,r)=>dw(e,t,r),e.refine=(t,r)=>e.check(function(e,t={}){return new DD({type:"custom",check:"custom",fn:e,...lD(t)})}(t,r)),e.superRefine=t=>e.check(function(e){var t;let r,n;return t=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(ly(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(ly(e)))},e(t.value,t)),(n=new lY({check:"custom",...lD(void 0)}))._zod.check=t,r=n}(t)),e.overwrite=t=>e.check(de(t)),e.optional=()=>Dr(e),e.nullable=()=>Di(e),e.nullish=()=>Dr(Di(e)),e.nonoptional=t=>new Du({type:"nonoptional",innerType:e,...lD(t)}),e.array=()=>d2(e),e.or=t=>new d6({type:"union",options:[e,t],...lD(void 0)}),e.and=t=>new d9({type:"intersection",left:e,right:t}),e.transform=t=>Dc(e,new De({type:"transform",transform:t})),e.default=t=>{var r,n;return r=e,n=t,new Do({type:"default",innerType:r,get defaultValue(){return"function"==typeof n?n():ls(n)}})},e.prefault=t=>{var r,n;return r=e,n=t,new Da({type:"prefault",innerType:r,get defaultValue(){return"function"==typeof n?n():ls(n)}})},e.catch=t=>{var r;return new Ds({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r})},e.pipe=t=>Dc(e,t),e.readonly=()=>new Dd({type:"readonly",innerType:e}),e.describe=t=>{let r=e.clone();return c6.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>c6.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return c6.get(e);let r=e.clone();return c6.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),dA=sX("_ZodString",(e,t)=>{cr.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{r.type="string";let{minimum:n,maximum:o,format:a,patterns:u,contentEncoding:s}=e._zod.bag;if("number"==typeof n&&(r.minLength=n),"number"==typeof o&&(r.maxLength=o),a&&(r.format=du[a]??a,""===r.format&&delete r.format),s&&(r.contentEncoding=s),u&&u.size>0){let e=[...u];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new l1({check:"string_format",format:"regex",...lD(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new l6({check:"string_format",format:"includes",...lD(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new l9({check:"string_format",format:"starts_with",...lD(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new l7({check:"string_format",format:"ends_with",...lD(t),suffix:e})}(...t)),e.min=(...t)=>e.check(c4(...t)),e.max=(...t)=>e.check(c7(...t)),e.length=(...t)=>e.check(c5(...t)),e.nonempty=(...t)=>e.check(c4(1,...t)),e.lowercase=t=>e.check(new l8({check:"string_format",format:"lowercase",...lD(t)})),e.uppercase=t=>e.check(new l3({check:"string_format",format:"uppercase",...lD(t)})),e.trim=()=>e.check(de(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return de(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(de(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(de(e=>e.toUpperCase())),e.slugify=()=>e.check(de(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}),dT=sX("ZodString",(e,t)=>{cr.init(e,t),dA.init(e,t),e.email=t=>e.check(new dO({type:"string",format:"email",check:"string_format",abort:!1,...lD(t)})),e.url=t=>e.check(new dk({type:"string",format:"url",check:"string_format",abort:!1,...lD(t)})),e.jwt=t=>e.check(new dJ({type:"string",format:"jwt",check:"string_format",abort:!1,...lD(t)})),e.emoji=t=>e.check(new dP({type:"string",format:"emoji",check:"string_format",abort:!1,...lD(t)})),e.guid=t=>e.check(c9(d$,t)),e.uuid=t=>e.check(new dR({type:"string",format:"uuid",check:"string_format",abort:!1,...lD(t)})),e.uuidv4=t=>e.check(new dR({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...lD(t)})),e.uuidv6=t=>e.check(new dR({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...lD(t)})),e.uuidv7=t=>e.check(new dR({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...lD(t)})),e.nanoid=t=>e.check(new dj({type:"string",format:"nanoid",check:"string_format",abort:!1,...lD(t)})),e.guid=t=>e.check(c9(d$,t)),e.cuid=t=>e.check(new dI({type:"string",format:"cuid",check:"string_format",abort:!1,...lD(t)})),e.cuid2=t=>e.check(new dz({type:"string",format:"cuid2",check:"string_format",abort:!1,...lD(t)})),e.ulid=t=>e.check(new dL({type:"string",format:"ulid",check:"string_format",abort:!1,...lD(t)})),e.base64=t=>e.check(new dV({type:"string",format:"base64",check:"string_format",abort:!1,...lD(t)})),e.base64url=t=>e.check(new dG({type:"string",format:"base64url",check:"string_format",abort:!1,...lD(t)})),e.xid=t=>e.check(new dM({type:"string",format:"xid",check:"string_format",abort:!1,...lD(t)})),e.ksuid=t=>e.check(new dU({type:"string",format:"ksuid",check:"string_format",abort:!1,...lD(t)})),e.ipv4=t=>e.check(new dN({type:"string",format:"ipv4",check:"string_format",abort:!1,...lD(t)})),e.ipv6=t=>e.check(new dW({type:"string",format:"ipv6",check:"string_format",abort:!1,...lD(t)})),e.cidrv4=t=>e.check(new dq({type:"string",format:"cidrv4",check:"string_format",abort:!1,...lD(t)})),e.cidrv6=t=>e.check(new dH({type:"string",format:"cidrv6",check:"string_format",abort:!1,...lD(t)})),e.e164=t=>e.check(new dZ({type:"string",format:"e164",check:"string_format",abort:!1,...lD(t)})),e.datetime=t=>e.check(new ds({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...lD(t)})),e.date=t=>e.check(new dl({type:"string",format:"date",check:"string_format",...lD(t)})),e.time=t=>e.check(new dc({type:"string",format:"time",check:"string_format",precision:null,...lD(t)})),e.duration=t=>e.check(new dd({type:"string",format:"duration",check:"string_format",...lD(t)}))});function dB(e){return new dT({type:"string",...lD(e)})}let dx=sX("ZodStringFormat",(e,t)=>{cn.init(e,t),dA.init(e,t)}),dO=sX("ZodEmail",(e,t)=>{ca.init(e,t),dx.init(e,t)}),d$=sX("ZodGUID",(e,t)=>{ci.init(e,t),dx.init(e,t)}),dR=sX("ZodUUID",(e,t)=>{co.init(e,t),dx.init(e,t)}),dk=sX("ZodURL",(e,t)=>{cu.init(e,t),dx.init(e,t)}),dP=sX("ZodEmoji",(e,t)=>{cs.init(e,t),dx.init(e,t)}),dj=sX("ZodNanoID",(e,t)=>{cl.init(e,t),dx.init(e,t)}),dI=sX("ZodCUID",(e,t)=>{cc.init(e,t),dx.init(e,t)}),dz=sX("ZodCUID2",(e,t)=>{cd.init(e,t),dx.init(e,t)}),dL=sX("ZodULID",(e,t)=>{cD.init(e,t),dx.init(e,t)}),dM=sX("ZodXID",(e,t)=>{cp.init(e,t),dx.init(e,t)}),dU=sX("ZodKSUID",(e,t)=>{ch.init(e,t),dx.init(e,t)}),dN=sX("ZodIPv4",(e,t)=>{cy.init(e,t),dx.init(e,t)}),dW=sX("ZodIPv6",(e,t)=>{c_.init(e,t),dx.init(e,t)}),dq=sX("ZodCIDRv4",(e,t)=>{cF.init(e,t),dx.init(e,t)}),dH=sX("ZodCIDRv6",(e,t)=>{cC.init(e,t),dx.init(e,t)}),dV=sX("ZodBase64",(e,t)=>{cv.init(e,t),dx.init(e,t)}),dG=sX("ZodBase64URL",(e,t)=>{cw.init(e,t),dx.init(e,t)}),dZ=sX("ZodE164",(e,t)=>{cS.init(e,t),dx.init(e,t)}),dJ=sX("ZodJWT",(e,t)=>{cA.init(e,t),dx.init(e,t)}),dK=sX("ZodUnknown",(e,t)=>{cT.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(e,t,r)=>void 0});function dY(){return new dK({type:"unknown"})}let dQ=sX("ZodNever",(e,t)=>{cB.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.not={}}});function dX(e){return new dQ({type:"never",...lD(e)})}let d0=sX("ZodArray",(e,t)=>{cO.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let o=e._zod.def,{minimum:a,maximum:u}=e._zod.bag;"number"==typeof a&&(r.minItems=a),"number"==typeof u&&(r.maxItems=u),r.type="array",r.items=dr(o.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,e.min=(t,r)=>e.check(c4(t,r)),e.nonempty=t=>e.check(c4(1,t)),e.max=(t,r)=>e.check(c7(t,r)),e.length=(t,r)=>e.check(c5(t,r)),e.unwrap=()=>e.element});function d2(e,t){return new d0({type:"array",element:e,...lD(t)})}let d1=sX("ZodObject",(e,t)=>{cj.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let o=e._zod.def;r.type="object",r.properties={};let a=o.shape;for(let e in a)r.properties[e]=dr(a[e],t,{...n,path:[...n.path,"properties",e]});let u=new Set([...new Set(Object.keys(a))].filter(e=>{let r=o.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));u.size>0&&(r.required=Array.from(u)),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=dr(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,r,n),le(e,"shape",()=>t.shape),e.keyof=()=>{var t;return new d5({type:"enum",entries:Array.isArray(t=Object.keys(e._zod.def.shape))?Object.fromEntries(t.map(e=>[e,e])):t,...lD(void 0)})},e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:dY()}),e.loose=()=>e.clone({...e._zod.def,catchall:dY()}),e.strict=()=>e.clone({...e._zod.def,catchall:dX()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>(function(e,t){if(!lu(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let n=lr(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return lt(this,"shape",r),r},checks:[]});return ld(e,n)})(e,t),e.safeExtend=t=>(function(e,t){if(!lu(t))throw Error("Invalid input to safeExtend: expected a plain object");let r={...e._zod.def,get shape(){let r={...e._zod.def.shape,...t};return lt(this,"shape",r),r},checks:e._zod.def.checks};return ld(e,r)})(e,t),e.merge=t=>{let r;return r=lr(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return lt(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]}),ld(e,r)},e.pick=t=>{let r,n;return r=e._zod.def,n=lr(e._zod.def,{get shape(){let e={};for(let n in t){if(!(n in r.shape))throw Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return lt(this,"shape",e),e},checks:[]}),ld(e,n)},e.omit=t=>{let r,n;return r=e._zod.def,n=lr(e._zod.def,{get shape(){let n={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return lt(this,"shape",n),n},checks:[]}),ld(e,n)},e.partial=(...t)=>{var r;let n;return r=t[0],n=lr(e._zod.def,{get shape(){let t=e._zod.def.shape,n={...t};if(r)for(let e in r){if(!(e in t))throw Error(`Unrecognized key: "${e}"`);r[e]&&(n[e]=Dt?new Dt({type:"optional",innerType:t[e]}):t[e])}else for(let e in t)n[e]=Dt?new Dt({type:"optional",innerType:t[e]}):t[e];return lt(this,"shape",n),n},checks:[]}),ld(e,n)},e.required=(...t)=>{var r;let n;return r=t[0],n=lr(e._zod.def,{get shape(){let t=e._zod.def.shape,n={...t};if(r)for(let e in r){if(!(e in n))throw Error(`Unrecognized key: "${e}"`);r[e]&&(n[e]=new Du({type:"nonoptional",innerType:t[e]}))}else for(let e in t)n[e]=new Du({type:"nonoptional",innerType:t[e]});return lt(this,"shape",n),n},checks:[]}),ld(e,n)}});function d8(e,t){return new d1({type:"object",shape:e,catchall:dX(),...lD(t)})}function d3(e,t){return new d1({type:"object",shape:e,catchall:dY(),...lD(t)})}let d6=sX("ZodUnion",(e,t)=>{cz.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let o,a,u;return a=!1===(o=e._zod.def).inclusive,u=o.options.map((e,r)=>dr(e,t,{...n,path:[...n.path,a?"oneOf":"anyOf",r]})),void(a?r.oneOf=u:r.anyOf=u)},e.options=t.options}),d9=sX("ZodIntersection",(e,t)=>{cL.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let o,a,u,s;return a=dr((o=e._zod.def).left,t,{...n,path:[...n.path,"allOf",0]}),u=dr(o.right,t,{...n,path:[...n.path,"allOf",1]}),void(r.allOf=[...(s=e=>"allOf"in e&&1===Object.keys(e).length)(a)?a.allOf:[a],...s(u)?u.allOf:[u]])}}),d7=sX("ZodRecord",(e,t)=>{cU.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let o;return o=e._zod.def,void(r.type="object",("draft-07"===t.target||"draft-2020-12"===t.target)&&(r.propertyNames=dr(o.keyType,t,{...n,path:[...n.path,"propertyNames"]})),r.additionalProperties=dr(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]}))},e.keyType=t.keyType,e.valueType=t.valueType});function d4(e,t,r){return new d7({type:"record",keyType:e,valueType:t,...lD(r)})}let d5=sX("ZodEnum",(e,t)=>{cN.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let o;(o=s3(e._zod.def.entries)).every(e=>"number"==typeof e)&&(r.type="number"),o.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=o},e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let o={};for(let n of e)if(r.has(n))o[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new d5({...t,checks:[],...lD(n),entries:o})},e.exclude=(e,n)=>{let o={...t.entries};for(let t of e)if(r.has(t))delete o[t];else throw Error(`Key ${t} not found in enum`);return new d5({...t,checks:[],...lD(n),entries:o})}}),De=sX("ZodTransform",(e,t)=>{cW.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(e,t,r)=>(e=>{if("throw"===e.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(e),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new s2(e.constructor.name);r.addIssue=n=>{"string"==typeof n?r.issues.push(ly(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=e),r.issues.push(ly(n)))};let o=t.transform(r.value,r);return o instanceof Promise?o.then(e=>(r.value=e,r)):(r.value=o,r)}}),Dt=sX("ZodOptional",(e,t)=>{cH.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let o;dr((o=e._zod.def).innerType,t,n),t.seen.get(e).ref=o.innerType},e.unwrap=()=>e._zod.def.innerType});function Dr(e){return new Dt({type:"optional",innerType:e})}let Dn=sX("ZodNullable",(e,t)=>{cV.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let o,a,u;return a=dr((o=e._zod.def).innerType,t,n),u=t.seen.get(e),void("openapi-3.0"===t.target?(u.ref=o.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function Di(e){return new Dn({type:"nullable",innerType:e})}let Do=sX("ZodDefault",(e,t)=>{cG.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let o;dr((o=e._zod.def).innerType,t,n),t.seen.get(e).ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),Da=sX("ZodPrefault",(e,t)=>{cJ.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let o;dr((o=e._zod.def).innerType,t,n),t.seen.get(e).ref=o.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},e.unwrap=()=>e._zod.def.innerType}),Du=sX("ZodNonOptional",(e,t)=>{cK.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let o;dr((o=e._zod.def).innerType,t,n),t.seen.get(e).ref=o.innerType},e.unwrap=()=>e._zod.def.innerType}),Ds=sX("ZodCatch",(e,t)=>{cQ.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let o,a=e._zod.def;dr(a.innerType,t,n),t.seen.get(e).ref=a.innerType;try{o=a.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=o})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),Dl=sX("ZodPipe",(e,t)=>{cX.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let o,a;return o=e._zod.def,void(dr(a="input"===t.io?"transform"===o.in._zod.def.type?o.out:o.in:o.out,t,n),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function Dc(e,t){return new Dl({type:"pipe",in:e,out:t})}let Dd=sX("ZodReadonly",(e,t)=>{c2.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let o;dr((o=e._zod.def).innerType,t,n),t.seen.get(e).ref=o.innerType,r.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),DD=sX("ZodCustom",(e,t)=>{c8.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(e,t,r)=>(e=>{if("throw"===e.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(e)});pw||(pw={}),s8({localeError:(o={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}},a={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},e=>{switch(e.code){case"invalid_type":return`Invalid input: expected ${e.expected}, received ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(e.input)}`;case"invalid_value":if(1===e.values.length)return`Invalid input: expected ${lp(e.values[0])}`;return`Invalid option: expected one of ${s6(e.values,"|")}`;case"too_big":{let t=e.inclusive?"<=":"<",r=o[e.origin]??null;if(r)return`Too big: expected ${e.origin??"value"} to have ${t}${e.maximum.toString()} ${r.unit??"elements"}`;return`Too big: expected ${e.origin??"value"} to be ${t}${e.maximum.toString()}`}case"too_small":{let t=e.inclusive?">=":">",r=o[e.origin]??null;if(r)return`Too small: expected ${e.origin} to have ${t}${e.minimum.toString()} ${r.unit}`;return`Too small: expected ${e.origin} to be ${t}${e.minimum.toString()}`}case"invalid_format":if("starts_with"===e.format)return`Invalid string: must start with "${e.prefix}"`;if("ends_with"===e.format)return`Invalid string: must end with "${e.suffix}"`;if("includes"===e.format)return`Invalid string: must include "${e.includes}"`;if("regex"===e.format)return`Invalid string: must match pattern ${e.pattern}`;return`Invalid ${a[e.format]??e.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${e.divisor}`;case"unrecognized_keys":return`Unrecognized key${e.keys.length>1?"s":""}: ${s6(e.keys,", ")}`;case"invalid_key":return`Invalid key in ${e.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${e.origin}`}})});var Dp,Dh,Df,Dm=JSON.parse('{"UU":"@doubao-dev/cli","rE":"1.0.0-rc.2","h_":"Doubao Plugins CLI"}');let Dg={name:Dm.UU,version:Dm.rE,description:Dm.h_,registry:"https://registry.npmjs.org",appDev:{name:"@doubao-dev/plugin-app-dev",version:Dm.rE},kit:{name:"@doubao-dev/kit",version:process.env.DBX_KIT_VERSION?.trim()||"0.9.0"},auth:{baseUrl:"https://open.doubao.com",verificationUrl:"https://open.doubao.com/apps-plugin/oauth/device"},apiUrl:"https://open.doubao.com",apiHeaders:{"User-Agent":`doubao-dev-cli-${Dm.rE}`},deviceApiUrl:"https://developer.doubao.com",consoleUrl:"https://open.doubao.com/console/plugins/"},Db=g.join(ee.homedir(),".dbx","token"),Dy=g.join(ee.homedir(),".doubao","token"),D_={};function DF(e={}){let t={...D_,...e},r=DE(t.baseUrl??"https://developer.doubao.com","baseUrl"),n=t.tokenPath??Db;return{...t,baseUrl:r,verificationUrl:DE(t.verificationUrl??new URL("/oauth/device",r).href,"verificationUrl"),allowedOrigins:function(e,t){let r=new Set([new URL(t).origin]);for(let t of e??[]){let e;try{e=new URL(t)}catch{throw Error(`allowedOrigins 中的来源必须是完整的 HTTPS 地址:${t}`)}if("https:"!==e.protocol)throw Error(`allowedOrigins 中的来源必须使用 HTTPS:${t}`);r.add(e.origin)}return[...r]}(t.allowedOrigins,r),tokenPath:n,legacyTokenPath:t.tokenPath?void 0:Dy,requestHeaders:new Headers(t.requestHeaders)}}function DC(e){return e.replace(/\/+$/,"")}function DE(e,t){let r;try{r=new URL(DC(e))}catch{throw Error(`${t} 必须是完整的 HTTPS URL`)}if("https:"!==r.protocol)throw Error(`${t} 必须使用 HTTPS`);return DC(r.toString())}let Dv=N(h),Dw="byted-doubao-open-dbx-cli",DS="dbx-cli",DA="aes-256-gcm";class DT extends Error{constructor(e){super(e),this.name="CredentialStoreError"}}class DB extends DT{constructor(){super("无法读取本地登录凭证:用于解密凭证的密钥文件 master.key 已丢失。请运行 dbx auth login 重新登录。")}}class Dx{constructor(e,t){this.primary=e,this.fallback=t}async get(e){let t;if(await this.isFallbackAuthoritative(e))return this.fallback.get(e);try{let t=await this.primary.get(e);if(t)return t}catch(e){t=e}try{let t=await this.fallback.get(e);if(t)return t}catch(e){if(t)throw new DT(`从系统凭证存储读取登录凭证失败(${DN(t)});从备用加密文件读取也失败:${DN(e)}`);throw e}if(t)throw t instanceof Error?t:new DT(`从系统凭证存储读取登录凭证失败:${String(t)}`)}async set(e,t){let r;try{await this.primary.set(e,t)}catch(e){r=e}try{await this.fallback.set(e,t)}catch(t){if(r)throw new DT(`向系统凭证存储写入登录凭证失败(${DN(r)}),写入备用加密文件也失败(${DN(t)})`);throw await this.removeStaleFallbackAfterPrimaryWrite(e,t),t}r?await this.markFallbackAuthoritative(e):await this.clearFallbackAuthority(e)}async delete(e){let t;try{await this.primary.delete(e)}catch(e){t=e}try{await this.fallback.delete(e)}catch(e){if(t)throw new DT(`从系统凭证存储删除登录凭证失败(${DN(t)}),从备用加密文件删除也失败(${DN(e)})`);throw e}t?await this.markFallbackAuthoritativeOrThrow(e,t):await this.clearFallbackAuthority(e)}async isFallbackAuthoritative(e){return!!Dj(this.fallback)&&this.fallback.isFallbackAuthoritative(e)}async markFallbackAuthoritative(e){Dj(this.fallback)&&await this.fallback.markFallbackAuthoritative(e)}async markFallbackAuthoritativeOrThrow(e,t){if(!Dj(this.fallback))throw t instanceof Error?t:new DT(`系统凭证删除失败,且备用存储无法记录删除状态:${String(t)}`);try{await this.fallback.markFallbackAuthoritative(e)}catch(e){throw new DT(`系统凭证删除失败(${DN(t)}),且无法记录备用凭证删除状态:${DN(e)}`)}}async clearFallbackAuthority(e){Dj(this.fallback)&&await this.fallback.clearFallbackAuthority(e)}async removeStaleFallbackAfterPrimaryWrite(e,t){let r=[];try{await this.fallback.delete(e)}catch(e){r.push(e)}try{await this.clearFallbackAuthority(e)}catch(e){r.push(e)}if(r.length>0)throw new DT(`系统凭证已写入,但备用加密文件写入失败(${DN(t)}),且清理旧备用凭证失败:${r.map(DN).join(";")}`)}}class DO{constructor(e={}){this.baseDir=e.baseDir??("darwin"===process.platform?g.join(ee.homedir(),"Library","Application Support",DS):"win32"===process.platform?g.join(process.env.APPDATA||g.join(ee.homedir(),"AppData","Roaming"),DS):g.join(process.env.XDG_DATA_HOME||g.join(ee.homedir(),".local","share"),DS))}async get(e){var t,r;let n,o,a=this.credentialFilePath(e);try{n=await S.readFile(a,"utf8")}catch(e){if(DU(e)&&"ENOENT"===e.code)return;throw new DT(`读取加密凭证文件失败:${DN(e)}`)}try{o=JSON.parse(n)}catch(e){throw new DT(`加密凭证文件不是有效的 JSON:${DN(e)}`)}if(!((t=o)&&"object"==typeof t&&1===t.version&&t.algorithm===DA&&"string"==typeof t.iv&&"string"==typeof t.authTag&&"string"==typeof t.ciphertext))throw new DT("无法读取本地登录凭证:当前 CLI 不支持凭证文件中的格式或字段。");let u=await this.readMasterKey();try{let t=eh.createDecipheriv(DA,u,Buffer.from(o.iv,"base64url"));return t.setAAD(Buffer.from((r=e,`${Dw}:${r}`),"utf8")),t.setAuthTag(Buffer.from(o.authTag,"base64url")),Buffer.concat([t.update(Buffer.from(o.ciphertext,"base64url")),t.final()]).toString("utf8")}catch(e){throw new DT(`解密凭证文件失败:${DN(e)}`)}}async set(e,t){var r;let n=await this.readOrCreateMasterKey(),o=eh.randomBytes(12),a=eh.createCipheriv(DA,n,o);a.setAAD(Buffer.from((r=e,`${Dw}:${r}`),"utf8"));let u=Buffer.concat([a.update(t,"utf8"),a.final()]),s={version:1,algorithm:DA,iv:o.toString("base64url"),authTag:a.getAuthTag().toString("base64url"),ciphertext:u.toString("base64url")};await Dk(this.credentialFilePath(e),`${JSON.stringify(s,null,2)}
70
+ `)}async delete(e){try{await S.unlink(this.credentialFilePath(e))}catch(e){if(!DU(e)||"ENOENT"!==e.code)throw new DT(`删除加密凭证文件失败:${DN(e)}`)}}async isFallbackAuthoritative(e){try{let t=await S.readFile(this.authorityFilePath(e),"utf8"),r=JSON.parse(t);return 1===r.version&&"fallback"===r.authority}catch(e){if(DU(e)&&"ENOENT"===e.code)return!1;throw new DT(`读取登录凭证权威副本标记失败:${DN(e)}`)}}async markFallbackAuthoritative(e){await Dk(this.authorityFilePath(e),`${JSON.stringify({version:1,authority:"fallback"},null,2)}
71
+ `)}async clearFallbackAuthority(e){try{await S.unlink(this.authorityFilePath(e))}catch(e){if(!DU(e)||"ENOENT"!==e.code)throw new DT(`清理登录凭证权威副本标记失败:${DN(e)}`)}}masterKeyPath(){return g.join(this.baseDir,"master.key")}credentialFilePath(e){let t=eh.createHash("sha256").update(e).digest("hex");return g.join(this.baseDir,"credentials",`${t}.json`)}authorityFilePath(e){let t=eh.createHash("sha256").update(e).digest("hex");return g.join(this.baseDir,"authorities",`${t}.json`)}async readMasterKey(){try{var e=await S.readFile(this.masterKeyPath(),"utf8");let t=Buffer.from(e.trim(),"base64url");if(32!==t.length)throw new DT("无法读取本地登录凭证:密钥文件 master.key 的内容无法解析为 32 字节密钥。");return t}catch(e){if(DU(e)&&"ENOENT"===e.code)throw new DB;if(e instanceof DT)throw e;throw new DT(`无法读取用于解密本地登录凭证的密钥文件 master.key:${DN(e)}`)}}async readOrCreateMasterKey(){try{return await this.readMasterKey()}catch(e){if(!(e instanceof DB))throw e}let e=eh.randomBytes(32);try{return await DP(this.masterKeyPath(),`${e.toString("base64url")}
72
+ `)?e:this.readMasterKey()}catch(e){throw new DT(`无法保存用于加密本地登录凭证的密钥文件 master.key:${DN(e)}`)}}}class D${async get(e){try{let{stdout:t}=await Dv("security",["find-generic-password","-a",e,"-s",Dw,"-w"]);return String(t).replace(/\n$/,"")}catch(e){if(DI(e))return;throw new DT(`从 macOS 钥匙串读取登录凭证失败:${DN(e)}`)}}async set(e,t){try{await Dv("security",["add-generic-password","-a",e,"-s",Dw,"-w",t,"-U"])}catch(e){throw new DT(`向 macOS 钥匙串写入登录凭证失败:${DN(e)}`)}}async delete(e){try{await Dv("security",["delete-generic-password","-a",e,"-s",Dw])}catch(e){if(DI(e))return;throw new DT(`从 macOS 钥匙串删除登录凭证失败:${DN(e)}`)}}}class DR{async get(e){try{let{stdout:t}=await Dv("secret-tool",["lookup","service",Dw,"account",e]);return String(t).replace(/\n$/,"")}catch(e){if(Dz(e))return;throw new DT(`从 Secret Service 读取登录凭证失败:${DN(e)}`)}}async set(e,t){try{var r,n,o;await (r="secret-tool",n=["store","--label","Doubao Open CLI 登录凭证","service",Dw,"account",e],o=t,new Promise((e,t)=>{let a=f(r,n,{stdio:["pipe","ignore","pipe"]}),u="";a.stderr.setEncoding("utf8"),a.stderr.on("data",e=>{u+=String(e)}),a.on("error",t),a.on("close",n=>{0===n?e():t(Error(u.trim()||`${r} 已退出,退出码为 ${n}`))}),a.stdin.end(o)}))}catch(e){throw new DT(`向 Secret Service 写入登录凭证失败:${DN(e)}`)}}async delete(e){try{await Dv("secret-tool",["clear","service",Dw,"account",e])}catch(e){if(Dz(e))return;throw new DT(`从 Secret Service 删除登录凭证失败:${DN(e)}`)}}}async function Dk(e,t){let r=g.dirname(e);await S.mkdir(r,{recursive:!0,mode:448}),"win32"!==process.platform&&await S.chmod(r,448);let n=g.join(r,`.${g.basename(e)}.${process.pid}.${Date.now()}.tmp`);try{await S.writeFile(n,t,{mode:384,flag:"wx"}),"win32"!==process.platform&&await S.chmod(n,384),await S.rename(n,e),"win32"!==process.platform&&await S.chmod(e,384)}finally{try{await S.unlink(n)}catch{}}}async function DP(e,t){let r=g.dirname(e);await S.mkdir(r,{recursive:!0,mode:448}),"win32"!==process.platform&&await S.chmod(r,448);let n=g.join(r,`.${g.basename(e)}.${process.pid}.${Date.now()}.${eh.randomBytes(8).toString("hex")}.tmp`);try{await S.writeFile(n,t,{mode:384,flag:"wx"}),"win32"!==process.platform&&await S.chmod(n,384);try{return await S.link(n,e),"win32"!==process.platform&&await S.chmod(e,384),!0}catch(e){if(DU(e)&&"EEXIST"===e.code)return!1;throw e}}finally{try{await S.unlink(n)}catch{}}}function Dj(e){return"function"==typeof e.isFallbackAuthoritative&&"function"==typeof e.markFallbackAuthoritative&&"function"==typeof e.clearFallbackAuthority}function DI(e){let t=DL(e),r=DM(e);return(1===t||44===t)&&(r.includes("could not be found")||r.includes("The specified item could not be found"))}function Dz(e){let t=DL(e),r=DM(e);return 1===t&&(r.includes("could not be found")||r.includes("No matching items")||""===r.trim())}function DL(e){return"object"==typeof e&&null!==e&&"code"in e?e.code:void 0}function DM(e){return"object"==typeof e&&null!==e&&"stderr"in e?String(e.stderr??""):""}function DU(e){return e instanceof Error&&"code"in e}function DN(e){if("object"==typeof e&&null!==e&&"stderr"in e){let t=String(e.stderr??"").trim();if(t)return t}return e instanceof Error&&e.message?e.message:String(e)}class DW extends Error{constructor(e,t){super(e),this.code=t,this.name="AuthError"}}class Dq extends DW{constructor(e="尚未登录,请运行 dbx auth login 完成登录。"){super(e,"NOT_LOGGED_IN"),this.name="NotLoggedInError"}}class DH extends DW{constructor(e="登录凭证已过期,请运行 dbx auth login 重新登录。"){super(e,"TOKEN_EXPIRED"),this.name="TokenExpiredError"}}class DV extends DW{constructor(e,t="DEVICE_AUTH_FAILED",r={}){super(e,t),this.name="DeviceAuthError",this.logId=r.logId}}async function DG(e,t={}){let r,n=process.env.DBX_ACCESS_TOKEN?.trim()||void 0;if(n)return{accessToken:n,tokenType:"Bearer",expiresAt:0xf4865700,baseUrl:t.envTokenBaseUrl??""};let o=await DX(e);if(void 0===o)return D0(e,t);try{r=JSON.parse(o)}catch(e){return}if(DQ(r)){if(!t.allowExpired&&DK(r))return void await DJ(e,t);let n=await D2(t).get(r.credentialAccount);if(!n)throw new DT("已找到登录记录,但登录凭证缺失或无法访问。请在能够访问凭证存储的终端中重新运行 dbx auth login。");return{accessToken:n,tokenType:r.tokenType,expiresAt:r.expiresAt,baseUrl:r.baseUrl}}if(DY(r))return!t.allowExpired&&DK(r)?void await DJ(e,t):(await DZ(e,r,t),r)}async function DZ(e,t,r={}){let n={version:2,storage:"keychain",credentialAccount:D1(e),tokenType:t.tokenType,expiresAt:t.expiresAt,baseUrl:t.baseUrl};await D2(r).set(n.credentialAccount,t.accessToken),await S.mkdir(g.dirname(e),{recursive:!0,mode:448}),"win32"!==process.platform&&await S.chmod(g.dirname(e),448);let o=`${e}.${process.pid}.${Date.now()}.tmp`;await S.writeFile(o,`${JSON.stringify(n,null,2)}
73
+ `,{mode:384}),"win32"!==process.platform&&await S.chmod(o,384),await S.rename(o,e),"win32"!==process.platform&&await S.chmod(e,384)}async function DJ(e,t={}){let r=await DX(e),n=D1(e);if(void 0!==r)try{let e=JSON.parse(r);DQ(e)&&(n=e.credentialAccount)}catch{}await D2(t).delete(n);try{await S.unlink(e)}catch(e){if(!D8(e)||"ENOENT"!==e.code)throw e}}function DK(e,t=Math.floor(Date.now()/1e3)){return e.expiresAt<=t}function DY(e){return!!e&&"object"==typeof e&&"string"==typeof e.accessToken&&e.accessToken.length>0&&"string"==typeof e.tokenType&&e.tokenType.length>0&&"number"==typeof e.expiresAt&&Number.isFinite(e.expiresAt)&&"string"==typeof e.baseUrl&&e.baseUrl.length>0}function DQ(e){return!!e&&"object"==typeof e&&2===e.version&&"keychain"===e.storage&&"string"==typeof e.credentialAccount&&e.credentialAccount.length>0&&"string"==typeof e.tokenType&&e.tokenType.length>0&&"number"==typeof e.expiresAt&&Number.isFinite(e.expiresAt)&&"string"==typeof e.baseUrl&&e.baseUrl.length>0}async function DX(e){try{return await S.readFile(e,"utf8")}catch(e){D8(e)&&e.code;return}}async function D0(e,t){let r;if(!t.legacyTokenPath||g.resolve(t.legacyTokenPath)===g.resolve(e))return;let n=await DX(t.legacyTokenPath);if(void 0!==n){try{r=JSON.parse(n)}catch{return}if(DY(r))return!t.allowExpired&&DK(r)?void await DJ(t.legacyTokenPath,t):(await DZ(e,r,t),await DJ(t.legacyTokenPath,t),r)}}function D2(e){let t;return e.credentialStore??(t=new DO,"darwin"===process.platform?new Dx(new D$,t):"linux"===process.platform?new Dx(new DR,t):t)}function D1(e){let t=eh.createHash("sha256").update(g.resolve(e)).digest("hex").slice(0,32);return`token:${t}`}function D8(e){return e instanceof Error&&"code"in e}async function D3(e={}){let t=DF(e),r=t.fetch??fetch,n=await D4(r,t.baseUrl,t.requestHeaders),o=pi(t.verificationUrl,n.user_code);return t.onVerification?.({userCode:n.user_code,verificationUrl:o,expiresIn:n.expires_in,interval:n.interval}),D7(n.device_code,t,Math.max(1,n.interval),1e3*n.expires_in)}async function D6(e={}){let t=DF(e),r=t.fetch??fetch,n=await D4(r,t.baseUrl,t.requestHeaders),o=pi(t.verificationUrl,n.user_code);return t.onVerification?.({userCode:n.user_code,verificationUrl:o,expiresIn:n.expires_in,interval:n.interval}),{userCode:n.user_code,deviceCode:n.device_code,verificationUrl:o,expiresIn:n.expires_in,interval:n.interval}}async function D9(e,t={}){return D7(e,DF(t),5,6e5)}async function D7(e,t,r,n){let o=t.fetch??fetch,a=t.sleep??X,u=r,s=Date.now()+n;for(;Date.now()<s;){await a(1e3*u);let n=await D5(o,t.baseUrl,e,t.requestHeaders);if(t.onPoll?.({status:n.status,interval:u}),n.status!==pS.Pending){if(n.status===pS.SlowDown){u+=r;continue}if(n.status===pS.Expired)throw new DV("设备授权已过期,请运行 dbx auth login 重新登录。","DEVICE_AUTH_EXPIRED");if(n.status===pS.Invalid)throw new DV("设备授权无效,请运行 dbx auth login 重新登录。","DEVICE_AUTH_INVALID");if(n.status===pS.Authorized){if(!n.access_token)throw new DV("无法完成登录:认证服务已确认授权,但未返回 access_token。");let e=function(e,t){let r=Math.floor(Date.now()/1e3);return{accessToken:e.access_token??"",tokenType:e.token_type??"Bearer",expiresAt:"number"==typeof e.expires_at?e.expires_at:r+(e.expires_in??0),baseUrl:t}}(n,t.baseUrl);return await DZ(t.tokenPath,e,{credentialStore:t.credentialStore}),{accessToken:e.accessToken,tokenType:e.tokenType,expiresAt:e.expiresAt,baseUrl:e.baseUrl,uid:function(e){let t=function(e){let t=e.split(".")[1];if(t)try{let e=Buffer.from(t,"base64url").toString("utf8"),r=JSON.parse(e);return r&&"object"==typeof r?r:void 0}catch{return}}(e),r=t?.uid??t?.sub;return"string"==typeof r&&r.length>0?r:"number"==typeof r&&Number.isFinite(r)?String(r):void 0}(e.accessToken),tokenPath:t.tokenPath}}throw new DV(`无法完成登录:认证服务返回了无法识别的授权状态 status=${String(n.status)}`)}}throw new DV("等待设备授权超时,请运行 dbx auth login 重新发起登录。","DEVICE_AUTH_EXPIRED")}async function D4(e,t,r){let n=await e(`${t}/app_developer/oauth/device/code`,{method:"POST",headers:pn(r),body:JSON.stringify({client_name:"dbx-cli"})}),o=await pe(n),a=pr(o);if(!a||!a.device_code||!a.user_code||"number"!=typeof a.expires_in||"number"!=typeof a.interval)throw new DV(`无法获取登录授权码:认证服务返回的数据缺少必要字段或字段类型不正确(HTTP ${n.status}):${JSON.stringify(o)}`);return a}async function D5(e,t,r,n){let o=await e(`${t}/app_developer/oauth/token`,{method:"POST",headers:pn(n),body:JSON.stringify({device_code:r})}),a=await pe(o),u=pr(a);if(u?.access_token)return{status:pS.Authorized,access_token:u.access_token,token_type:u.token_type,expires_in:u.expires_in,expires_at:u.expires_at};if(!u||"number"!=typeof u.status)throw new DV(`无法获取登录凭证:认证服务返回的数据缺少有效的 status 字段(HTTP ${o.status}):${JSON.stringify(a)}`);return u}async function pe(e){var t;let r,n=e.headers.get("x-tt-logid")??void 0;try{r=await e.json()}catch{throw new DV(`无法读取登录结果:认证服务返回的内容不是有效的 JSON(HTTP ${e.status})${pt(n)}`,"DEVICE_AUTH_FAILED",{logId:n})}let o=function(e){if(e&&"object"==typeof e)return"string"==typeof e.log_id&&e.log_id?e.log_id:void 0}(r)??n;if(!e.ok)throw new DV(`认证服务返回 HTTP ${e.status}:${JSON.stringify(r)}${pt(o)}`,"DEVICE_AUTH_FAILED",{logId:o});let a=(t=r)&&"object"==typeof t&&"number"==typeof t.code&&0!==t.code?{code:t.code,message:"string"==typeof t.message?t.message:"未知错误",logId:"string"==typeof t.log_id?t.log_id:void 0}:null;if(a)throw new DV(`认证服务出错(错误码 ${a.code}):${a.message}${pt(a.logId??o)}`,"DEVICE_AUTH_FAILED",{logId:a.logId??o});return r}function pt(e){return e?` [log_id: ${e}]`:""}function pr(e){return e&&"object"==typeof e&&"data"in e?e.data:e}function pn(e){let t=new Headers(e);return t.set("Content-Type","application/json"),t}function pi(e,t){let r=new URL(e);return r.searchParams.set("user_code",t),r.toString()}async function po(e,t,r){let n;var o,a,u=e,s=r.allowedOrigins;let l=function(e){try{if("string"==typeof e)return new URL(e);if(e instanceof URL)return e;return new URL(e.url)}catch{throw Error("携带登录凭证的请求必须使用完整的 HTTPS URL")}}(u);if("https:"!==l.protocol)throw Error(`携带登录凭证的请求必须使用 HTTPS:${l.toString()}`);if(!s.includes(l.origin))throw Error(`无法向不受信任的来源发送 Authorization 请求头:${l.origin}`);let c=await DG(r.tokenPath,{allowExpired:!0,envTokenBaseUrl:r.baseUrl,credentialStore:r.credentialStore,legacyTokenPath:r.legacyTokenPath});if(!c)throw new Dq;if(DK(c))throw new DH;let d=(o=e,a=t,n=new Headers(o instanceof Request?o.headers:void 0),new Headers(a).forEach((e,t)=>{n.set(t,e)}),n);return r.requestHeaders.forEach((e,t)=>{d.set(t,e)}),d.set("Authorization",`${c.tokenType||"Bearer"} ${c.accessToken}`),d}async function pa(e={}){let t=DF(e);await DJ(t.tokenPath,{credentialStore:t.credentialStore}),t.legacyTokenPath&&await DJ(t.legacyTokenPath,{credentialStore:t.credentialStore})}async function pu(e={}){let t,r=DF(e);try{t=await DG(r.tokenPath,{envTokenBaseUrl:r.baseUrl,credentialStore:r.credentialStore,legacyTokenPath:r.legacyTokenPath})}catch(e){if(e instanceof DT)return{loggedIn:!1,tokenPath:r.tokenPath,baseUrl:r.baseUrl,credentialError:{code:"CREDENTIAL_STORE_UNAVAILABLE",message:e.message}};throw e}if(!t)return{loggedIn:!1,tokenPath:r.tokenPath};let n=await ps(e.fetch??fetch,r.baseUrl,t,r.requestHeaders);return n?{loggedIn:!0,uid:n.userId,name:n.name,avatar:n.avatar,expiresAt:t.expiresAt,tokenPath:r.tokenPath,baseUrl:r.baseUrl}:{loggedIn:!1,expiresAt:t.expiresAt,tokenPath:r.tokenPath,baseUrl:r.baseUrl}}async function ps(e,t,r,n){let o=new Headers(n);o.set("Authorization",`${r.tokenType||"Bearer"} ${r.accessToken}`);let a=await e(`${t.replace(/\/+$/,"")}/app_developer/api/user/basic`,{method:"GET",headers:o});if(!a.ok)return;let u=await a.json();if(0===u.code){var s;return{userId:"string"==typeof(s=u.data?.user_id)&&s.length>0?s:"number"==typeof s&&Number.isFinite(s)?String(s):void 0,name:u.data?.name,avatar:u.data?.avatar}}}(pE=pS||(pS={}))[pE.Pending=1]="Pending",pE[pE.Authorized=2]="Authorized",pE[pE.Expired=3]="Expired",pE[pE.Invalid=4]="Invalid",pE[pE.SlowDown=5]="SlowDown";let pl="DOUBAO_REQUEST_HEADERS_JSON",pc="DBX_BUILD_REQUEST_HEADERS_JSON",pd=new Set(["x-tt-env","x-use-ppe","x-schedule-vdc"]);function pD(e,t){let r;try{r=JSON.parse(e)}catch{throw Error(`${t} 必须是有效的 JSON 对象`)}if("object"!=typeof r||null===r||Array.isArray(r))throw Error(`${t} 必须是 JSON 对象`);let n={};for(let[e,o]of Object.entries(r)){let r=e.toLowerCase();if(pd.has(r)){if("string"!=typeof o)throw Error(`${t} 中请求头 ${r} 的值必须是字符串`);n[r]=o}}return n}var pp="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{};function ph(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(0,Object.defineProperty)(ph,"name",{value:"getDefaultExportFromCjs",configurable:!0});var pf=Object.defineProperty,pm=e=>{throw TypeError(e)},pg=(e,t)=>pf(e,"name",{value:t,configurable:!0}),pb=(e,t,r)=>t.has(e)||pm("Cannot "+r),py=(e,t,r)=>(pb(e,t,"read from private field"),r?r.call(e):t.get(e)),p_=(e,t,r)=>t.has(e)?pm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),pF=(e,t,r,n)=>(pb(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function pC(e){if(!/^data:/i.test(e))throw TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');let t=(e=e.replace(/\r?\n/g,"")).indexOf(",");if(-1===t||t<=4)throw TypeError("malformed data: URI");let r=e.substring(5,t).split(";"),n="",o=!1,a=r[0]||"text/plain",u=a;for(let e=1;e<r.length;e++)"base64"===r[e]?o=!0:r[e]&&(u+=`;${r[e]}`,0===r[e].indexOf("charset=")&&(n=r[e].substring(8)));r[0]||n.length||(u+=";charset=US-ASCII",n="US-ASCII");let s=o?"base64":"ascii",l=unescape(e.substring(t+1)),c=Buffer.from(l,s);return c.type=a,c.typeFull=u,c.charset=n,c}pg(pC,"dataUriToBuffer");var pE,pv,pw,pS,pA,pT,pB,px,pO,p$,pR,pk,pP,pj,pI,pz,pL,pM,pU={},pN={};function pW(){return pM||(pM=1,function(e){var t,r,n;function o(){}function a(e){return"object"==typeof e&&null!==e||"function"==typeof e}function u(e,t){try{Object.defineProperty(e,"name",{value:t,configurable:!0})}catch{}}pg(o,"noop"),pg(a,"typeIsObject"),pg(u,"setFunctionName");let s=Promise,l=Promise.prototype.then,c=Promise.reject.bind(s);function d(e){return new s(e)}function D(e){return d(t=>t(e))}function p(e){return c(e)}function h(e,t,r){return l.call(e,t,r)}function f(e,t,r){h(h(e,t,r),void 0,o)}function m(e,t){f(e,t)}function g(e,t){f(e,void 0,t)}function b(e,t,r){return h(e,t,r)}function y(e){h(e,void 0,o)}pg(d,"newPromise"),pg(D,"promiseResolvedWith"),pg(p,"promiseRejectedWith"),pg(h,"PerformPromiseThen"),pg(f,"uponPromise"),pg(m,"uponFulfillment"),pg(g,"uponRejection"),pg(b,"transformPromiseWith"),pg(y,"setPromiseIsHandledToTrue");let _=pg(e=>{if("function"==typeof queueMicrotask)_=queueMicrotask;else{let e=D(void 0);_=pg(t=>h(e,t),"_queueMicrotask")}return _(e)},"_queueMicrotask");function F(e,t,r){if("function"!=typeof e)throw TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function C(e,t,r){try{return D(F(e,t,r))}catch(e){return p(e)}}pg(F,"reflectCall"),pg(C,"promiseCall");let E=class{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){let t=this._back,r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size}shift(){let e=this._front,t=e,r=this._cursor,n=r+1,o=e._elements,a=o[r];return 16384===n&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),o[r]=void 0,a}forEach(e){let t=this._cursor,r=this._front,n=r._elements;for(;(t!==n.length||void 0!==r._next)&&!(t===n.length&&(n=(r=r._next)._elements,t=0,0===n.length));)e(n[t]),++t}peek(){let e=this._front,t=this._cursor;return e._elements[t]}};pg(E,"SimpleQueue");let v=Symbol("[[AbortSteps]]"),w=Symbol("[[ErrorSteps]]"),S=Symbol("[[CancelSteps]]"),A=Symbol("[[PullSteps]]"),T=Symbol("[[ReleaseSteps]]");function B(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?R(e):"closed"===t._state?P(e):k(e,t._storedError)}function x(e,t){return nC(e._ownerReadableStream,t)}function O(e){let t=e._ownerReadableStream;"readable"===t._state?j(e,TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):I(e,TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),t._readableStreamController[T](),t._reader=void 0,e._ownerReadableStream=void 0}function $(e){return TypeError("Cannot "+e+" a stream using a released reader")}function R(e){e._closedPromise=d((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r})}function k(e,t){R(e),j(e,t)}function P(e){R(e),z(e)}function j(e,t){void 0!==e._closedPromise_reject&&(y(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function I(e,t){k(e,t)}function z(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}pg(B,"ReadableStreamReaderGenericInitialize"),pg(x,"ReadableStreamReaderGenericCancel"),pg(O,"ReadableStreamReaderGenericRelease"),pg($,"readerLockException"),pg(R,"defaultReaderClosedPromiseInitialize"),pg(k,"defaultReaderClosedPromiseInitializeAsRejected"),pg(P,"defaultReaderClosedPromiseInitializeAsResolved"),pg(j,"defaultReaderClosedPromiseReject"),pg(I,"defaultReaderClosedPromiseResetToRejected"),pg(z,"defaultReaderClosedPromiseResolve");let L=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},M=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function U(e){return"object"==typeof e||"function"==typeof e}function N(e,t){if(void 0!==e&&!U(e))throw TypeError(`${t} is not an object.`)}function W(e,t){if("function"!=typeof e)throw TypeError(`${t} is not a function.`)}function q(e){return"object"==typeof e&&null!==e||"function"==typeof e}function H(e,t){if(!q(e))throw TypeError(`${t} is not an object.`)}function V(e,t,r){if(void 0===e)throw TypeError(`Parameter ${t} is required in '${r}'.`)}function G(e,t,r){if(void 0===e)throw TypeError(`${t} is required in '${r}'.`)}function Z(e){return Number(e)}function J(e){return 0===e?0:e}function K(e){return J(M(e))}function Y(e,t){let r=Number.MAX_SAFE_INTEGER,n=Number(e);if(!L(n=J(n)))throw TypeError(`${t} is not a finite number`);if((n=K(n))<0||n>r)throw TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return L(n)&&0!==n?n:0}function Q(e,t){if(!n_(e))throw TypeError(`${t} is not a ReadableStream.`)}function X(e){return new eo(e)}function ee(e,t){e._reader._readRequests.push(t)}function et(e,t,r){let n=e._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(t)}function er(e){return e._reader._readRequests.length}function en(e){let t=e._reader;return!(void 0===t||!ea(t))}pg(U,"isDictionary"),pg(N,"assertDictionary"),pg(W,"assertFunction"),pg(q,"isObject"),pg(H,"assertObject"),pg(V,"assertRequiredArgument"),pg(G,"assertRequiredField"),pg(Z,"convertUnrestrictedDouble"),pg(J,"censorNegativeZero"),pg(K,"integerPart"),pg(Y,"convertUnsignedLongLongWithEnforceRange"),pg(Q,"assertReadableStream"),pg(X,"AcquireReadableStreamDefaultReader"),pg(ee,"ReadableStreamAddReadRequest"),pg(et,"ReadableStreamFulfillReadRequest"),pg(er,"ReadableStreamGetNumReadRequests"),pg(en,"ReadableStreamHasDefaultReader");let ei=class{constructor(e){if(V(e,1,"ReadableStreamDefaultReader"),Q(e,"First parameter"),nF(e))throw TypeError("This stream has already been locked for exclusive reading by another reader");B(this,e),this._readRequests=new E}get closed(){return ea(this)?this._closedPromise:p(ec("closed"))}cancel(e){return ea(this)?void 0===this._ownerReadableStream?p($("cancel")):x(this,e):p(ec("cancel"))}read(){let e,t;if(!ea(this))return p(ec("read"));if(void 0===this._ownerReadableStream)return p($("read from"));let r=d((r,n)=>{e=r,t=n});return eu(this,{_chunkSteps:pg(t=>e({value:t,done:!1}),"_chunkSteps"),_closeSteps:pg(()=>e({value:void 0,done:!0}),"_closeSteps"),_errorSteps:pg(e=>t(e),"_errorSteps")}),r}releaseLock(){if(!ea(this))throw ec("releaseLock");void 0!==this._ownerReadableStream&&es(this)}};pg(ei,"ReadableStreamDefaultReader");let eo=ei;function ea(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof eo}function eu(e,t){let r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[A](t)}function es(e){O(e),el(e,TypeError("Reader was released"))}function el(e,t){let r=e._readRequests;e._readRequests=new E,r.forEach(e=>{e._errorSteps(t)})}function ec(e){return TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}Object.defineProperties(eo.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),u(eo.prototype.cancel,"cancel"),u(eo.prototype.read,"read"),u(eo.prototype.releaseLock,"releaseLock"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(eo.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),pg(ea,"IsReadableStreamDefaultReader"),pg(eu,"ReadableStreamDefaultReaderRead"),pg(es,"ReadableStreamDefaultReaderRelease"),pg(el,"ReadableStreamDefaultReaderErrorReadRequests"),pg(ec,"defaultReaderBrandCheckException");let ed=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),eD=class{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){let e=pg(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?b(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){let t=pg(()=>this._returnSteps(e),"returnSteps");return this._ongoingPromise?b(this._ongoingPromise,t,t):t()}_nextSteps(){let e,t;if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let r=this._reader,n=d((r,n)=>{e=r,t=n});return eu(r,{_chunkSteps:pg(t=>{this._ongoingPromise=void 0,_(()=>e({value:t,done:!1}))},"_chunkSteps"),_closeSteps:pg(()=>{this._ongoingPromise=void 0,this._isFinished=!0,O(r),e({value:void 0,done:!0})},"_closeSteps"),_errorSteps:pg(e=>{this._ongoingPromise=void 0,this._isFinished=!0,O(r),t(e)},"_errorSteps")}),n}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;let t=this._reader;if(!this._preventCancel){let r=x(t,e);return O(t),b(r,()=>({value:e,done:!0}))}return O(t),D({value:e,done:!0})}};pg(eD,"ReadableStreamAsyncIteratorImpl");let ep={next(){return ef(this)?this._asyncIteratorImpl.next():p(em("next"))},return(e){return ef(this)?this._asyncIteratorImpl.return(e):p(em("return"))}};function eh(e,t){let r=new eD(X(e),t),n=Object.create(ep);return n._asyncIteratorImpl=r,n}function ef(e){if(!a(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof eD}catch{return!1}}function em(e){return TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}Object.setPrototypeOf(ep,ed),pg(eh,"AcquireReadableStreamAsyncIterator"),pg(ef,"IsReadableStreamAsyncIterator"),pg(em,"streamAsyncIteratorBrandCheckException");let eg=Number.isNaN||function(e){return e!=e};function eb(e){return e.slice()}function ey(e,t,r,n,o){new Uint8Array(e).set(new Uint8Array(r,n,o),t)}pg(eb,"CreateArrayFromList"),pg(ey,"CopyDataBlockBytes");let e_=pg(e=>(e_="function"==typeof e.transfer?pg(e=>e.transfer(),"TransferArrayBuffer"):"function"==typeof structuredClone?pg(e=>structuredClone(e,{transfer:[e]}),"TransferArrayBuffer"):pg(e=>e,"TransferArrayBuffer"))(e),"TransferArrayBuffer"),eF=pg(e=>(eF="boolean"==typeof e.detached?pg(e=>e.detached,"IsDetachedBuffer"):pg(e=>0===e.byteLength,"IsDetachedBuffer"))(e),"IsDetachedBuffer");function eC(e,t,r){if(e.slice)return e.slice(t,r);let n=r-t,o=new ArrayBuffer(n);return ey(o,0,e,t,n),o}function eE(e,t){let r=e[t];if(null!=r){if("function"!=typeof r)throw TypeError(`${String(t)} is not a function`);return r}}function ev(e){let t={[Symbol.iterator]:()=>e.iterator},r=async function*(){return yield*t}(),n=r.next;return{iterator:r,nextMethod:n,done:!1}}pg(eC,"ArrayBufferSlice"),pg(eE,"GetMethod"),pg(ev,"CreateAsyncFromSyncIterator");let ew=null!=(n=null!=(t=Symbol.asyncIterator)?t:null==(r=Symbol.for)?void 0:r.call(Symbol,"Symbol.asyncIterator"))?n:"@@asyncIterator";function eS(e,t="sync",r){if(void 0===r)if("async"===t){if(void 0===(r=eE(e,ew))){let t=eE(e,Symbol.iterator);return ev(eS(e,"sync",t))}}else r=eE(e,Symbol.iterator);if(void 0===r)throw TypeError("The object is not iterable");let n=F(r,e,[]);if(!a(n))throw TypeError("The iterator method must return an object");let o=n.next;return{iterator:n,nextMethod:o,done:!1}}function eA(e){let t=F(e.nextMethod,e.iterator,[]);if(!a(t))throw TypeError("The iterator.next() method must return an object");return t}function eT(e){return!!e.done}function eB(e){return e.value}function ex(e){return!("number"!=typeof e||eg(e)||e<0)}function eO(e){return new Uint8Array(eC(e.buffer,e.byteOffset,e.byteOffset+e.byteLength))}function e$(e){let t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function eR(e,t,r){if(!ex(r)||r===1/0)throw RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function ek(e){return e._queue.peek().value}function eP(e){e._queue=new E,e._queueTotalSize=0}function ej(e){return e===DataView}function eI(e){return ej(e.constructor)}function ez(e){return ej(e)?1:e.BYTES_PER_ELEMENT}pg(eS,"GetIterator"),pg(eA,"IteratorNext"),pg(eT,"IteratorComplete"),pg(eB,"IteratorValue"),pg(ex,"IsNonNegativeNumber"),pg(eO,"CloneAsUint8Array"),pg(e$,"DequeueValue"),pg(eR,"EnqueueValueWithSize"),pg(ek,"PeekQueueValue"),pg(eP,"ResetQueue"),pg(ej,"isDataViewConstructor"),pg(eI,"isDataView"),pg(ez,"arrayBufferViewElementSize");let eL=class{constructor(){throw TypeError("Illegal constructor")}get view(){if(!eN(this))throw tc("view");return this._view}respond(e){if(!eN(this))throw tc("respond");if(V(e,1,"respond"),e=Y(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw TypeError("This BYOB request has been invalidated");if(eF(this._view.buffer))throw TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");to(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!eN(this))throw tc("respondWithNewView");if(V(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw TypeError("You can only respond with array buffer views");if(void 0===this._associatedReadableByteStreamController)throw TypeError("This BYOB request has been invalidated");if(eF(e.buffer))throw TypeError("The given view's buffer has been detached and so cannot be used as a response");ta(this._associatedReadableByteStreamController,e)}};pg(eL,"ReadableStreamBYOBRequest"),Object.defineProperties(eL.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),u(eL.prototype.respond,"respond"),u(eL.prototype.respondWithNewView,"respondWithNewView"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(eL.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});let eM=class{constructor(){throw TypeError("Illegal constructor")}get byobRequest(){if(!eU(this))throw td("byobRequest");return tn(this)}get desiredSize(){if(!eU(this))throw td("desiredSize");return ti(this)}close(){if(!eU(this))throw td("close");if(this._closeRequested)throw TypeError("The stream has already been closed; do not close it again!");let e=this._controlledReadableByteStream._state;if("readable"!==e)throw TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);e5(this)}enqueue(e){if(!eU(this))throw td("enqueue");if(V(e,1,"enqueue"),!ArrayBuffer.isView(e))throw TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw TypeError("stream is closed or draining");let t=this._controlledReadableByteStream._state;if("readable"!==t)throw TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);te(this,e)}error(e){if(!eU(this))throw td("error");tt(this,e)}[S](e){eq(this),eP(this);let t=this._cancelAlgorithm(e);return e4(this),t}[A](e){let t=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void tr(this,e);let r=this._autoAllocateChunkSize;if(void 0!==r){let t;try{t=new ArrayBuffer(r)}catch(t){e._errorSteps(t);return}let n={buffer:t,bufferByteLength:r,byteOffset:0,byteLength:r,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(n)}ee(t,e),eW(this)}[T](){if(this._pendingPullIntos.length>0){let e=this._pendingPullIntos.peek();e.readerType="none",this._pendingPullIntos=new E,this._pendingPullIntos.push(e)}}};function eU(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof eM}function eN(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof eL}function eW(e){if(e7(e)){if(e._pulling){e._pullAgain=!0;return}e._pulling=!0,f(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,eW(e)),null),t=>(tt(e,t),null))}}function eq(e){eX(e),e._pendingPullIntos=new E}function eH(e,t){let r=!1;"closed"===e._state&&(r=!0);let n=eV(t);"default"===t.readerType?et(e,n,r):tg(e,n,r)}function eV(e){let t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function eG(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function eZ(e,t,r,n){let o;try{o=eC(t,r,r+n)}catch(t){throw tt(e,t),t}eG(e,o,0,n)}function eJ(e,t){t.bytesFilled>0&&eZ(e,t.buffer,t.byteOffset,t.bytesFilled),e9(e)}function eK(e,t){let r=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),n=t.bytesFilled+r,o=r,a=!1,u=n%t.elementSize,s=n-u;s>=t.minimumFill&&(o=s-t.bytesFilled,a=!0);let l=e._queue;for(;o>0;){let r=l.peek(),n=Math.min(o,r.byteLength),a=t.byteOffset+t.bytesFilled;ey(t.buffer,a,r.buffer,r.byteOffset,n),r.byteLength===n?l.shift():(r.byteOffset+=n,r.byteLength-=n),e._queueTotalSize-=n,eY(e,n,t),o-=n}return a}function eY(e,t,r){r.bytesFilled+=t}function eQ(e){0===e._queueTotalSize&&e._closeRequested?(e4(e),nE(e._controlledReadableByteStream)):eW(e)}function eX(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function e0(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;let t=e._pendingPullIntos.peek();eK(e,t)&&(e9(e),eH(e._controlledReadableByteStream,t))}}function e2(e){let t=e._controlledReadableByteStream._reader;for(;t._readRequests.length>0;){if(0===e._queueTotalSize)return;tr(e,t._readRequests.shift())}}function e1(e,t,r,n){let o,a=e._controlledReadableByteStream,u=t.constructor,s=ez(u),{byteOffset:l,byteLength:c}=t;try{o=e_(t.buffer)}catch(e){n._errorSteps(e);return}let d={buffer:o,bufferByteLength:o.byteLength,byteOffset:l,byteLength:c,bytesFilled:0,minimumFill:r*s,elementSize:s,viewConstructor:u,readerType:"byob"};if(e._pendingPullIntos.length>0){e._pendingPullIntos.push(d),tm(a,n);return}if("closed"===a._state){let e=new u(d.buffer,d.byteOffset,0);n._closeSteps(e);return}if(e._queueTotalSize>0){if(eK(e,d)){let t=eV(d);eQ(e),n._chunkSteps(t);return}if(e._closeRequested){let t=TypeError("Insufficient bytes to fill elements in the given buffer");tt(e,t),n._errorSteps(t);return}}e._pendingPullIntos.push(d),tm(a,n),eW(e)}function e8(e,t){"none"===t.readerType&&e9(e);let r=e._controlledReadableByteStream;if(ty(r))for(;tb(r)>0;)eH(r,e9(e))}function e3(e,t,r){if(eY(e,t,r),"none"===r.readerType){eJ(e,r),e0(e);return}if(r.bytesFilled<r.minimumFill)return;e9(e);let n=r.bytesFilled%r.elementSize;if(n>0){let t=r.byteOffset+r.bytesFilled;eZ(e,r.buffer,t-n,n)}r.bytesFilled-=n,eH(e._controlledReadableByteStream,r),e0(e)}function e6(e,t){let r=e._pendingPullIntos.peek();eX(e),"closed"===e._controlledReadableByteStream._state?e8(e,r):e3(e,t,r),eW(e)}function e9(e){return e._pendingPullIntos.shift()}function e7(e){let t=e._controlledReadableByteStream;return"readable"===t._state&&!e._closeRequested&&!!e._started&&!!(en(t)&&er(t)>0||ty(t)&&tb(t)>0||ti(e)>0)}function e4(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function e5(e){let t=e._controlledReadableByteStream;if(!(e._closeRequested||"readable"!==t._state)){if(e._queueTotalSize>0){e._closeRequested=!0;return}if(e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek();if(t.bytesFilled%t.elementSize!=0){let t=TypeError("Insufficient bytes to fill elements in the given buffer");throw tt(e,t),t}}e4(e),nE(t)}}function te(e,t){let r=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==r._state)return;let{buffer:n,byteOffset:o,byteLength:a}=t;if(eF(n))throw TypeError("chunk's buffer is detached and so cannot be enqueued");let u=e_(n);if(e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek();if(eF(t.buffer))throw TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");eX(e),t.buffer=e_(t.buffer),"none"===t.readerType&&eJ(e,t)}en(r)?(e2(e),0===er(r))?eG(e,u,o,a):(e._pendingPullIntos.length>0&&e9(e),et(r,new Uint8Array(u,o,a),!1)):ty(r)?(eG(e,u,o,a),e0(e)):eG(e,u,o,a),eW(e)}function tt(e,t){let r=e._controlledReadableByteStream;"readable"===r._state&&(eq(e),eP(e),e4(e),nv(r,t))}function tr(e,t){let r=e._queue.shift();e._queueTotalSize-=r.byteLength,eQ(e);let n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);t._chunkSteps(n)}function tn(e){if(null===e._byobRequest&&e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek(),r=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),n=Object.create(eL.prototype);tl(n,e,r),e._byobRequest=n}return e._byobRequest}function ti(e){let t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function to(e,t){let r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(0===t)throw TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(r.bytesFilled+t>r.byteLength)throw RangeError("bytesWritten out of range")}r.buffer=e_(r.buffer),e6(e,t)}function ta(e,t){let r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t.byteLength)throw TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(0===t.byteLength)throw TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw RangeError("The region specified by view does not match byobRequest");if(r.bufferByteLength!==t.buffer.byteLength)throw RangeError("The buffer of view has different capacity than byobRequest");if(r.bytesFilled+t.byteLength>r.byteLength)throw RangeError("The region specified by view is larger than byobRequest");let n=t.byteLength;r.buffer=e_(t.buffer),e6(e,n)}function tu(e,t,r,n,o,a,u){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,eP(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=o,t._autoAllocateChunkSize=u,t._pendingPullIntos=new E,e._readableStreamController=t,f(D(r()),()=>(t._started=!0,eW(t),null),e=>(tt(t,e),null))}function ts(e,t,r){let n,o,a,u=Object.create(eM.prototype);n=void 0!==t.start?pg(()=>t.start(u),"startAlgorithm"):pg(()=>{},"startAlgorithm"),o=void 0!==t.pull?pg(()=>t.pull(u),"pullAlgorithm"):pg(()=>D(void 0),"pullAlgorithm"),a=void 0!==t.cancel?pg(e=>t.cancel(e),"cancelAlgorithm"):pg(()=>D(void 0),"cancelAlgorithm");let s=t.autoAllocateChunkSize;if(0===s)throw TypeError("autoAllocateChunkSize must be greater than 0");tu(e,u,n,o,a,r,s)}function tl(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}function tc(e){return TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function td(e){return TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function tD(e,t){N(e,t);let r=e?.mode;return{mode:void 0===r?void 0:tp(r,`${t} has member 'mode' that`)}}function tp(e,t){if("byob"!=(e=`${e}`))throw TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function th(e,t){var r;return N(e,t),{min:Y(null!=(r=e?.min)?r:1,`${t} has member 'min' that`)}}function tf(e){return new tF(e)}function tm(e,t){e._reader._readIntoRequests.push(t)}function tg(e,t,r){let n=e._reader._readIntoRequests.shift();r?n._closeSteps(t):n._chunkSteps(t)}function tb(e){return e._reader._readIntoRequests.length}function ty(e){let t=e._reader;return!(void 0===t||!tC(t))}pg(eM,"ReadableByteStreamController"),Object.defineProperties(eM.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),u(eM.prototype.close,"close"),u(eM.prototype.enqueue,"enqueue"),u(eM.prototype.error,"error"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(eM.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0}),pg(eU,"IsReadableByteStreamController"),pg(eN,"IsReadableStreamBYOBRequest"),pg(eW,"ReadableByteStreamControllerCallPullIfNeeded"),pg(eq,"ReadableByteStreamControllerClearPendingPullIntos"),pg(eH,"ReadableByteStreamControllerCommitPullIntoDescriptor"),pg(eV,"ReadableByteStreamControllerConvertPullIntoDescriptor"),pg(eG,"ReadableByteStreamControllerEnqueueChunkToQueue"),pg(eZ,"ReadableByteStreamControllerEnqueueClonedChunkToQueue"),pg(eJ,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue"),pg(eK,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue"),pg(eY,"ReadableByteStreamControllerFillHeadPullIntoDescriptor"),pg(eQ,"ReadableByteStreamControllerHandleQueueDrain"),pg(eX,"ReadableByteStreamControllerInvalidateBYOBRequest"),pg(e0,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue"),pg(e2,"ReadableByteStreamControllerProcessReadRequestsUsingQueue"),pg(e1,"ReadableByteStreamControllerPullInto"),pg(e8,"ReadableByteStreamControllerRespondInClosedState"),pg(e3,"ReadableByteStreamControllerRespondInReadableState"),pg(e6,"ReadableByteStreamControllerRespondInternal"),pg(e9,"ReadableByteStreamControllerShiftPendingPullInto"),pg(e7,"ReadableByteStreamControllerShouldCallPull"),pg(e4,"ReadableByteStreamControllerClearAlgorithms"),pg(e5,"ReadableByteStreamControllerClose"),pg(te,"ReadableByteStreamControllerEnqueue"),pg(tt,"ReadableByteStreamControllerError"),pg(tr,"ReadableByteStreamControllerFillReadRequestFromQueue"),pg(tn,"ReadableByteStreamControllerGetBYOBRequest"),pg(ti,"ReadableByteStreamControllerGetDesiredSize"),pg(to,"ReadableByteStreamControllerRespond"),pg(ta,"ReadableByteStreamControllerRespondWithNewView"),pg(tu,"SetUpReadableByteStreamController"),pg(ts,"SetUpReadableByteStreamControllerFromUnderlyingSource"),pg(tl,"SetUpReadableStreamBYOBRequest"),pg(tc,"byobRequestBrandCheckException"),pg(td,"byteStreamControllerBrandCheckException"),pg(tD,"convertReaderOptions"),pg(tp,"convertReadableStreamReaderMode"),pg(th,"convertByobReadOptions"),pg(tf,"AcquireReadableStreamBYOBReader"),pg(tm,"ReadableStreamAddReadIntoRequest"),pg(tg,"ReadableStreamFulfillReadIntoRequest"),pg(tb,"ReadableStreamGetNumReadIntoRequests"),pg(ty,"ReadableStreamHasBYOBReader");let t_=class{constructor(e){if(V(e,1,"ReadableStreamBYOBReader"),Q(e,"First parameter"),nF(e))throw TypeError("This stream has already been locked for exclusive reading by another reader");if(!eU(e._readableStreamController))throw TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");B(this,e),this._readIntoRequests=new E}get closed(){return tC(this)?this._closedPromise:p(tS("closed"))}cancel(e){return tC(this)?void 0===this._ownerReadableStream?p($("cancel")):x(this,e):p(tS("cancel"))}read(e,t={}){let r,n,o;if(!tC(this))return p(tS("read"));if(!ArrayBuffer.isView(e))return p(TypeError("view must be an array buffer view"));if(0===e.byteLength)return p(TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return p(TypeError("view's buffer must have non-zero byteLength"));if(eF(e.buffer))return p(TypeError("view's buffer has been detached"));try{r=th(t,"options")}catch(e){return p(e)}let a=r.min;if(0===a)return p(TypeError("options.min must be greater than 0"));if(eI(e)){if(a>e.byteLength)return p(RangeError("options.min must be less than or equal to view's byteLength"))}else if(a>e.length)return p(RangeError("options.min must be less than or equal to view's length"));if(void 0===this._ownerReadableStream)return p($("read from"));let u=d((e,t)=>{n=e,o=t});return tE(this,e,a,{_chunkSteps:pg(e=>n({value:e,done:!1}),"_chunkSteps"),_closeSteps:pg(e=>n({value:e,done:!0}),"_closeSteps"),_errorSteps:pg(e=>o(e),"_errorSteps")}),u}releaseLock(){if(!tC(this))throw tS("releaseLock");void 0!==this._ownerReadableStream&&tv(this)}};pg(t_,"ReadableStreamBYOBReader");let tF=t_;function tC(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof tF}function tE(e,t,r,n){let o=e._ownerReadableStream;o._disturbed=!0,"errored"===o._state?n._errorSteps(o._storedError):e1(o._readableStreamController,t,r,n)}function tv(e){O(e),tw(e,TypeError("Reader was released"))}function tw(e,t){let r=e._readIntoRequests;e._readIntoRequests=new E,r.forEach(e=>{e._errorSteps(t)})}function tS(e){return TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function tA(e,t){let{highWaterMark:r}=e;if(void 0===r)return t;if(eg(r)||r<0)throw RangeError("Invalid highWaterMark");return r}function tT(e){let{size:t}=e;return t||(()=>1)}function tB(e,t){N(e,t);let r=e?.highWaterMark,n=e?.size;return{highWaterMark:void 0===r?void 0:Z(r),size:void 0===n?void 0:tx(n,`${t} has member 'size' that`)}}function tx(e,t){return W(e,t),t=>Z(e(t))}function tO(e,t){N(e,t);let r=e?.abort,n=e?.close,o=e?.start,a=e?.type,u=e?.write;return{abort:void 0===r?void 0:t$(r,e,`${t} has member 'abort' that`),close:void 0===n?void 0:tR(n,e,`${t} has member 'close' that`),start:void 0===o?void 0:tk(o,e,`${t} has member 'start' that`),write:void 0===u?void 0:tP(u,e,`${t} has member 'write' that`),type:a}}function t$(e,t,r){return W(e,r),r=>C(e,t,[r])}function tR(e,t,r){return W(e,r),()=>C(e,t,[])}function tk(e,t,r){return W(e,r),r=>F(e,t,[r])}function tP(e,t,r){return W(e,r),(r,n)=>C(e,t,[r,n])}function tj(e,t){if(!tq(e))throw TypeError(`${t} is not a WritableStream.`)}function tI(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch{return!1}}Object.defineProperties(tF.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),u(tF.prototype.cancel,"cancel"),u(tF.prototype.read,"read"),u(tF.prototype.releaseLock,"releaseLock"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(tF.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0}),pg(tC,"IsReadableStreamBYOBReader"),pg(tE,"ReadableStreamBYOBReaderRead"),pg(tv,"ReadableStreamBYOBReaderRelease"),pg(tw,"ReadableStreamBYOBReaderErrorReadIntoRequests"),pg(tS,"byobReaderBrandCheckException"),pg(tA,"ExtractHighWaterMark"),pg(tT,"ExtractSizeAlgorithm"),pg(tB,"convertQueuingStrategy"),pg(tx,"convertQueuingStrategySize"),pg(tO,"convertUnderlyingSink"),pg(t$,"convertUnderlyingSinkAbortCallback"),pg(tR,"convertUnderlyingSinkCloseCallback"),pg(tk,"convertUnderlyingSinkStartCallback"),pg(tP,"convertUnderlyingSinkWriteCallback"),pg(tj,"assertWritableStream"),pg(tI,"isAbortSignal");let tz="function"==typeof AbortController;function tL(){if(tz)return new AbortController}pg(tL,"createAbortController");let tM=class{constructor(e={},t={}){void 0===e?e=null:H(e,"First parameter");let r=tB(t,"Second parameter"),n=tO(e,"First parameter");if(tW(this),void 0!==n.type)throw RangeError("Invalid type is specified");let o=tT(r);rh(this,n,tA(r,1),o)}get locked(){if(!tq(this))throw rS("locked");return tH(this)}abort(e){return tq(this)?tH(this)?p(TypeError("Cannot abort a stream that already has a writer")):tV(this,e):p(rS("abort"))}close(){return tq(this)?tH(this)?p(TypeError("Cannot close a stream that already has a writer")):t1(this)?p(TypeError("Cannot close an already-closing stream")):tG(this):p(rS("close"))}getWriter(){if(!tq(this))throw rS("getWriter");return tU(this)}};function tU(e){return new t5(e)}function tN(e,t,r,n,o=1,a=()=>1){let u=Object.create(tM.prototype);return tW(u),rp(u,Object.create(rd.prototype),e,t,r,n,o,a),u}function tW(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new E,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function tq(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof tM}function tH(e){return void 0!==e._writer}function tV(e,t){var r;if("closed"===e._state||"errored"===e._state)return D(void 0);e._writableStreamController._abortReason=t,null==(r=e._writableStreamController._abortController)||r.abort(t);let n=e._state;if("closed"===n||"errored"===n)return D(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;let o=!1;"erroring"===n&&(o=!0,t=void 0);let a=d((r,n)=>{e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:n,_reason:t,_wasAlreadyErroring:o}});return e._pendingAbortRequest._promise=a,o||tK(e,t),a}function tG(e){let t=e._state;if("closed"===t||"errored"===t)return p(TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));let r=d((t,r)=>{e._closeRequest={_resolve:t,_reject:r}}),n=e._writer;return void 0!==n&&e._backpressure&&"writable"===t&&rN(n),rm(e._writableStreamController),r}function tZ(e){return d((t,r)=>{e._writeRequests.push({_resolve:t,_reject:r})})}function tJ(e,t){"writable"===e._state?tK(e,t):tY(e)}function tK(e,t){let r=e._writableStreamController;e._state="erroring",e._storedError=t;let n=e._writer;void 0!==n&&ro(n,t),!t8(e)&&r._started&&tY(e)}function tY(e){e._state="errored",e._writableStreamController[w]();let t=e._storedError;if(e._writeRequests.forEach(e=>{e._reject(t)}),e._writeRequests=new E,void 0===e._pendingAbortRequest)return void t9(e);let r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring){r._reject(t),t9(e);return}f(e._writableStreamController[v](r._reason),()=>(r._resolve(),t9(e),null),t=>(r._reject(t),t9(e),null))}function tQ(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}function tX(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,tJ(e,t)}function t0(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";let t=e._writer;void 0!==t&&rP(t)}function t2(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),tJ(e,t)}function t1(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function t8(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest}function t3(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0}function t6(e){e._inFlightWriteRequest=e._writeRequests.shift()}function t9(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let t=e._writer;void 0!==t&&rR(t,e._storedError)}function t7(e,t){let r=e._writer;void 0!==r&&t!==e._backpressure&&(t?rM(r):rN(r)),e._backpressure=t}pg(tM,"WritableStream"),Object.defineProperties(tM.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),u(tM.prototype.abort,"abort"),u(tM.prototype.close,"close"),u(tM.prototype.getWriter,"getWriter"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(tM.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0}),pg(tU,"AcquireWritableStreamDefaultWriter"),pg(tN,"CreateWritableStream"),pg(tW,"InitializeWritableStream"),pg(tq,"IsWritableStream"),pg(tH,"IsWritableStreamLocked"),pg(tV,"WritableStreamAbort"),pg(tG,"WritableStreamClose"),pg(tZ,"WritableStreamAddWriteRequest"),pg(tJ,"WritableStreamDealWithRejection"),pg(tK,"WritableStreamStartErroring"),pg(tY,"WritableStreamFinishErroring"),pg(tQ,"WritableStreamFinishInFlightWrite"),pg(tX,"WritableStreamFinishInFlightWriteWithError"),pg(t0,"WritableStreamFinishInFlightClose"),pg(t2,"WritableStreamFinishInFlightCloseWithError"),pg(t1,"WritableStreamCloseQueuedOrInFlight"),pg(t8,"WritableStreamHasOperationMarkedInFlight"),pg(t3,"WritableStreamMarkCloseRequestInFlight"),pg(t6,"WritableStreamMarkFirstWriteRequestInFlight"),pg(t9,"WritableStreamRejectCloseAndClosedPromiseIfNeeded"),pg(t7,"WritableStreamUpdateBackpressure");let t4=class{constructor(e){if(V(e,1,"WritableStreamDefaultWriter"),tj(e,"First parameter"),tH(e))throw TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;let t=e._state;if("writable"===t)!t1(e)&&e._backpressure?rj(this):rz(this),rx(this);else if("erroring"===t)rI(this,e._storedError),rx(this);else if("closed"===t)rz(this),r$(this);else{let t=e._storedError;rI(this,t),rO(this,t)}}get closed(){return re(this)?this._closedPromise:p(rT("closed"))}get desiredSize(){if(!re(this))throw rT("desiredSize");if(void 0===this._ownerWritableStream)throw rB("desiredSize");return ra(this)}get ready(){return re(this)?this._readyPromise:p(rT("ready"))}abort(e){return re(this)?void 0===this._ownerWritableStream?p(rB("abort")):rt(this,e):p(rT("abort"))}close(){if(!re(this))return p(rT("close"));let e=this._ownerWritableStream;return void 0===e?p(rB("close")):t1(e)?p(TypeError("Cannot close an already-closing stream")):rr(this)}releaseLock(){if(!re(this))throw rT("releaseLock");void 0!==this._ownerWritableStream&&ru(this)}write(e){return re(this)?void 0===this._ownerWritableStream?p(rB("write to")):rs(this,e):p(rT("write"))}};pg(t4,"WritableStreamDefaultWriter");let t5=t4;function re(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof t5}function rt(e,t){return tV(e._ownerWritableStream,t)}function rr(e){return tG(e._ownerWritableStream)}function rn(e){let t=e._ownerWritableStream,r=t._state;return t1(t)||"closed"===r?D(void 0):"errored"===r?p(t._storedError):rr(e)}function ri(e,t){"pending"===e._closedPromiseState?rR(e,t):rk(e,t)}function ro(e,t){"pending"===e._readyPromiseState?rL(e,t):rU(e,t)}function ra(e){let t=e._ownerWritableStream,r=t._state;return"errored"===r||"erroring"===r?null:"closed"===r?0:rb(t._writableStreamController)}function ru(e){let t=e._ownerWritableStream,r=TypeError("Writer was released and can no longer be used to monitor the stream's closedness");ro(e,r),ri(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function rs(e,t){let r=e._ownerWritableStream,n=r._writableStreamController,o=rg(n,t);if(r!==e._ownerWritableStream)return p(rB("write to"));let a=r._state;if("errored"===a)return p(r._storedError);if(t1(r)||"closed"===a)return p(TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===a)return p(r._storedError);let u=tZ(r);return ry(n,t,o),u}Object.defineProperties(t5.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),u(t5.prototype.abort,"abort"),u(t5.prototype.close,"close"),u(t5.prototype.releaseLock,"releaseLock"),u(t5.prototype.write,"write"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(t5.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0}),pg(re,"IsWritableStreamDefaultWriter"),pg(rt,"WritableStreamDefaultWriterAbort"),pg(rr,"WritableStreamDefaultWriterClose"),pg(rn,"WritableStreamDefaultWriterCloseWithErrorPropagation"),pg(ri,"WritableStreamDefaultWriterEnsureClosedPromiseRejected"),pg(ro,"WritableStreamDefaultWriterEnsureReadyPromiseRejected"),pg(ra,"WritableStreamDefaultWriterGetDesiredSize"),pg(ru,"WritableStreamDefaultWriterRelease"),pg(rs,"WritableStreamDefaultWriterWrite");let rl={},rc=class{constructor(){throw TypeError("Illegal constructor")}get abortReason(){if(!rD(this))throw rA("abortReason");return this._abortReason}get signal(){if(!rD(this))throw rA("signal");if(void 0===this._abortController)throw TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(e){if(!rD(this))throw rA("error");"writable"===this._controlledWritableStream._state&&rw(this,e)}[v](e){let t=this._abortAlgorithm(e);return rf(this),t}[w](){eP(this)}};pg(rc,"WritableStreamDefaultController");let rd=rc;function rD(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof rd}function rp(e,t,r,n,o,a,u,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,eP(t),t._abortReason=void 0,t._abortController=tL(),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=u,t._writeAlgorithm=n,t._closeAlgorithm=o,t._abortAlgorithm=a,t7(e,rv(t)),f(D(r()),()=>(t._started=!0,r_(t),null),r=>(t._started=!0,tJ(e,r),null))}function rh(e,t,r,n){let o,a,u=Object.create(rd.prototype);o=void 0!==t.start?pg(()=>t.start(u),"startAlgorithm"):pg(()=>{},"startAlgorithm"),a=void 0!==t.write?pg(e=>t.write(e,u),"writeAlgorithm"):pg(()=>D(void 0),"writeAlgorithm"),rp(e,u,o,a,void 0!==t.close?pg(()=>t.close(),"closeAlgorithm"):pg(()=>D(void 0),"closeAlgorithm"),void 0!==t.abort?pg(e=>t.abort(e),"abortAlgorithm"):pg(()=>D(void 0),"abortAlgorithm"),r,n)}function rf(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function rm(e){eR(e,rl,0),r_(e)}function rg(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return rF(e,t),1}}function rb(e){return e._strategyHWM-e._queueTotalSize}function ry(e,t,r){try{eR(e,t,r)}catch(t){rF(e,t);return}let n=e._controlledWritableStream;t1(n)||"writable"!==n._state||t7(n,rv(e)),r_(e)}function r_(e){let t=e._controlledWritableStream;if(!e._started||void 0!==t._inFlightWriteRequest)return;if("erroring"===t._state)return void tY(t);if(0===e._queue.length)return;let r=ek(e);r===rl?rC(e):rE(e,r)}function rF(e,t){"writable"===e._controlledWritableStream._state&&rw(e,t)}function rC(e){let t=e._controlledWritableStream;t3(t),e$(e);let r=e._closeAlgorithm();rf(e),f(r,()=>(t0(t),null),e=>(t2(t,e),null))}function rE(e,t){let r=e._controlledWritableStream;t6(r),f(e._writeAlgorithm(t),()=>{tQ(r);let t=r._state;return e$(e),t1(r)||"writable"!==t||t7(r,rv(e)),r_(e),null},t=>("writable"===r._state&&rf(e),tX(r,t),null))}function rv(e){return 0>=rb(e)}function rw(e,t){let r=e._controlledWritableStream;rf(e),tK(r,t)}function rS(e){return TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function rA(e){return TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function rT(e){return TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function rB(e){return TypeError("Cannot "+e+" a stream using a released writer")}function rx(e){e._closedPromise=d((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"})}function rO(e,t){rx(e),rR(e,t)}function r$(e){rx(e),rP(e)}function rR(e,t){void 0!==e._closedPromise_reject&&(y(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function rk(e,t){rO(e,t)}function rP(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function rj(e){e._readyPromise=d((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r}),e._readyPromiseState="pending"}function rI(e,t){rj(e),rL(e,t)}function rz(e){rj(e),rN(e)}function rL(e,t){void 0!==e._readyPromise_reject&&(y(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function rM(e){rj(e)}function rU(e,t){rI(e,t)}function rN(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}function rW(){return"u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof pp?pp:void 0}Object.defineProperties(rd.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(rd.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0}),pg(rD,"IsWritableStreamDefaultController"),pg(rp,"SetUpWritableStreamDefaultController"),pg(rh,"SetUpWritableStreamDefaultControllerFromUnderlyingSink"),pg(rf,"WritableStreamDefaultControllerClearAlgorithms"),pg(rm,"WritableStreamDefaultControllerClose"),pg(rg,"WritableStreamDefaultControllerGetChunkSize"),pg(rb,"WritableStreamDefaultControllerGetDesiredSize"),pg(ry,"WritableStreamDefaultControllerWrite"),pg(r_,"WritableStreamDefaultControllerAdvanceQueueIfNeeded"),pg(rF,"WritableStreamDefaultControllerErrorIfNeeded"),pg(rC,"WritableStreamDefaultControllerProcessClose"),pg(rE,"WritableStreamDefaultControllerProcessWrite"),pg(rv,"WritableStreamDefaultControllerGetBackpressure"),pg(rw,"WritableStreamDefaultControllerError"),pg(rS,"streamBrandCheckException$2"),pg(rA,"defaultControllerBrandCheckException$2"),pg(rT,"defaultWriterBrandCheckException"),pg(rB,"defaultWriterLockException"),pg(rx,"defaultWriterClosedPromiseInitialize"),pg(rO,"defaultWriterClosedPromiseInitializeAsRejected"),pg(r$,"defaultWriterClosedPromiseInitializeAsResolved"),pg(rR,"defaultWriterClosedPromiseReject"),pg(rk,"defaultWriterClosedPromiseResetToRejected"),pg(rP,"defaultWriterClosedPromiseResolve"),pg(rj,"defaultWriterReadyPromiseInitialize"),pg(rI,"defaultWriterReadyPromiseInitializeAsRejected"),pg(rz,"defaultWriterReadyPromiseInitializeAsResolved"),pg(rL,"defaultWriterReadyPromiseReject"),pg(rM,"defaultWriterReadyPromiseReset"),pg(rU,"defaultWriterReadyPromiseResetToRejected"),pg(rN,"defaultWriterReadyPromiseResolve"),pg(rW,"getGlobals");let rq=rW();function rH(e){if("function"!=typeof e&&"object"!=typeof e||"DOMException"!==e.name)return!1;try{return new e,!0}catch{return!1}}function rV(){let e=rq?.DOMException;return rH(e)?e:void 0}function rG(){let e=pg(function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return u(e,"DOMException"),e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}pg(rH,"isDOMExceptionConstructor"),pg(rV,"getFromGlobal"),pg(rG,"createPolyfill");let rZ=rV()||rG();function rJ(e,t,r,n,a,u){let s=X(e),l=tU(t);e._disturbed=!0;let c=!1,p=D(void 0);return d((b,_)=>{let F;if(void 0!==u){if(F=pg(()=>{let r=void 0!==u.reason?u.reason:new rZ("Aborted","AbortError"),o=[];n||o.push(()=>"writable"===t._state?tV(t,r):D(void 0)),a||o.push(()=>"readable"===e._state?nC(e,r):D(void 0)),A(()=>Promise.all(o.map(e=>e())),!0,r)},"abortAlgorithm"),u.aborted)return void F();u.addEventListener("abort",F)}function C(){return d((e,t)=>{function r(n){n?e():h(E(),r,t)}pg(r,"next"),r(!1)})}function E(){return c?D(!0):h(l._readyPromise,()=>d((e,t)=>{eu(s,{_chunkSteps:pg(t=>{p=h(rs(l,t),void 0,o),e(!1)},"_chunkSteps"),_closeSteps:pg(()=>e(!0),"_closeSteps"),_errorSteps:t})}))}if(pg(C,"pipeLoop"),pg(E,"pipeStep"),w(e,s._closedPromise,e=>(n?T(!0,e):A(()=>tV(t,e),!0,e),null)),w(t,l._closedPromise,t=>(a?T(!0,t):A(()=>nC(e,t),!0,t),null)),S(e,s._closedPromise,()=>(r?T():A(()=>rn(l)),null)),t1(t)||"closed"===t._state){let t=TypeError("the destination writable stream closed before all data could be piped to it");a?T(!0,t):A(()=>nC(e,t),!0,t)}function v(){let e=p;return h(p,()=>e!==p?v():void 0)}function w(e,t,r){"errored"===e._state?r(e._storedError):g(t,r)}function S(e,t,r){"closed"===e._state?r():m(t,r)}function A(e,r,n){c||(c=!0,"writable"!==t._state||t1(t)?o():m(v(),o),pg(o,"doTheRest"));function o(){return f(e(),()=>B(r,n),e=>B(!0,e)),null}}function T(e,r){c||(c=!0,"writable"!==t._state||t1(t)?B(e,r):m(v(),()=>B(e,r)))}function B(e,t){return ru(l),O(s),void 0!==u&&u.removeEventListener("abort",F),e?_(t):b(void 0),null}y(C()),pg(v,"waitForWritesToFinish"),pg(w,"isOrBecomesErrored"),pg(S,"isOrBecomesClosed"),pg(A,"shutdownWithAction"),pg(T,"shutdown"),pg(B,"finalize")})}pg(rJ,"ReadableStreamPipeTo");let rK=class{constructor(){throw TypeError("Illegal constructor")}get desiredSize(){if(!rY(this))throw r5("desiredSize");return r3(this)}close(){if(!rY(this))throw r5("close");if(!r9(this))throw TypeError("The stream is not in a state that permits close");r2(this)}enqueue(e){if(!rY(this))throw r5("enqueue");if(!r9(this))throw TypeError("The stream is not in a state that permits enqueue");return r1(this,e)}error(e){if(!rY(this))throw r5("error");r8(this,e)}[S](e){eP(this);let t=this._cancelAlgorithm(e);return r0(this),t}[A](e){let t=this._controlledReadableStream;if(this._queue.length>0){let r=e$(this);this._closeRequested&&0===this._queue.length?(r0(this),nE(t)):rQ(this),e._chunkSteps(r)}else ee(t,e),rQ(this)}[T](){}};function rY(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof rK}function rQ(e){if(rX(e)){if(e._pulling){e._pullAgain=!0;return}e._pulling=!0,f(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,rQ(e)),null),t=>(r8(e,t),null))}}function rX(e){let t=e._controlledReadableStream;return!!r9(e)&&!!e._started&&!!(nF(t)&&er(t)>0||r3(e)>0)}function r0(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function r2(e){if(!r9(e))return;let t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(r0(e),nE(t))}function r1(e,t){if(!r9(e))return;let r=e._controlledReadableStream;if(nF(r)&&er(r)>0)et(r,t,!1);else{let r;try{r=e._strategySizeAlgorithm(t)}catch(t){throw r8(e,t),t}try{eR(e,t,r)}catch(t){throw r8(e,t),t}}rQ(e)}function r8(e,t){let r=e._controlledReadableStream;"readable"===r._state&&(eP(e),r0(e),nv(r,t))}function r3(e){let t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function r6(e){return!rX(e)}function r9(e){let t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function r7(e,t,r,n,o,a,u){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,eP(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=u,t._strategyHWM=a,t._pullAlgorithm=n,t._cancelAlgorithm=o,e._readableStreamController=t,f(D(r()),()=>(t._started=!0,rQ(t),null),e=>(r8(t,e),null))}function r4(e,t,r,n){let o,a,u=Object.create(rK.prototype);o=void 0!==t.start?pg(()=>t.start(u),"startAlgorithm"):pg(()=>{},"startAlgorithm"),a=void 0!==t.pull?pg(()=>t.pull(u),"pullAlgorithm"):pg(()=>D(void 0),"pullAlgorithm"),r7(e,u,o,a,void 0!==t.cancel?pg(e=>t.cancel(e),"cancelAlgorithm"):pg(()=>D(void 0),"cancelAlgorithm"),r,n)}function r5(e){return TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function ne(e,t){return eU(e._readableStreamController)?nr(e):nt(e)}function nt(e,t){let r=X(e),n=!1,o=!1,a=!1,u=!1,s,l,c,p,h,f=d(e=>{h=e});function m(){return n?o=!0:(n=!0,eu(r,{_chunkSteps:pg(e=>{_(()=>{o=!1,a||r1(c._readableStreamController,e),u||r1(p._readableStreamController,e),n=!1,o&&m()})},"_chunkSteps"),_closeSteps:pg(()=>{n=!1,a||r2(c._readableStreamController),u||r2(p._readableStreamController),a&&u||h(void 0)},"_closeSteps"),_errorSteps:pg(()=>{n=!1},"_errorSteps")})),D(void 0)}function b(t){if(a=!0,s=t,u){let t=nC(e,eb([s,l]));h(t)}return f}function y(t){if(u=!0,l=t,a){let t=nC(e,eb([s,l]));h(t)}return f}function F(){}return pg(m,"pullAlgorithm"),pg(b,"cancel1Algorithm"),pg(y,"cancel2Algorithm"),pg(F,"startAlgorithm"),c=ng(F,m,b),p=ng(F,m,y),g(r._closedPromise,e=>(r8(c._readableStreamController,e),r8(p._readableStreamController,e),a&&u||h(void 0),null)),[c,p]}function nr(e){let t=X(e),r=!1,n=!1,o=!1,a=!1,u=!1,s,l,c,p,h,f=d(e=>{h=e});function m(e){g(e._closedPromise,r=>(e!==t||(tt(c._readableStreamController,r),tt(p._readableStreamController,r),a&&u||h(void 0)),null))}function b(){tC(t)&&(O(t),m(t=X(e))),eu(t,{_chunkSteps:pg(t=>{_(()=>{n=!1,o=!1;let s=t;if(!a&&!u)try{s=eO(t)}catch(t){tt(c._readableStreamController,t),tt(p._readableStreamController,t),h(nC(e,t));return}a||te(c._readableStreamController,t),u||te(p._readableStreamController,s),r=!1,n?F():o&&C()})},"_chunkSteps"),_closeSteps:pg(()=>{r=!1,a||e5(c._readableStreamController),u||e5(p._readableStreamController),c._readableStreamController._pendingPullIntos.length>0&&to(c._readableStreamController,0),p._readableStreamController._pendingPullIntos.length>0&&to(p._readableStreamController,0),a&&u||h(void 0)},"_closeSteps"),_errorSteps:pg(()=>{r=!1},"_errorSteps")})}function y(s,l){ea(t)&&(O(t),m(t=tf(e)));let d=l?p:c,D=l?c:p;tE(t,s,1,{_chunkSteps:pg(t=>{_(()=>{n=!1,o=!1;let s=l?u:a;if(l?a:u)s||ta(d._readableStreamController,t);else{let r;try{r=eO(t)}catch(t){tt(d._readableStreamController,t),tt(D._readableStreamController,t),h(nC(e,t));return}s||ta(d._readableStreamController,t),te(D._readableStreamController,r)}r=!1,n?F():o&&C()})},"_chunkSteps"),_closeSteps:pg(e=>{r=!1;let t=l?u:a,n=l?a:u;t||e5(d._readableStreamController),n||e5(D._readableStreamController),void 0!==e&&(t||ta(d._readableStreamController,e),!n&&D._readableStreamController._pendingPullIntos.length>0&&to(D._readableStreamController,0)),t&&n||h(void 0)},"_closeSteps"),_errorSteps:pg(()=>{r=!1},"_errorSteps")})}function F(){if(r)return n=!0,D(void 0);r=!0;let e=tn(c._readableStreamController);return null===e?b():y(e._view,!1),D(void 0)}function C(){if(r)return o=!0,D(void 0);r=!0;let e=tn(p._readableStreamController);return null===e?b():y(e._view,!0),D(void 0)}function E(t){if(a=!0,s=t,u){let t=nC(e,eb([s,l]));h(t)}return f}function v(t){if(u=!0,l=t,a){let t=nC(e,eb([s,l]));h(t)}return f}function w(){}return pg(m,"forwardReaderError"),pg(b,"pullWithDefaultReader"),pg(y,"pullWithBYOBReader"),pg(F,"pull1Algorithm"),pg(C,"pull2Algorithm"),pg(E,"cancel1Algorithm"),pg(v,"cancel2Algorithm"),pg(w,"startAlgorithm"),c=nb(w,F,E),p=nb(w,C,v),m(t),[c,p]}function nn(e){return a(e)&&"u">typeof e.getReader}function ni(e){return nn(e)?na(e.getReader()):no(e)}function no(e){let t,r=eS(e,"async");function n(){let e;try{e=eA(r)}catch(e){return p(e)}return b(D(e),e=>{if(!a(e))throw TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(eT(e))r2(t._readableStreamController);else{let r=eB(e);r1(t._readableStreamController,r)}})}function u(e){let t,n,o=r.iterator;try{t=eE(o,"return")}catch(e){return p(e)}if(void 0===t)return D(void 0);try{n=F(t,o,[e])}catch(e){return p(e)}return b(D(n),e=>{if(!a(e))throw TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return pg(n,"pullAlgorithm"),pg(u,"cancelAlgorithm"),t=ng(o,n,u,0)}function na(e){let t;function r(){let r;try{r=e.read()}catch(e){return p(e)}return b(r,e=>{if(!a(e))throw TypeError("The promise returned by the reader.read() method must fulfill with an object");if(e.done)r2(t._readableStreamController);else{let r=e.value;r1(t._readableStreamController,r)}})}function n(t){try{return D(e.cancel(t))}catch(e){return p(e)}}return pg(r,"pullAlgorithm"),pg(n,"cancelAlgorithm"),t=ng(o,r,n,0)}function nu(e,t){N(e,t);let r=e?.autoAllocateChunkSize,n=e?.cancel,o=e?.pull,a=e?.start,u=e?.type;return{autoAllocateChunkSize:void 0===r?void 0:Y(r,`${t} has member 'autoAllocateChunkSize' that`),cancel:void 0===n?void 0:ns(n,e,`${t} has member 'cancel' that`),pull:void 0===o?void 0:nl(o,e,`${t} has member 'pull' that`),start:void 0===a?void 0:nc(a,e,`${t} has member 'start' that`),type:void 0===u?void 0:nd(u,`${t} has member 'type' that`)}}function ns(e,t,r){return W(e,r),r=>C(e,t,[r])}function nl(e,t,r){return W(e,r),r=>C(e,t,[r])}function nc(e,t,r){return W(e,r),r=>F(e,t,[r])}function nd(e,t){if("bytes"!=(e=`${e}`))throw TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function nD(e,t){return N(e,t),{preventCancel:!!e?.preventCancel}}function np(e,t){N(e,t);let r=e?.preventAbort,n=e?.preventCancel,o=e?.preventClose,a=e?.signal;return void 0!==a&&nh(a,`${t} has member 'signal' that`),{preventAbort:!!r,preventCancel:!!n,preventClose:!!o,signal:a}}function nh(e,t){if(!tI(e))throw TypeError(`${t} is not an AbortSignal.`)}function nf(e,t){N(e,t);let r=e?.readable;G(r,"readable","ReadableWritablePair"),Q(r,`${t} has member 'readable' that`);let n=e?.writable;return G(n,"writable","ReadableWritablePair"),tj(n,`${t} has member 'writable' that`),{readable:r,writable:n}}pg(rK,"ReadableStreamDefaultController"),Object.defineProperties(rK.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),u(rK.prototype.close,"close"),u(rK.prototype.enqueue,"enqueue"),u(rK.prototype.error,"error"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(rK.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0}),pg(rY,"IsReadableStreamDefaultController"),pg(rQ,"ReadableStreamDefaultControllerCallPullIfNeeded"),pg(rX,"ReadableStreamDefaultControllerShouldCallPull"),pg(r0,"ReadableStreamDefaultControllerClearAlgorithms"),pg(r2,"ReadableStreamDefaultControllerClose"),pg(r1,"ReadableStreamDefaultControllerEnqueue"),pg(r8,"ReadableStreamDefaultControllerError"),pg(r3,"ReadableStreamDefaultControllerGetDesiredSize"),pg(r6,"ReadableStreamDefaultControllerHasBackpressure"),pg(r9,"ReadableStreamDefaultControllerCanCloseOrEnqueue"),pg(r7,"SetUpReadableStreamDefaultController"),pg(r4,"SetUpReadableStreamDefaultControllerFromUnderlyingSource"),pg(r5,"defaultControllerBrandCheckException$1"),pg(ne,"ReadableStreamTee"),pg(nt,"ReadableStreamDefaultTee"),pg(nr,"ReadableByteStreamTee"),pg(nn,"isReadableStreamLike"),pg(ni,"ReadableStreamFrom"),pg(no,"ReadableStreamFromIterable"),pg(na,"ReadableStreamFromDefaultReader"),pg(nu,"convertUnderlyingDefaultOrByteSource"),pg(ns,"convertUnderlyingSourceCancelCallback"),pg(nl,"convertUnderlyingSourcePullCallback"),pg(nc,"convertUnderlyingSourceStartCallback"),pg(nd,"convertReadableStreamType"),pg(nD,"convertIteratorOptions"),pg(np,"convertPipeOptions"),pg(nh,"assertAbortSignal"),pg(nf,"convertReadableWritablePair");let nm=class{constructor(e={},t={}){void 0===e?e=null:H(e,"First parameter");let r=tB(t,"Second parameter"),n=nu(e,"First parameter");if(ny(this),"bytes"===n.type){if(void 0!==r.size)throw RangeError("The strategy for a byte stream cannot have a size function");ts(this,n,tA(r,0))}else{let e=tT(r);r4(this,n,tA(r,1),e)}}get locked(){if(!n_(this))throw nw("locked");return nF(this)}cancel(e){return n_(this)?nF(this)?p(TypeError("Cannot cancel a stream that already has a reader")):nC(this,e):p(nw("cancel"))}getReader(e){if(!n_(this))throw nw("getReader");return void 0===tD(e,"First parameter").mode?X(this):tf(this)}pipeThrough(e,t={}){if(!n_(this))throw nw("pipeThrough");V(e,1,"pipeThrough");let r=nf(e,"First parameter"),n=np(t,"Second parameter");if(nF(this))throw TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(tH(r.writable))throw TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return y(rJ(this,r.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),r.readable}pipeTo(e,t={}){let r;if(!n_(this))return p(nw("pipeTo"));if(void 0===e)return p("Parameter 1 is required in 'pipeTo'.");if(!tq(e))return p(TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));try{r=np(t,"Second parameter")}catch(e){return p(e)}return nF(this)?p(TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):tH(e)?p(TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):rJ(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!n_(this))throw nw("tee");return eb(ne(this))}values(e){if(!n_(this))throw nw("values");return eh(this,nD(e,"First parameter").preventCancel)}[ew](e){return this.values(e)}static from(e){return ni(e)}};function ng(e,t,r,n=1,o=()=>1){let a=Object.create(nm.prototype);return ny(a),r7(a,Object.create(rK.prototype),e,t,r,n,o),a}function nb(e,t,r){let n=Object.create(nm.prototype);return ny(n),tu(n,Object.create(eM.prototype),e,t,r,0,void 0),n}function ny(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function n_(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof nm}function nF(e){return void 0!==e._reader}function nC(e,t){if(e._disturbed=!0,"closed"===e._state)return D(void 0);if("errored"===e._state)return p(e._storedError);nE(e);let r=e._reader;if(void 0!==r&&tC(r)){let e=r._readIntoRequests;r._readIntoRequests=new E,e.forEach(e=>{e._closeSteps(void 0)})}return b(e._readableStreamController[S](t),o)}function nE(e){e._state="closed";let t=e._reader;if(void 0!==t&&(z(t),ea(t))){let e=t._readRequests;t._readRequests=new E,e.forEach(e=>{e._closeSteps()})}}function nv(e,t){e._state="errored",e._storedError=t;let r=e._reader;void 0!==r&&(j(r,t),ea(r)?el(r,t):tw(r,t))}function nw(e){return TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function nS(e,t){N(e,t);let r=e?.highWaterMark;return G(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Z(r)}}pg(nm,"ReadableStream"),Object.defineProperties(nm,{from:{enumerable:!0}}),Object.defineProperties(nm.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),u(nm.from,"from"),u(nm.prototype.cancel,"cancel"),u(nm.prototype.getReader,"getReader"),u(nm.prototype.pipeThrough,"pipeThrough"),u(nm.prototype.pipeTo,"pipeTo"),u(nm.prototype.tee,"tee"),u(nm.prototype.values,"values"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(nm.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(nm.prototype,ew,{value:nm.prototype.values,writable:!0,configurable:!0}),pg(ng,"CreateReadableStream"),pg(nb,"CreateReadableByteStream"),pg(ny,"InitializeReadableStream"),pg(n_,"IsReadableStream"),pg(nF,"IsReadableStreamLocked"),pg(nC,"ReadableStreamCancel"),pg(nE,"ReadableStreamClose"),pg(nv,"ReadableStreamError"),pg(nw,"streamBrandCheckException$1"),pg(nS,"convertQueuingStrategyInit");let nA=pg(e=>e.byteLength,"byteLengthSizeFunction");u(nA,"size");let nT=class{constructor(e){V(e,1,"ByteLengthQueuingStrategy"),e=nS(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!nx(this))throw nB("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!nx(this))throw nB("size");return nA}};function nB(e){return TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function nx(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof nT}pg(nT,"ByteLengthQueuingStrategy"),Object.defineProperties(nT.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(nT.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0}),pg(nB,"byteLengthBrandCheckException"),pg(nx,"IsByteLengthQueuingStrategy");let nO=pg(()=>1,"countSizeFunction");u(nO,"size");let n$=class{constructor(e){V(e,1,"CountQueuingStrategy"),e=nS(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!nk(this))throw nR("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!nk(this))throw nR("size");return nO}};function nR(e){return TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function nk(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof n$}function nP(e,t){N(e,t);let r=e?.cancel,n=e?.flush,o=e?.readableType,a=e?.start,u=e?.transform,s=e?.writableType;return{cancel:void 0===r?void 0:nL(r,e,`${t} has member 'cancel' that`),flush:void 0===n?void 0:nj(n,e,`${t} has member 'flush' that`),readableType:o,start:void 0===a?void 0:nI(a,e,`${t} has member 'start' that`),transform:void 0===u?void 0:nz(u,e,`${t} has member 'transform' that`),writableType:s}}function nj(e,t,r){return W(e,r),r=>C(e,t,[r])}function nI(e,t,r){return W(e,r),r=>F(e,t,[r])}function nz(e,t,r){return W(e,r),(r,n)=>C(e,t,[r,n])}function nL(e,t,r){return W(e,r),r=>C(e,t,[r])}pg(n$,"CountQueuingStrategy"),Object.defineProperties(n$.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(n$.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0}),pg(nR,"countBrandCheckException"),pg(nk,"IsCountQueuingStrategy"),pg(nP,"convertTransformer"),pg(nj,"convertTransformerFlushCallback"),pg(nI,"convertTransformerStartCallback"),pg(nz,"convertTransformerTransformCallback"),pg(nL,"convertTransformerCancelCallback");let nM=class{constructor(e={},t={},r={}){let n;void 0===e&&(e=null);let o=tB(t,"Second parameter"),a=tB(r,"Third parameter"),u=nP(e,"First parameter");if(void 0!==u.readableType)throw RangeError("Invalid readableType specified");if(void 0!==u.writableType)throw RangeError("Invalid writableType specified");let s=tA(a,0),l=tT(a),c=tA(o,1),D=tT(o);nU(this,d(e=>{n=e}),c,D,s,l),nK(this,u),void 0!==u.start?n(u.start(this._transformStreamController)):n(void 0)}get readable(){if(!nN(this))throw ie("readable");return this._readable}get writable(){if(!nN(this))throw ie("writable");return this._writable}};function nU(e,t,r,n,o,a){function u(){return t}function s(t){return n1(e,t)}function l(t){return n8(e,t)}function c(){return n3(e)}function d(){return n6(e)}function D(t){return n9(e,t)}pg(u,"startAlgorithm"),pg(s,"writeAlgorithm"),pg(l,"abortAlgorithm"),pg(c,"closeAlgorithm"),e._writable=tN(u,s,c,l,r,n),pg(d,"pullAlgorithm"),pg(D,"cancelAlgorithm"),e._readable=ng(u,d,D,o,a),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,nV(e,!0),e._transformStreamController=void 0}function nN(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof nM}function nW(e,t){r8(e._readable._readableStreamController,t),nq(e,t)}function nq(e,t){nY(e._transformStreamController),rF(e._writable._writableStreamController,t),nH(e)}function nH(e){e._backpressure&&nV(e,!1)}function nV(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=d(t=>{e._backpressureChangePromise_resolve=t}),e._backpressure=t}pg(nM,"TransformStream"),Object.defineProperties(nM.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(nM.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0}),pg(nU,"InitializeTransformStream"),pg(nN,"IsTransformStream"),pg(nW,"TransformStreamError"),pg(nq,"TransformStreamErrorWritableAndUnblockWrite"),pg(nH,"TransformStreamUnblockWrite"),pg(nV,"TransformStreamSetBackpressure");let nG=class{constructor(){throw TypeError("Illegal constructor")}get desiredSize(){if(!nZ(this))throw n7("desiredSize");return r3(this._controlledTransformStream._readable._readableStreamController)}enqueue(e){if(!nZ(this))throw n7("enqueue");nQ(this,e)}error(e){if(!nZ(this))throw n7("error");nX(this,e)}terminate(){if(!nZ(this))throw n7("terminate");n2(this)}};function nZ(e){return!!a(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof nG}function nJ(e,t,r,n,o){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n,t._cancelAlgorithm=o,t._finishPromise=void 0,t._finishPromise_resolve=void 0,t._finishPromise_reject=void 0}function nK(e,t){let r,n,o=Object.create(nG.prototype);r=void 0!==t.transform?pg(e=>t.transform(e,o),"transformAlgorithm"):pg(e=>{try{return nQ(o,e),D(void 0)}catch(e){return p(e)}},"transformAlgorithm"),n=void 0!==t.flush?pg(()=>t.flush(o),"flushAlgorithm"):pg(()=>D(void 0),"flushAlgorithm"),nJ(e,o,r,n,void 0!==t.cancel?pg(e=>t.cancel(e),"cancelAlgorithm"):pg(()=>D(void 0),"cancelAlgorithm"))}function nY(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0,e._cancelAlgorithm=void 0}function nQ(e,t){let r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!r9(n))throw TypeError("Readable side is not in a state that permits enqueue");try{r1(n,t)}catch(e){throw nq(r,e),r._readable._storedError}r6(n)!==r._backpressure&&nV(r,!0)}function nX(e,t){nW(e._controlledTransformStream,t)}function n0(e,t){return b(e._transformAlgorithm(t),void 0,t=>{throw nW(e._controlledTransformStream,t),t})}function n2(e){let t=e._controlledTransformStream;r2(t._readable._readableStreamController),nq(t,TypeError("TransformStream terminated"))}function n1(e,t){let r=e._transformStreamController;return e._backpressure?b(e._backpressureChangePromise,()=>{let n=e._writable;if("erroring"===n._state)throw n._storedError;return n0(r,t)}):n0(r,t)}function n8(e,t){let r=e._transformStreamController;if(void 0!==r._finishPromise)return r._finishPromise;let n=e._readable;r._finishPromise=d((e,t)=>{r._finishPromise_resolve=e,r._finishPromise_reject=t});let o=r._cancelAlgorithm(t);return nY(r),f(o,()=>("errored"===n._state?n5(r,n._storedError):(r8(n._readableStreamController,t),n4(r)),null),e=>(r8(n._readableStreamController,e),n5(r,e),null)),r._finishPromise}function n3(e){let t=e._transformStreamController;if(void 0!==t._finishPromise)return t._finishPromise;let r=e._readable;t._finishPromise=d((e,r)=>{t._finishPromise_resolve=e,t._finishPromise_reject=r});let n=t._flushAlgorithm();return nY(t),f(n,()=>("errored"===r._state?n5(t,r._storedError):(r2(r._readableStreamController),n4(t)),null),e=>(r8(r._readableStreamController,e),n5(t,e),null)),t._finishPromise}function n6(e){return nV(e,!1),e._backpressureChangePromise}function n9(e,t){let r=e._transformStreamController;if(void 0!==r._finishPromise)return r._finishPromise;let n=e._writable;r._finishPromise=d((e,t)=>{r._finishPromise_resolve=e,r._finishPromise_reject=t});let o=r._cancelAlgorithm(t);return nY(r),f(o,()=>("errored"===n._state?n5(r,n._storedError):(rF(n._writableStreamController,t),nH(e),n4(r)),null),t=>(rF(n._writableStreamController,t),nH(e),n5(r,t),null)),r._finishPromise}function n7(e){return TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function n4(e){void 0!==e._finishPromise_resolve&&(e._finishPromise_resolve(),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function n5(e,t){void 0!==e._finishPromise_reject&&(y(e._finishPromise),e._finishPromise_reject(t),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function ie(e){return TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}pg(nG,"TransformStreamDefaultController"),Object.defineProperties(nG.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),u(nG.prototype.enqueue,"enqueue"),u(nG.prototype.error,"error"),u(nG.prototype.terminate,"terminate"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(nG.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0}),pg(nZ,"IsTransformStreamDefaultController"),pg(nJ,"SetUpTransformStreamDefaultController"),pg(nK,"SetUpTransformStreamDefaultControllerFromTransformer"),pg(nY,"TransformStreamDefaultControllerClearAlgorithms"),pg(nQ,"TransformStreamDefaultControllerEnqueue"),pg(nX,"TransformStreamDefaultControllerError"),pg(n0,"TransformStreamDefaultControllerPerformTransform"),pg(n2,"TransformStreamDefaultControllerTerminate"),pg(n1,"TransformStreamDefaultSinkWriteAlgorithm"),pg(n8,"TransformStreamDefaultSinkAbortAlgorithm"),pg(n3,"TransformStreamDefaultSinkCloseAlgorithm"),pg(n6,"TransformStreamDefaultSourcePullAlgorithm"),pg(n9,"TransformStreamDefaultSourceCancelAlgorithm"),pg(n7,"defaultControllerBrandCheckException"),pg(n4,"defaultControllerFinishPromiseResolve"),pg(n5,"defaultControllerFinishPromiseReject"),pg(ie,"streamBrandCheckException"),e.ByteLengthQueuingStrategy=nT,e.CountQueuingStrategy=n$,e.ReadableByteStreamController=eM,e.ReadableStream=nm,e.ReadableStreamBYOBReader=tF,e.ReadableStreamBYOBRequest=eL,e.ReadableStreamDefaultController=rK,e.ReadableStreamDefaultReader=eo,e.TransformStream=nM,e.TransformStreamDefaultController=nG,e.WritableStream=tM,e.WritableStreamDefaultController=rd,e.WritableStreamDefaultWriter=t5}(pN)),pN}function pq(){if(Dp)return pU;if(Dp=1,!globalThis.ReadableStream)try{let e=require("node:process"),{emitWarning:t}=e;try{e.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),e.emitWarning=t}catch(r){throw e.emitWarning=t,r}}catch{Object.assign(globalThis,pW())}try{let{Blob:e}=require("buffer");e&&!e.prototype.stream&&(e.prototype.stream=pg(function(e){let t=0,r=this;return new ReadableStream({type:"bytes",async pull(e){let n=await r.slice(t,Math.min(r.size,t+65536)).arrayBuffer();t+=n.byteLength,e.enqueue(new Uint8Array(n)),t===r.size&&e.close()}})},"name"))}catch{}return pU}async function*pH(e,t=!0){for(let r of e)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(t){let e=r.byteOffset,t=r.byteOffset+r.byteLength;for(;e!==t;){let n=Math.min(t-e,65536),o=r.buffer.slice(e,e+n);e+=o.byteLength,yield new Uint8Array(o)}}else yield r;else{let e=0;for(;e!==r.size;){let t=await r.slice(e,Math.min(r.size,e+65536)).arrayBuffer();e+=t.byteLength,yield new Uint8Array(t)}}}pg(pW,"requirePonyfill_es2018"),pg(pq,"requireStreams"),pq(),pg(pH,"toIterator");let pV=(pO=class{constructor(e=[],t={}){if(p_(this,pA,[]),p_(this,pT,""),p_(this,pB,0),p_(this,px,"transparent"),"object"!=typeof e||null===e)throw TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if("function"!=typeof e[Symbol.iterator])throw TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if("object"!=typeof t&&"function"!=typeof t)throw TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");null===t&&(t={});let r=new TextEncoder;for(let t of e){let e;e=ArrayBuffer.isView(t)?new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)):t instanceof ArrayBuffer?new Uint8Array(t.slice(0)):t instanceof pO?t:r.encode(`${t}`),pF(this,pB,py(this,pB)+(ArrayBuffer.isView(e)?e.byteLength:e.size)),py(this,pA).push(e)}pF(this,px,`${void 0===t.endings?"transparent":t.endings}`);let n=void 0===t.type?"":String(t.type);pF(this,pT,/^[\x20-\x7E]*$/.test(n)?n:"")}get size(){return py(this,pB)}get type(){return py(this,pT)}async text(){let e=new TextDecoder,t="";for await(let r of pH(py(this,pA),!1))t+=e.decode(r,{stream:!0});return t+e.decode()}async arrayBuffer(){let e=new Uint8Array(this.size),t=0;for await(let r of pH(py(this,pA),!1))e.set(r,t),t+=r.length;return e.buffer}stream(){let e=pH(py(this,pA),!0);return new globalThis.ReadableStream({type:"bytes",async pull(t){let r=await e.next();r.done?t.close():t.enqueue(r.value)},async cancel(){await e.return()}})}slice(e=0,t=this.size,r=""){let{size:n}=this,o=e<0?Math.max(n+e,0):Math.min(e,n),a=t<0?Math.max(n+t,0):Math.min(t,n),u=Math.max(a-o,0),s=py(this,pA),l=[],c=0;for(let e of s){if(c>=u)break;let t=ArrayBuffer.isView(e)?e.byteLength:e.size;if(o&&t<=o)o-=t,a-=t;else{let r;ArrayBuffer.isView(e)?c+=(r=e.subarray(o,Math.min(t,a))).byteLength:c+=(r=e.slice(o,Math.min(t,a))).size,a-=t,l.push(r),o=0}}let d=new pO([],{type:String(r).toLowerCase()});return pF(d,pB,u),pF(d,pA,l),d}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&"object"==typeof e&&"function"==typeof e.constructor&&("function"==typeof e.stream||"function"==typeof e.arrayBuffer)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}},pA=new WeakMap,pT=new WeakMap,pB=new WeakMap,px=new WeakMap,pg(pO,"Blob"),pO);Object.defineProperties(pV.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});let pG=pV,pZ=(pk=class extends pG{constructor(e,t,r={}){if(arguments.length<2)throw TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,r),p_(this,p$,0),p_(this,pR,""),null===r&&(r={});let n=void 0===r.lastModified?Date.now():Number(r.lastModified);Number.isNaN(n)||pF(this,p$,n),pF(this,pR,String(t))}get name(){return py(this,pR)}get lastModified(){return py(this,p$)}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof pG&&/^(File)$/.test(e[Symbol.toStringTag])}},p$=new WeakMap,pR=new WeakMap,pg(pk,"File"),pk);var{toStringTag:pJ,iterator:pK,hasInstance:pY}=Symbol,pQ=Math.random,pX="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),p0=pg((e,t,r)=>(e+="",/^(Blob|File)$/.test(t&&t[pJ])?[(r=void 0!==r?r+"":"File"==t[pJ]?t.name:"blob",e),t.name!==r||"blob"==t[pJ]?new pZ([t],r,t):t]:[e,t+""]),"f"),p2=pg((e,t)=>(t?e:e.replace(/\r?\n|\r/g,`\r
74
+ `)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e$1"),p1=pg((e,t,r)=>{if(t.length<r)throw TypeError(`Failed to execute '${e}' on 'FormData': ${r} arguments required, but only ${t.length} present.`)},"x");let p8=(pj=class{constructor(...e){if(p_(this,pP,[]),e.length)throw TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[pJ](){return"FormData"}[pK](){return this.entries()}static[pY](e){return e&&"object"==typeof e&&"FormData"===e[pJ]&&!pX.some(t=>"function"!=typeof e[t])}append(...e){p1("append",arguments,2),py(this,pP).push(p0(...e))}delete(e){p1("delete",arguments,1),e+="",pF(this,pP,py(this,pP).filter(([t])=>t!==e))}get(e){p1("get",arguments,1),e+="";for(var t=py(this,pP),r=t.length,n=0;n<r;n++)if(t[n][0]===e)return t[n][1];return null}getAll(e,t){return p1("getAll",arguments,1),t=[],e+="",py(this,pP).forEach(r=>r[0]===e&&t.push(r[1])),t}has(e){return p1("has",arguments,1),e+="",py(this,pP).some(t=>t[0]===e)}forEach(e,t){for(var[r,n]of(p1("forEach",arguments,1),this))e.call(t,n,r,this)}set(...e){p1("set",arguments,2);var t=[],r=!0;e=p0(...e),py(this,pP).forEach(n=>{n[0]===e[0]?r&&(r=!t.push(e)):t.push(n)}),r&&t.push(e),pF(this,pP,t)}*entries(){yield*py(this,pP)}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}},pP=new WeakMap,pg(pj,"FormData"),pj);function p3(e,t=pG){var r=`${pQ()}${pQ()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],o=`--${r}\r
75
+ Content-Disposition: form-data; name="`;return e.forEach((e,t)=>"string"==typeof e?n.push(o+p2(t)+`"\r
76
+ \r
77
+ ${e.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
78
+ `)}\r
79
+ `):n.push(o+p2(t)+`"; filename="${p2(e.name,1)}"\r
80
+ Content-Type: ${e.type||"application/octet-stream"}\r
81
+ \r
82
+ `,e,`\r
83
+ `)),n.push(`--${r}--`),new t(n,{type:"multipart/form-data; boundary="+r})}pg(p3,"formDataToBlob");let p6=class extends Error{constructor(e,t){super(e),Error.captureStackTrace(this,this.constructor),this.type=t}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};pg(p6,"FetchBaseError");let p9=p6,p7=class extends p9{constructor(e,t,r){super(e,t),r&&(this.code=this.errno=r.code,this.erroredSysCall=r.syscall)}};pg(p7,"FetchError");let p4=Symbol.toStringTag,p5=pg(e=>"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&"function"==typeof e.sort&&"URLSearchParams"===e[p4],"isURLSearchParameters"),he=pg(e=>e&&"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&/^(Blob|File)$/.test(e[p4]),"isBlob"),ht=pg(e=>"object"==typeof e&&("AbortSignal"===e[p4]||"EventTarget"===e[p4]),"isAbortSignal"),hr=pg((e,t)=>{let r=new URL(t).hostname,n=new URL(e).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),hn=pg((e,t)=>new URL(t).protocol===new URL(e).protocol,"isSameProtocol"),hi=N(ei.pipeline),ho=Symbol("Body internals"),ha=class{constructor(e,{size:t=0}={}){let r=null;null===e?e=null:p5(e)?e=eD.from(e.toString()):he(e)||eD.isBuffer(e)||(q.isAnyArrayBuffer(e)?e=eD.from(e):ArrayBuffer.isView(e)?e=eD.from(e.buffer,e.byteOffset,e.byteLength):e instanceof ei||(e instanceof p8?r=(e=p3(e)).type.split("=")[1]:e=eD.from(String(e))));let n=e;eD.isBuffer(e)?n=ei.Readable.from(e):he(e)&&(n=ei.Readable.from(e.stream())),this[ho]={body:e,stream:n,boundary:r,disturbed:!1,error:null},this.size=t,e instanceof ei&&e.on("error",e=>{let t=e instanceof p9?e:new p7(`Invalid response body while trying to fetch ${this.url}: ${e.message}`,"system",e);this[ho].error=t})}get body(){return this[ho].stream}get bodyUsed(){return this[ho].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:t,byteLength:r}=await hs(this);return e.slice(t,t+r)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let e=new p8;for(let[t,r]of new URLSearchParams(await this.text()))e.append(t,r);return e}let{toFormData:t}=await import("./multipart-parser.js");return t(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[ho].body&&this[ho].body.type||"";return new pG([await this.arrayBuffer()],{type:e})}async json(){return JSON.parse(await this.text())}async text(){let e=await hs(this);return new TextDecoder().decode(e)}buffer(){return hs(this)}};pg(ha,"Body");let hu=ha;async function hs(e){if(e[ho].disturbed)throw TypeError(`body used already for: ${e.url}`);if(e[ho].disturbed=!0,e[ho].error)throw e[ho].error;let{body:t}=e;if(null===t||!(t instanceof ei))return eD.alloc(0);let r=[],n=0;try{for await(let o of t){if(e.size>0&&n+o.length>e.size){let r=new p7(`content size at ${e.url} over limit: ${e.size}`,"max-size");throw t.destroy(r),r}n+=o.length,r.push(o)}}catch(t){throw t instanceof p9?t:new p7(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t)}if(!0===t.readableEnded||!0===t._readableState.ended)try{return r.every(e=>"string"==typeof e)?eD.from(r.join("")):eD.concat(r,n)}catch(t){throw new p7(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t)}throw new p7(`Premature close of server response while trying to fetch ${e.url}`)}hu.prototype.buffer=M(hu.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer"),Object.defineProperties(hu.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:M(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}}),pg(hs,"consumeBody");let hl=pg((e,t)=>{let r,n,{body:o}=e[ho];if(e.bodyUsed)throw Error("cannot clone body after it is used");return o instanceof ei&&"function"!=typeof o.getBoundary&&(r=new ea({highWaterMark:t}),n=new ea({highWaterMark:t}),o.pipe(r),o.pipe(n),e[ho].stream=r,o=n),o},"clone"),hc=M(e=>e.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),hd=pg((e,t)=>null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":p5(e)?"application/x-www-form-urlencoded;charset=UTF-8":he(e)?e.type||null:eD.isBuffer(e)||q.isAnyArrayBuffer(e)||ArrayBuffer.isView(e)?null:e instanceof p8?`multipart/form-data; boundary=${t[ho].boundary}`:e&&"function"==typeof e.getBoundary?`multipart/form-data;boundary=${hc(e)}`:e instanceof ei?null:"text/plain;charset=UTF-8","extractContentType"),hD=pg(e=>{let{body:t}=e[ho];return null===t?0:he(t)?t.size:eD.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&t.hasKnownLength&&t.hasKnownLength()?t.getLengthSync():null},"getTotalBytes"),hp=pg(async(e,{body:t})=>{null===t?e.end():await hi(t,e)},"writeToStream"),hh="function"==typeof ef.validateHeaderName?ef.validateHeaderName:e=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let t=TypeError(`Header name must be a valid HTTP token [${e}]`);throw Object.defineProperty(t,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),t}},hf="function"==typeof ef.validateHeaderValue?ef.validateHeaderValue:(e,t)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(t)){let t=TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(t,"code",{value:"ERR_INVALID_CHAR"}),t}},hm=class e extends URLSearchParams{constructor(t){let r=[];if(t instanceof e)for(let[e,n]of Object.entries(t.raw()))r.push(...n.map(t=>[e,t]));else if(null!=t)if("object"!=typeof t||q.isBoxedPrimitive(t))throw TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");else{let e=t[Symbol.iterator];if(null==e)r.push(...Object.entries(t));else{if("function"!=typeof e)throw TypeError("Header pairs must be iterable");r=[...t].map(e=>{if("object"!=typeof e||q.isBoxedPrimitive(e))throw TypeError("Each header pair must be an iterable object");return[...e]}).map(e=>{if(2!==e.length)throw TypeError("Each header pair must be a name/value tuple");return[...e]})}}return super(r=r.length>0?r.map(([e,t])=>(hh(e),hf(e,String(t)),[String(e).toLowerCase(),String(t)])):void 0),new Proxy(this,{get(e,t,r){switch(t){case"append":case"set":return(r,n)=>(hh(r),hf(r,String(n)),URLSearchParams.prototype[t].call(e,String(r).toLowerCase(),String(n)));case"delete":case"has":case"getAll":return r=>(hh(r),URLSearchParams.prototype[t].call(e,String(r).toLowerCase()));case"keys":return()=>(e.sort(),new Set(URLSearchParams.prototype.keys.call(e)).keys());default:return Reflect.get(e,t,r)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let t=this.getAll(e);if(0===t.length)return null;let r=t.join(", ");return/^content-encoding$/i.test(e)&&(r=r.toLowerCase()),r}forEach(e,t){for(let r of this.keys())Reflect.apply(e,t,[this.get(r),r,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,t)=>(e[t]=this.getAll(t),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,t)=>{let r=this.getAll(t);return"host"===t?e[t]=r[0]:e[t]=r.length>1?r:r[0],e},{})}};function hg(e=[]){return new hm(e.reduce((e,t,r,n)=>(r%2==0&&e.push(n.slice(r,r+2)),e),[]).filter(([e,t])=>{try{return hh(e),hf(e,String(t)),!0}catch{return!1}}))}pg(hm,"Headers"),Object.defineProperties(hm.prototype,["get","entries","forEach","values"].reduce((e,t)=>(e[t]={enumerable:!0},e),{})),pg(hg,"fromRawHeaders");let hb=new Set([301,302,303,307,308]),hy=pg(e=>hb.has(e),"isRedirect"),h_=Symbol("Response internals"),hF=class e extends hu{constructor(e=null,t={}){super(e,t);let r=null!=t.status?t.status:200,n=new hm(t.headers);if(null!==e&&!n.has("Content-Type")){let t=hd(e,this);t&&n.append("Content-Type",t)}this[h_]={type:"default",url:t.url,status:r,statusText:t.statusText||"",headers:n,counter:t.counter,highWaterMark:t.highWaterMark}}get type(){return this[h_].type}get url(){return this[h_].url||""}get status(){return this[h_].status}get ok(){return this[h_].status>=200&&this[h_].status<300}get redirected(){return this[h_].counter>0}get statusText(){return this[h_].statusText}get headers(){return this[h_].headers}get highWaterMark(){return this[h_].highWaterMark}clone(){return new e(hl(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(t,r=302){if(!hy(r))throw RangeError('Failed to execute "redirect" on "response": Invalid status code');return new e(null,{headers:{location:new URL(t).toString()},status:r})}static error(){let t=new e(null,{status:0,statusText:""});return t[h_].type="error",t}static json(t,r={}){let n=JSON.stringify(t);if(void 0===n)throw TypeError("data is not JSON serializable");let o=new hm(r&&r.headers);return o.has("content-type")||o.set("content-type","application/json"),new e(n,{...r,headers:o})}get[Symbol.toStringTag](){return"Response"}};pg(hF,"Response"),Object.defineProperties(hF.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});let hC=pg(e=>{if(e.search)return e.search;let t=e.href.length-1,r=e.hash||("#"===e.href[t]?"#":"");return"?"===e.href[t-r.length]?"?":""},"getSearch");function hE(e,t=!1){return null==e||(e=new URL(e),/^(about|blob|data):$/.test(e.protocol))?"no-referrer":(e.username="",e.password="",e.hash="",t&&(e.pathname="",e.search=""),e)}pg(hE,"stripURLForUseAsAReferrer");let hv=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]);function hw(e){if(!hv.has(e))throw TypeError(`Invalid referrerPolicy: ${e}`);return e}function hS(e){if(/^(http|ws)s:$/.test(e.protocol))return!0;let t=e.host.replace(/(^\[)|(]$)/g,""),r=eb(t);return!!(4===r&&/^127\./.test(t)||6===r&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(t))||!("localhost"===e.host||e.host.endsWith(".localhost"))&&"file:"===e.protocol}function hA(e){return!!(/^about:(blank|srcdoc)$/.test(e)||"data:"===e.protocol||/^(blob|filesystem):$/.test(e.protocol))||hS(e)}function hT(e,{referrerURLCallback:t,referrerOriginCallback:r}={}){if("no-referrer"===e.referrer||""===e.referrerPolicy)return null;let n=e.referrerPolicy;if("about:client"===e.referrer)return"no-referrer";let o=e.referrer,a=hE(o),u=hE(o,!0);a.toString().length>4096&&(a=u),t&&(a=t(a)),r&&(u=r(u));let s=new URL(e.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return u;case"unsafe-url":return a;case"strict-origin":return hA(a)&&!hA(s)?"no-referrer":u.toString();case"strict-origin-when-cross-origin":return a.origin===s.origin?a:hA(a)&&!hA(s)?"no-referrer":u;case"same-origin":return a.origin===s.origin?a:"no-referrer";case"origin-when-cross-origin":return a.origin===s.origin?a:u;case"no-referrer-when-downgrade":return hA(a)&&!hA(s)?"no-referrer":a;default:throw TypeError(`Invalid referrerPolicy: ${n}`)}}function hB(e){let t=(e.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let e of t)e&&hv.has(e)&&(r=e);return r}pg(hw,"validateReferrerPolicy"),pg(hS,"isOriginPotentiallyTrustworthy"),pg(hA,"isUrlPotentiallyTrustworthy"),pg(hT,"determineRequestsReferrer"),pg(hB,"parseReferrerPolicyFromHeader");let hx=Symbol("Request internals"),hO=pg(e=>"object"==typeof e&&"object"==typeof e[hx],"isRequest"),h$=M(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),hR=class e extends hu{constructor(e,t={}){let r;if(hO(e)?r=new URL(e.url):(r=new URL(e),e={}),""!==r.username||""!==r.password)throw TypeError(`${r} is an url with embedded credentials.`);let n=t.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(n)&&(n=n.toUpperCase()),!hO(t)&&"data"in t&&h$(),(null!=t.body||hO(e)&&null!==e.body)&&("GET"===n||"HEAD"===n))throw TypeError("Request with GET/HEAD method cannot have body");let o=t.body?t.body:hO(e)&&null!==e.body?hl(e):null;super(o,{size:t.size||e.size||0});let a=new hm(t.headers||e.headers||{});if(null!==o&&!a.has("Content-Type")){let e=hd(o,this);e&&a.set("Content-Type",e)}let u=hO(e)?e.signal:null;if("signal"in t&&(u=t.signal),null!=u&&!ht(u))throw TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let s=null==t.referrer?e.referrer:t.referrer;if(""===s)s="no-referrer";else if(s){let e=new URL(s);s=/^about:(\/\/)?client$/.test(e)?"client":e}else s=void 0;this[hx]={method:n,redirect:t.redirect||e.redirect||"follow",headers:a,parsedURL:r,signal:u,referrer:s},this.follow=void 0===t.follow?void 0===e.follow?20:e.follow:t.follow,this.compress=void 0===t.compress?void 0===e.compress||e.compress:t.compress,this.counter=t.counter||e.counter||0,this.agent=t.agent||e.agent,this.highWaterMark=t.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=t.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=t.referrerPolicy||e.referrerPolicy||""}get method(){return this[hx].method}get url(){return G(this[hx].parsedURL)}get headers(){return this[hx].headers}get redirect(){return this[hx].redirect}get signal(){return this[hx].signal}get referrer(){return"no-referrer"===this[hx].referrer?"":"client"===this[hx].referrer?"about:client":this[hx].referrer?this[hx].referrer.toString():void 0}get referrerPolicy(){return this[hx].referrerPolicy}set referrerPolicy(e){this[hx].referrerPolicy=hw(e)}clone(){return new e(this)}get[Symbol.toStringTag](){return"Request"}};pg(hR,"Request"),Object.defineProperties(hR.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});let hk=pg(e=>{let{parsedURL:t}=e[hx],r=new hm(e[hx].headers);r.has("Accept")||r.set("Accept","*/*");let n=null;if(null===e.body&&/^(post|put)$/i.test(e.method)&&(n="0"),null!==e.body){let t=hD(e);"number"!=typeof t||Number.isNaN(t)||(n=String(t))}n&&r.set("Content-Length",n),""===e.referrerPolicy&&(e.referrerPolicy="strict-origin-when-cross-origin"),e.referrer&&"no-referrer"!==e.referrer?e[hx].referrer=hT(e):e[hx].referrer="no-referrer",e[hx].referrer instanceof URL&&r.set("Referer",e.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:o}=e;"function"==typeof o&&(o=o(t));let a=hC(t),u={path:t.pathname+a,method:e.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:e.insecureHTTPParser,agent:o};return{parsedURL:t,options:u}},"getNodeRequestOptions"),hP=class extends p9{constructor(e,t="aborted"){super(e,t)}};function hj(){if(Df)return Dh;if(Df=1,!globalThis.DOMException)try{let{MessageChannel:e}=require("worker_threads"),t=new e().port1,r=new ArrayBuffer;t.postMessage(r,[r,r])}catch(e){"DOMException"===e.constructor.name&&(globalThis.DOMException=e.constructor)}return Dh=globalThis.DOMException}pg(hP,"AbortError"),pg(hj,"requireNodeDomexception");let hI=ph(hj()),{stat:hz}=S,hL=(pg((e,t)=>hL(T(e),e,t),"blobFromSync"),pg((e,t)=>hz(e).then(r=>hL(r,e,t)),"blobFrom"),pg((e,t)=>hz(e).then(r=>hM(r,e,t)),"fileFrom"),pg((e,t)=>hM(T(e),e,t),"fileFromSync"),pg((e,t,r="")=>new pG([new hN({path:t,size:e.size,lastModified:e.mtimeMs,start:0})],{type:r}),"fromBlob")),hM=pg((e,t,r="")=>new pZ([new hN({path:t,size:e.size,lastModified:e.mtimeMs,start:0})],b(t),{type:r,lastModified:e.mtimeMs}),"fromFile"),hU=class e{constructor(e){p_(this,pI),p_(this,pz),pF(this,pI,e.path),pF(this,pz,e.start),this.size=e.size,this.lastModified=e.lastModified}slice(t,r){return new e({path:py(this,pI),lastModified:this.lastModified,size:r-t,start:py(this,pz)+t})}async *stream(){let{mtimeMs:e}=await hz(py(this,pI));if(e>this.lastModified)throw new hI("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*v(py(this,pI),{start:py(this,pz),end:py(this,pz)+this.size-1})}get[Symbol.toStringTag](){return"Blob"}};pI=new WeakMap,pz=new WeakMap,pg(hU,"BlobDataItem");let hN=hU,hW=new Set(["data:","http:","https:"]);async function hq(e,t){return new Promise((r,n)=>{let o=new hR(e,t),{parsedURL:a,options:u}=hk(o);if(!hW.has(a.protocol))throw TypeError(`node-fetch cannot load ${e}. URL scheme "${a.protocol.replace(/:$/,"")}" is not supported.`);if("data:"===a.protocol){let e=pC(o.url);r(new hF(e,{headers:{"Content-Type":e.typeFull}}));return}let s=("https:"===a.protocol?em:ef).request,{signal:l}=o,c=null,d=pg(()=>{let e=new hP("The operation was aborted.");n(e),o.body&&o.body instanceof ei.Readable&&o.body.destroy(e),c&&c.body&&c.body.emit("error",e)},"abort");if(l&&l.aborted)return void d();let D=pg(()=>{d(),h()},"abortAndFinalize"),p=s(a.toString(),u);l&&l.addEventListener("abort",D);let h=pg(()=>{p.abort(),l&&l.removeEventListener("abort",D)},"finalize");p.on("error",e=>{n(new p7(`request to ${o.url} failed, reason: ${e.message}`,"system",e)),h()}),hH(p,e=>{c&&c.body&&c.body.destroy(e)}),process.version<"v14"&&p.on("socket",e=>{let t;e.prependListener("end",()=>{t=e._eventsCount}),e.prependListener("close",r=>{if(c&&t<e._eventsCount&&!r){let e=Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",c.body.emit("error",e)}})}),p.on("response",e=>{p.setTimeout(0);let a=hg(e.rawHeaders);if(hy(e.statusCode)){let u=a.get("Location"),s=null;try{s=null===u?null:new URL(u,o.url)}catch{if("manual"!==o.redirect){n(new p7(`uri requested responds with an invalid redirect URL: ${u}`,"invalid-redirect")),h();return}}switch(o.redirect){case"error":n(new p7(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),h();return;case"manual":break;case"follow":{if(null===s)break;if(o.counter>=o.follow){n(new p7(`maximum redirect reached at: ${o.url}`,"max-redirect")),h();return}let u={headers:new hm(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:hl(o),signal:o.signal,size:o.size,referrer:o.referrer,referrerPolicy:o.referrerPolicy};if(!hr(o.url,s)||!hn(o.url,s))for(let e of["authorization","www-authenticate","cookie","cookie2"])u.headers.delete(e);if(303!==e.statusCode&&o.body&&t.body instanceof ei.Readable){n(new p7("Cannot follow redirect with body being a readable stream","unsupported-redirect")),h();return}(303===e.statusCode||(301===e.statusCode||302===e.statusCode)&&"POST"===o.method)&&(u.method="GET",u.body=void 0,u.headers.delete("content-length"));let l=hB(a);l&&(u.referrerPolicy=l),r(hq(new hR(s,u))),h();return}default:return n(TypeError(`Redirect option '${o.redirect}' is not a valid value of RequestRedirect`))}}l&&e.once("end",()=>{l.removeEventListener("abort",D)});let u=ed(e,new ea,e=>{e&&n(e)});process.version<"v12.10"&&e.on("aborted",D);let s={url:o.url,status:e.statusCode,statusText:e.statusMessage,headers:a,size:o.size,counter:o.counter,highWaterMark:o.highWaterMark},d=a.get("Content-Encoding");if(!o.compress||"HEAD"===o.method||null===d||204===e.statusCode||304===e.statusCode)return void r(c=new hF(u,s));let f={flush:eg.Z_SYNC_FLUSH,finishFlush:eg.Z_SYNC_FLUSH};if("gzip"===d||"x-gzip"===d)return void r(c=new hF(u=ed(u,eg.createGunzip(f),e=>{e&&n(e)}),s));if("deflate"===d||"x-deflate"===d){let t=ed(e,new ea,e=>{e&&n(e)});t.once("data",e=>{r(c=new hF(u=(15&e[0])==8?ed(u,eg.createInflate(),e=>{e&&n(e)}):ed(u,eg.createInflateRaw(),e=>{e&&n(e)}),s))}),t.once("end",()=>{c||r(c=new hF(u,s))});return}"br"===d?r(c=new hF(u=ed(u,eg.createBrotliDecompress(),e=>{e&&n(e)}),s)):r(c=new hF(u,s))}),hp(p,o).catch(n)})}function hH(e,t){let r=eD.from(`0\r
84
+ \r
85
+ `),n=!1,o=!1,a;e.on("response",e=>{let{headers:t}=e;n="chunked"===t["transfer-encoding"]&&!t["content-length"]}),e.on("socket",u=>{let s=pg(()=>{if(n&&!o){let e=Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",t(e)}},"onSocketClose"),l=pg(e=>{(o=0===eD.compare(e.slice(-5),r))||!a||(o=0===eD.compare(a.slice(-3),r.slice(0,3))&&0===eD.compare(e.slice(-2),r.slice(3))),a=e},"onData");u.prependListener("close",s),u.on("data",l),e.on("close",()=>{u.removeListener("close",s),u.removeListener("data",l)})})}pg(hq,"fetch$1"),pg(hH,"fixResponseChunkedTransferBadEnding");let hV=new WeakMap,hG=new WeakMap;function hZ(e){let t=hV.get(e);return console.assert(null!=t,"'this' is expected an Event object, but got",e),t}function hJ(e){if(null!=e.passiveListener){"u">typeof console&&"function"==typeof console.error&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener);return}e.event.cancelable&&(e.canceled=!0,"function"==typeof e.event.preventDefault&&e.event.preventDefault())}function hK(e,t){hV.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let r=Object.keys(t);for(let e=0;e<r.length;++e){let t=r[e];t in this||Object.defineProperty(this,t,hY(t))}}function hY(e){return{get(){return hZ(this).event[e]},set(t){hZ(this).event[e]=t},configurable:!0,enumerable:!0}}function hQ(e){return{value(){let t=hZ(this).event;return t[e].apply(t,arguments)},configurable:!0,enumerable:!0}}function hX(e,t){let r=Object.keys(t);if(0===r.length)return e;function n(t,r){e.call(this,t,r)}pg(n,"CustomEvent"),n.prototype=Object.create(e.prototype,{constructor:{value:n,configurable:!0,writable:!0}});for(let o=0;o<r.length;++o){let a=r[o];if(!(a in e.prototype)){let e="function"==typeof Object.getOwnPropertyDescriptor(t,a).value;Object.defineProperty(n.prototype,a,e?hQ(a):hY(a))}}return n}function h0(e){if(null==e||e===Object.prototype)return hK;let t=hG.get(e);return null==t&&(t=hX(h0(Object.getPrototypeOf(e)),e),hG.set(e,t)),t}function h2(e,t){return new(h0(Object.getPrototypeOf(t)))(e,t)}function h1(e){return hZ(e).immediateStopped}function h8(e,t){hZ(e).eventPhase=t}function h3(e,t){hZ(e).currentTarget=t}function h6(e,t){hZ(e).passiveListener=t}pg(hZ,"pd"),pg(hJ,"setCancelFlag"),pg(hK,"Event"),hK.prototype={get type(){return hZ(this).event.type},get target(){return hZ(this).eventTarget},get currentTarget(){return hZ(this).currentTarget},composedPath(){let e=hZ(this).currentTarget;return null==e?[]:[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return hZ(this).eventPhase},stopPropagation(){let e=hZ(this);e.stopped=!0,"function"==typeof e.event.stopPropagation&&e.event.stopPropagation()},stopImmediatePropagation(){let e=hZ(this);e.stopped=!0,e.immediateStopped=!0,"function"==typeof e.event.stopImmediatePropagation&&e.event.stopImmediatePropagation()},get bubbles(){return!!hZ(this).event.bubbles},get cancelable(){return!!hZ(this).event.cancelable},preventDefault(){hJ(hZ(this))},get defaultPrevented(){return hZ(this).canceled},get composed(){return!!hZ(this).event.composed},get timeStamp(){return hZ(this).timeStamp},get srcElement(){return hZ(this).eventTarget},get cancelBubble(){return hZ(this).stopped},set cancelBubble(i){if(!i)return;let e=hZ(this);e.stopped=!0,"boolean"==typeof e.event.cancelBubble&&(e.event.cancelBubble=!0)},get returnValue(){return!hZ(this).canceled},set returnValue(i){i||hJ(hZ(this))},initEvent(){}},Object.defineProperty(hK.prototype,"constructor",{value:hK,configurable:!0,writable:!0}),"u">typeof window&&"u">typeof window.Event&&(Object.setPrototypeOf(hK.prototype,window.Event.prototype),hG.set(window.Event.prototype,hK)),pg(hY,"defineRedirectDescriptor"),pg(hQ,"defineCallDescriptor"),pg(hX,"defineWrapper"),pg(h0,"getWrapper"),pg(h2,"wrapEvent"),pg(h1,"isStopped"),pg(h8,"setEventPhase"),pg(h3,"setCurrentTarget"),pg(h6,"setPassiveListener");let h9=new WeakMap;function h7(e){return null!==e&&"object"==typeof e}function h4(e){let t=h9.get(e);if(null==t)throw TypeError("'this' is expected an EventTarget object, but got another value.");return t}function h5(e){return{get(){let t=h4(this).get(e);for(;null!=t;){if(3===t.listenerType)return t.listener;t=t.next}return null},set(t){"function"==typeof t||h7(t)||(t=null);let r=h4(this),n=null,o=r.get(e);for(;null!=o;)3===o.listenerType?null!==n?n.next=o.next:null!==o.next?r.set(e,o.next):r.delete(e):n=o,o=o.next;if(null!==t){let o={listener:t,listenerType:3,passive:!1,once:!1,next:null};null===n?r.set(e,o):n.next=o}},configurable:!0,enumerable:!0}}function fe(e,t){Object.defineProperty(e,`on${t}`,h5(t))}function ft(e){function t(){fr.call(this)}pg(t,"CustomEventTarget"),t.prototype=Object.create(fr.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let r=0;r<e.length;++r)fe(t.prototype,e[r]);return t}function fr(){if(this instanceof fr)return void h9.set(this,new Map);if(1==arguments.length&&Array.isArray(arguments[0]))return ft(arguments[0]);if(arguments.length>0){let e=Array(arguments.length);for(let t=0;t<arguments.length;++t)e[t]=arguments[t];return ft(e)}throw TypeError("Cannot call a class as a function")}pg(h7,"isObject"),pg(h4,"getListeners"),pg(h5,"defineEventAttributeDescriptor"),pg(fe,"defineEventAttribute"),pg(ft,"defineCustomEventTarget"),pg(fr,"EventTarget"),fr.prototype={addEventListener(e,t,r){if(null==t)return;if("function"!=typeof t&&!h7(t))throw TypeError("'listener' should be a function or an object.");let n=h4(this),o=h7(r),a=(o?r.capture:r)?1:2,u={listener:t,listenerType:a,passive:o&&!!r.passive,once:o&&!!r.once,next:null},s=n.get(e);if(void 0===s)return void n.set(e,u);let l=null;for(;null!=s;){if(s.listener===t&&s.listenerType===a)return;l=s,s=s.next}l.next=u},removeEventListener(e,t,r){if(null==t)return;let n=h4(this),o=(h7(r)?r.capture:r)?1:2,a=null,u=n.get(e);for(;null!=u;){if(u.listener===t&&u.listenerType===o)return void(null!==a?a.next=u.next:null!==u.next?n.set(e,u.next):n.delete(e));a=u,u=u.next}},dispatchEvent(e){if(null==e||"string"!=typeof e.type)throw TypeError('"event.type" should be a string.');let t=h4(this),r=e.type,n=t.get(r);if(null==n)return!0;let o=h2(this,e),a=null;for(;null!=n;){if(n.once?null!==a?a.next=n.next:null!==n.next?t.set(r,n.next):t.delete(r):a=n,h6(o,n.passive?n.listener:null),"function"==typeof n.listener)try{n.listener.call(this,o)}catch(e){"u">typeof console&&"function"==typeof console.error&&console.error(e)}else 3!==n.listenerType&&"function"==typeof n.listener.handleEvent&&n.listener.handleEvent(o);if(h1(o))break;n=n.next}return h6(o,null),h8(o,0),h3(o,null),!o.defaultPrevented}},Object.defineProperty(fr.prototype,"constructor",{value:fr,configurable:!0,writable:!0}),"u">typeof window&&"u">typeof window.EventTarget&&Object.setPrototypeOf(fr.prototype,window.EventTarget.prototype);let fn=class extends fr{constructor(){throw super(),TypeError("AbortSignal cannot be constructed directly")}get aborted(){let e=fa.get(this);if("boolean"!=typeof e)throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return e}};function fi(){let e=Object.create(fn.prototype);return fr.call(e),fa.set(e,!1),e}function fo(e){!1===fa.get(e)&&(fa.set(e,!0),e.dispatchEvent({type:"abort"}))}pg(fn,"AbortSignal"),fe(fn.prototype,"abort"),pg(fi,"createAbortSignal"),pg(fo,"abortSignal");let fa=new WeakMap;Object.defineProperties(fn.prototype,{aborted:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(fn.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});let fu=(pg(pL=class{constructor(){fs.set(this,fi())}get signal(){return fl(this)}abort(){fo(fl(this))}},"AbortController"),pL),fs=new WeakMap;function fl(e){let t=fs.get(e);if(null==t)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${null===e?"null":typeof e}`);return t}pg(fl,"getSignal"),Object.defineProperties(fu.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(fu.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});var fc=Object.defineProperty,fd=pg((e,t)=>fc(e,"name",{value:t,configurable:!0}),"e");function fD(){globalThis.process?.versions?.node||globalThis.process?.env?.DISABLE_NODE_FETCH_NATIVE_WARN||console.warn("[node-fetch-native] Node.js compatible build of `node-fetch-native` is being used in a non-Node.js environment. Please make sure you are using proper export conditions or report this issue to https://github.com/unjs/node-fetch-native. You can set `process.env.DISABLE_NODE_FETCH_NATIVE_WARN` to disable this warning.")}fD(),pg(fD,"s"),fd(fD,"checkNodeEnvironment");let fp=!!globalThis.process?.env?.FORCE_NODE_FETCH,fh=!fp&&globalThis.fetch||hq,ff=!fp&&globalThis.Headers||hm,fm=!fp&&globalThis.AbortController||fu,fg=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,fb=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,fy=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function f_(e,t){var r;return"__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t?void(r=e,console.warn(`[destr] Dropping "${r}" key to prevent prototype pollution.`)):t}function fF(e,t={}){if("string"!=typeof e)return e;if('"'===e[0]&&'"'===e[e.length-1]&&-1===e.indexOf("\\"))return e.slice(1,-1);let r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return NaN;case"infinity":return 1/0;case"-infinity":return-1/0}if(!fy.test(e)){if(t.strict)throw SyntaxError("[destr] Invalid JSON");return e}try{if(fg.test(e)||fb.test(e)){if(t.strict)throw Error("[destr] Possible prototype pollution");return JSON.parse(e,f_)}return JSON.parse(e)}catch(r){if(t.strict)throw r;return e}}let fC=/#/g,fE=/&/g,fv=/\//g,fw=/=/g,fS=/\+/g,fA=/%5e/gi,fT=/%60/gi,fB=/%7c/gi,fx=/%20/gi;function fO(e){return encodeURI(""+("string"==typeof e?e:JSON.stringify(e))).replace(fB,"|").replace(fS,"%2B").replace(fx,"+").replace(fC,"%23").replace(fE,"%26").replace(fT,"`").replace(fA,"^").replace(fv,"%2F")}function f$(e){return fO(e).replace(fw,"%3D")}function fR(e=""){try{return decodeURIComponent(""+e)}catch{return""+e}}let fk=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,fP=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,fj=/^([/\\]\s*){2,}[^/\\]/,fI=/\/$|\/\?|\/#/,fz=/^\.?\//;function fL(e,t={}){return("boolean"==typeof t&&(t={acceptRelative:t}),t.strict)?fk.test(e):fP.test(e)||!!t.acceptRelative&&fj.test(e)}let fM=Symbol.for("ufo:protocolRelative");function fU(e=""){let[t="",r="",n=""]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:r,hash:n}}class fN extends Error{constructor(e,t){super(e,t),this.name="FetchError",t?.cause&&!this.cause&&(this.cause=t.cause)}}let fW=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function fq(e="GET"){return fW.has(e.toUpperCase())}let fH=new Set(["image/svg","application/xml","application/xhtml","application/html"]),fV=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;async function fG(e,t){if(t)if(Array.isArray(t))for(let r of t)await r(e);else await t(e)}let fZ=new Set([408,409,425,429,500,502,503,504]),fJ=new Set([101,204,205,304]),fK=function e(t={}){let{fetch:r=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:o=globalThis.AbortController}=t;async function a(e){let t=e.error&&"AbortError"===e.error.name&&!e.options.timeout||!1;if(!1!==e.options.retry&&!t){let t;t="number"==typeof e.options.retry?e.options.retry:+!fq(e.options.method);let r=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(r):fZ.has(r))){let r="function"==typeof e.options.retryDelay?e.options.retryDelay(e):e.options.retryDelay||0;return r>0&&await new Promise(e=>setTimeout(e,r)),u(e.request,{...e.options,retry:t-1})}}let r=function(e){let t=e.error?.message||e.error?.toString()||"",r=e.request?.method||e.options?.method||"GET",n=e.request?.url||String(e.request)||"/",o=`[${r}] ${JSON.stringify(n)}`,a=e.response?`${e.response.status} ${e.response.statusText}`:"<no response>",u=new fN(`${o}: ${a}${t?` ${t}`:""}`,e.error?{cause:e.error}:void 0);for(let t of["request","options","response"])Object.defineProperty(u,t,{get:()=>e[t]});for(let[t,r]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(u,t,{get:()=>e.response&&e.response[r]});return u}(e);throw Error.captureStackTrace&&Error.captureStackTrace(r,u),r}let u=async function(e,u={}){var s,l,c,d;let D,p,h,f={request:e,options:(s=t.defaults,h=function(e,t,r){if(!t)return new r(e);let n=new r(t);if(e)for(let[t,o]of Symbol.iterator in e||Array.isArray(e)?e:new r(e))n.set(t,o);return n}(u?.headers??e?.headers,s?.headers,n),(s?.query||s?.params||u?.params||u?.query)&&(p={...s?.params,...s?.query,...u?.params,...u?.query}),{...s,...u,query:p,params:p,headers:h}),response:void 0,error:void 0};if(f.options.method&&(f.options.method=f.options.method.toUpperCase()),f.options.onRequest&&(await fG(f,f.options.onRequest),f.options.headers instanceof n||(f.options.headers=new n(f.options.headers||{}))),"string"==typeof f.request){if(f.options.baseURL&&(f.request=function(e,t){var r;if(!(r=t)||"/"===r||fL(e))return e;let n=function(e=""){return(!function(e=""){return e.endsWith("/")}(e)?e:e.slice(0,-1))||"/"}(t);if(e.startsWith(n)){let t=e[n.length];if(!t||"/"===t||"?"===t)return e}return function(e,...t){let r=e||"";for(let e of t.filter(e=>e&&"/"!==e))if(r){let t=e.replace(fz,"");r=function(e=""){return e.endsWith("/")?e:e+"/"}(r)+t}else r=e;return r}(n,e)}(f.request,f.options.baseURL)),f.options.query){let e,t,r,n,o,a,u;l=f.request,c=f.options.query,t={...function(e=""){let t=Object.create(null);for(let r of("?"===e[0]&&(e=e.slice(1)),e.split("&"))){let e=r.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let n=fR(e[1].replace(fS," "));if("__proto__"===n||"constructor"===n)continue;let o=fR((e[2]||"").replace(fS," "));void 0===t[n]?t[n]=o:Array.isArray(t[n])?t[n].push(o):t[n]=[t[n],o]}return t}((e=function e(t="",r){let n=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=""]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:"",host:"",search:"",hash:""}}if(!fL(t,{acceptRelative:!0}))return r?e(r+t):fU(t);let[,o="",a,u=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,s="",l=""]=u.match(/([^#/?]*)(.*)?/)||[];"file:"===o&&(l=l.replace(/\/(?=[A-Za-z]:)/,""));let{pathname:c,search:d,hash:D}=fU(l);return{protocol:o.toLowerCase(),auth:a?a.slice(0,Math.max(0,a.length-1)):"",host:s,pathname:c,search:d,hash:D,[fM]:!o}}(l)).search),...c},e.search=Object.keys(t).filter(e=>void 0!==t[e]).map(e=>{var r;return(("number"==typeof(r=t[e])||"boolean"==typeof r)&&(r=String(r)),r)?Array.isArray(r)?r.map(t=>`${f$(e)}=${fO(t)}`).join("&"):`${f$(e)}=${fO(r)}`:f$(e)}).filter(Boolean).join("&"),r=(d=e).pathname||"",n=d.search?(d.search.startsWith("?")?"":"?")+d.search:"",o=d.hash||"",a=d.auth?d.auth+"@":"",u=d.host||"",f.request=(d.protocol||d[fM]?(d.protocol||"")+"//":"")+a+u+r+n+o,delete f.options.query}"query"in f.options&&delete f.options.query,"params"in f.options&&delete f.options.params}if(f.options.body&&fq(f.options.method))if(function(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!(e.buffer||e instanceof FormData||e instanceof URLSearchParams)&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}(f.options.body)){let e=f.options.headers.get("content-type");"string"!=typeof f.options.body&&(f.options.body="application/x-www-form-urlencoded"===e?new URLSearchParams(f.options.body).toString():JSON.stringify(f.options.body)),e||f.options.headers.set("content-type","application/json"),f.options.headers.has("accept")||f.options.headers.set("accept","application/json")}else("pipeTo"in f.options.body&&"function"==typeof f.options.body.pipeTo||"function"==typeof f.options.body.pipe)&&!("duplex"in f.options)&&(f.options.duplex="half");if(!f.options.signal&&f.options.timeout){let e=new o;D=setTimeout(()=>{let t=Error("[TimeoutError]: The operation was aborted due to timeout");t.name="TimeoutError",t.code=23,e.abort(t)},f.options.timeout),f.options.signal=e.signal}try{f.response=await r(f.request,f.options)}catch(e){return f.error=e,f.options.onRequestError&&await fG(f,f.options.onRequestError),await a(f)}finally{D&&clearTimeout(D)}if((f.response.body||f.response._bodyInit)&&!fJ.has(f.response.status)&&"HEAD"!==f.options.method){let e=(f.options.parseResponse?"json":f.options.responseType)||function(e=""){if(!e)return"json";let t=e.split(";").shift()||"";return fV.test(t)?"json":"text/event-stream"===t?"stream":fH.has(t)||t.startsWith("text/")?"text":"blob"}(f.response.headers.get("content-type")||"");switch(e){case"json":{let e=await f.response.text(),t=f.options.parseResponse||fF;f.response._data=t(e);break}case"stream":f.response._data=f.response.body||f.response._bodyInit;break;default:f.response._data=await f.response[e]()}}return(f.options.onResponse&&await fG(f,f.options.onResponse),!f.options.ignoreResponseError&&f.response.status>=400&&f.response.status<600)?(f.options.onResponseError&&await fG(f,f.options.onResponseError),await a(f)):f.response},s=async function(e,t){return(await u(e,t))._data};return s.raw=u,s.native=(...e)=>r(...e),s.create=(r={},n={})=>e({...t,...n,defaults:{...t.defaults,...n.defaults,...r}}),s}({fetch:globalThis.fetch?(...e)=>globalThis.fetch(...e):function(){if(!JSON.parse(process.env.FETCH_KEEP_ALIVE||"false"))return fh;let e={keepAlive:!0},t=new ef.Agent(e),r=new em.Agent(e),n={agent:e=>"http:"===e.protocol?t:r};return function(e,t){return fh(e,{...n,...t})}}(),Headers:globalThis.Headers||ff,AbortController:globalThis.AbortController||fm}),fY=[{agent:"codex",name:"CODEX_THREAD_ID",source:"openai/codex"},{agent:"codex",name:"CODEX_SESSION_ID",source:"openai/codex"},{agent:"claude-code",name:"CLAUDECODE",source:"Claude Code docs"},{agent:"gemini-cli",name:"GEMINI_CLI",source:"Gemini CLI docs"},{agent:"cursor",name:"CURSOR_AGENT",source:"Cursor docs"},{agent:"doubao",name:"DOUBAO_SANDBOX_TYPE",source:"Doubao sandbox environment"}],fQ=["SaaS","Local"],fX=`${process.env.DBX_BUILD_API_BASE_URL||Dg.apiUrl}/platform/api/v1`,f0=fK.create({baseURL:fX,headers:{...Dg.apiHeaders,...function({compatXTTEnv:e=!0}={}){let t=process.env[pl],r=process.env[pc];void 0!==t&&void 0!==r&&console.warn(`${pl} 与 ${pc} 同时设置,将使用 ${pl} 并忽略 ${pc}`);let n=void 0!==t?pD(t,pl):r?pD(r,pc):{};return e&&process.env.X_TT_ENV&&(n["x-tt-env"]=process.env.X_TT_ENV,n["x-use-ppe"]="1"),n}(),...function(e=process.env){let t=function(e=process.env){for(let{agent:t,name:r}of fY){let n=e[r];if("string"==typeof n&&n.length>0)return t}}(e);return t?{"X-CLI-Agent":t}:{}}(),...function(e=process.env){let t=function(e=process.env){let t=e.DOUBAO_SANDBOX_TYPE?.trim();if(t)return fQ.find(e=>e.toLowerCase()===t.toLowerCase())??void 0}(e);return t?{"x-doubao-sandbox-type":t}:{}}()},method:"GET",timeout:3e4,retry:0,redirect:"error",responseType:"json",ignoreResponseError:!0,async onRequest({request:e,options:t}){let r="string"==typeof e?new URL(e,t.baseURL):e;t.headers=await function(e,t,r={}){return po(e,t,DF(r))}(r,t.headers,{baseUrl:t.baseURL}),t.signal&&t.timeout&&(t.signal=AbortSignal.any([t.signal,AbortSignal.timeout(t.timeout)]))},onResponse({response:e}){let t=e._data;if(!e.ok||t?.code!==0){let r=t?.msg||t?.message||t?.statusText||`接口请求失败(HTTP ${e.status})`,n=[];throw e.headers.has("x-tt-logid")&&n.push(`请求日志 ID:${e.headers.get("x-tt-logid")}`),Error([r,"",...n].join("\n"))}e._data=t.data}});async function f2(e,t){let r=await f0(`/app_developer/check_api/apps/${encodeURIComponent(e.appKey)}/debug/ticket`,{baseURL:Dg.deviceApiUrl,method:"POST",signal:t,body:{debug_context:JSON.stringify({appletName:e.appKey,appletHost:e.hostUrl,appletType:0,isSigned:!1,isEncrypted:!1,defaultDebugTagState:!0,wifiConnectUrl:e.wifiConnectUrl,...e.versionTag?{versionTag:e.versionTag}:{}})}}),n=new d1({type:"object",shape:{debug_token:dB().trim().min(1),encrypted_debug_payload:dB().trim().min(1)}??{},...lD(void 0)}).parse(r);return{debugToken:n.debug_token,qrCodeValue:JSON.stringify({action:"start_real_device_debug",...n})}}function f1(e,t){return f0("/devtool/plugin-mini-app-base-info",{query:{...e},signal:t})}function f8(e,t,r){return f0("/devtool/plugin-package-uploads",{method:"POST",query:{file_name:e},headers:{"Content-Type":"application/zip"},body:t,signal:r})}function f3(e){return f0("/devtool/plugin-material-validations",{method:"POST",body:e})}function f6(){return f0("/devtool/plugin-categories")}function f9(e){return f0("/devtool/plugin-drafts",{query:{name:e}})}function f7(e){return f0("/devtool/plugin-drafts",{method:"POST",body:e,timeout:6e4})}function f4(e){return f0("/devtool/plugin-versions",{method:"POST",body:e})}function f5(e,t){return f0("/devtool/plugin-versions",{query:{...e},signal:t})}function me(e,t){return f0("/devtool/plugin-versions/build-status",{query:{...e},signal:t})}function mt(e,t){return f0("/devtool/plugin-previews",{method:"POST",body:e,signal:t})}function mr(e,t){return f0("/devtool/plugin-operations",{method:"POST",body:e,signal:t})}function mn(e,t){return f0("/devtool/plugin-approvals/submit",{method:"POST",body:{name:e,version:t}})}function mi(e){return f0("/devtool/plugin-approvals/withdraw",{method:"POST",body:{approval_id:e}})}function mo(e){return f0("/devtool/plugin-approvals/get",{method:"POST",body:{approval_id:e}})}let ma="plugin.json",mu="mcp.json",ms="SKILL.md",ml="manifest.yaml",mc="com.doubao/app",md=["dist","node_modules/.doubao"],mD=[".git",".dbx","node_modules"],mp=[".gitkeep",".gitignore",".DS_Store"],mh="templates",mf="standard",mm=".template",mg="__PLUGIN_NAME__",mb="doubao-plugin-cli",my="doubao-plugin-app",m_=eC("../../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"),mF=eC("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"),mC=function({onlyFirst:e=!1}={}){return RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))",e?void 0:"g")}();function mE(e){if("string"!=typeof e)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(mC,"")}function mv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mw={exports:{}},mS={};function mA(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}mw.exports=mS,mS.eastAsianWidth=function(e){var t=e.charCodeAt(0),r=2==e.length?e.charCodeAt(1):0,n=t;return 55296<=t&&t<=56319&&56320<=r&&r<=57343&&(t&=1023,r&=1023,n=(t<<10|r)+65536),12288==n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361==n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172==n||175==n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161==n||164==n||167<=n&&n<=168||170==n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198==n||208==n||215<=n&&n<=216||222<=n&&n<=225||230==n||232<=n&&n<=234||236<=n&&n<=237||240==n||242<=n&&n<=243||247<=n&&n<=250||252==n||254==n||257==n||273==n||275==n||283==n||294<=n&&n<=295||299==n||305<=n&&n<=307||312==n||319<=n&&n<=322||324==n||328<=n&&n<=331||333==n||338<=n&&n<=339||358<=n&&n<=359||363==n||462==n||464==n||466==n||468==n||470==n||472==n||474==n||476==n||593==n||609==n||708==n||711==n||713<=n&&n<=715||717==n||720==n||728<=n&&n<=731||733==n||735==n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025==n||1040<=n&&n<=1103||1105==n||8208==n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240==n||8242<=n&&n<=8243||8245==n||8251==n||8254==n||8308==n||8319==n||8321<=n&&n<=8324||8364==n||8451==n||8453==n||8457==n||8467==n||8470==n||8481<=n&&n<=8482||8486==n||8491==n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585==n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658==n||8660==n||8679==n||8704==n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715==n||8719==n||8721==n||8725==n||8730==n||8733<=n&&n<=8736||8739==n||8741==n||8743<=n&&n<=8748||8750==n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776==n||8780==n||8786==n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853==n||8857==n||8869==n||8895==n||8978==n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675==n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711==n||9733<=n&&n<=9734||9737==n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756==n||9758==n||9792==n||9794==n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839==n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955==n||9960<=n&&n<=9983||10045==n||10071==n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533==n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"},mS.characterLength=function(e){var t=this.eastAsianWidth(e);return"F"==t||"W"==t||"A"==t?2:1},mS.length=function(e){for(var t=mA(e),r=0,n=0;n<t.length;n++)r+=this.characterLength(t[n]);return r},mS.slice=function(e,t,r){textLen=mS.length(e),r=r||1,(t=t||0)<0&&(t=textLen+t),r<0&&(r=textLen+r);for(var n="",o=0,a=mA(e),u=0;u<a.length;u++){var s=a[u],l=mS.length(s);if(o>=t-(2==l))if(o+l<=r)n+=s;else break;o+=l}return n};let mT=mv(mw.exports),mB=mv(function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g});function mx(e,t={}){if("string"!=typeof e||0===e.length||(t={ambiguousIsNarrow:!0,...t},0===(e=mE(e)).length))return 0;e=e.replace(mB()," ");let r=t.ambiguousIsNarrow?1:2,n=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31)&&(!(e>=127)||!(e<=159))&&(!(e>=768)||!(e<=879)))switch(mT.eastAsianWidth(t)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}let mO=(e=0)=>t=>`\x1b[${t+e}m`,m$=(e=0)=>t=>`\x1b[${38+e};5;${t}m`,mR=(e=0)=>(t,r,n)=>`\x1b[${38+e};2;${t};${r};${n}m`,mk={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(mk.modifier),[...Object.keys(mk.color),...Object.keys(mk.bgColor)];let mP=function(){let e=new Map;for(let[t,r]of Object.entries(mk)){for(let[t,n]of Object.entries(r))mk[t]={open:`\x1b[${n[0]}m`,close:`\x1b[${n[1]}m`},r[t]=mk[t],e.set(n[0],n[1]);Object.defineProperty(mk,t,{value:r,enumerable:!1})}return Object.defineProperty(mk,"codes",{value:e,enumerable:!1}),mk.color.close="\x1b[39m",mk.bgColor.close="\x1b[49m",mk.color.ansi=mO(),mk.color.ansi256=m$(),mk.color.ansi16m=mR(),mk.bgColor.ansi=mO(10),mk.bgColor.ansi256=m$(10),mk.bgColor.ansi16m=mR(10),Object.defineProperties(mk,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;3===r.length&&(r=[...r].map(e=>e+e).join(""));let n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},enumerable:!1},hexToAnsi256:{value:e=>mk.rgbToAnsi256(...mk.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{let t,r,n;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)r=t=((e-232)*10+8)/255,n=t;else{let o=(e-=16)%36;t=Math.floor(e/36)/5,r=Math.floor(o/6)/5,n=o%6/5}let o=2*Math.max(t,r,n);if(0===o)return 30;let a=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return 2===o&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>mk.ansi256ToAnsi(mk.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>mk.ansi256ToAnsi(mk.hexToAnsi256(e)),enumerable:!1}}),mk}(),mj=new Set(["\x1b","\x9b"]),mI="]8;;",mz=e=>`${mj.values().next().value}[${e}m`,mL=e=>`${mj.values().next().value}${mI}${e}\x07`,mM=(e,t,r)=>{let n=[...t],o=!1,a=!1,u=mx(mE(e[e.length-1]));for(let[t,s]of n.entries()){let l=mx(s);if(u+l<=r?e[e.length-1]+=s:(e.push(s),u=0),mj.has(s)&&(o=!0,a=n.slice(t+1).join("").startsWith(mI)),o){a?"\x07"===s&&(o=!1,a=!1):"m"===s&&(o=!1);continue}(u+=l)===r&&t<n.length-1&&(e.push(""),u=0)}!u&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())};function mU(e,t,r){return String(e).normalize().replace(/\r\n/g,`
86
+ `).split(`
87
+ `).map(e=>((e,t,r={})=>{if(!1!==r.trim&&""===e.trim())return"";let n="",o,a,u=e.split(" ").map(e=>mx(e)),s=[""];for(let[n,o]of e.split(" ").entries()){!1!==r.trim&&(s[s.length-1]=s[s.length-1].trimStart());let e=mx(s[s.length-1]);if(0!==n&&(e>=t&&(!1===r.wordWrap||!1===r.trim)&&(s.push(""),e=0),(e>0||!1===r.trim)&&(s[s.length-1]+=" ",e++)),r.hard&&u[n]>t){let r=t-e,a=1+Math.floor((u[n]-r-1)/t);Math.floor((u[n]-1)/t)<a&&s.push(""),mM(s,o,t);continue}if(e+u[n]>t&&e>0&&u[n]>0){if(!1===r.wordWrap&&e<t){mM(s,o,t);continue}s.push("")}if(e+u[n]>t&&!1===r.wordWrap){mM(s,o,t);continue}s[s.length-1]+=o}!1!==r.trim&&(s=s.map(e=>(e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(mx(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")})(e)));let l=[...s.join(`
88
+ `)];for(let[e,t]of l.entries()){if(n+=t,mj.has(t)){let{groups:t}=RegExp(`(?:\\[(?<code>\\d+)m|\\${mI}(?<uri>.*)\x07)`).exec(l.slice(e).join(""))||{groups:{}};if(void 0!==t.code){let e=Number.parseFloat(t.code);o=39===e?void 0:e}else void 0!==t.uri&&(a=0===t.uri.length?void 0:t.uri)}let r=mP.codes.get(Number(o));l[e+1]===`
89
+ `?(a&&(n+=mL("")),o&&r&&(n+=mz(r))):t===`
90
+ `&&(o&&r&&(n+=mz(o)),a&&(n+=mL(a)))}return n})(e,t,r)).join(`
91
+ `)}let mN={actions:new Set(["up","down","left","right","space","enter","cancel"]),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};globalThis.process.platform.startsWith("win");let mW=Symbol("clack:cancel");function mq(e){return e===mW}function mH(e,t){e.isTTY&&e.setRawMode(t)}var mV=Object.defineProperty,mG=(e,t,r)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?mV(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,r};class mZ{constructor(e,t=!0){mG(this,"input"),mG(this,"output"),mG(this,"_abortSignal"),mG(this,"rl"),mG(this,"opts"),mG(this,"_render"),mG(this,"_track",!1),mG(this,"_prevFrame",""),mG(this,"_subscribers",new Map),mG(this,"_cursor",0),mG(this,"state","initial"),mG(this,"error",""),mG(this,"value");let{input:r=P,output:n=j,render:o,signal:a,...u}=e;this.opts=u,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=t,this._abortSignal=a,this.input=r,this.output=n}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let r=this._subscribers.get(e)??[];r.push(t),this._subscribers.set(e,r)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let r=this._subscribers.get(e)??[],n=[];for(let e of r)e.cb(...t),e.once&&n.push(()=>r.splice(r.indexOf(e),1));for(let e of n)e()}prompt(){return new Promise((e,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(mW);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let r=new el;r._write=(e,t,r)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),r()},this.input.pipe(r),this.rl=ey.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),ey.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),void 0!==this.opts.initialValue&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),mH(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(m_.cursor.show),this.output.off("resize",this.render),mH(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(m_.cursor.show),this.output.off("resize",this.render),mH(this.input,!1),e(mW)})})}onKeypress(e,t){if("error"===this.state&&(this.state="active"),t?.name&&(!this._track&&mN.aliases.has(t.name)&&this.emit("cursor",mN.aliases.get(t.name)),mN.actions.has(t.name)&&this.emit("cursor",t.name)),e&&("y"===e.toLowerCase()||"n"===e.toLowerCase())&&this.emit("confirm","y"===e.toLowerCase())," "===e&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),t?.name==="return"){if(this.opts.validate){let e=this.opts.validate(this.value);e&&(this.error=e instanceof Error?e.message:e,this.state="error",this.rl?.write(this.value))}"error"!==this.state&&(this.state="submit")}(function e(t,r){if("string"==typeof t)return mN.aliases.get(t)===r;for(let n of t)if(void 0!==n&&e(n,r))return!0;return!1})([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),("submit"===this.state||"cancel"===this.state)&&this.emit("finalize"),this.render(),("submit"===this.state||"cancel"===this.state)&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
92
+ `),mH(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=mU(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
93
+ `).length-1;this.output.write(m_.cursor.move(-999,-1*e))}render(){let e=mU(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if("initial"===this.state)this.output.write(m_.cursor.hide);else{let t=function(e,t){if(e===t)return;let r=e.split(`
94
+ `),n=t.split(`
95
+ `),o=[];for(let e=0;e<Math.max(r.length,n.length);e++)r[e]!==n[e]&&o.push(e);return o}(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let r=t[0];this.output.write(m_.cursor.move(0,r)),this.output.write(m_.erase.lines(1));let n=e.split(`
96
+ `);this.output.write(n[r]),this._prevFrame=e,this.output.write(m_.cursor.move(0,n.length-r-1));return}if(t&&t?.length>1){let r=t[0];this.output.write(m_.cursor.move(0,r)),this.output.write(m_.erase.down());let n=e.split(`
97
+ `).slice(r);this.output.write(n.join(`
98
+ `)),this._prevFrame=e;return}this.output.write(m_.erase.down())}this.output.write(e),"initial"===this.state&&(this.state="active"),this._prevFrame=e}}}class mJ extends mZ{get cursor(){return+!this.value}get _value(){return 0===this.cursor}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",e=>{this.output.write(m_.cursor.move(0,-1)),this.value=e,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}new WeakMap;var mK=Object.defineProperty,mY=(e,t,r)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?mK(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,r};class mQ extends mZ{constructor(e){super(e,!1),mY(this,"options"),mY(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),-1===this.cursor&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=0===this.cursor?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}class mX extends mZ{get valueWithCursor(){if("submit"===this.state)return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[t,...r]=this.value.slice(this.cursor);return`${e}${mF.inverse(t)}${r.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}}let m0="win32"!==x.platform?"linux"!==x.env.TERM:!!x.env.CI||!!x.env.WT_SESSION||!!x.env.TERMINUS_SUBLIME||"{cmd::Cmder}"===x.env.ConEmuTask||"Terminus-Sublime"===x.env.TERM_PROGRAM||"vscode"===x.env.TERM_PROGRAM||"xterm-256color"===x.env.TERM||"alacritty"===x.env.TERM||"JetBrains-JediTerm"===x.env.TERMINAL_EMULATOR,m2=(e,t)=>m0?e:t,m1=m2("◆","*"),m8=m2("■","x"),m3=m2("▲","x"),m6=m2("◇","o"),m9=m2("│","|"),m7=m2("└","—"),m4=m2("●",">"),m5=m2("○"," "),ge=m2("●","•"),gt=m2("◆","*"),gr=m2("▲","!"),gn=m2("■","x"),gi=e=>{switch(e){case"initial":case"active":return mF.cyan(m1);case"cancel":return mF.red(m8);case"error":return mF.yellow(m3);case"submit":return mF.green(m6)}},go=e=>new mX({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,render(){let t=`${mF.gray(m9)}
99
+ ${gi(this.state)} ${e.message}
100
+ `,r=e.placeholder?mF.inverse(e.placeholder[0])+mF.dim(e.placeholder.slice(1)):mF.inverse(mF.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${t.trim()}
101
+ ${mF.yellow(m9)} ${n}
102
+ ${mF.yellow(m7)} ${mF.yellow(this.error)}
103
+ `;case"submit":return`${t}${mF.gray(m9)} ${mF.dim(this.value||e.placeholder)}`;case"cancel":return`${t}${mF.gray(m9)} ${mF.strikethrough(mF.dim(this.value??""))}${this.value?.trim()?`
104
+ ${mF.gray(m9)}`:""}`;default:return`${t}${mF.cyan(m9)} ${n}
105
+ ${mF.cyan(m7)}
106
+ `}}}).prompt(),ga=e=>{let t=e.active??"Yes",r=e.inactive??"No";return new mJ({active:t,inactive:r,initialValue:e.initialValue??!0,render(){let n=`${mF.gray(m9)}
107
+ ${gi(this.state)} ${e.message}
108
+ `,o=this.value?t:r;switch(this.state){case"submit":return`${n}${mF.gray(m9)} ${mF.dim(o)}`;case"cancel":return`${n}${mF.gray(m9)} ${mF.strikethrough(mF.dim(o))}
109
+ ${mF.gray(m9)}`;default:return`${n}${mF.cyan(m9)} ${this.value?`${mF.green(m4)} ${t}`:`${mF.dim(m5)} ${mF.dim(t)}`} ${mF.dim("/")} ${this.value?`${mF.dim(m5)} ${mF.dim(r)}`:`${mF.green(m4)} ${r}`}
110
+ ${mF.cyan(m7)}
111
+ `}}}).prompt()},gu=e=>{let t=(e,t)=>{let r=e.label??String(e.value);switch(t){case"selected":return`${mF.dim(r)}`;case"active":return`${mF.green(m4)} ${r} ${e.hint?mF.dim(`(${e.hint})`):""}`;case"cancelled":return`${mF.strikethrough(mF.dim(r))}`;default:return`${mF.dim(m5)} ${mF.dim(r)}`}};return new mQ({options:e.options,initialValue:e.initialValue,render(){let r=`${mF.gray(m9)}
112
+ ${gi(this.state)} ${e.message}
113
+ `;switch(this.state){case"submit":return`${r}${mF.gray(m9)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${mF.gray(m9)} ${t(this.options[this.cursor],"cancelled")}
114
+ ${mF.gray(m9)}`;default:return`${r}${mF.cyan(m9)} ${(e=>{let{cursor:t,options:r,style:n}=e,o=e.maxItems??1/0,a=Math.min(Math.max(process.stdout.rows-4,0),Math.max(o,5)),u=0;t>=0+a-3?u=Math.max(Math.min(t-a+3,r.length-a),0):t<u+2&&(u=Math.max(t-2,0));let s=a<r.length&&u>0,l=a<r.length&&u+a<r.length;return r.slice(u,u+a).map((e,r,o)=>{let a=r===o.length-1&&l;return 0===r&&s||a?mF.dim("..."):n(e,r+u===t)})})({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,r)=>t(e,r?"active":"inactive")}).join(`
115
+ ${mF.cyan(m9)} `)}
116
+ ${mF.cyan(m7)}
117
+ `}}}).prompt()},gs=(e="")=>{process.stdout.write(`${mF.gray(m7)} ${mF.red(e)}
118
+
119
+ `)},gl={message:(e="",{symbol:t=mF.gray(m9)}={})=>{let r=[`${mF.gray(m9)}`];if(e){let[n,...o]=e.split(`
120
+ `);r.push(`${t} ${n}`,...o.map(e=>`${mF.gray(m9)} ${e}`))}process.stdout.write(`${r.join(`
121
+ `)}
122
+ `)},info:e=>{gl.message(e,{symbol:mF.blue(ge)})},success:e=>{gl.message(e,{symbol:mF.green(gt)})},step:e=>{gl.message(e,{symbol:mF.green(m6)})},warn:e=>{gl.message(e,{symbol:mF.yellow(gr)})},warning:e=>{gl.warn(e)},error:e=>{gl.message(e,{symbol:mF.red(gn)})}};function gc(){return!!(process.stdin.isTTY&&process.stdout.isTTY)}function gd(e){console.log(W(e))}function gD(e){console.error(W(e))}mF.gray(m9);let gp=gc()?gl:{info:gd,step:gd,success:gd,warn:gD,error:gD},gh=(e=0)=>t=>`\u001B[${t+e}m`,gf=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,gm=(e=0)=>(t,r,n)=>`\u001B[${38+e};2;${t};${r};${n}m`,gg={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(gg.modifier),[...Object.keys(gg.color),...Object.keys(gg.bgColor)];let gb=function(){let e=new Map;for(let[t,r]of Object.entries(gg)){for(let[t,n]of Object.entries(r))gg[t]={open:`\u001B[${n[0]}m`,close:`\u001B[${n[1]}m`},r[t]=gg[t],e.set(n[0],n[1]);Object.defineProperty(gg,t,{value:r,enumerable:!1})}return Object.defineProperty(gg,"codes",{value:e,enumerable:!1}),gg.color.close="\x1b[39m",gg.bgColor.close="\x1b[49m",gg.color.ansi=gh(),gg.color.ansi256=gf(),gg.color.ansi16m=gm(),gg.bgColor.ansi=gh(10),gg.bgColor.ansi256=gf(10),gg.bgColor.ansi16m=gm(10),Object.defineProperties(gg,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;3===r.length&&(r=[...r].map(e=>e+e).join(""));let n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},enumerable:!1},hexToAnsi256:{value:e=>gg.rgbToAnsi256(...gg.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){let t,r,n;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)r=t=((e-232)*10+8)/255,n=t;else{let o=(e-=16)%36;t=Math.floor(e/36)/5,r=Math.floor(o/6)/5,n=o%6/5}let o=2*Math.max(t,r,n);if(0===o)return 30;let a=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return 2===o&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>gg.ansi256ToAnsi(gg.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>gg.ansi256ToAnsi(gg.hexToAnsi256(e)),enumerable:!1}}),gg}();function gy(e,t=globalThis.Deno?globalThis.Deno.args:x.argv){let r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return -1!==n&&(-1===o||n<o)}let{env:g_}=x;function gF(t,r={}){var n;return 0!==(n=function(t,{streamIsTTY:r,sniffFlags:n=!0}={}){let o=function(){if("FORCE_COLOR"in g_)return"true"===g_.FORCE_COLOR?1:"false"===g_.FORCE_COLOR?0:0===g_.FORCE_COLOR.length?1:Math.min(Number.parseInt(g_.FORCE_COLOR,10),3)}();void 0!==o&&(e=o);let a=n?e:o;if(0===a)return 0;if(n){if(gy("color=16m")||gy("color=full")||gy("color=truecolor"))return 3;if(gy("color=256"))return 2}if("TF_BUILD"in g_&&"AGENT_NAME"in g_)return 1;if(t&&!r&&void 0===a)return 0;let u=a||0;if("dumb"===g_.TERM)return u;if("win32"===x.platform){let e=ee.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in g_)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(e=>e in g_)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in g_)||"codeship"===g_.CI_NAME?1:u;if("TEAMCITY_VERSION"in g_)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(g_.TEAMCITY_VERSION);if("truecolor"===g_.COLORTERM||"xterm-kitty"===g_.TERM||"xterm-ghostty"===g_.TERM||"wezterm"===g_.TERM)return 3;if("TERM_PROGRAM"in g_){let e=Number.parseInt((g_.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(g_.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(g_.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(g_.TERM)||"COLORTERM"in g_?1:u}(t,{streamIsTTY:t&&t.isTTY,...r}))&&{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}gy("no-color")||gy("no-colors")||gy("color=false")||gy("color=never")?e=0:(gy("color")||gy("colors")||gy("color=true")||gy("color=always"))&&(e=1);let{stdout:gC,stderr:gE}={stdout:gF({isTTY:K.isatty(1)}),stderr:gF({isTTY:K.isatty(2)})},gv=Symbol("GENERATOR"),gw=Symbol("STYLER"),gS=Symbol("IS_EMPTY"),gA=["ansi","ansi","ansi256","ansi16m"],gT=Object.create(null);function gB(e){let t;return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let r=gC?gC.level:0;e.level=void 0===t.level?r:t.level})(t=(...e)=>e.join(" "),e),Object.setPrototypeOf(t,gB.prototype),t}for(let[e,t]of(Object.setPrototypeOf(gB.prototype,Function.prototype),Object.entries(gb)))gT[e]={get(){let r=gR(this,g$(t.open,t.close,this[gw]),this[gS]);return Object.defineProperty(this,e,{value:r}),r}};gT.visible={get(){let e=gR(this,this[gw],!0);return Object.defineProperty(this,"visible",{value:e}),e}};let gx=(e,t,r,...n)=>"rgb"===e?"ansi16m"===t?gb[r].ansi16m(...n):"ansi256"===t?gb[r].ansi256(gb.rgbToAnsi256(...n)):gb[r].ansi(gb.rgbToAnsi(...n)):"hex"===e?gx("rgb",t,r,...gb.hexToRgb(...n)):gb[r][e](...n);for(let e of["rgb","hex","ansi256"])gT[e]={get(){let{level:t}=this;return function(...r){return gR(this,g$(gx(e,gA[t],"color",...r),gb.color.close,this[gw]),this[gS])}}},gT["bg"+e[0].toUpperCase()+e.slice(1)]={get(){let{level:t}=this;return function(...r){return gR(this,g$(gx(e,gA[t],"bgColor",...r),gb.bgColor.close,this[gw]),this[gS])}}};let gO=Object.defineProperties(()=>{},{...gT,level:{enumerable:!0,get(){return this[gv].level},set(e){this[gv].level=e}}}),g$=(e,t,r)=>{let n,o;return void 0===r?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},gR=(e,t,r)=>{let n=(...e)=>gk(n,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(n,gO),n[gv]=e,n[gw]=t,n[gS]=r,n},gk=(e,t)=>{if(e.level<=0||!t)return e[gS]?"":t;let r=e[gw];if(void 0===r)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1b"))for(;void 0!==r;)t=function(e,t,r){let n=e.indexOf(t);if(-1===n)return e;let o=t.length,a=0,u="";do u+=e.slice(a,n)+t+r,a=n+o,n=e.indexOf(t,a);while(-1!==n);return u+e.slice(a)}(t,r.close,r.open),r=r.parent;let a=t.indexOf("\n");return -1!==a&&(t=function(e,t,r,n){let o=0,a="";do{let u="\r"===e[n-1];a+=e.slice(o,u?n-1:n)+t+(u?"\r\n":"\n")+r,o=n+1,n=e.indexOf("\n",o)}while(-1!==n);return a+e.slice(o)}(t,o,n,a)),n+t+o};Object.defineProperties(gB.prototype,gT);let gP=gB();gB({level:gE?gE.level:0});let gj=gP,gI=(e,t,r,n)=>{if("length"===r||"prototype"===r||"arguments"===r||"caller"===r)return;let o=Object.getOwnPropertyDescriptor(e,r),a=Object.getOwnPropertyDescriptor(t,r);(gz(o,a)||!n)&&Object.defineProperty(e,r,a)},gz=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},gL=(e,t)=>`/* Wrapped ${e}*/
123
+ ${t}`,gM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),gU=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),gN=new WeakMap,gW=(e,t={})=>{let r;if("function"!=typeof e)throw TypeError("Expected a function");let n=0,o=e.displayName||e.name||"<anonymous>",a=function(...u){if(gN.set(a,++n),1===n)r=e.apply(this,u),e=void 0;else if(!0===t.throw)throw Error(`Function \`${o}\` can only be called once`);return r};return!function(e,t,{ignoreNonConfigurable:r=!1}={}){let n,{name:o}=e;for(let n of Reflect.ownKeys(t))gI(e,t,n,r);(n=Object.getPrototypeOf(t))!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n),((e,t,r)=>{let n=""===r?"":`with ${r.trim()}() `,o=gL.bind(null,n,t.toString());Object.defineProperty(o,"name",gU);let{writable:a,enumerable:u,configurable:s}=gM;Object.defineProperty(e,"toString",{value:o,writable:a,enumerable:u,configurable:s})})(e,t,o)}(a,e),gN.set(a,n),a};gW.callCount=e=>{if(!gN.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return gN.get(e)};let gq=x.stderr.isTTY?x.stderr:x.stdout.isTTY?x.stdout:void 0,gH=gq?gW(()=>{ui(()=>{gq.write("\x1b[?25h")},{alwaysLast:!0})}):()=>{},gV=!1,gG={};gG.show=(e=x.stderr)=>{e.isTTY&&(gV=!1,e.write("\x1b[?25h"))},gG.hide=(e=x.stderr)=>{e.isTTY&&(gH(),gV=!0,e.write("\x1b[?25l"))},gG.toggle=(e,t)=>{void 0!==e&&(gV=e),gV?gG.show(t):gG.hide(t)};let gZ={info:gj.blue("ℹ"),success:gj.green("✔"),warning:gj.yellow("⚠"),error:gj.red("✖")},gJ={info:gj.blue("i"),success:gj.green("√"),warning:gj.yellow("‼"),error:gj.red("\xd7")},gK=("win32"!==x.platform?"linux"!==x.env.TERM:x.env.CI||x.env.WT_SESSION||x.env.TERMINUS_SUBLIME||"{cmd::Cmder}"===x.env.ConEmuTask||"Terminus-Sublime"===x.env.TERM_PROGRAM||"vscode"===x.env.TERM_PROGRAM||"xterm-256color"===x.env.TERM||"alacritty"===x.env.TERM||"JetBrains-JediTerm"===x.env.TERMINAL_EMULATOR)?gZ:gJ,gY=function({onlyFirst:e=!1}={}){return RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",e?void 0:"g")}();function gQ(e){if("string"!=typeof e)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(gY,"")}let gX=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],g0=[12288,12288,65281,65376,65504,65510],g2=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101594,101631,101664,101760,101874,101888,102801,102816,102866,110576,110579,110581,110587,110589,110590,110592,110888,110898,110898,110928,110930,110933,110933,110948,110952,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127406,127406,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128729,128732,128735,128747,128748,128756,128764,128986,128986,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129734,129736,129736,129740,129757,129759,129771,129775,129786,131072,196605,196608,262141],g1=(e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){let o=Math.floor((r+n)/2),a=2*o;if(t<e[a])n=o-1;else{if(!(t>e[a+1]))return!0;r=o+1}}return!1},[g8,g3]=function(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){let o=e[n],a=e[n+1];if(19968>=o&&19968<=a)return[o,a];a-o>r-t&&(t=o,r=a)}return[t,r]}(g2),g6=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,g9=new Intl.Segmenter,g7=/^\p{Default_Ignorable_Code_Point}$/u,g4=new class{#F=0;start(){this.#F++,1===this.#F&&this.#C()}stop(){if(this.#F<=0)throw Error("`stop` called more times than `start`");this.#F--,0===this.#F&&this.#E()}#C(){"win32"!==x.platform&&x.stdin.isTTY&&(x.stdin.setRawMode(!0),x.stdin.on("data",this.#v),x.stdin.resume())}#E(){x.stdin.isTTY&&(x.stdin.off("data",this.#v),x.stdin.pause(),x.stdin.setRawMode(!1))}#v(e){3===e[0]&&x.emit("SIGINT")}},g5=eC("../../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/index.js");class be{#w=0;#S=!1;#A=0;#T=0;#B;#x;#O;#$;#R;#k;#P;#j;#I;#z;#L;color;constructor(e){"string"==typeof e&&(e={text:e}),this.#B={color:"cyan",stream:x.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#B.color,this.spinner=this.#B.spinner,this.#R=this.#B.interval,this.#O=this.#B.stream,this.#k="boolean"==typeof this.#B.isEnabled?this.#B.isEnabled:function({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}({stream:this.#O}),this.#P="boolean"==typeof this.#B.isSilent&&this.#B.isSilent,this.text=this.#B.text,this.prefixText=this.#B.prefixText,this.suffixText=this.#B.suffixText,this.indent=this.#B.indent,"test"===x.env.NODE_ENV&&(this._stream=this.#O,this._isEnabled=this.#k,Object.defineProperty(this,"_linesToClear",{get(){return this.#w},set(e){this.#w=e}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#T}}),Object.defineProperty(this,"_lineCount",{get(){return this.#A}}))}get indent(){return this.#j}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw Error("The `indent` option must be an integer from 0 and up");this.#j=e,this.#M()}get interval(){return this.#R??this.#x.interval??100}get spinner(){return this.#x}set spinner(e){if(this.#T=0,this.#R=void 0,"object"==typeof e){if(void 0===e.frames)throw Error("The given spinner must have a `frames` property");this.#x=e}else if(tB())if(void 0===e)this.#x=g5.dots;else if("default"!==e&&g5[e])this.#x=g5[e];else throw Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);else this.#x=g5.line}get text(){return this.#I}set text(e=""){this.#I=e,this.#M()}get prefixText(){return this.#z}set prefixText(e=""){this.#z=e,this.#M()}get suffixText(){return this.#L}set suffixText(e=""){this.#L=e,this.#M()}get isSpinning(){return void 0!==this.#$}#U(e=this.#z,t=" "){return"string"==typeof e&&""!==e?e+t:"function"==typeof e?e()+t:""}#N(e=this.#L,t=" "){return"string"==typeof e&&""!==e?t+e:"function"==typeof e?t+e():""}#M(){let e=this.#O.columns??80,t=this.#U(this.#z,"-"),r=this.#N(this.#L,"-"),n=" ".repeat(this.#j)+t+"--"+this.#I+"--"+r;for(let t of(this.#A=0,gQ(n).split("\n")))this.#A+=Math.max(1,Math.ceil(function(e,t={}){if("string"!=typeof e||0===e.length)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=gQ(e)),0===e.length)return 0;let o=0,a={ambiguousAsWide:!r};for(let{segment:t}of g9.segment(e)){let e=t.codePointAt(0);if(!(e<=31)&&(!(e>=127)||!(e<=159))&&(!(e>=8203)||!(e<=8207))&&65279!==e&&(!(e>=768)||!(e<=879))&&(!(e>=6832)||!(e<=6911))&&(!(e>=7616)||!(e<=7679))&&(!(e>=8400)||!(e<=8447))&&(!(e>=65056)||!(e<=65071))&&(!(e>=55296)||!(e<=57343))&&(!(e>=65024)||!(e<=65039))&&!g7.test(t)){if(g6().test(t)){o+=2;continue}o+=function(e,{ambiguousAsWide:t=!1}={}){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`);return!(e<12288)&&!(e>65510)&&g1(g0,e)||e>=g8&&e<=g3||!(e<4352)&&!(e>262141)&&g1(g2,e)||t&&!(e<161)&&!(e>1114109)&&g1(gX,e)?2:1}(e,a)}}return o}(t,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#k&&!this.#P}set isEnabled(e){if("boolean"!=typeof e)throw TypeError("The `isEnabled` option must be a boolean");this.#k=e}get isSilent(){return this.#P}set isSilent(e){if("boolean"!=typeof e)throw TypeError("The `isSilent` option must be a boolean");this.#P=e}frame(){let{frames:e}=this.#x,t=e[this.#T];return this.color&&(t=gj[this.color](t)),this.#T=++this.#T%e.length,("string"==typeof this.#z&&""!==this.#z?this.#z+" ":"")+t+("string"==typeof this.text?" "+this.text:"")+("string"==typeof this.#L&&""!==this.#L?" "+this.#L:"")}clear(){if(!this.#k||!this.#O.isTTY)return this;this.#O.cursorTo(0);for(let e=0;e<this.#w;e++)e>0&&this.#O.moveCursor(0,-1),this.#O.clearLine(1);return(this.#j||this.lastIndent!==this.#j)&&this.#O.cursorTo(this.#j),this.lastIndent=this.#j,this.#w=0,this}render(){return this.#P||(this.clear(),this.#O.write(this.frame()),this.#w=this.#A),this}start(e){return e&&(this.text=e),this.#P||(this.#k?this.isSpinning||(this.#B.hideCursor&&gG.hide(this.#O),this.#B.discardStdin&&x.stdin.isTTY&&(this.#S=!0,g4.start()),this.render(),this.#$=setInterval(this.render.bind(this),this.interval)):this.text&&this.#O.write(`- ${this.text}
124
+ `)),this}stop(){return this.#k&&(clearInterval(this.#$),this.#$=void 0,this.#T=0,this.clear(),this.#B.hideCursor&&gG.show(this.#O),this.#B.discardStdin&&x.stdin.isTTY&&this.#S&&(g4.stop(),this.#S=!1)),this}succeed(e){return this.stopAndPersist({symbol:gK.success,text:e})}fail(e){return this.stopAndPersist({symbol:gK.error,text:e})}warn(e){return this.stopAndPersist({symbol:gK.warning,text:e})}info(e){return this.stopAndPersist({symbol:gK.info,text:e})}stopAndPersist(e={}){if(this.#P)return this;let t=e.prefixText??this.#z,r=this.#U(t," "),n=e.symbol??" ",o=e.text??this.text,a=e.suffixText??this.#L,u=r+n+("string"==typeof o?" "+o:"")+this.#N(a," ")+"\n";return this.stop(),this.#O.write(u),this}}async function bt(e,t){let r="function"==typeof e,n="function"==typeof e.then;if(!r&&!n)throw TypeError("Parameter `action` must be a Function or a Promise");let{successText:o,failText:a}="object"==typeof t?t:{successText:void 0,failText:void 0},u=new be(t).start();try{let t=r?e(u):e,n=await t;return u.succeed(void 0===o?void 0:"string"==typeof o?o:o(n)),n}catch(e){throw u.fail(void 0===a?void 0:"string"==typeof a?a:a(e)),e}}async function br(e,t,r,n){r?.throwIfAborted();let o=e.title??"应用开发工具",a=g.join(er(),".dbx/tools",e.name,e.version),u=()=>(function(e,t){let r=e.name===Dg.kit.name?process.env.DBX_KIT_PATH?.trim():void 0;if(!r)return;let n=bi(g.resolve(r,"package.json"),t);if(!n)throw Error(`本地 Kit 的 SDK 入口不存在,请先构建:${r}`);return n})(e,t)??bn(import.meta.url,e,t)??bn(g.join(a,"package.json"),e,t);if(!u()){let u=bo(e,t,a,r);if(n||!gc())(n?.log??gp).info(`正在安装${o}`),await u;else{let t=performance.now();await bt(u,{text:` 正在安装${o}`,suffixText:()=>`(${Math.floor((performance.now()-t)/1e3)}s)`,successText:` ${o}已安装`,failText:()=>r?.aborted?` 已取消安装${o}`:` ${o}安装失败(${e.name}@${e.version})`,stream:process.stdout,discardStdin:!1})}}let s=u();if(!s)throw Error(`${e.name} 的入口 ${t} 不存在`);return Z(s).href}function bn(e,t,r){let n;try{n=e_(e).resolve(`${t.name}/package.json`)}catch(e){if("MODULE_NOT_FOUND"===e.code)return;throw e}return bi(n,r,t.version)}function bi(e,t,r){let n=JSON.parse(C.readFileSync(e,"utf8"));if(r&&n.version!==r)return;let o=n.exports?.[t],a="string"==typeof o?o:o?.import,u=a&&g.resolve(g.dirname(e),a);return u&&C.existsSync(u)?u:void 0}async function bo(e,t,r,n){C.mkdirSync(g.dirname(r),{recursive:!0});let o=C.mkdtempSync(`${r}-`);try{let a=await sZ("npm",["install",`${e.name}@${e.version}`,"--prefix",o,"--registry",Dg.registry,"--no-audit","--no-fund","--loglevel","error"],{cancelSignal:n,stdin:"ignore",stdout:"ignore",stderr:"pipe",reject:!1});if(n?.throwIfAborted(),a.failed)throw Error(`未能安装 ${e.name}@${e.version}(npm 退出码:${a.exitCode??"未知"})
125
+ ${a.stderr.trim()}`);if(!bn(g.join(o,"package.json"),e,t))throw Error(`${e.name}@${e.version} 安装后无法加载,请检查包版本和发布内容。`);try{C.renameSync(o,r)}catch{bn(g.join(r,"package.json"),e,t)||(C.rmSync(r,{recursive:!0,force:!0}),C.renameSync(o,r))}}finally{C.rmSync(o,{recursive:!0,force:!0})}}async function ba(e,t,r){return import(await br(Dg.appDev,e,t,r))}let bu=(e,t)=>br(Dg.kit,"./sdk",e,t),bs={name:"doubao-app",setup(e){e.init.addOption({flags:"--app",description:"添加应用(App)",prompt:"添加应用(App)?"}),e.init.addOption({flags:"--no-install-deps",description:"创建 App 后不安装前端依赖"}),e.init.onPrepareTemplates(async({options:e})=>{if(!e.app)return[];let{templatesRoot:t}=await ba("./assets");return await bu(),[t]}),e.init.onAfterCreate(async({directory:e,options:t})=>{t.app&&(!1!==t.installDeps&&await bl(_(e,mc)),gp.step(`cd ${b(e)}
126
+ dbx dev --app`))}),e.skills.onProvide(async({project:e})=>{if(!e.app)return[];let{skillsRoot:t}=await ba("./assets");return[{name:my,root:t,packageName:Dg.appDev.name,guide:`仅开发豆包 App 的 Page、Widget 或 Manifest 时,先阅读 [应用开发 Skill](.agents/skills/${my}/SKILL.md)。普通 MCP 和 MCP Apps 不使用 App Manifest。`}]}),e.package.onExclude((e,t)=>"dev"===t?[mc]:[`${mc}/node_modules`]),e.upload.onSuccess(async(e,t)=>{if(!e.project.app)return;let{showPreview:r}=await import("./preview.js");await r(e.project,t.version)}),e.dev.addTarget({name:"app",title:"应用调试(App)",label:"App",option:{flags:"--app",description:"同时启动应用调试(App)"},watch:[mu],appliesTo:({project:e})=>!!e.app,async start(e){let{startApp:t}=await ba(".",e.signal,e);e.signal.throwIfAborted(),await t(e,{loadKit:t=>bu(e.signal,t),queryAppInfo:f1,requestTicket:f2,queryVersions:async()=>{let{id:t,name:r}=e.project.plugin,{items:n=[]}=await f5(t?{ability_id:t}:{name:r},e.signal);return n}})}})}};async function bl(e){gp.info("正在使用 pnpm 安装应用依赖…");try{let t=await sZ("pnpm",["install"],{cwd:e,stdin:gc()?"inherit":"ignore",stdout:"inherit",stderr:"inherit",reject:!1});if(t.failed)throw Error(`pnpm 安装失败,退出码:${t.exitCode??"未知"}`);gp.success("应用依赖已安装")}catch(t){gp.warn(`应用依赖未安装:${eI(t)}`),gp.info(`项目已保留,请进入 ${e} 后运行 pnpm install。`)}}function bc(e=Dg.name){let t=e.replace(/^@/,"").replace(/[\\/]/g,"+");return _(er(),".dbx","skills",t,"current")}async function bd(e,t){let r=[{name:mb,root:F(import.meta.dirname,"skills"),packageName:Dg.name,guide:ev.readFileSync(_(import.meta.dirname,"templates/standard/AGENTS.md"),"utf8")}];r.push(...await eU(t.provideSkills,{project:e}));let n=_(e.root,".gitignore"),o=_(e.root,"AGENTS.md");for(let{name:t,root:a,packageName:u,guide:s}of r){let r=bc(u);bp(a,r);let l=`.agents/skills/${t}`;bp(_(r,t),_(e.root,l));let c=ev.existsSync(n)?ev.readFileSync(n,"utf8"):"",d=`/${l}`;c.split(/\r?\n/).includes(d)||bD(n,c,`${d}
127
+ `);let D=ev.existsSync(o)?ev.readFileSync(o,"utf8"):"";s&&!D.includes(`${l}/SKILL.md`)&&bD(o,D,`${D?"\n":""}${s.trim()}
128
+ `)}}function bD(e,t,r){let n=t&&!t.endsWith("\n")?"\n":"";ev.writeFileSync(e,`${t}${n}${r}`)}function bp(e,t){let r=ev.lstatSync(t,{throwIfNoEntry:!1});if(!r?.isSymbolicLink()||F(y(t),ev.readlinkSync(t))!==e){if(r&&!r.isSymbolicLink())throw Error(`开发 Skill 路径已存在且不是软链接,请先确认并移走该路径:${t}`);ev.mkdirSync(y(t),{recursive:!0}),ev.rmSync(t,{recursive:!0,force:!0}),ev.symlinkSync(e,t,"win32"===process.platform?"junction":"dir")}}let bh={name:"builtin",setup(e){e.cli.onSetup(({program:e,hooks:t})=>{let r=new ex("--cwd <path>","项目根目录").argParser(e=>F(e)).default(process.cwd()),n=e.command("init").description("创建应用插件项目").argument("[name]","项目名称,同时作为目录名").action(async(e,r)=>{let{runInit:n}=await import("./command~3.js");return n(e,r,t)});for(let{flags:e,description:r}of t.initOptions)n.addOption(new ex(e,r));e.command("upload").description("上传应用插件包到开放平台并保存版本").addOption(r).option("--version <version>","应用插件版本,格式为 x.y.z").action(bf(async(e,r)=>{let{runUpload:n}=await import("./command~5.js");await n(e,r,t)}));let o=t.devTargets.flatMap(({target:e})=>e.option?[new ex(e.option.flags,e.option.description)]:[]),a=e.command("dev").description("启动本地开发调试,监听目录变化并同步插件开发包").addOption(new ex("--plugin","仅运行默认调试目标").conflicts(o.map(e=>e.attributeName())));o.forEach(e=>a.addOption(e)),a.addOption(r).action(bf(async(e,r)=>{let{runSession:n}=await import("./session.js");await n(e,r,t)})),e.command("uninstall").description("从当前用户卸载插件开发包").addOption(r).action(bf(async e=>{let{runUninstall:t}=await import("./uninstall.js");await t(e)})),e.command("categories").description("查询审核类目,输出包含 category_id 和 name 的 JSON 列表").action(async()=>{let{runCategories:e}=await import("./categories.js");await e()}),e.command("audit").description("完善当前草稿审核材料、保存版本并提交审核").option("--input <path>","审核材料 JSON 文件;相对项目根目录,跳过交互提示").addOption(r).action(bf(async(e,t)=>{let{runAudit:r}=await import("./command.js");await r(e,t)})),e.command("versions").description("查询应用插件各版本的状态和审核信息").addOption(r).action(bf(async e=>{let{runVersions:t}=await import("./versions.js");await t(e)})),e.command("cancel-audit").description("取消应用插件提审").addOption(r).action(bf(async e=>{let{runCancelAudit:t}=await import("./command~2.js");await t(e)})),e.command("skills").description("配置项目开发 Skill").addOption(r).action(bf(async e=>{await bd(e,t),gp.success("项目开发 Skill 已配置")})),e.command("inspect").description("启动本地调试界面,调试 MCP Server 和 MCP Apps").option("--mcp-server [endpoint]","调试 MCP Server,可带地址,如 http://localhost:8088/mcp").option("-H, --header <header>",'请求头,格式为 "Key: Value",可写多次',(e,t=[])=>[...t,e]).option("--port <port>","调试界面端口,默认 6274;被占用时自动顺延").option("--no-open","只启动服务,不打开窗口").action(async e=>{let{runInspect:t}=await import("./command~4.js");await t(e)});let u=e.command("auth").description("认证管理");u.command("login").description("登录").addOption(new ex("--begin","发起设备授权并显示操作说明").conflicts("complete")).addOption(new ex("--complete <device-code>","使用指定设备码完成授权").conflicts("begin")).action(async e=>{let{runLogin:t}=await import("./command~1.js");await t(e)}),u.command("logout").description("退出登录,清除本地登录凭据").action(async()=>{let{runLogout:e}=await import("./command~1.js");await e()}),u.command("status").description("查看登录状态").action(async()=>{let{runStatus:e}=await import("./command~1.js");await e()})})}};function bf(e){return async({cwd:t,...r})=>{let{PluginProject:n}=await import("./plugin.js");await e(new n(t),r)}}async function bm(e){try{e.ui.update({status:"pending",message:"正在打包"});let t=await e.packDevelopment();e.signal.throwIfAborted(),e.ui.update({status:"pending",message:"正在上传"});let{package_id:r}=await f8(`${e.project.plugin.name}-${Date.now()}.zip`,t,e.signal);if(!r)throw Error("上传失败:服务端未返回 package_id");e.signal.throwIfAborted(),e.ui.update({status:"pending",message:"正在安装到当前账号"}),await mr({package_id:r,action:"Install"},e.signal),e.ui.update({status:"success",message:"已同步"})}catch(t){e.signal.aborted||(e.ui.update({status:"error",message:"同步失败"}),e.log.error(`平台同步失败:${eI(t)}`))}}let bg={name:"platform",setup(e){e.dev.addTarget({name:"platform",title:"插件调试(Skill / MCP)",label:"Skill / MCP",watch:["skills",mu,ma],async start(e){e.onFilesChanged(()=>bm(e)),await bm(e)}})}};async function bb(e=process.argv,t={}){let r=new ek().name("dbx").description(Dg.description).version(Dg.version,"-V, --version").enablePositionalOptions().configureOutput({outputError:e=>gp.error(e.trimEnd())}).exitOverride();try{await eL(r,[bh,bg,bs,...t.plugins??[]]),r.action(()=>r.outputHelp());let n=F(import.meta.dirname,"skills");if(!ev.statSync(_(n,mb,"SKILL.md")).isFile())throw Error("CLI 安装包中的开发 Skill 不完整,请重新安装 CLI。");bp(n,bc()),await r.parseAsync(e)}catch(e){if(e instanceof ew){process.exitCode=e.exitCode;return}gp.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}export{md as APP_GENERATED_DIRECTORIES,ml as APP_MANIFEST_FILENAME,mc as DOUBAO_APP_DIRECTORY,mu as MCP_CONFIG_FILENAME,Dq as NotLoggedInError,ma as PLUGIN_MANIFEST_FILENAME,mg as PLUGIN_NAME_PLACEHOLDER,mD as PROJECT_EXCLUDED_DIRECTORIES,mp as PROJECT_EXCLUDED_FILES,ms as SKILL_FILENAME,mf as STANDARD_TEMPLATE_DIRECTORY,mh as TEMPLATES_DIRECTORY,mm as TEMPLATE_SUFFIX,p8 as br,eM as callHook,gj as chalk_source,eU as collectHooks,D9 as completeLogin,mt as createPreview,go as dist_he,gu as dist_ve,gs as dist_xe,ga as dist_ye,eI as error_errorMessage,mo as getApproval,me as getBuildStatus,f9 as getPluginDraft,gc as isInteractive,f6 as listPluginCategories,f5 as listPluginVersions,gp as log,D3 as login,pa as logout,d3 as looseObject,bb as main,ex as option_Option,bt as oraPromise,mq as pD,pZ as qn,Dg as runtime,f4 as savePluginVersion,d2 as schemas_array,d4 as schemas_record,dB as schemas_string,dY as schemas_unknown,D6 as startLogin,d8 as strictObject,mn as submitApproval,bd as syncProjectSkill,mr as updateUserPlugin,f8 as uploadPackage,f7 as upsertPluginDraft,f3 as validateMaterial,pu as whoami,mi as withdrawApproval};