@fastgpt-plugin/cli 0.1.0-alpha.7 → 0.1.0-alpha.9

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.
@@ -1,109 +0,0 @@
1
- import{r as e}from"./index.js";import{builtinModules as t,createRequire as n}from"node:module";import r from"node:path";import i from"node:process";import{spawn as a}from"node:child_process";import o,{existsSync as s}from"node:fs";import{tmpdir as c}from"node:os";import l from"node:crypto";import{fileURLToPath as u,pathToFileURL as d}from"node:url";import{Buffer as f}from"node:buffer";import.meta.url;function p(e,t){if(e.preset===`bundle-require`)return t;if(e.preset===`jiti`){let n=r.extname(e.path);if(t&&typeof t==`object`&&t[Symbol.toStringTag]===`Module`&&Object.keys(t).length===0)return n===`.mjs`?t:{}}return t&&typeof t==`object`&&`default`in t?t.default:t}function m(e){if(!e)return`index.ts`;if(e instanceof URL)return e.protocol===`file:`?u(e):e.href;if(typeof e==`string`){if(!e.startsWith(`file:`))return e;try{return u(e)}catch{try{return u(new URL(e))}catch{return e}}}return String(e)}function h(e={}){let t={path:r.resolve(i.cwd(),m(e.path)),debug:e.debug||!1,preset:e.preset||`none`,inputOptions:e.inputOptions,outputOptions:e.outputOptions};if(!o.existsSync(t.path))throw Error(`[unrun] File not found: ${t.path}`);if(!new Set([`none`,`jiti`,`bundle-require`]).has(t.preset))throw Error(`[unrun] Invalid preset "${t.preset}" (expected: none | jiti | bundle-require)`);return t}const g=new Set([...t,...t.map(e=>`node:${e}`)]);function _(e){return e?g.has(e)||e.startsWith(`node:`):!1}function v(e){let t=r.dirname(e.path),n=e=>{let n=y(e);if(!n)return!1;let i=t;for(;;){if(s(r.join(i,`node_modules`,n)))return!0;let e=r.dirname(i);if(e===i)break;i=e}return!1};return function(e){return!e||e.startsWith(`\0`)||e.startsWith(`.`)||e.startsWith(`#`)||r.isAbsolute(e)?!1:_(e)?!0:!!n(e)}}function y(e){if(!e)return;if(e.startsWith(`@`)){let t=e.split(`/`);return t.length>=2?`${t[0]}/${t[1]}`:void 0}let[t]=e.split(`/`);return t||void 0}const b=`(function(){
2
- function __unrun__fmt(names, getter, np){
3
- var onlyDefault = names.length === 1 && names[0] === "default";
4
- var o = np ? Object.create(null) : {};
5
- for (var i = 0; i < names.length; i++) {
6
- var n = names[i];
7
- try { o[n] = getter(n) } catch {}
8
- }
9
- if (onlyDefault) {
10
- try {
11
- var s = JSON.stringify(o.default);
12
- if (s !== undefined) {
13
- s = s.replace(/"([^"]+)":/g, "$1: ").replace(/,/g, ", ").replace(/{/g, "{ ").replace(/}/g, " }");
14
- return "[Module: null prototype] { default: " + s + " }";
15
- }
16
- } catch {}
17
- return "[Module: null prototype] { default: " + String(o.default) + " }";
18
- }
19
- return o;
20
- }
21
- function __unrun__setInspect(obj, names, getter, np){
22
- try {
23
- var __insp = Symbol.for('nodejs.util.inspect.custom');
24
- Object.defineProperty(obj, __insp, {
25
- value: function(){ return __unrun__fmt(names, getter, np) },
26
- enumerable: false, configurable: true
27
- });
28
- } catch {}
29
- return obj;
30
- }
31
- try {
32
- Object.defineProperty(globalThis, "__unrun__setInspect", {
33
- value: __unrun__setInspect,
34
- enumerable: false,
35
- });
36
- } catch {}
37
- })();`,x=/__unrun__setInspect\b/;function S(){return{name:`unrun-console-output-customizer`,generateBundle:{handler(e,t){for(let e of Object.values(t))e.type===`chunk`&&(C(e),w(e))}}}}function C(e){x.test(e.code)||(e.code=e.code.startsWith(`#!`)?E(e.code,`${b}\n`):`${b}\n${e.code}`)}function w(e){if(e.code.includes(`__unrun__wrapRolldownHelpers`))return;let t=T(e.code),n=`(function __unrun__wrapRolldownHelpers(){
38
- if (typeof __unrun__setInspect !== "function") return;
39
- if (typeof __export === "function" && !__export.__unrunPatched) {
40
- var __unrun__origExport = __export;
41
- var __unrun__patchedExport = (...__unrun__args) => {
42
- var __unrun__target = __unrun__origExport(...__unrun__args);
43
- if (__unrun__target && typeof __unrun__target === "object") {
44
- try {
45
- var __unrun__map = (__unrun__args[0] && typeof __unrun__args[0] === "object") ? __unrun__args[0] : {};
46
- var __unrun__names = Object.keys(__unrun__map).filter(function(n){ return n !== "__esModule" });
47
- __unrun__setInspect(
48
- __unrun__target,
49
- __unrun__names,
50
- function(n){
51
- var getter = __unrun__map[n];
52
- return typeof getter === "function" ? getter() : getter;
53
- },
54
- false,
55
- );
56
- } catch {}
57
- }
58
- return __unrun__target;
59
- };
60
- __unrun__patchedExport.__unrunPatched = true;
61
- __export = __unrun__patchedExport;
62
- }
63
- if (typeof __exportAll === "function" && !__exportAll.__unrunPatched) {
64
- var __unrun__origExportAll = __exportAll;
65
- var __unrun__patchedExportAll = (...__unrun__args) => {
66
- var __unrun__target = __unrun__origExportAll(...__unrun__args);
67
- if (__unrun__target && typeof __unrun__target === "object") {
68
- try {
69
- var __unrun__map = (__unrun__args[0] && typeof __unrun__args[0] === "object") ? __unrun__args[0] : {};
70
- var __unrun__names = Object.keys(__unrun__map).filter(function(n){ return n !== "__esModule" });
71
- __unrun__setInspect(
72
- __unrun__target,
73
- __unrun__names,
74
- function(n){
75
- var getter = __unrun__map[n];
76
- return typeof getter === "function" ? getter() : getter;
77
- },
78
- false,
79
- );
80
- } catch {}
81
- }
82
- return __unrun__target;
83
- };
84
- __unrun__patchedExportAll.__unrunPatched = true;
85
- __exportAll = __unrun__patchedExportAll;
86
- }
87
- if (typeof __copyProps === "function" && !__copyProps.__unrunPatched) {
88
- var __unrun__origCopyProps = __copyProps;
89
- var __unrun__patchedCopyProps = (...__unrun__args) => {
90
- var __unrun__result = __unrun__origCopyProps(...__unrun__args);
91
- if (__unrun__result && typeof __unrun__result === "object") {
92
- try {
93
- var __unrun__names = Object.keys(__unrun__result).filter(function(n){ return n !== "__esModule" });
94
- __unrun__setInspect(__unrun__result, __unrun__names, function(n){ return __unrun__result[n] }, true);
95
- } catch {}
96
- }
97
- return __unrun__result;
98
- };
99
- __unrun__patchedCopyProps.__unrunPatched = true;
100
- __copyProps = __unrun__patchedCopyProps;
101
- }
102
- })();
103
- `;if(t===-1){e.code=`${e.code}\n${n}`;return}e.code=`${e.code.slice(0,t)}${n}${e.code.slice(t)}`}function T(e){let t=e.indexOf(`//#endregion`);if(t===-1)return-1;let n=e.indexOf(`
104
- `,t);return n===-1?e.length:n+1}function E(e,t){let n=e.indexOf(`
105
- `);return n===-1?`${e}\n${t}`:`${e.slice(0,n+1)}${t}${e.slice(n+1)}`}function D(){return{name:`unrun-json-loader`,resolveId:{handler(e,t){if(!e.endsWith(`.json`))return null;let n=t?r.dirname(t):i.cwd(),a=r.resolve(n,e),s=!1;try{if(t){let n=o.readFileSync(t,`utf8`),r=e.replaceAll(/[.*+?^${}()|[\]\\]/g,e=>`\\${e}`),i=String.raw`\brequire\s*\(\s*['"]${r}['"]\s*\)`;s=new RegExp(i).test(n)}}catch{}return{id:`${a}?unrun-json.${s?`cjs`:`mjs`}`}}},load:{filter:{id:/\?unrun-json\.(?:mjs|cjs)$/},handler(e){try{let t=e.replace(/\?unrun-json\.(?:mjs|cjs)$/,``),n=o.readFileSync(t,`utf8`),r=JSON.parse(n),i=JSON.stringify(r);if(e.endsWith(`?unrun-json.cjs`))return{code:`const __data = ${i}\ntry { Object.defineProperty(__data, 'default', { value: __data, enumerable: false, configurable: true }) } catch {}\nmodule.exports = __data\n`};let a=Object.keys(r).filter(e=>/^[$A-Z_]\w*$/i.test(e)).map(e=>`export const ${e} = __data[${JSON.stringify(e)}]`).join(`
106
- `);return{code:[`const __data = ${i}`,`try { Object.defineProperty(__data, 'default', { value: __data, enumerable: false, configurable: true }) } catch {}`,a,`export default __data`].filter(Boolean).join(`
107
- `)}}catch{return null}}}}}function O(){return{name:`unrun-make-cjs-wrapper-async-friendly`,generateBundle:{handler(e,t){for(let e of Object.values(t)){if(e.type!==`chunk`)continue;let t=e.code,n=[`__commonJS({`,`__commonJSMin(`];if(!n.some(e=>t.includes(e)))continue;let r=e=>{let n=0;for(;;){let r=t.indexOf(e,n);if(r===-1)break;let i=t.indexOf(`(() => {`,r);if(i===-1){n=r+e.length;continue}let a=i+8,o=a,s=1;for(;o<t.length&&s>0;){let e=t[o++];e===`{`?s++:e===`}`&&s--}if(s!==0)break;let c=o-1,l=t.slice(a,c);if(/\bawait\b/.test(l)&&t.slice(i,i+14)!==`(async () => {`){t=`${t.slice(0,i+1)}async ${t.slice(i+1)}`,n=i+1+6;continue}n=c}};for(let e of n)r(e);t!==e.code&&(e.code=t)}}}}}function k(e){return{name:`unrun-require-resolve-fix`,generateBundle:{handler(t,n){for(let t of Object.values(n))t.type===`chunk`&&(t.code=t.code.replaceAll(/__require\.resolve\(["']([^"']+)["']\)/g,(t,n)=>{if(n.startsWith(`./`)||n.startsWith(`../`))try{let t=r.dirname(e.path);for(let e of[``,`.ts`,`.js`,`.mts`,`.mjs`,`.cts`,`.cjs`]){let i=r.resolve(t,n+e);if(o.existsSync(i))return JSON.stringify(i)}let i=r.resolve(t,n);return JSON.stringify(i)}catch{return t}return t}))}}}}function A(){return{name:`unrun-require-typeof-fix`,generateBundle:{handler(e,t){for(let e of Object.values(t))e.type===`chunk`&&(e.code=e.code.replaceAll(/\btypeof\s+__require\b/g,`typeof require`))}}}}function j(){return{name:`unrun-source-context-shims`,load:{filter:{id:/\.(?:m?[jt]s|c?tsx?)(?:$|\?)/},handler(e){let t=e.split(`?`)[0].split(`#`)[0],n=r.normalize(t),i;try{i=o.readFileSync(n,`utf8`)}catch{return null}if(n.replaceAll(`\\`,`/`).includes(`/node_modules/`))return null;let a=n,s=r.dirname(n),c=d(n).href,l=i.includes(`import.meta`),u=/\b__filename\b/.test(i),f=/\b(?:const|let|var)\s+__filename\b/.test(i),p=/\b__dirname\b/.test(i),m=/\b(?:const|let|var)\s+__dirname\b/.test(i),h=u&&!f,g=p&&!m;if(h||g||l){let e=[];h&&e.push(`const __filename = ${JSON.stringify(a)}`),g&&e.push(`const __dirname = ${JSON.stringify(s)}`);let t=i,o=!1;if(l){let e=/import\s*\.\s*meta\s*\.\s*resolve!?\s*\(\s*(["'])([^"']+)\1\s*\)/y,i=/import\s*\.\s*meta\s*\.\s*url\b/y,l=/import\s*\.\s*meta\s*\.\s*dirname\b/y,u=/import\s*\.\s*meta\s*\.\s*filename\b/y,f=``,p=`normal`,m=[],h=0,g=()=>{p=m.pop()??`normal`};for(let _=0;_<t.length;){let v=t[_],y=t[_+1];if(p===`lineComment`){f+=v,_+=1,v===`
108
- `&&g();continue}if(p===`blockComment`){f+=v,_+=1,v===`*`&&y===`/`&&(f+=`/`,_+=1,g());continue}if(p===`single`){if(f+=v,_+=1,v===`\\`){f+=t[_]??``,_+=1;continue}v===`'`&&g();continue}if(p===`double`){if(f+=v,_+=1,v===`\\`){f+=t[_]??``,_+=1;continue}v===`"`&&g();continue}if(p===`template`){if(f+=v,_+=1,v===`\\`){f+=t[_]??``,_+=1;continue}if(v==="`"){g();continue}v===`$`&&y===`{`&&(f+=`{`,_+=1,m.push(p),p=`templateExpr`,h=1);continue}if(p===`templateExpr`){if(v===`{`)h+=1;else if(v===`}`&&(--h,h===0)){f+=v,_+=1,g();continue}}if(v===`/`&&y===`/`){f+=`//`,_+=2,m.push(p),p=`lineComment`;continue}if(v===`/`&&y===`*`){f+=`/*`,_+=2,m.push(p),p=`blockComment`;continue}if(v===`'`){f+=v,_+=1,m.push(p),p=`single`;continue}if(v===`"`){f+=v,_+=1,m.push(p),p=`double`;continue}if(v==="`"){f+=v,_+=1,m.push(p),p=`template`;continue}e.lastIndex=_;let b=e.exec(t);if(b){let t=b[2],i=d(r.resolve(r.dirname(n),t)).href;f+=JSON.stringify(i),_=e.lastIndex,o=!0;continue}if(i.lastIndex=_,i.test(t)){f+=JSON.stringify(c),_=i.lastIndex,o=!0;continue}if(l.lastIndex=_,l.test(t)){f+=JSON.stringify(s),_=l.lastIndex,o=!0;continue}if(u.lastIndex=_,u.test(t)){f+=JSON.stringify(a),_=u.lastIndex,o=!0;continue}f+=v,_+=1}o&&(t=f)}if(e.length>0&&(t=`${e.join(`
109
- `)}\n${t}`),t!==i)return{code:t}}return null}}}}async function M(t){let n=r.resolve(i.cwd(),`tsconfig.json`),a=s(n)?n:void 0,o={input:t.path,platform:`node`,external:v(t),plugins:[O(),k(t),j(),...t.preset===`jiti`?[S(),D(),A()]:[]],transform:{define:{__dirname:JSON.stringify(r.dirname(t.path)),__filename:JSON.stringify(t.path),"import.meta.url":JSON.stringify(d(t.path).href),"import.meta.filename":JSON.stringify(t.path),"import.meta.dirname":JSON.stringify(r.dirname(t.path)),"import.meta.env":`process.env`}},logLevel:`silent`,...t.inputOptions};a&&(o.tsconfig=a);let c=await e(o),l={format:`esm`,codeSplitting:!1,keepNames:!0,...t.outputOptions},u=await c.generate(l);if(!u.output[0])throw Error(`[unrun] No output chunk found`);let f=await c.watchFiles;return{chunk:u.output[0],dependencies:f}}function N(e,t){if(!t.debug)try{if(e.startsWith(`file://`)){let t=new URL(e);o.unlinkSync(t)}}catch(e){if(e.code!==`ENOENT`)throw e}}function P(e){return e.replaceAll(/[^\w.-]/g,`_`)}function F(e,t){let n=r.basename(t.path),a=``;try{let t=l.randomBytes(16).toString(`hex`),s=`${n?`${P(n)}.`:``}${t}.mjs`,u=r.join(i.cwd(),`node_modules`),f=r.join(u,`.unrun`),p=r.join(f,s);if(!o.existsSync(p))try{o.mkdirSync(f,{recursive:!0}),o.writeFileSync(p,e,`utf8`)}catch{let t=r.join(c(),`unrun-cache`),n=r.join(t,s);o.mkdirSync(t,{recursive:!0}),o.writeFileSync(n,e,`utf8`),a=d(n).href}a||=d(p).href}catch{a=`data:text/javascript;base64,${f.from(e).toString(`base64`)}`}return a}async function I(e,t){let n=F(e,t),r;try{r=await import(n)}finally{N(n,t)}return r}async function L(e){let t=h(e),n=await M(t),r;try{r=await I(n.chunk.code,t)}catch(e){throw Error(`[unrun] Import failed (code length: ${n.chunk.code.length}): ${e.message}`)}return{module:p(t,r),dependencies:n.dependencies}}export{L as unrun};
@@ -1 +0,0 @@
1
- function e(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}const t=Math.random.bind(Math);function n(e=21){let n=``,r=e;for(;r--;)n+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[t()*64|0];return n}const r=e=>e,i=r,{clearTimeout:a,setTimeout:o}=globalThis;function s(t,s){let{post:c,on:l,off:u=()=>{},eventNames:d=[],serialize:f=r,deserialize:p=i,resolver:m,bind:h=`rpc`,timeout:g=6e4,proxify:_=!0}=s,v=!1,y=new Map,b,x;async function S(t,r,i,l){if(v)throw Error(`[birpc] rpc is closed, cannot call "${t}"`);let u={m:t,a:r,t:`q`};l&&(u.o=!0);let d=async e=>c(f(e));if(i){await d(u);return}if(b)try{await b}finally{b=void 0}let{promise:p,resolve:m,reject:h}=e(),_=n();u.i=_;let S;async function C(e=u){return g>=0&&(S=o(()=>{try{if(s.onTimeoutError?.call(x,t,r)!==!0)throw Error(`[birpc] timeout on calling "${t}"`)}catch(e){h(e)}y.delete(_)},g),typeof S==`object`&&(S=S.unref?.())),y.set(_,{resolve:m,reject:h,timeoutId:S,method:t}),await d(e),p}try{s.onRequest?await s.onRequest.call(x,u,C,m):await C()}catch(e){if(s.onGeneralError?.call(x,e)!==!0)throw e;return}finally{a(S),y.delete(_)}return p}let C={$call:(e,...t)=>S(e,t,!1),$callOptional:(e,...t)=>S(e,t,!1,!0),$callEvent:(e,...t)=>S(e,t,!0),$callRaw:e=>S(e.method,e.args,e.event,e.optional),$rejectPendingCalls:T,get $closed(){return v},get $meta(){return s.meta},$close:w,$functions:t};x=_?new Proxy({},{get(e,n){if(Object.prototype.hasOwnProperty.call(C,n))return C[n];if(n===`then`&&!d.includes(`then`)&&!(`then`in t))return;let r=(...e)=>S(n,e,!0);if(d.includes(n))return r.asEvent=r,r;let i=(...e)=>S(n,e,!1);return i.asEvent=r,i}}):C;function w(e){v=!0,y.forEach(({reject:t,method:n})=>{let r=Error(`[birpc] rpc is closed, cannot call "${n}"`);if(e)return e.cause??=r,t(e);t(r)}),y.clear(),u(E)}function T(e){let t=Array.from(y.values()).map(({method:t,reject:n})=>e?e({method:t,reject:n}):n(Error(`[birpc]: rejected pending call "${t}".`)));return y.clear(),t}async function E(e,...n){let r;try{r=p(e)}catch(e){if(s.onGeneralError?.call(x,e)!==!0)throw e;return}if(r.t===`q`){let{m:e,a:i,o:a}=r,o,l,u=await(m?m.call(x,e,t[e]):t[e]);if(a&&(u||=()=>void 0),!u)l=Error(`[birpc] function "${e}" not found`);else try{o=await u.apply(h===`rpc`?x:t,i)}catch(e){l=e}if(r.i){if(l&&s.onFunctionError&&s.onFunctionError.call(x,l,e,i)===!0)return;if(!l)try{await c(f({t:`s`,i:r.i,r:o}),...n);return}catch(t){if(l=t,s.onGeneralError?.call(x,t,e,i)!==!0)throw t}try{await c(f({t:`s`,i:r.i,e:l}),...n)}catch(t){if(s.onGeneralError?.call(x,t,e,i)!==!0)throw t}}}else{let{i:e,r:t,e:n}=r,i=y.get(e);i&&(a(i.timeoutId),n?i.reject(n):i.resolve(t)),y.delete(e)}}return b=l(E),x}export{s as createBirpc};
@@ -1,45 +0,0 @@
1
- import e,{stdin as t,stdout as n}from"node:process";import{WriteStream as r}from"node:tty";import i from"node:readline";function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var o,s;function c(){if(s)return o;s=1;let e={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},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`};return o={cursor:e,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{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(t){let n=``;for(let r=0;r<t;r++)n+=this.line+(r<t-1?e.up():``);return t&&(n+=e.left),n}},beep:`\x07`},o}var l=c(),u={exports:{}},d;function ee(){if(d)return u.exports;d=1;let e=process||{},t=e.argv||[],n=e.env||{},r=!(n.NO_COLOR||t.includes(`--no-color`))&&(!!n.FORCE_COLOR||t.includes(`--color`)||e.platform===`win32`||(e.stdout||{}).isTTY&&n.TERM!==`dumb`||!!n.CI),i=(e,t,n=e)=>r=>{let i=``+r,o=i.indexOf(t,e.length);return~o?e+a(i,t,n,o)+t:e+i+t},a=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},o=(e=r)=>{let t=e?i:()=>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`)}};return u.exports=o(),u.exports.createColors=o,u.exports}const f=a(ee());function te({onlyFirst:e=!1}={}){let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}const p=te();function m(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(p,``)}function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var g={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(e){var t=e.charCodeAt(0),n=e.length==2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r==12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r==8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r==172||r==175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r==161||r==164||167<=r&&r<=168||r==170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r==198||r==208||215<=r&&r<=216||222<=r&&r<=225||r==230||232<=r&&r<=234||236<=r&&r<=237||r==240||242<=r&&r<=243||247<=r&&r<=250||r==252||r==254||r==257||r==273||r==275||r==283||294<=r&&r<=295||r==299||305<=r&&r<=307||r==312||319<=r&&r<=322||r==324||328<=r&&r<=331||r==333||338<=r&&r<=339||358<=r&&r<=359||r==363||r==462||r==464||r==466||r==468||r==470||r==472||r==474||r==476||r==593||r==609||r==708||r==711||713<=r&&r<=715||r==717||r==720||728<=r&&r<=731||r==733||r==735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r==1025||1040<=r&&r<=1103||r==1105||r==8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r==8240||8242<=r&&r<=8243||r==8245||r==8251||r==8254||r==8308||r==8319||8321<=r&&r<=8324||r==8364||r==8451||r==8453||r==8457||r==8467||r==8470||8481<=r&&r<=8482||r==8486||r==8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r==8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r==8658||r==8660||r==8679||r==8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r==8715||r==8719||r==8721||r==8725||r==8730||8733<=r&&r<=8736||r==8739||r==8741||8743<=r&&r<=8748||r==8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r==8776||r==8780||r==8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r==8853||r==8857||r==8869||r==8895||r==8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r==9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r==9711||9733<=r&&r<=9734||r==9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r==9756||r==9758||r==9792||r==9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r==9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r==9955||9960<=r&&r<=9983||r==10045||r==10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r==65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`},t.characterLength=function(e){var t=this.eastAsianWidth(e);return t==`F`||t==`W`||t==`A`?2:1};function n(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(e){for(var t=n(e),r=0,i=0;i<t.length;i++)r+=this.characterLength(t[i]);return r},t.slice=function(e,r,i){textLen=t.length(e),r||=0,i||=1,r<0&&(r=textLen+r),i<0&&(i=textLen+i);for(var a=``,o=0,s=n(e),c=0;c<s.length;c++){var l=s[c],u=t.length(l);if(o>=r-(u==2?1:0))if(o+u<=i)a+=l;else break;o+=u}return a}})(g);var _=g.exports;const ne=h(_),re=h(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 v(e,t={}){if(typeof e!=`string`||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=m(e),e.length===0))return 0;e=e.replace(re(),` `);let n=t.ambiguousIsNarrow?1:2,r=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159||e>=768&&e<=879))switch(ne.eastAsianWidth(t)){case`F`:case`W`:r+=2;break;case`A`:r+=n;break;default:r+=1}}return r}const y=(e=0)=>t=>`\x1B[${t+e}m`,b=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,x=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,S={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(S.modifier);const ie=Object.keys(S.color),C=Object.keys(S.bgColor);[...ie,...C];function ae(){let e=new Map;for(let[t,n]of Object.entries(S)){for(let[t,r]of Object.entries(n))S[t]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[t]=S[t],e.set(r[0],r[1]);Object.defineProperty(S,t,{value:n,enumerable:!1})}return Object.defineProperty(S,`codes`,{value:e,enumerable:!1}),S.color.close=`\x1B[39m`,S.bgColor.close=`\x1B[49m`,S.color.ansi=y(),S.color.ansi256=b(),S.color.ansi16m=x(),S.bgColor.ansi=y(10),S.bgColor.ansi256=b(10),S.bgColor.ansi16m=x(10),Object.defineProperties(S,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?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(n/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[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>S.rgbToAnsi256(...S.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>S.ansi256ToAnsi(S.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>S.ansi256ToAnsi(S.hexToAnsi256(e)),enumerable:!1}}),S}const oe=ae(),w=new Set([`\x1B`,`›`]),T=`]8;;`,E=e=>`${w.values().next().value}[${e}m`,D=e=>`${w.values().next().value}${T}${e}`,O=e=>e.split(` `).map(e=>v(e)),k=(e,t,n)=>{let r=[...t],i=!1,a=!1,o=v(m(e[e.length-1]));for(let[t,s]of r.entries()){let c=v(s);if(o+c<=n?e[e.length-1]+=s:(e.push(s),o=0),w.has(s)&&(i=!0,a=r.slice(t+1).join(``).startsWith(T)),i){a?s===`\x07`&&(i=!1,a=!1):s===`m`&&(i=!1);continue}o+=c,o===n&&t<r.length-1&&(e.push(``),o=0)}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},se=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(v(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},ce=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=O(e),s=[``];for(let[r,i]of e.split(` `).entries()){n.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let e=v(s[s.length-1]);if(r!==0&&(e>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),e=0),(e>0||n.trim===!1)&&(s[s.length-1]+=` `,e++)),n.hard&&o[r]>t){let n=t-e,a=1+Math.floor((o[r]-n-1)/t);Math.floor((o[r]-1)/t)<a&&s.push(``),k(s,i,t);continue}if(e+o[r]>t&&e>0&&o[r]>0){if(n.wordWrap===!1&&e<t){k(s,i,t);continue}s.push(``)}if(e+o[r]>t&&n.wordWrap===!1){k(s,i,t);continue}s[s.length-1]+=i}n.trim!==!1&&(s=s.map(e=>se(e)));let c=[...s.join(`
2
- `)];for(let[e,t]of c.entries()){if(r+=t,w.has(t)){let{groups:t}=RegExp(`(?:\\[(?<code>\\d+)m|\\${T}(?<uri>.*))`).exec(c.slice(e).join(``))||{groups:{}};if(t.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}let n=oe.codes.get(Number(i));c[e+1]===`
3
- `?(a&&(r+=D(``)),i&&n&&(r+=E(n))):t===`
4
- `&&(i&&n&&(r+=E(i)),a&&(r+=D(a)))}return r};function A(e,t,n){return String(e).normalize().replace(/\r\n/g,`
5
- `).split(`
6
- `).map(e=>ce(e,t,n)).join(`
7
- `)}const j={actions:new Set([`up`,`down`,`left`,`right`,`space`,`enter`,`cancel`]),aliases:new Map([[`k`,`up`],[`j`,`down`],[`h`,`left`],[`l`,`right`],[``,`cancel`],[`escape`,`cancel`]])};function M(e,t){if(typeof e==`string`)return j.aliases.get(e)===t;for(let n of e)if(n!==void 0&&M(n,t))return!0;return!1}function le(e,t){if(e===t)return;let n=e.split(`
8
- `),r=t.split(`
9
- `),i=[];for(let e=0;e<Math.max(n.length,r.length);e++)n[e]!==r[e]&&i.push(e);return i}globalThis.process.platform.startsWith(`win`);const N=Symbol(`clack:cancel`);function P(e,t){let n=e;n.isTTY&&n.setRawMode(t)}var ue=Object.defineProperty,F=(e,t,n)=>t in e?ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I=(e,t,n)=>(F(e,typeof t==`symbol`?t:t+``,n),n),L=class{constructor(e,r=!0){I(this,`input`),I(this,`output`),I(this,`_abortSignal`),I(this,`rl`),I(this,`opts`),I(this,`_render`),I(this,`_track`,!1),I(this,`_prevFrame`,``),I(this,`_subscribers`,new Map),I(this,`_cursor`,0),I(this,`state`,`initial`),I(this,`error`,``),I(this,`value`);let{input:i=t,output:a=n,render:o,signal:s,...c}=e;this.opts=c,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=r,this._abortSignal=s,this.input=i,this.output=a}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let n=this._subscribers.get(e)??[];n.push(t),this._subscribers.set(e,n)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let n=this._subscribers.get(e)??[],r=[];for(let e of n)e.cb(...t),e.once&&r.push(()=>n.splice(n.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise((e,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state=`cancel`,this.close(),e(N);this._abortSignal.addEventListener(`abort`,()=>{this.state=`cancel`,this.close()},{once:!0})}let n=new r(0);n._write=(e,t,n)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,``),this._cursor=this.rl?.cursor??0,this.emit(`value`,this.value)),n()},this.input.pipe(n),this.rl=i.createInterface({input:this.input,output:n,tabSize:2,prompt:``,escapeCodeTimeout:50}),i.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on(`keypress`,this.onKeypress),P(this.input,!0),this.output.on(`resize`,this.render),this.render(),this.once(`submit`,()=>{this.output.write(l.cursor.show),this.output.off(`resize`,this.render),P(this.input,!1),e(this.value)}),this.once(`cancel`,()=>{this.output.write(l.cursor.show),this.output.off(`resize`,this.render),P(this.input,!1),e(N)})})}onKeypress(e,t){if(this.state===`error`&&(this.state=`active`),t?.name&&(!this._track&&j.aliases.has(t.name)&&this.emit(`cursor`,j.aliases.get(t.name)),j.actions.has(t.name)&&this.emit(`cursor`,t.name)),e&&(e.toLowerCase()===`y`||e.toLowerCase()===`n`)&&this.emit(`confirm`,e.toLowerCase()===`y`),e===` `&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit(`value`,this.opts.placeholder))),e&&this.emit(`key`,e.toLowerCase()),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))}this.state!==`error`&&(this.state=`submit`)}M([e,t?.name,t?.sequence],`cancel`)&&(this.state=`cancel`),(this.state===`submit`||this.state===`cancel`)&&this.emit(`finalize`),this.render(),(this.state===`submit`||this.state===`cancel`)&&this.close()}close(){this.input.unpipe(),this.input.removeListener(`keypress`,this.onKeypress),this.output.write(`
10
- `),P(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=A(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
11
- `).length-1;this.output.write(l.cursor.move(-999,e*-1))}render(){let e=A(this._render(this)??``,process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state===`initial`)this.output.write(l.cursor.hide);else{let t=le(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let n=t[0];this.output.write(l.cursor.move(0,n)),this.output.write(l.erase.lines(1));let r=e.split(`
12
- `);this.output.write(r[n]),this._prevFrame=e,this.output.write(l.cursor.move(0,r.length-n-1));return}if(t&&t?.length>1){let n=t[0];this.output.write(l.cursor.move(0,n)),this.output.write(l.erase.down());let r=e.split(`
13
- `).slice(n);this.output.write(r.join(`
14
- `)),this._prevFrame=e;return}this.output.write(l.erase.down())}this.output.write(e),this.state===`initial`&&(this.state=`active`),this._prevFrame=e}}},R=class extends L{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on(`value`,()=>{this.value=this._value}),this.on(`confirm`,e=>{this.output.write(l.cursor.move(0,-1)),this.value=e,this.state=`submit`,this.close()}),this.on(`cursor`,()=>{this.value=!this.value})}},z=Object.defineProperty,B=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V=(e,t,n)=>(B(e,typeof t==`symbol`?t:t+``,n),n);let H=class extends L{constructor(e){super(e,!1),V(this,`options`),V(this,`cursor`,0),this.options=e.options,this.value=[...e.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===e.cursorAt),0),this.on(`key`,e=>{e===`a`&&this.toggleAll()}),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case`down`:case`right`:this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case`space`:this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){this.value=this.value.length===this.options.length?[]:this.options.map(e=>e.value)}toggleValue(){this.value=this.value.includes(this._value)?this.value.filter(e=>e!==this._value):[...this.value,this._value]}};var U=Object.defineProperty,de=(e,t,n)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t,n)=>(de(e,typeof t==`symbol`?t:t+``,n),n),fe=class extends L{constructor(e){super(e,!1),W(this,`options`),W(this,`cursor`,0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case`down`:case`right`:this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},pe=class extends L{get valueWithCursor(){if(this.state===`submit`)return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[t,...n]=this.value.slice(this.cursor);return`${e}${f.inverse(t)}${n.join(``)}`}get cursor(){return this._cursor}constructor(e){super(e),this.on(`finalize`,()=>{this.value||=e.defaultValue})}};function me(){return e.platform===`win32`?!!e.env.CI||!!e.env.WT_SESSION||!!e.env.TERMINUS_SUBLIME||e.env.ConEmuTask===`{cmd::Cmder}`||e.env.TERM_PROGRAM===`Terminus-Sublime`||e.env.TERM_PROGRAM===`vscode`||e.env.TERM===`xterm-256color`||e.env.TERM===`alacritty`||e.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:e.env.TERM!==`linux`}const he=me(),G=(e,t)=>he?e:t,ge=G(`❯`,`>`),_e=G(`■`,`x`),ve=G(`▲`,`x`),ye=G(`✔`,`√`),K=G(``),q=G(``),J=G(`●`,`>`),Y=G(`○`,` `),be=G(`◻`,`[•]`),X=G(`◼`,`[+]`),xe=G(`◻`,`[ ]`),Z=e=>{switch(e){case`initial`:case`active`:return f.cyan(ge);case`cancel`:return f.red(_e);case`error`:return f.yellow(ve);case`submit`:return f.green(ye)}},Q=e=>{let{cursor:t,options:n,style:r}=e,i=e.maxItems??1/0,a=Math.max(process.stdout.rows-4,0),o=Math.min(a,Math.max(i,5)),s=0;t>=s+o-3?s=Math.max(Math.min(t-o+3,n.length-o),0):t<s+2&&(s=Math.max(t-2,0));let c=o<n.length&&s>0,l=o<n.length&&s+o<n.length;return n.slice(s,s+o).map((e,n,i)=>{let a=n===0&&c,o=n===i.length-1&&l;return a||o?f.dim(`...`):r(e,n+s===t)})},Se=e=>new pe({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,render(){let t=`${f.gray(K)}
15
- ${Z(this.state)} ${e.message}
16
- `,n=e.placeholder?f.inverse(e.placeholder[0])+f.dim(e.placeholder.slice(1)):f.inverse(f.hidden(`_`)),r=this.value?this.valueWithCursor:n;switch(this.state){case`error`:return`${t.trim()}
17
- ${f.yellow(K)} ${r}
18
- ${f.yellow(q)} ${f.yellow(this.error)}
19
- `;case`submit`:return`${t}${f.gray(K)} ${f.dim(this.value||e.placeholder)}`;case`cancel`:return`${t}${f.gray(K)} ${f.strikethrough(f.dim(this.value??``))}${this.value?.trim()?`
20
- ${f.gray(K)}`:``}`;default:return`${t}${f.cyan(K)} ${r}
21
- ${f.cyan(q)}
22
- `}}}).prompt(),Ce=e=>{let t=e.active??`Yes`,n=e.inactive??`No`;return new R({active:t,inactive:n,initialValue:e.initialValue??!0,render(){let r=`${f.gray(K)}
23
- ${Z(this.state)} ${e.message}
24
- `,i=this.value?t:n;switch(this.state){case`submit`:return`${r}${f.gray(K)} ${f.dim(i)}`;case`cancel`:return`${r}${f.gray(K)} ${f.strikethrough(f.dim(i))}
25
- ${f.gray(K)}`;default:return`${r}${f.cyan(K)} ${this.value?`${f.green(J)} ${t}`:`${f.dim(Y)} ${f.dim(t)}`} ${f.dim(`/`)} ${this.value?`${f.dim(Y)} ${f.dim(n)}`:`${f.green(J)} ${n}`}
26
- ${f.cyan(q)}
27
- `}}}).prompt()},we=e=>{let t=(e,t)=>{let n=e.label??String(e.value);switch(t){case`selected`:return`${f.dim(n)}`;case`active`:return`${f.green(J)} ${n} ${e.hint?f.dim(`(${e.hint})`):``}`;case`cancelled`:return`${f.strikethrough(f.dim(n))}`;default:return`${f.dim(Y)} ${f.dim(n)}`}};return new fe({options:e.options,initialValue:e.initialValue,render(){let n=`${f.gray(K)}
28
- ${Z(this.state)} ${e.message}
29
- `;switch(this.state){case`submit`:return`${n}${f.gray(K)} ${t(this.options[this.cursor],`selected`)}`;case`cancel`:return`${n}${f.gray(K)} ${t(this.options[this.cursor],`cancelled`)}
30
- ${f.gray(K)}`;default:return`${n}${f.cyan(K)} ${Q({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,n)=>t(e,n?`active`:`inactive`)}).join(`
31
- ${f.cyan(K)} `)}
32
- ${f.cyan(q)}
33
- `}}}).prompt()},Te=e=>{let t=(e,t)=>{let n=e.label??String(e.value);return t===`active`?`${f.cyan(be)} ${n} ${e.hint?f.dim(`(${e.hint})`):``}`:t===`selected`?`${f.green(X)} ${f.dim(n)}`:t===`cancelled`?`${f.strikethrough(f.dim(n))}`:t===`active-selected`?`${f.green(X)} ${n} ${e.hint?f.dim(`(${e.hint})`):``}`:t===`submitted`?`${f.dim(n)}`:`${f.dim(xe)} ${f.dim(n)}`};return new H({options:e.options,initialValues:e.initialValues,required:e.required??!0,cursorAt:e.cursorAt,validate(e){if(this.required&&e.length===0)return`Please select at least one option.
34
- ${f.reset(f.dim(`Press ${f.gray(f.bgWhite(f.inverse(` space `)))} to select, ${f.gray(f.bgWhite(f.inverse(` enter `)))} to submit`))}`},render(){let n=`${f.gray(K)}
35
- ${Z(this.state)} ${e.message}
36
- `,r=(e,n)=>{let r=this.value.includes(e.value);return n&&r?t(e,`active-selected`):r?t(e,`selected`):t(e,n?`active`:`inactive`)};switch(this.state){case`submit`:return`${n}${f.gray(K)} ${this.options.filter(({value:e})=>this.value.includes(e)).map(e=>t(e,`submitted`)).join(f.dim(`, `))||f.dim(`none`)}`;case`cancel`:{let e=this.options.filter(({value:e})=>this.value.includes(e)).map(e=>t(e,`cancelled`)).join(f.dim(`, `));return`${n}${f.gray(K)} ${e.trim()?`${e}
37
- ${f.gray(K)}`:``}`}case`error`:{let t=this.error.split(`
38
- `).map((e,t)=>t===0?`${f.yellow(q)} ${f.yellow(e)}`:` ${e}`).join(`
39
- `);return`${n+f.yellow(K)} ${Q({options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:r}).join(`
40
- ${f.yellow(K)} `)}
41
- ${t}
42
- `}default:return`${n}${f.cyan(K)} ${Q({options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:r}).join(`
43
- ${f.cyan(K)} `)}
44
- ${f.cyan(q)}
45
- `}}}).prompt()};`${f.gray(K)}`;const Ee=Symbol.for(`cancel`);async function $(e,t={}){let n=e=>{if(typeof e!=`symbol`||e.toString()!==`Symbol(clack:cancel)`)return e;switch(t.cancel){case`reject`:{let e=Error(`Prompt cancelled.`);throw e.name=`ConsolaPromptCancelledError`,Error.captureStackTrace&&Error.captureStackTrace(e,$),e}case`undefined`:return;case`null`:return null;case`symbol`:return Ee;default:case`default`:return t.default??t.initial}};if(!t.type||t.type===`text`)return await Se({message:e,defaultValue:t.default,placeholder:t.placeholder,initialValue:t.initial}).then(n);if(t.type===`confirm`)return await Ce({message:e,initialValue:t.initial}).then(n);if(t.type===`select`)return await we({message:e,options:t.options.map(e=>typeof e==`string`?{value:e,label:e}:e),initialValue:t.initial}).then(n);if(t.type===`multiselect`)return await Te({message:e,options:t.options.map(e=>typeof e==`string`?{value:e,label:e}:e),required:t.required,initialValues:t.initial}).then(n);throw Error(`Unknown prompt type: ${t.type}`)}export{$ as prompt};
@@ -1 +0,0 @@
1
- import{b as e}from"./index.js";const t=globalThis.process.getBuiltinModule(`module`).createRequire(import.meta.url),n=globalThis.process.getBuiltinModule(`node:path`),r=t(`typescript`),i=e(`rolldown-plugin-dts:tsc-resolver`);function a(e,t,a,o,s,c){let l=o?n.dirname(o):a,u=r.parseJsonConfigFileContent(s,r.sys,l),d=r.bundlerModuleNameResolver(e,t,{moduleResolution:r.ModuleResolutionKind.Bundler,...u.options},r.sys,void 0,c);return i(`tsc resolving id "%s" from "%s" -> %O`,e,t,d.resolvedModule),d.resolvedModule?.resolvedFileName}export{a as tscResolve};
@@ -1 +0,0 @@
1
- import{b as e,c as t,s as n}from"./index.js";import{n as r}from"./context-DoVwxr5H-CUnaSkDS.js";const i=globalThis.process.getBuiltinModule(`module`).createRequire(import.meta.url),{createRequire:a}=globalThis.process.getBuiltinModule(`node:module`),o=globalThis.process.getBuiltinModule(`node:path`),s=i(`typescript`),{pathToFileURL:c}=globalThis.process.getBuiltinModule(`node:url`);var l=a(import.meta.url);const u=e(`rolldown-plugin-dts:tsc-system`);function d(e){return{...s.sys,write(e){u(e)},resolvePath(t){return e.has(t)?t:s.sys.resolvePath(t)},directoryExists(t){return Array.from(e.keys()).some(e=>e.startsWith(t))?!0:s.sys.directoryExists(t)},fileExists(t){return e.has(t)?!0:s.sys.fileExists(t)},readFile(t,...n){return e.has(t)?e.get(t):s.sys.readFile(t,...n)},writeFile(t,n,...r){e.set(t,n),s.sys.writeFile(t,n,...r)},deleteFile(t,...n){e.delete(t),s.sys.deleteFile?.(t,...n)}}}function f(e){return{...d(e),writeFile(t,n){e.set(t,n)},deleteFile(t){e.delete(t)}}}const p={getCurrentDirectory:()=>s.sys.getCurrentDirectory(),getNewLine:()=>s.sys.newLine,getCanonicalFileName:s.sys.useCaseSensitiveFileNames?e=>e:e=>e.toLowerCase()},m={afterDeclarations:[e=>{let t=n=>s.isPropertySignature(n)&&s.isPrivateIdentifier(n.name)?e.factory.updatePropertySignature(n,n.modifiers,e.factory.createStringLiteral(n.name.text),n.questionToken,n.type):s.visitEachChild(n,t,e);return e=>s.visitNode(e,t,s.isSourceFile)??e}]};function h(e,t,n){if(!e||e.sourceRoot)return;let r=o.posix.dirname(c(t).pathname),i=o.posix.dirname(c(n).pathname);r!==i&&(e.sourceRoot=o.posix.relative(i,r))}const g=e(`rolldown-plugin-dts:tsc-build`);function _(e){let{id:i,tsconfig:a,incremental:o,context:c=r,sourcemap:l}=e;if(g(`running tscEmitBuild id: ${i}, tsconfig: ${a}, incremental: ${o}`),!a)return{error:`[rolldown-plugin-dts] build mode requires a tsconfig path`};let u=(o?d:f)(c.files),p=u.resolvePath(i);p!==i&&g(`resolved id from ${i} to ${p}`);let m=v(c,u,a,!o,l).get(p);if(!m)return g(`unable to locate a project containing ${p}`),{error:`Unable to locate ${i} from the given tsconfig file ${a}`};g(`loaded project ${m.tsconfigPath} for ${i}`);let y=!u.useCaseSensitiveFileNames,b=s.getOutputFileNames(m.parsedConfig,p,y),x,S;for(let e of b){if(n.test(e)){if(!u.fileExists(e)){console.warn(`[rolldown-plugin-dts] Unable to read file ${e}`);continue}x=u.readFile(e);continue}if(t.test(e)){if(!u.fileExists(e))continue;let t=u.readFile(e);if(!t){console.warn(`[rolldown-plugin-dts] Unexpected sourcemap ${e}`);continue}S=JSON.parse(t),h(S,e,p)}}return x?{code:x,map:S}:o?(g(`incremental build failed`),_({...e,incremental:!1})):(g(`unable to build .d.ts file for ${i}`),m.parsedConfig.options.declaration===!0?{error:`Unable to build .d.ts file for ${i}; This seems like a bug of rolldown-plugin-dts. Please report this issue to https://github.com/sxzz/rolldown-plugin-dts/issues`}:{error:`Unable to build .d.ts file for ${i}; Make sure the "declaration" option is set to true in ${m.tsconfigPath}`})}function v(e,t,n,r,i){let a=e.projects.get(n);return a?(g(`skip building projects for ${n}`),a):(a=y(t,n,r,i),e.projects.set(n,a),a)}function y(e,t,n,r){g(`start building projects for ${t}`);let i=b(t,e,n,r);g(`collected %d projects: %j`,i.length,i.map(e=>e.tsconfigPath));let a=s.createSolutionBuilderHost(e,C);g(`built solution for ${t} with exit status ${s.createSolutionBuilder(a,[t],{force:n,verbose:!0}).build(void 0,void 0,void 0,e=>(g(`transforming project ${e}`),m))}`);let o=new Map;for(let t of i)for(let n of t.parsedConfig.fileNames)o.set(e.resolvePath(n),t);return o}function b(e,t,n,r){let i=new Set,a=[],o=[t.resolvePath(e)];for(;;){let e=o.pop();if(!e)break;if(i.has(e))continue;i.add(e);let c=x(e,t);if(c){c.options=S(c.options,{tsconfigPath:e,force:n,sourcemap:r}),a.push({tsconfigPath:e,parsedConfig:c});for(let e of c.projectReferences??[])o.push(s.resolveProjectReferencePath(e))}}return a}function x(e,t){let n=[],r=s.getParsedCommandLineOfConfigFile(e,void 0,{...t,onUnRecoverableConfigFileDiagnostic:e=>{n.push(e)}});if(n.length)throw Error(`[rolldown-plugin-dts] Unable to read ${e}: ${s.formatDiagnostics(n,p)}`);return r}function S(e,t){let n=e.noEmit??!1,r=e.declaration??!!e.composite,i=e.declarationMap??!1,a=t?.tsconfigPath&&!t.force;return n===!0&&(e={...e,noEmit:!1},a&&console.warn(`[rolldown-plugin-dts] ${t.tsconfigPath} has "noEmit" set to true. Please set it to false to generate declaration files.`)),r===!1&&(e={...e,declaration:!0},a&&console.warn(`[rolldown-plugin-dts] ${t.tsconfigPath} has "declaration" set to false. Please set it to true to generate declaration files.`)),i===!1&&t?.sourcemap&&(e={...e,declarationMap:!0},a&&console.warn(`[rolldown-plugin-dts] ${t.tsconfigPath} has "declarationMap" set to false. Please set it to true if you want to generate source maps for declaration files.`)),e}const C=(e,t,...n)=>s.createEmitAndSemanticDiagnosticsBuilderProgram(e,S(t??{},null),...n),w=e(`rolldown-plugin-dts:volar`);function T(){w(`loading vue language tools`);try{let e=l.resolve(`vue-tsc`);return{volarTs:l(l.resolve(`@volar/typescript`,{paths:[e]})),vue:l(l.resolve(`@vue/language-core`,{paths:[e]}))}}catch(e){throw w(`vue language tools not found`,e),Error(`Failed to load vue language tools. Please manually install vue-tsc.`)}}function E(){let{vue:e,volarTs:{proxyCreateProgram:t}}=T();return{proxyCreateProgram:t,getLanguagePlugin:(t,n)=>{let r=n.options.$rootDir,i=n.options.$configRaw,a=new e.CompilerOptionsResolver(t,t.sys.readFile);a.addConfig(i?.vueCompilerOptions??{},r);let o=a.build();return e.createVueLanguagePlugin(t,n.options,o,e=>e)}}}function D(){let t=e(`rolldown-plugin-dts:ts-macro`);t(`loading ts-macro language tools`);try{let e=l.resolve(`@ts-macro/tsc`),{proxyCreateProgram:t}=l(l.resolve(`@volar/typescript`,{paths:[e]})),n=l(l.resolve(`@ts-macro/language-plugin`,{paths:[e]})),{getOptions:r}=l(l.resolve(`@ts-macro/language-plugin/options`,{paths:[e]}));return{proxyCreateProgram:t,getLanguagePlugin:(e,t)=>{let i=t.options.$rootDir;return n.getLanguagePlugins(e,t.options,r(e,i))[0]}}}catch(e){throw t(`ts-macro language tools not found`,e),Error(`Failed to load ts-macro language tools. Please manually install @ts-macro/tsc.`)}}function O(e,t){let n=t.vue?E():void 0,r=t.tsMacro?D():void 0,i=n?.proxyCreateProgram||r?.proxyCreateProgram;return i?i(e,e.createProgram,(e,t)=>{let i=[];return n&&i.push(n.getLanguagePlugin(e,t)),r&&i.push(r.getLanguagePlugin(e,t)),{languagePlugins:i}}):e.createProgram}const k=e(`rolldown-plugin-dts:tsc-compiler`),A={declaration:!0,noEmit:!1,emitDeclarationOnly:!0,noEmitOnError:!0,checkJs:!1,declarationMap:!1,skipLibCheck:!0,target:99,resolveJsonModule:!0,moduleResolution:s.ModuleResolutionKind.Bundler};function j(e){let{id:t,entries:n,context:i=r}=e,a=i.programs.find(e=>{let r=e.getRootFileNames();return n?n.every(e=>r.includes(e)):r.includes(t)});if(a){let e=a.getSourceFile(t);if(e)return{program:a,file:e}}k(`create program for module: ${t}`);let o=M(e);return k(`created program for module: ${t}`),i.programs.push(o.program),o}function M({entries:e,id:t,tsconfig:n,tsconfigRaw:i,vue:a,tsMacro:c,cwd:l,context:u=r}){let f=d(u.files),p=n?o.dirname(n):l,m=s.parseJsonConfigFileContent(i,f,p,void 0,void 0,void 0,a?[{extension:`vue`,isMixedContent:!0,scriptKind:s.ScriptKind.Deferred}]:void 0);return k(`creating program for root project: ${p}`),N({parsedConfig:m,fsSystem:f,baseDir:p,id:t,entries:e,vue:a,tsMacro:c})}function N({parsedConfig:e,fsSystem:t,baseDir:n,id:r,entries:i,vue:a,tsMacro:o}){let c={...A,...e.options,$configRaw:e.raw,$rootDir:n},l=[...new Set([r,...i||e.fileNames].map(e=>t.resolvePath(e)))],u=s.createCompilerHost(c,!0),d=O(s,{vue:a,tsMacro:o})({rootNames:l,options:c,host:u,projectReferences:e.projectReferences}),f=d.getSourceFile(r);if(!f)throw k(`source file not found in program: ${r}`),e.projectReferences?.length?Error(`[rolldown-plugin-dts] Unable to load ${r}; You have "references" in your tsconfig file. Perhaps you want to add \`dts: { build: true }\` in your config?`):t.fileExists(r)?(k(`File ${r} exists on disk.`),Error(`Unable to load file ${r} from the program. This seems like a bug of rolldown-plugin-dts. Please report this issue to https://github.com/sxzz/rolldown-plugin-dts/issues`)):(k(`File ${r} does not exist on disk.`),Error(`Source file not found: ${r}`));return{program:d,file:f}}function P(e){k(`running tscEmitCompiler ${e.id}`);let{program:t,file:n}=j(e);k(`got source file: ${n.fileName}`);let r,i,{emitSkipped:a,diagnostics:o}=t.emit(n,(t,n)=>{t.endsWith(`.map`)?(k(`emit dts sourcemap: ${t}`),i=JSON.parse(n),h(i,t,e.id)):(k(`emit dts: ${t}`),r=n)},void 0,!0,m,!0);return a&&o.length?{error:s.formatDiagnostics(o,p)}:(r||(k(`nothing was emitted.`),n.isDeclarationFile?(k(`source file is a declaration file.`),r=n.getFullText()):console.warn("[rolldown-plugin-dts] Warning: Failed to emit declaration file. Please try to enable `eager` option (`dts.eager` for tsdown).")),{code:r,map:i})}const F=e(`rolldown-plugin-dts:tsc`);F(`loaded typescript: ${s.version}`);function I(e){return F(`running tscEmit ${e.id}`),e.build?_(e):P(e)}export{I as tscEmit};