UNPKG

@werk/cli

Version:

werk-cli 脚手架

2 lines 546 kB
#!/usr/bin/env node import{Command as e}from"commander";import n from"node:fs";import t from"node:constants";import i,{Readable as r}from"node:stream";import o,{stripVTControlCharacters as a}from"node:util";import s from"node:assert";import c from"node:path";import u from"node:os";import l from"node:tty";import p,{EventEmitter as f}from"node:events";import d from"node:crypto";import{spawn as m,exec as h}from"node:child_process";import D from"node:process";import*as v from"node:readline";import{AsyncLocalStorage as g,AsyncResource as x}from"node:async_hooks";import b from"node:http";import y from"node:https";import w from"node:url";import F from"node:zlib";function _(e,n,t,i){return new(t||(t=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}c((i=i.apply(e,n||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const E=e=>"up"===e.name||"k"===e.name||e.ctrl&&"p"===e.name,C=e=>"down"===e.name||"j"===e.name||e.ctrl&&"n"===e.name,k=e=>"space"===e.name,B=e=>"backspace"===e.name,S=e=>"1234567890".includes(e.name),A=e=>"enter"===e.name||"return"===e.name;class j extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(e){super(),this.cause=e?.cause}}class O extends Error{name="CancelPromptError";message="Prompt was canceled"}class T extends Error{name="ExitPromptError"}class R extends Error{name="HookError"}class P extends Error{name="ValidationError"}const L=new g;function M(){const e=L.getStore();if(!e)throw new R("[Inquirer] Hook functions can only be called from within a prompt");return e}function I(){return M().rl}function U(e){return x.bind(((...n)=>{const t=M();let i=!1;const r=t.handleChange;t.handleChange=()=>{i=!0};const o=e(...n);return i&&r(),t.handleChange=r,o}))}function N(e){const n=M(),{index:t}=n,i=e({get:()=>n.hooks[t],set(e){n.hooks[t]=e},initialized:t in n.hooks});return n.index++,i}const z={queue(e){const n=M(),{index:t}=n;n.hooksEffect.push((()=>{n.hooksCleanup[t]?.();const i=e(I());if(null!=i&&"function"!=typeof i)throw new P("useEffect return value must be a cleanup function or nothing.");n.hooksCleanup[t]=i}))},run(){const e=M();U((()=>{e.hooksEffect.forEach((e=>{e()})),e.hooksEffect.length=0}))()},clearAll(){const e=M();e.hooksCleanup.forEach((e=>{e?.()})),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function $(e){return N((n=>{const t=e=>{n.get()!==e&&(n.set(e),M().handleChange())};if(n.initialized)return[n.get(),t];const i="function"==typeof e?e():e;return n.set(i),[i,t]}))}function q(e,n){N((t=>{const i=t.get();(!Array.isArray(i)||n.some(((e,n)=>!Object.is(e,i[n]))))&&z.queue(e),t.set(n)}))}var G,W,H="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function V(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function J(){if(W)return G;W=1;const e=l,n=e?.WriteStream?.prototype?.hasColors?.()??!1,t=(e,t)=>{if(!n)return e=>e;const i=`[${e}m`,r=`[${t}m`;return e=>{const n=e+"";let t=n.indexOf(r);if(-1===t)return i+n+r;let o=i,a=0;for(;-1!==t;)o+=n.slice(a,t)+i,a=t+r.length,t=n.indexOf(r,a);return o+=n.slice(a)+r,o}},i={};return i.reset=t(0,0),i.bold=t(1,22),i.dim=t(2,22),i.italic=t(3,23),i.underline=t(4,24),i.overline=t(53,55),i.inverse=t(7,27),i.hidden=t(8,28),i.strikethrough=t(9,29),i.black=t(30,39),i.red=t(31,39),i.green=t(32,39),i.yellow=t(33,39),i.blue=t(34,39),i.magenta=t(35,39),i.cyan=t(36,39),i.white=t(37,39),i.gray=t(90,39),i.bgBlack=t(40,49),i.bgRed=t(41,49),i.bgGreen=t(42,49),i.bgYellow=t(43,49),i.bgBlue=t(44,49),i.bgMagenta=t(45,49),i.bgCyan=t(46,49),i.bgWhite=t(47,49),i.bgGray=t(100,49),i.redBright=t(91,39),i.greenBright=t(92,39),i.yellowBright=t(93,39),i.blueBright=t(94,39),i.magentaBright=t(95,39),i.cyanBright=t(96,39),i.whiteBright=t(97,39),i.bgRedBright=t(101,49),i.bgGreenBright=t(102,49),i.bgYellowBright=t(103,49),i.bgBlueBright=t(104,49),i.bgMagentaBright=t(105,49),i.bgCyanBright=t(106,49),i.bgWhiteBright=t(107,49),G=i}var K=V(J());const Y={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:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",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:"╱"},Z={...Y,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:"⅒"},X={...Y,tick:"√",info:"i",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:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Q=("win32"!==D.platform?"linux"!==D.env.TERM:Boolean(D.env.WT_SESSION)||Boolean(D.env.TERMINUS_SUBLIME)||"{cmd::Cmder}"===D.env.ConEmuTask||"Terminus-Sublime"===D.env.TERM_PROGRAM||"vscode"===D.env.TERM_PROGRAM||"xterm-256color"===D.env.TERM||"alacritty"===D.env.TERM||"JetBrains-JediTerm"===D.env.TERMINAL_EMULATOR)?Z:X,ee={prefix:{idle:K.blue("?"),done:K.green(Q.tick)},spinner:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map((e=>K.yellow(e)))},style:{answer:K.cyan,message:K.bold,error:e=>K.red(`> ${e}`),defaultAnswer:e=>K.dim(`(${e})`),help:K.dim,highlight:K.cyan,key:e=>K.cyan(K.bold(`<${e}>`))}};function ne(e){if("object"!=typeof e||null===e)return!1;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}function te(...e){const n={};for(const t of e)for(const[e,i]of Object.entries(t)){const t=n[e];n[e]=ne(t)&&ne(i)?te(t,i):i}return n}function ie(...e){return te(...[ee,...e.filter((e=>null!=e))])}function re({status:e="idle",theme:n}){const[t,i]=$(!1),[r,o]=$(0),{prefix:a,spinner:s}=ie(n);if(q((()=>{if("loading"===e){let e,n=-1;const t=setTimeout(x.bind((()=>{i(!0),e=setInterval(x.bind((()=>{n+=1,o(n%s.frames.length)})),s.interval)})),300);return()=>{clearTimeout(t),clearInterval(e)}}i(!1)}),[e]),t)return s.frames[r];return"string"==typeof a?a:a["loading"===e?"idle":e]??a.idle}function oe(e,n){return N((t=>{const i=t.get();if(!i||i.dependencies.length!==n.length||i.dependencies.some(((e,t)=>e!==n[t]))){const i=e();return t.set({value:i,dependencies:n}),i}return i.value}))}function ae(e){return $({current:e})[0]}function se(e){const n=ae(e);n.current=e,q((e=>{let t=!1;const i=U(((i,r)=>{t||n.current(r,e)}));return e.input.on("keypress",i),()=>{t=!0,e.input.removeListener("keypress",i)}}),[])}var ce,ue;var le,pe,fe,de,me=ue?ce:(ue=1,ce=function(e){const n=function(e){const n={defaultWidth:0,output:process.stdout,tty:l};return e?(Object.keys(n).forEach((function(t){e[t]||(e[t]=n[t])})),e):n}(e);if(n.output.getWindowSize)return n.output.getWindowSize()[0]||n.defaultWidth;if(n.tty.getWindowSize)return n.tty.getWindowSize()[1]||n.defaultWidth;if(n.output.columns)return n.output.columns;if(process.env.CLI_WIDTH){const e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&0!==e)return e}return n.defaultWidth}),he=V(me),De={exports:{}};function ve(){if(de)return fe;de=1;const e=pe?le:(pe=1,le=({onlyFirst:e=!1}={})=>{const n=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(n,e?void 0:"g")});return fe=n=>"string"==typeof n?n.replace(e(),""):n}var ge,xe,be,ye,we={exports:{}};function Fe(){if(ye)return De.exports;ye=1;const e=ve(),n=function(){if(ge)return we.exports;ge=1;const e=e=>!Number.isNaN(e)&&e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&12351!==e||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);return we.exports=e,we.exports.default=e,we.exports}(),t=be?xe:(be=1,xe=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}),i=i=>{if("string"!=typeof i||0===i.length)return 0;if(0===(i=e(i)).length)return 0;i=i.replace(t()," ");let r=0;for(let e=0;e<i.length;e++){const t=i.codePointAt(e);t<=31||t>=127&&t<=159||(t>=768&&t<=879||(t>65535&&e++,r+=n(t)?2:1))}return r};return De.exports=i,De.exports.default=i,De.exports}var _e,Ee,Ce,ke,Be,Se,Ae,je,Oe,Te,Re,Pe={exports:{}};function Le(){if(ke)return Ce;ke=1;const e=Ee?_e:(Ee=1,_e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),n={};for(const t of Object.keys(e))n[e[t]]=t;const t={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Ce=t;for(const e of Object.keys(t)){if(!("channels"in t[e]))throw new Error("missing channels property: "+e);if(!("labels"in t[e]))throw new Error("missing channel labels property: "+e);if(t[e].labels.length!==t[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:n,labels:i}=t[e];delete t[e].channels,delete t[e].labels,Object.defineProperty(t[e],"channels",{value:n}),Object.defineProperty(t[e],"labels",{value:i})}return t.rgb.hsl=function(e){const n=e[0]/255,t=e[1]/255,i=e[2]/255,r=Math.min(n,t,i),o=Math.max(n,t,i),a=o-r;let s,c;o===r?s=0:n===o?s=(t-i)/a:t===o?s=2+(i-n)/a:i===o&&(s=4+(n-t)/a),s=Math.min(60*s,360),s<0&&(s+=360);const u=(r+o)/2;return c=o===r?0:u<=.5?a/(o+r):a/(2-o-r),[s,100*c,100*u]},t.rgb.hsv=function(e){let n,t,i,r,o;const a=e[0]/255,s=e[1]/255,c=e[2]/255,u=Math.max(a,s,c),l=u-Math.min(a,s,c),p=function(e){return(u-e)/6/l+.5};return 0===l?(r=0,o=0):(o=l/u,n=p(a),t=p(s),i=p(c),a===u?r=i-t:s===u?r=1/3+n-i:c===u&&(r=2/3+t-n),r<0?r+=1:r>1&&(r-=1)),[360*r,100*o,100*u]},t.rgb.hwb=function(e){const n=e[0],i=e[1];let r=e[2];const o=t.rgb.hsl(e)[0],a=1/255*Math.min(n,Math.min(i,r));return r=1-1/255*Math.max(n,Math.max(i,r)),[o,100*a,100*r]},t.rgb.cmyk=function(e){const n=e[0]/255,t=e[1]/255,i=e[2]/255,r=Math.min(1-n,1-t,1-i);return[100*((1-n-r)/(1-r)||0),100*((1-t-r)/(1-r)||0),100*((1-i-r)/(1-r)||0),100*r]},t.rgb.keyword=function(t){const i=n[t];if(i)return i;let r,o=1/0;for(const n of Object.keys(e)){const i=e[n],c=(s=i,((a=t)[0]-s[0])**2+(a[1]-s[1])**2+(a[2]-s[2])**2);c<o&&(o=c,r=n)}var a,s;return r},t.keyword.rgb=function(n){return e[n]},t.rgb.xyz=function(e){let n=e[0]/255,t=e[1]/255,i=e[2]/255;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;return[100*(.4124*n+.3576*t+.1805*i),100*(.2126*n+.7152*t+.0722*i),100*(.0193*n+.1192*t+.9505*i)]},t.rgb.lab=function(e){const n=t.rgb.xyz(e);let i=n[0],r=n[1],o=n[2];i/=95.047,r/=100,o/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;return[116*r-16,500*(i-r),200*(r-o)]},t.hsl.rgb=function(e){const n=e[0]/360,t=e[1]/100,i=e[2]/100;let r,o,a;if(0===t)return a=255*i,[a,a,a];r=i<.5?i*(1+t):i+t-i*t;const s=2*i-r,c=[0,0,0];for(let e=0;e<3;e++)o=n+1/3*-(e-1),o<0&&o++,o>1&&o--,a=6*o<1?s+6*(r-s)*o:2*o<1?r:3*o<2?s+(r-s)*(2/3-o)*6:s,c[e]=255*a;return c},t.hsl.hsv=function(e){const n=e[0];let t=e[1]/100,i=e[2]/100,r=t;const o=Math.max(i,.01);i*=2,t*=i<=1?i:2-i,r*=o<=1?o:2-o;return[n,100*(0===i?2*r/(o+r):2*t/(i+t)),100*((i+t)/2)]},t.hsv.rgb=function(e){const n=e[0]/60,t=e[1]/100;let i=e[2]/100;const r=Math.floor(n)%6,o=n-Math.floor(n),a=255*i*(1-t),s=255*i*(1-t*o),c=255*i*(1-t*(1-o));switch(i*=255,r){case 0:return[i,c,a];case 1:return[s,i,a];case 2:return[a,i,c];case 3:return[a,s,i];case 4:return[c,a,i];case 5:return[i,a,s]}},t.hsv.hsl=function(e){const n=e[0],t=e[1]/100,i=e[2]/100,r=Math.max(i,.01);let o,a;a=(2-t)*i;const s=(2-t)*r;return o=t*r,o/=s<=1?s:2-s,o=o||0,a/=2,[n,100*o,100*a]},t.hwb.rgb=function(e){const n=e[0]/360;let t=e[1]/100,i=e[2]/100;const r=t+i;let o;r>1&&(t/=r,i/=r);const a=Math.floor(6*n),s=1-i;o=6*n-a,1&a&&(o=1-o);const c=t+o*(s-t);let u,l,p;switch(a){default:case 6:case 0:u=s,l=c,p=t;break;case 1:u=c,l=s,p=t;break;case 2:u=t,l=s,p=c;break;case 3:u=t,l=c,p=s;break;case 4:u=c,l=t,p=s;break;case 5:u=s,l=t,p=c}return[255*u,255*l,255*p]},t.cmyk.rgb=function(e){const n=e[0]/100,t=e[1]/100,i=e[2]/100,r=e[3]/100;return[255*(1-Math.min(1,n*(1-r)+r)),255*(1-Math.min(1,t*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r))]},t.xyz.rgb=function(e){const n=e[0]/100,t=e[1]/100,i=e[2]/100;let r,o,a;return r=3.2406*n+-1.5372*t+-.4986*i,o=-.9689*n+1.8758*t+.0415*i,a=.0557*n+-.204*t+1.057*i,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[255*r,255*o,255*a]},t.xyz.lab=function(e){let n=e[0],t=e[1],i=e[2];n/=95.047,t/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*t-16,500*(n-t),200*(t-i)]},t.lab.xyz=function(e){let n,t,i;t=(e[0]+16)/116,n=e[1]/500+t,i=t-e[2]/200;const r=t**3,o=n**3,a=i**3;return t=r>.008856?r:(t-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,i=a>.008856?a:(i-16/116)/7.787,n*=95.047,t*=100,i*=108.883,[n,t,i]},t.lab.lch=function(e){const n=e[0],t=e[1],i=e[2];let r;r=360*Math.atan2(i,t)/2/Math.PI,r<0&&(r+=360);return[n,Math.sqrt(t*t+i*i),r]},t.lch.lab=function(e){const n=e[0],t=e[1],i=e[2]/360*2*Math.PI;return[n,t*Math.cos(i),t*Math.sin(i)]},t.rgb.ansi16=function(e,n=null){const[i,r,o]=e;let a=null===n?t.rgb.hsv(e)[2]:n;if(a=Math.round(a/50),0===a)return 30;let s=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(i/255));return 2===a&&(s+=60),s},t.hsv.ansi16=function(e){return t.rgb.ansi16(t.hsv.rgb(e),e[2])},t.rgb.ansi256=function(e){const n=e[0],t=e[1],i=e[2];if(n===t&&t===i)return n<8?16:n>248?231:Math.round((n-8)/247*24)+232;return 16+36*Math.round(n/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5)},t.ansi16.rgb=function(e){let n=e%10;if(0===n||7===n)return e>50&&(n+=3.5),n=n/10.5*255,[n,n,n];const t=.5*(1+~~(e>50));return[(1&n)*t*255,(n>>1&1)*t*255,(n>>2&1)*t*255]},t.ansi256.rgb=function(e){if(e>=232){const n=10*(e-232)+8;return[n,n,n]}let n;e-=16;return[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},t.rgb.hex=function(e){const n=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(n.length)+n},t.hex.rgb=function(e){const n=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!n)return[0,0,0];let t=n[0];3===n[0].length&&(t=t.split("").map((e=>e+e)).join(""));const i=parseInt(t,16);return[i>>16&255,i>>8&255,255&i]},t.rgb.hcg=function(e){const n=e[0]/255,t=e[1]/255,i=e[2]/255,r=Math.max(Math.max(n,t),i),o=Math.min(Math.min(n,t),i),a=r-o;let s,c;return s=a<1?o/(1-a):0,c=a<=0?0:r===n?(t-i)/a%6:r===t?2+(i-n)/a:4+(n-t)/a,c/=6,c%=1,[360*c,100*a,100*s]},t.hsl.hcg=function(e){const n=e[1]/100,t=e[2]/100,i=t<.5?2*n*t:2*n*(1-t);let r=0;return i<1&&(r=(t-.5*i)/(1-i)),[e[0],100*i,100*r]},t.hsv.hcg=function(e){const n=e[1]/100,t=e[2]/100,i=n*t;let r=0;return i<1&&(r=(t-i)/(1-i)),[e[0],100*i,100*r]},t.hcg.rgb=function(e){const n=e[0]/360,t=e[1]/100,i=e[2]/100;if(0===t)return[255*i,255*i,255*i];const r=[0,0,0],o=n%1*6,a=o%1,s=1-a;let c=0;switch(Math.floor(o)){case 0:r[0]=1,r[1]=a,r[2]=0;break;case 1:r[0]=s,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=a;break;case 3:r[0]=0,r[1]=s,r[2]=1;break;case 4:r[0]=a,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=s}return c=(1-t)*i,[255*(t*r[0]+c),255*(t*r[1]+c),255*(t*r[2]+c)]},t.hcg.hsv=function(e){const n=e[1]/100,t=n+e[2]/100*(1-n);let i=0;return t>0&&(i=n/t),[e[0],100*i,100*t]},t.hcg.hsl=function(e){const n=e[1]/100,t=e[2]/100*(1-n)+.5*n;let i=0;return t>0&&t<.5?i=n/(2*t):t>=.5&&t<1&&(i=n/(2*(1-t))),[e[0],100*i,100*t]},t.hcg.hwb=function(e){const n=e[1]/100,t=n+e[2]/100*(1-n);return[e[0],100*(t-n),100*(1-t)]},t.hwb.hcg=function(e){const n=e[1]/100,t=1-e[2]/100,i=t-n;let r=0;return i<1&&(r=(t-i)/(1-i)),[e[0],100*i,100*r]},t.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},t.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},t.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},t.gray.hsl=function(e){return[0,0,e[0]]},t.gray.hsv=t.gray.hsl,t.gray.hwb=function(e){return[0,100,e[0]]},t.gray.cmyk=function(e){return[0,0,0,e[0]]},t.gray.lab=function(e){return[e[0],0,0]},t.gray.hex=function(e){const n=255&Math.round(e[0]/100*255),t=((n<<16)+(n<<8)+n).toString(16).toUpperCase();return"000000".substring(t.length)+t},t.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]},Ce}function Me(){if(Se)return Be;Se=1;const e=Le();function n(n){const t=function(){const n={},t=Object.keys(e);for(let e=t.length,i=0;i<e;i++)n[t[i]]={distance:-1,parent:null};return n}(),i=[n];for(t[n].distance=0;i.length;){const n=i.pop(),r=Object.keys(e[n]);for(let e=r.length,o=0;o<e;o++){const e=r[o],a=t[e];-1===a.distance&&(a.distance=t[n].distance+1,a.parent=n,i.unshift(e))}}return t}function t(e,n){return function(t){return n(e(t))}}function i(n,i){const r=[i[n].parent,n];let o=e[i[n].parent][n],a=i[n].parent;for(;i[a].parent;)r.unshift(i[a].parent),o=t(e[i[a].parent][a],o),a=i[a].parent;return o.conversion=r,o}return Be=function(e){const t=n(e),r={},o=Object.keys(t);for(let e=o.length,n=0;n<e;n++){const e=o[n];null!==t[e].parent&&(r[e]=i(e,t))}return r}}function Ie(){if(je)return Ae;je=1;const e=Le(),n=Me(),t={};return Object.keys(e).forEach((i=>{t[i]={},Object.defineProperty(t[i],"channels",{value:e[i].channels}),Object.defineProperty(t[i],"labels",{value:e[i].labels});const r=n(i);Object.keys(r).forEach((e=>{const n=r[e];t[i][e]=function(e){const n=function(...n){const t=n[0];if(null==t)return t;t.length>1&&(n=t);const i=e(n);if("object"==typeof i)for(let e=i.length,n=0;n<e;n++)i[n]=Math.round(i[n]);return i};return"conversion"in e&&(n.conversion=e.conversion),n}(n),t[i][e].raw=function(e){const n=function(...n){const t=n[0];return null==t?t:(t.length>1&&(n=t),e(n))};return"conversion"in e&&(n.conversion=e.conversion),n}(n)}))})),Ae=t}function Ue(){return Oe||(Oe=1,function(e){const n=(e,n)=>(...t)=>`[${e(...t)+n}m`,t=(e,n)=>(...t)=>{const i=e(...t);return`[${38+n};5;${i}m`},i=(e,n)=>(...t)=>{const i=e(...t);return`[${38+n};2;${i[0]};${i[1]};${i[2]}m`},r=e=>e,o=(e,n,t)=>[e,n,t],a=(e,n,t)=>{Object.defineProperty(e,n,{get:()=>{const i=t();return Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0}),i},enumerable:!0,configurable:!0})};let s;const c=(e,n,t,i)=>{void 0===s&&(s=Ie());const r=i?10:0,o={};for(const[i,a]of Object.entries(s)){const s="ansi16"===i?"ansi":i;i===n?o[s]=e(t,r):"object"==typeof a&&(o[s]=e(a[n],r))}return o};Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};s.color.gray=s.color.blackBright,s.bgColor.bgGray=s.bgColor.bgBlackBright,s.color.grey=s.color.blackBright,s.bgColor.bgGrey=s.bgColor.bgBlackBright;for(const[n,t]of Object.entries(s)){for(const[n,i]of Object.entries(t))s[n]={open:`[${i[0]}m`,close:`[${i[1]}m`},t[n]=s[n],e.set(i[0],i[1]);Object.defineProperty(s,n,{value:t,enumerable:!1})}return Object.defineProperty(s,"codes",{value:e,enumerable:!1}),s.color.close="",s.bgColor.close="",a(s.color,"ansi",(()=>c(n,"ansi16",r,!1))),a(s.color,"ansi256",(()=>c(t,"ansi256",r,!1))),a(s.color,"ansi16m",(()=>c(i,"rgb",o,!1))),a(s.bgColor,"ansi",(()=>c(n,"ansi16",r,!0))),a(s.bgColor,"ansi256",(()=>c(t,"ansi256",r,!0))),a(s.bgColor,"ansi16m",(()=>c(i,"rgb",o,!0))),s}})}(Pe)),Pe.exports}var Ne,ze,$e=function(){if(Re)return Te;Re=1;const e=Fe(),n=ve(),t=Ue(),i=new Set(["","›"]),r=e=>`${i.values().next().value}[${e}m`,o=(t,r,o)=>{const a=[...r];let s=!1,c=e(n(t[t.length-1]));for(const[n,r]of a.entries()){const u=e(r);if(c+u<=o?t[t.length-1]+=r:(t.push(r),c=0),i.has(r))s=!0;else if(s&&"m"===r){s=!1;continue}s||(c+=u,c===o&&n<a.length-1&&(t.push(""),c=0))}!c&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},a=n=>{const t=n.split(" ");let i=t.length;for(;i>0&&!(e(t[i-1])>0);)i--;return i===t.length?n:t.slice(0,i).join(" ")+t.slice(i).join("")},s=(n,s,c={})=>{if(!1!==c.trim&&""===n.trim())return"";let u,l="",p="";const f=(n=>n.split(" ").map((n=>e(n))))(n);let d=[""];for(const[t,i]of n.split(" ").entries()){!1!==c.trim&&(d[d.length-1]=d[d.length-1].trimLeft());let n=e(d[d.length-1]);if(0!==t&&(n>=s&&(!1===c.wordWrap||!1===c.trim)&&(d.push(""),n=0),(n>0||!1===c.trim)&&(d[d.length-1]+=" ",n++)),c.hard&&f[t]>s){const e=s-n,r=1+Math.floor((f[t]-e-1)/s);Math.floor((f[t]-1)/s)<r&&d.push(""),o(d,i,s)}else{if(n+f[t]>s&&n>0&&f[t]>0){if(!1===c.wordWrap&&n<s){o(d,i,s);continue}d.push("")}n+f[t]>s&&!1===c.wordWrap?o(d,i,s):d[d.length-1]+=i}}!1!==c.trim&&(d=d.map(a)),l=d.join("\n");for(const[e,n]of[...l].entries()){if(p+=n,i.has(n)){const n=parseFloat(/\d[^m]*/.exec(l.slice(e,e+4)));u=39===n?null:n}const o=t.codes.get(Number(u));u&&o&&("\n"===l[e+1]?p+=r(o):"\n"===n&&(p+=r(u)))}return p};return Te=(e,n,t)=>String(e).normalize().replace(/\r\n/g,"\n").split("\n").map((e=>s(e,n,t))).join("\n"),Te}(),qe=V($e);function Ge(e,n){return e.split("\n").flatMap((e=>qe(e,n,{trim:!1,hard:!0}).split("\n").map((e=>e.trimEnd())))).join("\n")}function We(){return he({defaultWidth:80,output:I().output})}function He({items:e,width:n,renderItem:t,active:i,position:r,pageSize:o}){const a=e.map(((e,n)=>({item:e,index:n,isActive:n===i}))),s=function(e,n){const t=n.length,i=(e%t+t)%t;return[...n.slice(i),...n.slice(0,i)]}(i-r,a).slice(0,o),c=e=>null==s[e]?[]:function(e,n){return Ge(e,n).split("\n")}(t(s[e]),n),u=Array.from({length:o}),l=c(r).slice(0,o),p=r+l.length<=o?r:o-l.length;u.splice(p,l.length,...l);let f=p+l.length,d=r+1;for(;f<o&&d<s.length;){for(const e of c(d))if(u[f++]=e,f>=o)break;d++}for(f=p-1,d=r-1;f>=0&&d>=0;){for(const e of c(d).reverse())if(u[f--]=e,f<0)break;d--}return u.filter((e=>"string"==typeof e))}function Ve({items:e,active:n,renderItem:t,pageSize:i,loop:r=!0}){const o=ae({position:0,lastActive:0}),a=r?function({active:e,lastActive:n,total:t,pageSize:i,pointer:r}){return t<=i?e:n<e&&e-n<i?Math.min(Math.floor(i/2),r+e-n):r}({active:n,lastActive:o.current.lastActive,total:e.length,pageSize:i,pointer:o.current.position}):function({active:e,pageSize:n,total:t}){const i=Math.floor(n/2);return t<=n||e<i?e:e>=t-i?e+n-t:i}({active:n,total:e.length,pageSize:i});return o.current.position=a,o.current.lastActive=n,He({items:e,width:We(),renderItem:t,active:n,position:a,pageSize:i}).join("\n")}var Je=function(){if(ze)return Ne;ze=1;const e=i;return Ne=class extends e{#e=null;constructor(e={}){super(e),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=e.replace,this._prompt=e.prompt||null,this._hadControl=!1}#n(e,n){return this._dest?this._dest[e]:this._src?this._src[e]:n}#t(e,...n){"function"==typeof this._dest?.[e]&&this._dest[e](...n),"function"==typeof this._src?.[e]&&this._src[e](...n)}get isTTY(){return null!==this.#e?this.#e:this.#n("isTTY",!1)}set isTTY(e){this.#e=e}get rows(){return this.#n("rows")}get columns(){return this.#n("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(e){this._src=e}pipe(e,n){return this._dest=e,super.pipe(e,n)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(e){if(this.muted){if(!this.replace)return!0;if(e.match(/^\u001b/))return 0===e.indexOf(this._prompt)&&(e=(e=e.slice(this._prompt.length)).replace(/./g,this.replace),e=this._prompt+e),this._hadControl=!0,this.emit("data",e);this._prompt&&this._hadControl&&0===e.indexOf(this._prompt)&&(this._hadControl=!1,this.emit("data",this._prompt),e=e.slice(this._prompt.length)),e=e.toString().replace(/./g,this.replace)}this.emit("data",e)}end(e){this.muted&&(e=e&&this.replace?e.toString().replace(/./g,this.replace):null),e&&this.emit("data",e),this.emit("end")}destroy(...e){return this.#t("destroy",...e)}destroySoon(...e){return this.#t("destroySoon",...e)}close(...e){return this.#t("close",...e)}},Ne}(),Ke=V(Je);const Ye=[];Ye.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&Ye.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&Ye.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const Ze=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,Xe=Symbol.for("signal-exit emitter"),Qe=globalThis,en=Object.defineProperty.bind(Object);class nn{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Qe[Xe])return Qe[Xe];en(Qe,Xe,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,n){this.listeners[e].push(n)}removeListener(e,n){const t=this.listeners[e],i=t.indexOf(n);-1!==i&&(0===i&&1===t.length?t.length=0:t.splice(i,1))}emit(e,n,t){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(const r of this.listeners[e])i=!0===r(n,t)||i;return"exit"===e&&(i=this.emit("afterExit",n,t)||i),i}}class tn{}const rn=globalThis.process,{onExit:on}=(an=Ze(rn)?new class extends tn{#i="win32"===rn.platform?"SIGINT":"SIGHUP";#r=new nn;#o;#a;#s;#c={};#u=!1;constructor(e){super(),this.#o=e,this.#c={};for(const n of Ye)this.#c[n]=()=>{const t=this.#o.listeners(n);let{count:i}=this.#r;const r=e;if("object"==typeof r.__signal_exit_emitter__&&"number"==typeof r.__signal_exit_emitter__.count&&(i+=r.__signal_exit_emitter__.count),t.length===i){this.unload();const t=this.#r.emit("exit",null,n),i="SIGHUP"===n?this.#i:n;t||e.kill(e.pid,i)}};this.#s=e.reallyExit,this.#a=e.emit}onExit(e,n){if(!Ze(this.#o))return()=>{};!1===this.#u&&this.load();const t=n?.alwaysLast?"afterExit":"exit";return this.#r.on(t,e),()=>{this.#r.removeListener(t,e),0===this.#r.listeners.exit.length&&0===this.#r.listeners.afterExit.length&&this.unload()}}load(){if(!this.#u){this.#u=!0,this.#r.count+=1;for(const e of Ye)try{const n=this.#c[e];n&&this.#o.on(e,n)}catch(e){}this.#o.emit=(e,...n)=>this.#l(e,...n),this.#o.reallyExit=e=>this.#p(e)}}unload(){this.#u&&(this.#u=!1,Ye.forEach((e=>{const n=this.#c[e];if(!n)throw new Error("Listener not defined for signal: "+e);try{this.#o.removeListener(e,n)}catch(e){}})),this.#o.emit=this.#a,this.#o.reallyExit=this.#s,this.#r.count-=1)}#p(e){return Ze(this.#o)?(this.#o.exitCode=e||0,this.#r.emit("exit",this.#o.exitCode,null),this.#s.call(this.#o,this.#o.exitCode)):0}#l(e,...n){const t=this.#a;if("exit"===e&&Ze(this.#o)){"number"==typeof n[0]&&(this.#o.exitCode=n[0]);const i=t.call(this.#o,e,...n);return this.#r.emit("exit",this.#o.exitCode,null),i}return t.call(this.#o,e,...n)}}(rn):new class extends tn{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,n)=>an.onExit(e,n),load:()=>an.load(),unload:()=>an.unload()});var an,sn,cn={exports:{}};var un=(sn||(sn=1,function(e){const n=e.exports;e.exports.default=n;const t="[",i="]",r="",o=";",a="Apple_Terminal"===process.env.TERM_PROGRAM;n.cursorTo=(e,n)=>{if("number"!=typeof e)throw new TypeError("The `x` argument is required");return"number"!=typeof n?t+(e+1)+"G":t+(n+1)+";"+(e+1)+"H"},n.cursorMove=(e,n)=>{if("number"!=typeof e)throw new TypeError("The `x` argument is required");let i="";return e<0?i+=t+-e+"D":e>0&&(i+=t+e+"C"),n<0?i+=t+-n+"A":n>0&&(i+=t+n+"B"),i},n.cursorUp=(e=1)=>t+e+"A",n.cursorDown=(e=1)=>t+e+"B",n.cursorForward=(e=1)=>t+e+"C",n.cursorBackward=(e=1)=>t+e+"D",n.cursorLeft="",n.cursorSavePosition=a?"7":"",n.cursorRestorePosition=a?"8":"",n.cursorGetPosition="",n.cursorNextLine="",n.cursorPrevLine="",n.cursorHide="[?25l",n.cursorShow="[?25h",n.eraseLines=e=>{let t="";for(let i=0;i<e;i++)t+=n.eraseLine+(i<e-1?n.cursorUp():"");return e&&(t+=n.cursorLeft),t},n.eraseEndLine="",n.eraseStartLine="",n.eraseLine="",n.eraseDown="",n.eraseUp="",n.eraseScreen="",n.scrollUp="",n.scrollDown="",n.clearScreen="c",n.clearTerminal="win32"===process.platform?`${n.eraseScreen}${t}0f`:`${n.eraseScreen}${t}3J${t}H`,n.beep=r,n.link=(e,n)=>[i,"8",o,o,n,r,e,i,"8",o,o,r].join(""),n.image=(e,n={})=>{let t=`${i}1337;File=inline=1`;return n.width&&(t+=`;width=${n.width}`),n.height&&(t+=`;height=${n.height}`),!1===n.preserveAspectRatio&&(t+=";preserveAspectRatio=0"),t+":"+e.toString("base64")+r},n.iTerm={setCwd:(e=process.cwd())=>`${i}50;CurrentDir=${e}${r}`,annotation:(e,n={})=>{let t=`${i}1337;`;const o=void 0!==n.x,a=void 0!==n.y;if((o||a)&&(!o||!a||void 0===n.length))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),t+=n.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",n.length>0?t+=(o?[e,n.length,n.x,n.y]:[n.length,e]).join("|"):t+=e,t+r}}}(cn)),cn.exports),ln=V(un);const pn=e=>e.split("\n").length;function fn(e){return e>0?ln.cursorDown(e):""}class dn{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(e){this.rl=e,this.cursorPos=e.getCursorPos()}write(e){this.rl.output.unmute(),this.rl.output.write(e),this.rl.output.mute()}render(e,n=""){const t=(e=>e.split("\n").pop()??"")(e),i=a(t);let r=i;this.rl.line.length>0&&(r=r.slice(0,-this.rl.line.length)),this.rl.setPrompt(r),this.cursorPos=this.rl.getCursorPos();const o=We();e=Ge(e,o),n=Ge(n,o),i.length%o==0&&(e+="\n");let s=e+(n?"\n"+n:"");const c=Math.floor(i.length/o)-this.cursorPos.rows+(n?pn(n):0);c>0&&(s+=ln.cursorUp(c)),s+=ln.cursorTo(this.cursorPos.cols),this.write(fn(this.extraLinesUnderPrompt)+ln.eraseLines(this.height)+s),this.extraLinesUnderPrompt=c,this.height=pn(s)}checkCursorPos(){const e=this.rl.getCursorPos();e.cols!==this.cursorPos.cols&&(this.write(ln.cursorTo(e.cols)),this.cursorPos=e)}done({clearContent:e}){this.rl.setPrompt("");let n=fn(this.extraLinesUnderPrompt);n+=e?ln.eraseLines(this.height):"\n",n+=ln.cursorShow,this.write(n),this.rl.close()}}class mn extends Promise{static withResolver(){let e,n;return{promise:new Promise(((t,i)=>{e=t,n=i})),resolve:e,reject:n}}}function hn(e){const n=function(){const e=Error.prepareStackTrace;let n=[];try{Error.prepareStackTrace=(e,t)=>{const i=t.slice(1);return n=i,i},(new Error).stack}catch{return n}return Error.prepareStackTrace=e,n}();return(t,i={})=>{const{input:r=process.stdin,signal:o}=i,a=new Set,s=new Ke;s.pipe(i.output??process.stdout);const c=v.createInterface({terminal:!0,input:r,output:s}),u=new dn(c),{promise:l,resolve:p,reject:f}=mn.withResolver(),d=()=>f(new O);if(o){const e=()=>f(new j({cause:o.reason}));if(o.aborted)return e(),Object.assign(l,{cancel:d});o.addEventListener("abort",e),a.add((()=>o.removeEventListener("abort",e)))}a.add(on(((e,n)=>{f(n