Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@clack/core

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clack/core - npm Package Compare versions

Comparing version
1.0.0-alpha.0
to
1.0.0-alpha.1
+16
-0
CHANGELOG.md
# @clack/core
## 1.0.0-alpha.1
### Minor Changes
- 7bc3301: Prompts now have a `userInput` stored separately from their `value`.
- 2837845: Adds suggestion and path prompts
- df4eea1: Remove `suggestion` prompt and change `path` prompt to be an autocomplete prompt.
### Patch Changes
- bfe0dd3: Prevents placeholder from being used as input value in text prompts
- 34f52fe: Validates initial values immediately when using text prompts with initialValue and validate props.
- 94fee2a: Changes `placeholder` to be a visual hint rather than a tabbable value.
- 4f6b3c2: Set initial values of auto complete prompt to first option when multiple is false.
- 8ead5d3: Avoid passing initial values to core when using auto complete prompt
## 1.0.0-alpha.0

@@ -4,0 +20,0 @@

+43
-39

@@ -50,3 +50,3 @@ import { Key } from 'node:readline';

*/
interface ClackEvents {
interface ClackEvents<TValue> {
initial: (value?: any) => void;

@@ -59,12 +59,14 @@ active: (value?: any) => void;

key: (key: string | undefined, info: Key) => void;
value: (value?: string) => void;
value: (value?: TValue) => void;
userInput: (value: string) => void;
confirm: (value?: boolean) => void;
finalize: () => void;
beforePrompt: () => void;
}
interface PromptOptions<Self extends Prompt> {
interface PromptOptions<TValue, Self extends Prompt<TValue>> {
render(this: Omit<Self, 'prompt'>): string | undefined;
placeholder?: string;
initialValue?: any;
validate?: ((value: any) => string | Error | undefined) | undefined;
initialUserInput?: string;
validate?: ((value: TValue | undefined) => string | Error | undefined) | undefined;
input?: Readable;

@@ -75,3 +77,3 @@ output?: Writable;

}
declare class Prompt {
declare class Prompt<TValue> {
protected input: Readable;

@@ -87,7 +89,7 @@ protected output: Writable;

protected _cursor: number;
protected _usePlaceholderAsValue: boolean;
state: ClackState;
error: string;
value: any;
constructor(options: PromptOptions<Prompt>, trackValue?: boolean);
value: TValue | undefined;
userInput: string;
constructor(options: PromptOptions<TValue, Prompt<TValue>>, trackValue?: boolean);
/**

@@ -107,3 +109,3 @@ * Unsubscribe all listeners

*/
on<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]): void;
on<T extends keyof ClackEvents<TValue>>(event: T, cb: ClackEvents<TValue>[T]): void;
/**

@@ -114,3 +116,3 @@ * Subscribe to an event once

*/
once<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]): void;
once<T extends keyof ClackEvents<TValue>>(event: T, cb: ClackEvents<TValue>[T]): void;
/**

@@ -121,6 +123,7 @@ * Emit an event with data

*/
emit<T extends keyof ClackEvents>(event: T, ...data: Parameters<ClackEvents[T]>): void;
prompt(): Promise<string | symbol>;
emit<T extends keyof ClackEvents<TValue>>(event: T, ...data: Parameters<ClackEvents<TValue>[T]>): void;
prompt(): Promise<symbol | TValue | undefined>;
protected _isActionKey(char: string | undefined, _key: Key): boolean;
protected _setValue(value: unknown): void;
protected _setValue(value: TValue | undefined): void;
protected _setUserInput(value: string | undefined, write?: boolean): void;
private onKeypress;

@@ -132,3 +135,3 @@ protected close(): void;

interface ConfirmOptions extends PromptOptions<ConfirmPrompt> {
interface ConfirmOptions extends PromptOptions<boolean, ConfirmPrompt> {
active: string;

@@ -138,3 +141,3 @@ inactive: string;

}
declare class ConfirmPrompt extends Prompt {
declare class ConfirmPrompt extends Prompt<boolean> {
get cursor(): 0 | 1;

@@ -147,3 +150,3 @@ private get _value();

value: any;
}> extends PromptOptions<GroupMultiSelectPrompt<T>> {
}> extends PromptOptions<T['value'][], GroupMultiSelectPrompt<T>> {
options: Record<string, T[]>;

@@ -157,3 +160,3 @@ initialValues?: T['value'][];

value: any;
}> extends Prompt {
}> extends Prompt<T['value'][]> {
#private;

@@ -172,3 +175,3 @@ options: (T & {

value: any;
}> extends PromptOptions<MultiSelectPrompt<T>> {
}> extends PromptOptions<T['value'][], MultiSelectPrompt<T>> {
options: T[];

@@ -181,3 +184,3 @@ initialValues?: T['value'][];

value: any;
}> extends Prompt {
}> extends Prompt<T['value'][]> {
options: T[];

@@ -191,10 +194,10 @@ cursor: number;

interface PasswordOptions extends PromptOptions<PasswordPrompt> {
interface PasswordOptions extends PromptOptions<string, PasswordPrompt> {
mask?: string;
}
declare class PasswordPrompt extends Prompt {
declare class PasswordPrompt extends Prompt<string> {
private _mask;
get cursor(): number;
get masked(): any;
get valueWithCursor(): any;
get masked(): string;
get userInputWithCursor(): string;
constructor({ mask, ...opts }: PasswordOptions);

@@ -205,3 +208,3 @@ }

value: any;
}> extends PromptOptions<SelectPrompt<T>> {
}> extends PromptOptions<T['value'], SelectPrompt<T>> {
options: T[];

@@ -212,6 +215,6 @@ initialValue?: T['value'];

value: any;
}> extends Prompt {
}> extends Prompt<T['value']> {
options: T[];
cursor: number;
private get _value();
private get _selectedValue();
private changeValue;

@@ -222,9 +225,9 @@ constructor(opts: SelectOptions<T>);

interface SelectKeyOptions<T extends {
value: any;
}> extends PromptOptions<SelectKeyPrompt<T>> {
value: string;
}> extends PromptOptions<T['value'], SelectKeyPrompt<T>> {
options: T[];
}
declare class SelectKeyPrompt<T extends {
value: any;
}> extends Prompt {
value: string;
}> extends Prompt<T['value']> {
options: T[];

@@ -235,8 +238,8 @@ cursor: number;

interface TextOptions extends PromptOptions<TextPrompt> {
interface TextOptions extends PromptOptions<string, TextPrompt> {
placeholder?: string;
defaultValue?: string;
}
declare class TextPrompt extends Prompt {
get valueWithCursor(): any;
declare class TextPrompt extends Prompt<string> {
get userInputWithCursor(): string;
get cursor(): number;

@@ -251,10 +254,9 @@ constructor(opts: TextOptions);

type FilterFunction<T extends OptionLike> = (search: string, opt: T) => boolean;
interface AutocompleteOptions<T extends OptionLike> extends PromptOptions<AutocompletePrompt<T>> {
options: T[];
interface AutocompleteOptions<T extends OptionLike> extends PromptOptions<T['value'] | T['value'][], AutocompletePrompt<T>> {
options: T[] | ((this: AutocompletePrompt<T>) => T[]);
filter?: FilterFunction<T>;
multiple?: boolean;
}
declare class AutocompletePrompt<T extends OptionLike> extends Prompt {
declare class AutocompletePrompt<T extends OptionLike> extends Prompt<T['value'] | T['value'][]> {
#private;
options: T[];
filteredOptions: T[];

@@ -266,5 +268,7 @@ multiple: boolean;

get cursor(): number;
get valueWithCursor(): string;
get userInputWithCursor(): string;
get options(): T[];
constructor(opts: AutocompleteOptions<T>);
protected _isActionKey(char: string | undefined, key: Key): boolean;
deselectAll(): void;
toggleSelected(value: T['value']): void;

@@ -271,0 +275,0 @@ }

@@ -1,15 +0,15 @@

import{cursor as h,erase as V}from"sisteransi";import{stdin as K,stdout as G}from"node:process";import*as y from"node:readline";import Eu from"node:readline";import{ReadStream as z,WriteStream as lu}from"node:tty";import p from"picocolors";function hu({onlyFirst:e=!1}={}){const 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 cu=hu();function Y(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(cu,"")}function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q={exports:{}};(function(e){var D={};e.exports=D,D.eastAsianWidth=function(s){var i=s.charCodeAt(0),F=s.length==2?s.charCodeAt(1):0,u=i;return 55296<=i&&i<=56319&&56320<=F&&F<=57343&&(i&=1023,F&=1023,u=i<<10|F,u+=65536),u==12288||65281<=u&&u<=65376||65504<=u&&u<=65510?"F":u==8361||65377<=u&&u<=65470||65474<=u&&u<=65479||65482<=u&&u<=65487||65490<=u&&u<=65495||65498<=u&&u<=65500||65512<=u&&u<=65518?"H":4352<=u&&u<=4447||4515<=u&&u<=4519||4602<=u&&u<=4607||9001<=u&&u<=9002||11904<=u&&u<=11929||11931<=u&&u<=12019||12032<=u&&u<=12245||12272<=u&&u<=12283||12289<=u&&u<=12350||12353<=u&&u<=12438||12441<=u&&u<=12543||12549<=u&&u<=12589||12593<=u&&u<=12686||12688<=u&&u<=12730||12736<=u&&u<=12771||12784<=u&&u<=12830||12832<=u&&u<=12871||12880<=u&&u<=13054||13056<=u&&u<=19903||19968<=u&&u<=42124||42128<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||55216<=u&&u<=55238||55243<=u&&u<=55291||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65106||65108<=u&&u<=65126||65128<=u&&u<=65131||110592<=u&&u<=110593||127488<=u&&u<=127490||127504<=u&&u<=127546||127552<=u&&u<=127560||127568<=u&&u<=127569||131072<=u&&u<=194367||177984<=u&&u<=196605||196608<=u&&u<=262141?"W":32<=u&&u<=126||162<=u&&u<=163||165<=u&&u<=166||u==172||u==175||10214<=u&&u<=10221||10629<=u&&u<=10630?"Na":u==161||u==164||167<=u&&u<=168||u==170||173<=u&&u<=174||176<=u&&u<=180||182<=u&&u<=186||188<=u&&u<=191||u==198||u==208||215<=u&&u<=216||222<=u&&u<=225||u==230||232<=u&&u<=234||236<=u&&u<=237||u==240||242<=u&&u<=243||247<=u&&u<=250||u==252||u==254||u==257||u==273||u==275||u==283||294<=u&&u<=295||u==299||305<=u&&u<=307||u==312||319<=u&&u<=322||u==324||328<=u&&u<=331||u==333||338<=u&&u<=339||358<=u&&u<=359||u==363||u==462||u==464||u==466||u==468||u==470||u==472||u==474||u==476||u==593||u==609||u==708||u==711||713<=u&&u<=715||u==717||u==720||728<=u&&u<=731||u==733||u==735||768<=u&&u<=879||913<=u&&u<=929||931<=u&&u<=937||945<=u&&u<=961||963<=u&&u<=969||u==1025||1040<=u&&u<=1103||u==1105||u==8208||8211<=u&&u<=8214||8216<=u&&u<=8217||8220<=u&&u<=8221||8224<=u&&u<=8226||8228<=u&&u<=8231||u==8240||8242<=u&&u<=8243||u==8245||u==8251||u==8254||u==8308||u==8319||8321<=u&&u<=8324||u==8364||u==8451||u==8453||u==8457||u==8467||u==8470||8481<=u&&u<=8482||u==8486||u==8491||8531<=u&&u<=8532||8539<=u&&u<=8542||8544<=u&&u<=8555||8560<=u&&u<=8569||u==8585||8592<=u&&u<=8601||8632<=u&&u<=8633||u==8658||u==8660||u==8679||u==8704||8706<=u&&u<=8707||8711<=u&&u<=8712||u==8715||u==8719||u==8721||u==8725||u==8730||8733<=u&&u<=8736||u==8739||u==8741||8743<=u&&u<=8748||u==8750||8756<=u&&u<=8759||8764<=u&&u<=8765||u==8776||u==8780||u==8786||8800<=u&&u<=8801||8804<=u&&u<=8807||8810<=u&&u<=8811||8814<=u&&u<=8815||8834<=u&&u<=8835||8838<=u&&u<=8839||u==8853||u==8857||u==8869||u==8895||u==8978||9312<=u&&u<=9449||9451<=u&&u<=9547||9552<=u&&u<=9587||9600<=u&&u<=9615||9618<=u&&u<=9621||9632<=u&&u<=9633||9635<=u&&u<=9641||9650<=u&&u<=9651||9654<=u&&u<=9655||9660<=u&&u<=9661||9664<=u&&u<=9665||9670<=u&&u<=9672||u==9675||9678<=u&&u<=9681||9698<=u&&u<=9701||u==9711||9733<=u&&u<=9734||u==9737||9742<=u&&u<=9743||9748<=u&&u<=9749||u==9756||u==9758||u==9792||u==9794||9824<=u&&u<=9825||9827<=u&&u<=9829||9831<=u&&u<=9834||9836<=u&&u<=9837||u==9839||9886<=u&&u<=9887||9918<=u&&u<=9919||9924<=u&&u<=9933||9935<=u&&u<=9953||u==9955||9960<=u&&u<=9983||u==10045||u==10071||10102<=u&&u<=10111||11093<=u&&u<=11097||12872<=u&&u<=12879||57344<=u&&u<=63743||65024<=u&&u<=65039||u==65533||127232<=u&&u<=127242||127248<=u&&u<=127277||127280<=u&&u<=127337||127344<=u&&u<=127386||917760<=u&&u<=917999||983040<=u&&u<=1048573||1048576<=u&&u<=1114109?"A":"N"},D.characterLength=function(s){var i=this.eastAsianWidth(s);return i=="F"||i=="W"||i=="A"?2:1};function t(s){return s.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}D.length=function(s){for(var i=t(s),F=0,u=0;u<i.length;u++)F=F+this.characterLength(i[u]);return F},D.slice=function(s,i,F){textLen=D.length(s),i=i||0,F=F||1,i<0&&(i=textLen+i),F<0&&(F=textLen+F);for(var u="",r=0,a=t(s),n=0;n<a.length;n++){var l=a[n],o=D.length(l);if(r>=i-(o==2?1:0))if(r+o<=F)u+=l;else break;r+=o}return u}})(q);var xu=q.exports;const Bu=Z(xu);var Au=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])|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E80\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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[\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};const pu=Z(Au);function m(e,D={}){if(typeof e!="string"||e.length===0||(D={ambiguousIsNarrow:!0,...D},e=Y(e),e.length===0))return 0;e=e.replace(pu()," ");const t=D.ambiguousIsNarrow?1:2;let s=0;for(const i of e){const F=i.codePointAt(0);if(F<=31||F>=127&&F<=159||F>=768&&F<=879)continue;switch(Bu.eastAsianWidth(i)){case"F":case"W":s+=2;break;case"A":s+=t;break;default:s+=1}}return s}const O=10,H=(e=0)=>D=>`\x1B[${D+e}m`,U=(e=0)=>D=>`\x1B[${38+e};5;${D}m`,J=(e=0)=>(D,t,s)=>`\x1B[${38+e};2;${D};${t};${s}m`,C={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(C.modifier);const fu=Object.keys(C.color),du=Object.keys(C.bgColor);[...fu,...du];function gu(){const e=new Map;for(const[D,t]of Object.entries(C)){for(const[s,i]of Object.entries(t))C[s]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[s]=C[s],e.set(i[0],i[1]);Object.defineProperty(C,D,{value:t,enumerable:!1})}return Object.defineProperty(C,"codes",{value:e,enumerable:!1}),C.color.close="\x1B[39m",C.bgColor.close="\x1B[49m",C.color.ansi=H(),C.color.ansi256=U(),C.color.ansi16m=J(),C.bgColor.ansi=H(O),C.bgColor.ansi256=U(O),C.bgColor.ansi16m=J(O),Object.defineProperties(C,{rgbToAnsi256:{value:(D,t,s)=>D===t&&t===s?D<8?16:D>248?231:Math.round((D-8)/247*24)+232:16+36*Math.round(D/255*5)+6*Math.round(t/255*5)+Math.round(s/255*5),enumerable:!1},hexToRgb:{value:D=>{const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(D.toString(16));if(!t)return[0,0,0];let[s]=t;s.length===3&&(s=[...s].map(F=>F+F).join(""));const i=Number.parseInt(s,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:D=>C.rgbToAnsi256(...C.hexToRgb(D)),enumerable:!1},ansi256ToAnsi:{value:D=>{if(D<8)return 30+D;if(D<16)return 90+(D-8);let t,s,i;if(D>=232)t=((D-232)*10+8)/255,s=t,i=t;else{D-=16;const r=D%36;t=Math.floor(D/36)/5,s=Math.floor(r/6)/5,i=r%6/5}const F=Math.max(t,s,i)*2;if(F===0)return 30;let u=30+(Math.round(i)<<2|Math.round(s)<<1|Math.round(t));return F===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(D,t,s)=>C.ansi256ToAnsi(C.rgbToAnsi256(D,t,s)),enumerable:!1},hexToAnsi:{value:D=>C.ansi256ToAnsi(C.hexToAnsi256(D)),enumerable:!1}}),C}const mu=gu(),_=new Set(["\x1B","\x9B"]),vu=39,M="\x07",Q="[",bu="]",X="m",T=`${bu}8;;`,uu=e=>`${_.values().next().value}${Q}${e}${X}`,Du=e=>`${_.values().next().value}${T}${e}${M}`,wu=e=>e.split(" ").map(D=>m(D)),j=(e,D,t)=>{const s=[...D];let i=!1,F=!1,u=m(Y(e[e.length-1]));for(const[r,a]of s.entries()){const n=m(a);if(u+n<=t?e[e.length-1]+=a:(e.push(a),u=0),_.has(a)&&(i=!0,F=s.slice(r+1).join("").startsWith(T)),i){F?a===M&&(i=!1,F=!1):a===X&&(i=!1);continue}u+=n,u===t&&r<s.length-1&&(e.push(""),u=0)}!u&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},yu=e=>{const D=e.split(" ");let t=D.length;for(;t>0&&!(m(D[t-1])>0);)t--;return t===D.length?e:D.slice(0,t).join(" ")+D.slice(t).join("")},_u=(e,D,t={})=>{if(t.trim!==!1&&e.trim()==="")return"";let s="",i,F;const u=wu(e);let r=[""];for(const[n,l]of e.split(" ").entries()){t.trim!==!1&&(r[r.length-1]=r[r.length-1].trimStart());let o=m(r[r.length-1]);if(n!==0&&(o>=D&&(t.wordWrap===!1||t.trim===!1)&&(r.push(""),o=0),(o>0||t.trim===!1)&&(r[r.length-1]+=" ",o++)),t.hard&&u[n]>D){const A=D-o,w=1+Math.floor((u[n]-A-1)/D);Math.floor((u[n]-1)/D)<w&&r.push(""),j(r,l,D);continue}if(o+u[n]>D&&o>0&&u[n]>0){if(t.wordWrap===!1&&o<D){j(r,l,D);continue}r.push("")}if(o+u[n]>D&&t.wordWrap===!1){j(r,l,D);continue}r[r.length-1]+=l}t.trim!==!1&&(r=r.map(n=>yu(n)));const a=[...r.join(`
`)];for(const[n,l]of a.entries()){if(s+=l,_.has(l)){const{groups:A}=new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${T}(?<uri>.*)${M})`).exec(a.slice(n).join(""))||{groups:{}};if(A.code!==void 0){const w=Number.parseFloat(A.code);i=w===vu?void 0:w}else A.uri!==void 0&&(F=A.uri.length===0?void 0:A.uri)}const o=mu.codes.get(Number(i));a[n+1]===`
`?(F&&(s+=Du("")),i&&o&&(s+=uu(o))):l===`
`&&(i&&o&&(s+=uu(i)),F&&(s+=Du(F)))}return s};function tu(e,D,t){return String(e).normalize().replace(/\r\n/g,`
import{cursor as h,erase as V}from"sisteransi";import{stdin as G,stdout as z}from"node:process";import*as _ from"node:readline";import Eu from"node:readline";import{ReadStream as U,WriteStream as lu}from"node:tty";import f from"picocolors";function hu({onlyFirst:e=!1}={}){const 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 cu=hu();function Y(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(cu,"")}function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q={exports:{}};(function(e){var D={};e.exports=D,D.eastAsianWidth=function(s){var i=s.charCodeAt(0),F=s.length==2?s.charCodeAt(1):0,u=i;return 55296<=i&&i<=56319&&56320<=F&&F<=57343&&(i&=1023,F&=1023,u=i<<10|F,u+=65536),u==12288||65281<=u&&u<=65376||65504<=u&&u<=65510?"F":u==8361||65377<=u&&u<=65470||65474<=u&&u<=65479||65482<=u&&u<=65487||65490<=u&&u<=65495||65498<=u&&u<=65500||65512<=u&&u<=65518?"H":4352<=u&&u<=4447||4515<=u&&u<=4519||4602<=u&&u<=4607||9001<=u&&u<=9002||11904<=u&&u<=11929||11931<=u&&u<=12019||12032<=u&&u<=12245||12272<=u&&u<=12283||12289<=u&&u<=12350||12353<=u&&u<=12438||12441<=u&&u<=12543||12549<=u&&u<=12589||12593<=u&&u<=12686||12688<=u&&u<=12730||12736<=u&&u<=12771||12784<=u&&u<=12830||12832<=u&&u<=12871||12880<=u&&u<=13054||13056<=u&&u<=19903||19968<=u&&u<=42124||42128<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||55216<=u&&u<=55238||55243<=u&&u<=55291||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65106||65108<=u&&u<=65126||65128<=u&&u<=65131||110592<=u&&u<=110593||127488<=u&&u<=127490||127504<=u&&u<=127546||127552<=u&&u<=127560||127568<=u&&u<=127569||131072<=u&&u<=194367||177984<=u&&u<=196605||196608<=u&&u<=262141?"W":32<=u&&u<=126||162<=u&&u<=163||165<=u&&u<=166||u==172||u==175||10214<=u&&u<=10221||10629<=u&&u<=10630?"Na":u==161||u==164||167<=u&&u<=168||u==170||173<=u&&u<=174||176<=u&&u<=180||182<=u&&u<=186||188<=u&&u<=191||u==198||u==208||215<=u&&u<=216||222<=u&&u<=225||u==230||232<=u&&u<=234||236<=u&&u<=237||u==240||242<=u&&u<=243||247<=u&&u<=250||u==252||u==254||u==257||u==273||u==275||u==283||294<=u&&u<=295||u==299||305<=u&&u<=307||u==312||319<=u&&u<=322||u==324||328<=u&&u<=331||u==333||338<=u&&u<=339||358<=u&&u<=359||u==363||u==462||u==464||u==466||u==468||u==470||u==472||u==474||u==476||u==593||u==609||u==708||u==711||713<=u&&u<=715||u==717||u==720||728<=u&&u<=731||u==733||u==735||768<=u&&u<=879||913<=u&&u<=929||931<=u&&u<=937||945<=u&&u<=961||963<=u&&u<=969||u==1025||1040<=u&&u<=1103||u==1105||u==8208||8211<=u&&u<=8214||8216<=u&&u<=8217||8220<=u&&u<=8221||8224<=u&&u<=8226||8228<=u&&u<=8231||u==8240||8242<=u&&u<=8243||u==8245||u==8251||u==8254||u==8308||u==8319||8321<=u&&u<=8324||u==8364||u==8451||u==8453||u==8457||u==8467||u==8470||8481<=u&&u<=8482||u==8486||u==8491||8531<=u&&u<=8532||8539<=u&&u<=8542||8544<=u&&u<=8555||8560<=u&&u<=8569||u==8585||8592<=u&&u<=8601||8632<=u&&u<=8633||u==8658||u==8660||u==8679||u==8704||8706<=u&&u<=8707||8711<=u&&u<=8712||u==8715||u==8719||u==8721||u==8725||u==8730||8733<=u&&u<=8736||u==8739||u==8741||8743<=u&&u<=8748||u==8750||8756<=u&&u<=8759||8764<=u&&u<=8765||u==8776||u==8780||u==8786||8800<=u&&u<=8801||8804<=u&&u<=8807||8810<=u&&u<=8811||8814<=u&&u<=8815||8834<=u&&u<=8835||8838<=u&&u<=8839||u==8853||u==8857||u==8869||u==8895||u==8978||9312<=u&&u<=9449||9451<=u&&u<=9547||9552<=u&&u<=9587||9600<=u&&u<=9615||9618<=u&&u<=9621||9632<=u&&u<=9633||9635<=u&&u<=9641||9650<=u&&u<=9651||9654<=u&&u<=9655||9660<=u&&u<=9661||9664<=u&&u<=9665||9670<=u&&u<=9672||u==9675||9678<=u&&u<=9681||9698<=u&&u<=9701||u==9711||9733<=u&&u<=9734||u==9737||9742<=u&&u<=9743||9748<=u&&u<=9749||u==9756||u==9758||u==9792||u==9794||9824<=u&&u<=9825||9827<=u&&u<=9829||9831<=u&&u<=9834||9836<=u&&u<=9837||u==9839||9886<=u&&u<=9887||9918<=u&&u<=9919||9924<=u&&u<=9933||9935<=u&&u<=9953||u==9955||9960<=u&&u<=9983||u==10045||u==10071||10102<=u&&u<=10111||11093<=u&&u<=11097||12872<=u&&u<=12879||57344<=u&&u<=63743||65024<=u&&u<=65039||u==65533||127232<=u&&u<=127242||127248<=u&&u<=127277||127280<=u&&u<=127337||127344<=u&&u<=127386||917760<=u&&u<=917999||983040<=u&&u<=1048573||1048576<=u&&u<=1114109?"A":"N"},D.characterLength=function(s){var i=this.eastAsianWidth(s);return i=="F"||i=="W"||i=="A"?2:1};function t(s){return s.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}D.length=function(s){for(var i=t(s),F=0,u=0;u<i.length;u++)F=F+this.characterLength(i[u]);return F},D.slice=function(s,i,F){textLen=D.length(s),i=i||0,F=F||1,i<0&&(i=textLen+i),F<0&&(F=textLen+F);for(var u="",r=0,a=t(s),n=0;n<a.length;n++){var l=a[n],o=D.length(l);if(r>=i-(o==2?1:0))if(r+o<=F)u+=l;else break;r+=o}return u}})(q);var xu=q.exports;const Bu=Z(xu);var pu=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\uD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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\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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};const Au=Z(pu);function b(e,D={}){if(typeof e!="string"||e.length===0||(D={ambiguousIsNarrow:!0,...D},e=Y(e),e.length===0))return 0;e=e.replace(Au()," ");const t=D.ambiguousIsNarrow?1:2;let s=0;for(const i of e){const F=i.codePointAt(0);if(F<=31||F>=127&&F<=159||F>=768&&F<=879)continue;switch(Bu.eastAsianWidth(i)){case"F":case"W":s+=2;break;case"A":s+=t;break;default:s+=1}}return s}const M=10,H=(e=0)=>D=>`\x1B[${D+e}m`,J=(e=0)=>D=>`\x1B[${38+e};5;${D}m`,Q=(e=0)=>(D,t,s)=>`\x1B[${38+e};2;${D};${t};${s}m`,C={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(C.modifier);const fu=Object.keys(C.color),du=Object.keys(C.bgColor);[...fu,...du];function gu(){const e=new Map;for(const[D,t]of Object.entries(C)){for(const[s,i]of Object.entries(t))C[s]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[s]=C[s],e.set(i[0],i[1]);Object.defineProperty(C,D,{value:t,enumerable:!1})}return Object.defineProperty(C,"codes",{value:e,enumerable:!1}),C.color.close="\x1B[39m",C.bgColor.close="\x1B[49m",C.color.ansi=H(),C.color.ansi256=J(),C.color.ansi16m=Q(),C.bgColor.ansi=H(M),C.bgColor.ansi256=J(M),C.bgColor.ansi16m=Q(M),Object.defineProperties(C,{rgbToAnsi256:{value:(D,t,s)=>D===t&&t===s?D<8?16:D>248?231:Math.round((D-8)/247*24)+232:16+36*Math.round(D/255*5)+6*Math.round(t/255*5)+Math.round(s/255*5),enumerable:!1},hexToRgb:{value:D=>{const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(D.toString(16));if(!t)return[0,0,0];let[s]=t;s.length===3&&(s=[...s].map(F=>F+F).join(""));const i=Number.parseInt(s,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:D=>C.rgbToAnsi256(...C.hexToRgb(D)),enumerable:!1},ansi256ToAnsi:{value:D=>{if(D<8)return 30+D;if(D<16)return 90+(D-8);let t,s,i;if(D>=232)t=((D-232)*10+8)/255,s=t,i=t;else{D-=16;const r=D%36;t=Math.floor(D/36)/5,s=Math.floor(r/6)/5,i=r%6/5}const F=Math.max(t,s,i)*2;if(F===0)return 30;let u=30+(Math.round(i)<<2|Math.round(s)<<1|Math.round(t));return F===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(D,t,s)=>C.ansi256ToAnsi(C.rgbToAnsi256(D,t,s)),enumerable:!1},hexToAnsi:{value:D=>C.ansi256ToAnsi(C.hexToAnsi256(D)),enumerable:!1}}),C}const mu=gu(),$=new Set(["\x1B","\x9B"]),vu=39,O="\x07",X="[",bu="]",uu="m",T=`${bu}8;;`,Du=e=>`${$.values().next().value}${X}${e}${uu}`,tu=e=>`${$.values().next().value}${T}${e}${O}`,wu=e=>e.split(" ").map(D=>b(D)),j=(e,D,t)=>{const s=[...D];let i=!1,F=!1,u=b(Y(e[e.length-1]));for(const[r,a]of s.entries()){const n=b(a);if(u+n<=t?e[e.length-1]+=a:(e.push(a),u=0),$.has(a)&&(i=!0,F=s.slice(r+1).join("").startsWith(T)),i){F?a===O&&(i=!1,F=!1):a===uu&&(i=!1);continue}u+=n,u===t&&r<s.length-1&&(e.push(""),u=0)}!u&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},yu=e=>{const D=e.split(" ");let t=D.length;for(;t>0&&!(b(D[t-1])>0);)t--;return t===D.length?e:D.slice(0,t).join(" ")+D.slice(t).join("")},_u=(e,D,t={})=>{if(t.trim!==!1&&e.trim()==="")return"";let s="",i,F;const u=wu(e);let r=[""];for(const[n,l]of e.split(" ").entries()){t.trim!==!1&&(r[r.length-1]=r[r.length-1].trimStart());let o=b(r[r.length-1]);if(n!==0&&(o>=D&&(t.wordWrap===!1||t.trim===!1)&&(r.push(""),o=0),(o>0||t.trim===!1)&&(r[r.length-1]+=" ",o++)),t.hard&&u[n]>D){const A=D-o,y=1+Math.floor((u[n]-A-1)/D);Math.floor((u[n]-1)/D)<y&&r.push(""),j(r,l,D);continue}if(o+u[n]>D&&o>0&&u[n]>0){if(t.wordWrap===!1&&o<D){j(r,l,D);continue}r.push("")}if(o+u[n]>D&&t.wordWrap===!1){j(r,l,D);continue}r[r.length-1]+=l}t.trim!==!1&&(r=r.map(n=>yu(n)));const a=[...r.join(`
`)];for(const[n,l]of a.entries()){if(s+=l,$.has(l)){const{groups:A}=new RegExp(`(?:\\${X}(?<code>\\d+)m|\\${T}(?<uri>.*)${O})`).exec(a.slice(n).join(""))||{groups:{}};if(A.code!==void 0){const y=Number.parseFloat(A.code);i=y===vu?void 0:y}else A.uri!==void 0&&(F=A.uri.length===0?void 0:A.uri)}const o=mu.codes.get(Number(i));a[n+1]===`
`?(F&&(s+=tu("")),i&&o&&(s+=Du(o))):l===`
`&&(i&&o&&(s+=Du(i)),F&&(s+=tu(F)))}return s};function eu(e,D,t){return String(e).normalize().replace(/\r\n/g,`
`).split(`
`).map(s=>_u(s,D,t)).join(`
`)}const $u=["up","down","left","right","space","enter","cancel"],c={actions:new Set($u),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};function ku(e){if(e.aliases!==void 0){const D=e.aliases;for(const t in D){if(!Object.hasOwn(D,t))continue;const s=D[t];c.actions.has(s)&&(c.aliases.has(t)||c.aliases.set(t,s))}}if(e.messages!==void 0){const D=e.messages;D.cancel!==void 0&&(c.messages.cancel=D.cancel),D.error!==void 0&&(c.messages.error=D.error)}}function P(e,D){if(typeof e=="string")return c.aliases.get(e)===D;for(const t of e)if(t!==void 0&&P(t,D))return!0;return!1}function Su(e,D){if(e===D)return;const t=e.split(`
`)}const $u=["up","down","left","right","space","enter","cancel"],c={actions:new Set($u),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};function Su(e){if(e.aliases!==void 0){const D=e.aliases;for(const t in D){if(!Object.hasOwn(D,t))continue;const s=D[t];c.actions.has(s)&&(c.aliases.has(t)||c.aliases.set(t,s))}}if(e.messages!==void 0){const D=e.messages;D.cancel!==void 0&&(c.messages.cancel=D.cancel),D.error!==void 0&&(c.messages.error=D.error)}}function W(e,D){if(typeof e=="string")return c.aliases.get(e)===D;for(const t of e)if(t!==void 0&&W(t,D))return!0;return!1}function ku(e,D){if(e===D)return;const t=e.split(`
`),s=D.split(`
`),i=[];for(let F=0;F<Math.max(t.length,s.length);F++)t[F]!==s[F]&&i.push(F);return i}const Vu=globalThis.process.platform.startsWith("win"),N=Symbol("clack:cancel");function Ou(e){return e===N}function $(e,D){const t=e;t.isTTY&&t.setRawMode(D)}function Mu({input:e=K,output:D=G,overwrite:t=!0,hideCursor:s=!0}={}){const i=y.createInterface({input:e,output:D,prompt:"",tabSize:1});y.emitKeypressEvents(e,i),e instanceof z&&e.isTTY&&e.setRawMode(!0);const F=(u,{name:r,sequence:a})=>{const n=String(u);if(P([n,r,a],"cancel")){s&&D.write(h.show),process.exit(0);return}if(!t)return;const l=r==="return"?0:-1,o=r==="return"?-1:0;y.moveCursor(D,l,o,()=>{y.clearLine(D,1,()=>{e.once("keypress",F)})})};return s&&D.write(h.hide),e.once("keypress",F),()=>{e.off("keypress",F),s&&D.write(h.show),e instanceof z&&e.isTTY&&!Vu&&e.setRawMode(!1),i.terminal=!1,i.close()}}const Tu=e=>e instanceof lu&&e.columns?e.columns:80;var ju=Object.defineProperty,Pu=(e,D,t)=>D in e?ju(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,E=(e,D,t)=>(Pu(e,typeof D!="symbol"?D+"":D,t),t);class B{constructor(D,t=!0){E(this,"input"),E(this,"output"),E(this,"_abortSignal"),E(this,"rl"),E(this,"opts"),E(this,"_render"),E(this,"_track",!1),E(this,"_prevFrame",""),E(this,"_subscribers",new Map),E(this,"_cursor",0),E(this,"_usePlaceholderAsValue",!0),E(this,"state","initial"),E(this,"error",""),E(this,"value");const{input:s=K,output:i=G,render:F,signal:u,...r}=D;this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=F.bind(this),this._track=t,this._abortSignal=u,this.input=s,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(D,t){const s=this._subscribers.get(D)??[];s.push(t),this._subscribers.set(D,s)}on(D,t){this.setSubscriber(D,{cb:t})}once(D,t){this.setSubscriber(D,{cb:t,once:!0})}emit(D,...t){const s=this._subscribers.get(D)??[],i=[];for(const F of s)F.cb(...t),F.once&&i.push(()=>s.splice(s.indexOf(F),1));for(const F of i)F()}prompt(){return new Promise((D,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),D(N);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=Eu.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialValue!==void 0&&(this._track&&this.rl.write(this.opts.initialValue),this._setValue(this.opts.initialValue)),this.input.on("keypress",this.onKeypress),$(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(h.show),this.output.off("resize",this.render),$(this.input,!1),D(this.value)}),this.once("cancel",()=>{this.output.write(h.show),this.output.off("resize",this.render),$(this.input,!1),D(N)})})}_isActionKey(D,t){return D===" "}_setValue(D){this.value=D,this.emit("value",this.value)}onKeypress(D,t){if(this._track&&t.name!=="return"&&(t.name&&this._isActionKey(D,t)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setValue(this.rl?.line)),this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&c.aliases.has(t.name)&&this.emit("cursor",c.aliases.get(t.name)),c.actions.has(t.name)&&this.emit("cursor",t.name)),D&&(D.toLowerCase()==="y"||D.toLowerCase()==="n")&&this.emit("confirm",D.toLowerCase()==="y"),this._usePlaceholderAsValue&&D===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this._setValue(this.opts.placeholder))),this.emit("key",D?.toLowerCase(),t),t?.name==="return"){if(!this.value&&this.opts.placeholder&&(this.rl?.write(this.opts.placeholder),this._setValue(this.opts.placeholder)),this.opts.validate){const s=this.opts.validate(this.value);s&&(this.error=s instanceof Error?s.message:s,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}P([D,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(`
`),$(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const D=tu(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
`).length-1;this.output.write(h.move(-999,D*-1))}render(){const D=tu(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(h.hide);else{const t=Su(this._prevFrame,D);if(this.restoreCursor(),t&&t?.length===1){const s=t[0];this.output.write(h.move(0,s)),this.output.write(V.lines(1));const i=D.split(`
`),i=[];for(let F=0;F<Math.max(t.length,s.length);F++)t[F]!==s[F]&&i.push(F);return i}const Iu=globalThis.process.platform.startsWith("win"),L=Symbol("clack:cancel");function Vu(e){return e===L}function S(e,D){const t=e;t.isTTY&&t.setRawMode(D)}function Mu({input:e=G,output:D=z,overwrite:t=!0,hideCursor:s=!0}={}){const i=_.createInterface({input:e,output:D,prompt:"",tabSize:1});_.emitKeypressEvents(e,i),e instanceof U&&e.isTTY&&e.setRawMode(!0);const F=(u,{name:r,sequence:a})=>{const n=String(u);if(W([n,r,a],"cancel")){s&&D.write(h.show),process.exit(0);return}if(!t)return;const l=r==="return"?0:-1,o=r==="return"?-1:0;_.moveCursor(D,l,o,()=>{_.clearLine(D,1,()=>{e.once("keypress",F)})})};return s&&D.write(h.hide),e.once("keypress",F),()=>{e.off("keypress",F),s&&D.write(h.show),e instanceof U&&e.isTTY&&!Iu&&e.setRawMode(!1),i.terminal=!1,i.close()}}const Ou=e=>e instanceof lu&&e.columns?e.columns:80;var Tu=Object.defineProperty,ju=(e,D,t)=>D in e?Tu(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,E=(e,D,t)=>(ju(e,typeof D!="symbol"?D+"":D,t),t);let p=class{constructor(D,t=!0){E(this,"input"),E(this,"output"),E(this,"_abortSignal"),E(this,"rl"),E(this,"opts"),E(this,"_render"),E(this,"_track",!1),E(this,"_prevFrame",""),E(this,"_subscribers",new Map),E(this,"_cursor",0),E(this,"state","initial"),E(this,"error",""),E(this,"value"),E(this,"userInput","");const{input:s=G,output:i=z,render:F,signal:u,...r}=D;this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=F.bind(this),this._track=t,this._abortSignal=u,this.input=s,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(D,t){const s=this._subscribers.get(D)??[];s.push(t),this._subscribers.set(D,s)}on(D,t){this.setSubscriber(D,{cb:t})}once(D,t){this.setSubscriber(D,{cb:t,once:!0})}emit(D,...t){const s=this._subscribers.get(D)??[],i=[];for(const F of s)F.cb(...t),F.once&&i.push(()=>s.splice(s.indexOf(F),1));for(const F of i)F()}prompt(){return new Promise(D=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),D(L);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=Eu.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),S(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(h.show),this.output.off("resize",this.render),S(this.input,!1),D(this.value)}),this.once("cancel",()=>{this.output.write(h.show),this.output.off("resize",this.render),S(this.input,!1),D(L)})})}_isActionKey(D,t){return D===" "}_setValue(D){this.value=D,this.emit("value",this.value)}_setUserInput(D,t){this.userInput=D??"",this.emit("userInput",this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}onKeypress(D,t){if(this._track&&t.name!=="return"&&(t.name&&this._isActionKey(D,t)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&c.aliases.has(t.name)&&this.emit("cursor",c.aliases.get(t.name)),c.actions.has(t.name)&&this.emit("cursor",t.name)),D&&(D.toLowerCase()==="y"||D.toLowerCase()==="n")&&this.emit("confirm",D.toLowerCase()==="y"),this.emit("key",D?.toLowerCase(),t),t?.name==="return"){if(this.opts.validate){const s=this.opts.validate(this.value);s&&(this.error=s instanceof Error?s.message:s,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}W([D,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(`
`),S(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const D=eu(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
`).length-1;this.output.write(h.move(-999,D*-1))}render(){const D=eu(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(h.hide);else{const t=ku(this._prevFrame,D);if(this.restoreCursor(),t&&t?.length===1){const s=t[0];this.output.write(h.move(0,s)),this.output.write(V.lines(1));const i=D.split(`
`);this.output.write(i[s]),this._prevFrame=D,this.output.write(h.move(0,i.length-s-1));return}if(t&&t?.length>1){const s=t[0];this.output.write(h.move(0,s)),this.output.write(V.down());const i=D.split(`
`).slice(s);this.output.write(i.join(`
`)),this._prevFrame=D;return}this.output.write(V.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}}class Nu extends B{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",t=>{this.output.write(h.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var Wu=Object.defineProperty,Lu=(e,D,t)=>D in e?Wu(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,eu=(e,D,t)=>(Lu(e,typeof D!="symbol"?D+"":D,t),t),su=(e,D,t)=>{if(!D.has(e))throw TypeError("Cannot "+t)},W=(e,D,t)=>(su(e,D,"read from private field"),t?t.call(e):D.get(e)),Iu=(e,D,t)=>{if(D.has(e))throw TypeError("Cannot add the same private member more than once");D instanceof WeakSet?D.add(e):D.set(e,t)},Ru=(e,D,t,s)=>(su(e,D,"write to private field"),s?s.call(e,t):D.set(e,t),t),d;let Ku=class extends B{constructor(D){super(D,!1),eu(this,"options"),eu(this,"cursor",0),Iu(this,d,void 0);const{options:t}=D;Ru(this,d,D.selectableGroups!==!1),this.options=Object.entries(t).flatMap(([s,i])=>[{value:s,group:!0,label:s},...i.map(F=>({...F,group:s}))]),this.value=[...D.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:s})=>s===D.cursorAt),W(this,d)?0:1),this.on("cursor",s=>{switch(s){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;const i=this.options[this.cursor]?.group===!0;!W(this,d)&&i&&(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;const i=this.options[this.cursor]?.group===!0;!W(this,d)&&i&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}getGroupItems(D){return this.options.filter(t=>t.group===D)}isGroupSelected(D){return this.getGroupItems(D).every(t=>this.value.includes(t.value))}toggleValue(){const D=this.options[this.cursor];if(D.group===!0){const t=D.value,s=this.getGroupItems(t);this.isGroupSelected(t)?this.value=this.value.filter(i=>s.findIndex(F=>F.value===i)===-1):this.value=[...this.value,...s.map(i=>i.value)],this.value=Array.from(new Set(this.value))}else{const t=this.value.includes(D.value);this.value=t?this.value.filter(s=>s!==D.value):[...this.value,D.value]}}};d=new WeakMap;var Gu=Object.defineProperty,zu=(e,D,t)=>D in e?Gu(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,iu=(e,D,t)=>(zu(e,typeof D!="symbol"?D+"":D,t),t);let Yu=class extends B{constructor(D){super(D,!1),iu(this,"options"),iu(this,"cursor",0),this.options=D.options,this.value=[...D.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===D.cursorAt),0),this.on("key",t=>{t==="a"&&this.toggleAll()}),this.on("cursor",t=>{switch(t){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(){const D=this.value.length===this.options.length;this.value=D?[]:this.options.map(t=>t.value)}toggleValue(){const D=this.value.includes(this._value);this.value=D?this.value.filter(t=>t!==this._value):[...this.value,this._value]}};var Zu=Object.defineProperty,qu=(e,D,t)=>D in e?Zu(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,Hu=(e,D,t)=>(qu(e,typeof D!="symbol"?D+"":D,t),t);let Uu=class extends B{constructor({mask:D,...t}){super(t),Hu(this,"_mask","\u2022"),this._mask=D??"\u2022"}get cursor(){return this._cursor}get masked(){return this.value?.replaceAll(/./g,this._mask)??""}get valueWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;const D=this.value??"";if(this.cursor>=D.length)return`${this.masked}${p.inverse(p.hidden("_"))}`;const t=this.masked.slice(0,this.cursor),s=this.masked.slice(this.cursor);return`${t}${p.inverse(s[0])}${s.slice(1)}`}};var Ju=Object.defineProperty,Qu=(e,D,t)=>D in e?Ju(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,Fu=(e,D,t)=>(Qu(e,typeof D!="symbol"?D+"":D,t),t);let Xu=class extends B{constructor(D){super(D,!1),Fu(this,"options"),Fu(this,"cursor",0),this.options=D.options,this.cursor=this.options.findIndex(({value:t})=>t===D.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",t=>{switch(t){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}};var uD=Object.defineProperty,DD=(e,D,t)=>D in e?uD(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,ru=(e,D,t)=>(DD(e,typeof D!="symbol"?D+"":D,t),t);let tD=class extends B{constructor(D){super(D,!1),ru(this,"options"),ru(this,"cursor",0),this.options=D.options;const t=this.options.map(({value:[s]})=>s?.toLowerCase());this.cursor=Math.max(t.indexOf(D.initialValue),0),this.on("key",s=>{if(!t.includes(s))return;const i=this.options.find(({value:[F]})=>F?.toLowerCase()===s);i&&(this.value=i.value,this.state="submit",this.emit("submit"))})}},eD=class extends B{get valueWithCursor(){if(this.state==="submit")return this.value;const D=this.value??"";if(this.cursor>=D.length)return`${this.value}\u2588`;const t=D.slice(0,this.cursor),[s,...i]=D.slice(this.cursor);return`${t}${p.inverse(s)}${i.join("")}`}get cursor(){return this._cursor}constructor(D){super(D),this.on("finalize",()=>{this.value||(this.value=D.defaultValue)})}};var sD=Object.defineProperty,iD=(e,D,t)=>D in e?sD(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,g=(e,D,t)=>(iD(e,typeof D!="symbol"?D+"":D,t),t),L=(e,D,t)=>{if(!D.has(e))throw TypeError("Cannot "+t)},f=(e,D,t)=>(L(e,D,"read from private field"),t?t.call(e):D.get(e)),v=(e,D,t)=>{if(D.has(e))throw TypeError("Cannot add the same private member more than once");D instanceof WeakSet?D.add(e):D.set(e,t)},b=(e,D,t,s)=>(L(e,D,"write to private field"),s?s.call(e,t):D.set(e,t),t),Cu=(e,D,t)=>(L(e,D,"access private method"),t),x,k,S,I,nu,R,ou;function FD(e,D){if(e===void 0||D.length===0)return 0;const t=D.findIndex(s=>s.value===e);return t!==-1?t:0}function rD(e,D){return(D.label??String(D.value)).toLowerCase().includes(e.toLowerCase())}function au(e,D){if(D)return e?D:D[0]}class CD extends B{constructor(D){super(D),v(this,I),v(this,R),g(this,"options"),g(this,"filteredOptions"),g(this,"multiple"),g(this,"isNavigating",!1),g(this,"selectedValues",[]),g(this,"focusedValue"),v(this,x,0),v(this,k,void 0),v(this,S,void 0),this.options=D.options,this.filteredOptions=[...this.options],this.multiple=D.multiple===!0,this._usePlaceholderAsValue=!1,b(this,S,D.filter??rD);let t;if(D.initialValue&&Array.isArray(D.initialValue)&&(this.multiple?t=D.initialValue:t=D.initialValue.slice(0,1)),t){this.selectedValues=t;for(const s of t){const i=this.options.findIndex(F=>F.value===s);i!==-1&&(this.toggleSelected(s),b(this,x,i),this.focusedValue=this.options[f(this,x)]?.value)}}this.on("finalize",()=>{this.value||(this.value=au(this.multiple,t)),this.state==="submit"&&(this.value=au(this.multiple,this.selectedValues))}),this.on("key",(s,i)=>Cu(this,I,nu).call(this,s,i)),this.on("value",s=>Cu(this,R,ou).call(this,s))}get cursor(){return f(this,x)}get valueWithCursor(){if(!this.value)return p.inverse(p.hidden("_"));if(this._cursor>=this.value.length)return`${this.value}\u2588`;const D=this.value.slice(0,this._cursor),[t,...s]=this.value.slice(this._cursor);return`${D}${p.inverse(t)}${s.join("")}`}_isActionKey(D,t){return D===" "||this.multiple&&this.isNavigating&&t.name==="space"&&D!==void 0&&D!==""}toggleSelected(D){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(D)?this.selectedValues=this.selectedValues.filter(t=>t!==D):this.selectedValues=[...this.selectedValues,D]:this.selectedValues=[D])}}x=new WeakMap,k=new WeakMap,S=new WeakMap,I=new WeakSet,nu=function(e,D){const t=D.name==="up",s=D.name==="down";t||s?(b(this,x,Math.max(0,Math.min(f(this,x)+(t?-1:1),this.filteredOptions.length-1))),this.focusedValue=this.filteredOptions[f(this,x)]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):this.multiple&&this.focusedValue!==void 0&&(D.name==="tab"||this.isNavigating&&D.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1},R=new WeakSet,ou=function(e){e!==f(this,k)&&(b(this,k,e),e?this.filteredOptions=this.options.filter(D=>f(this,S).call(this,e,D)):this.filteredOptions=[...this.options],b(this,x,FD(this.focusedValue,this.filteredOptions)),this.focusedValue=this.filteredOptions[f(this,x)]?.value)};export{CD as AutocompletePrompt,Nu as ConfirmPrompt,Ku as GroupMultiSelectPrompt,Yu as MultiSelectPrompt,Uu as PasswordPrompt,B as Prompt,tD as SelectKeyPrompt,Xu as SelectPrompt,eD as TextPrompt,Mu as block,Tu as getColumns,Ou as isCancel,c as settings,ku as updateSettings};
`)),this._prevFrame=D;return}this.output.write(V.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}},Wu=class extends p{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",t=>{this.output.write(h.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var Lu=Object.defineProperty,Nu=(e,D,t)=>D in e?Lu(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,su=(e,D,t)=>(Nu(e,typeof D!="symbol"?D+"":D,t),t),iu=(e,D,t)=>{if(!D.has(e))throw TypeError("Cannot "+t)},N=(e,D,t)=>(iu(e,D,"read from private field"),t?t.call(e):D.get(e)),Pu=(e,D,t)=>{if(D.has(e))throw TypeError("Cannot add the same private member more than once");D instanceof WeakSet?D.add(e):D.set(e,t)},Ru=(e,D,t,s)=>(iu(e,D,"write to private field"),s?s.call(e,t):D.set(e,t),t),d;let Ku=class extends p{constructor(D){super(D,!1),su(this,"options"),su(this,"cursor",0),Pu(this,d,void 0);const{options:t}=D;Ru(this,d,D.selectableGroups!==!1),this.options=Object.entries(t).flatMap(([s,i])=>[{value:s,group:!0,label:s},...i.map(F=>({...F,group:s}))]),this.value=[...D.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:s})=>s===D.cursorAt),N(this,d)?0:1),this.on("cursor",s=>{switch(s){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;const i=this.options[this.cursor]?.group===!0;!N(this,d)&&i&&(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;const i=this.options[this.cursor]?.group===!0;!N(this,d)&&i&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}getGroupItems(D){return this.options.filter(t=>t.group===D)}isGroupSelected(D){const t=this.getGroupItems(D),s=this.value;return s===void 0?!1:t.every(i=>s.includes(i.value))}toggleValue(){const D=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),D.group===!0){const t=D.value,s=this.getGroupItems(t);this.isGroupSelected(t)?this.value=this.value.filter(i=>s.findIndex(F=>F.value===i)===-1):this.value=[...this.value,...s.map(i=>i.value)],this.value=Array.from(new Set(this.value))}else{const t=this.value.includes(D.value);this.value=t?this.value.filter(s=>s!==D.value):[...this.value,D.value]}}};d=new WeakMap;var Gu=Object.defineProperty,zu=(e,D,t)=>D in e?Gu(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,Fu=(e,D,t)=>(zu(e,typeof D!="symbol"?D+"":D,t),t);let Uu=class extends p{constructor(D){super(D,!1),Fu(this,"options"),Fu(this,"cursor",0),this.options=D.options,this.value=[...D.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===D.cursorAt),0),this.on("key",t=>{t==="a"&&this.toggleAll()}),this.on("cursor",t=>{switch(t){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(){const D=this.value!==void 0&&this.value.length===this.options.length;this.value=D?[]:this.options.map(t=>t.value)}toggleValue(){this.value===void 0&&(this.value=[]);const D=this.value.includes(this._value);this.value=D?this.value.filter(t=>t!==this._value):[...this.value,this._value]}};var Yu=Object.defineProperty,Zu=(e,D,t)=>D in e?Yu(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,qu=(e,D,t)=>(Zu(e,typeof D!="symbol"?D+"":D,t),t);let Hu=class extends p{constructor({mask:D,...t}){super(t),qu(this,"_mask","\u2022"),this._mask=D??"\u2022",this.on("userInput",s=>{this._setValue(s)})}get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;const D=this.userInput;if(this.cursor>=D.length)return`${this.masked}${f.inverse(f.hidden("_"))}`;const t=this.masked,s=t.slice(0,this.cursor),i=t.slice(this.cursor);return`${s}${f.inverse(i[0])}${i.slice(1)}`}};var Ju=Object.defineProperty,Qu=(e,D,t)=>D in e?Ju(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,ru=(e,D,t)=>(Qu(e,typeof D!="symbol"?D+"":D,t),t);let Xu=class extends p{constructor(D){super(D,!1),ru(this,"options"),ru(this,"cursor",0),this.options=D.options,this.cursor=this.options.findIndex(({value:t})=>t===D.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",t=>{switch(t){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 _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}};var uD=Object.defineProperty,DD=(e,D,t)=>D in e?uD(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,Cu=(e,D,t)=>(DD(e,typeof D!="symbol"?D+"":D,t),t);let tD=class extends p{constructor(D){super(D,!1),Cu(this,"options"),Cu(this,"cursor",0),this.options=D.options;const t=this.options.map(({value:[s]})=>s?.toLowerCase());this.cursor=Math.max(t.indexOf(D.initialValue),0),this.on("key",s=>{if(!s||!t.includes(s))return;const i=this.options.find(({value:[F]})=>F?.toLowerCase()===s);i&&(this.value=i.value,this.state="submit",this.emit("submit"))})}};class eD extends p{get userInputWithCursor(){if(this.state==="submit")return this.userInput;const D=this.userInput;if(this.cursor>=D.length)return`${this.userInput}\u2588`;const t=D.slice(0,this.cursor),[s,...i]=D.slice(this.cursor);return`${t}${f.inverse(s)}${i.join("")}`}get cursor(){return this._cursor}constructor(D){super({...D,initialUserInput:D.initialUserInput??D.initialValue}),this.on("userInput",t=>{this._setValue(t)}),this.on("finalize",()=>{this.value||(this.value=D.defaultValue),this.value===void 0&&(this.value="")})}}var sD=Object.defineProperty,iD=(e,D,t)=>D in e?sD(e,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[D]=t,w=(e,D,t)=>(iD(e,typeof D!="symbol"?D+"":D,t),t),P=(e,D,t)=>{if(!D.has(e))throw TypeError("Cannot "+t)},x=(e,D,t)=>(P(e,D,"read from private field"),t?t.call(e):D.get(e)),g=(e,D,t)=>{if(D.has(e))throw TypeError("Cannot add the same private member more than once");D instanceof WeakSet?D.add(e):D.set(e,t)},m=(e,D,t,s)=>(P(e,D,"write to private field"),s?s.call(e,t):D.set(e,t),t),nu=(e,D,t)=>(P(e,D,"access private method"),t),B,k,I,v,R,ou,K,au;function FD(e,D){if(e===void 0||D.length===0)return 0;const t=D.findIndex(s=>s.value===e);return t!==-1?t:0}function rD(e,D){return(D.label??String(D.value)).toLowerCase().includes(e.toLowerCase())}function CD(e,D){if(D)return e?D:D[0]}class nD extends p{constructor(D){super(D),g(this,R),g(this,K),w(this,"filteredOptions"),w(this,"multiple"),w(this,"isNavigating",!1),w(this,"selectedValues",[]),w(this,"focusedValue"),g(this,B,0),g(this,k,""),g(this,I,void 0),g(this,v,void 0),m(this,v,D.options);const t=this.options;this.filteredOptions=[...t],this.multiple=D.multiple===!0,m(this,I,D.filter??rD);let s;if(D.initialValue&&Array.isArray(D.initialValue)?this.multiple?s=D.initialValue:s=D.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(s=[this.options[0].value]),s)for(const i of s){const F=t.findIndex(u=>u.value===i);F!==-1&&(this.toggleSelected(i),m(this,B,F))}this.focusedValue=this.options[x(this,B)]?.value,this.on("key",(i,F)=>nu(this,R,ou).call(this,i,F)),this.on("userInput",i=>nu(this,K,au).call(this,i))}get cursor(){return x(this,B)}get userInputWithCursor(){if(!this.userInput)return f.inverse(f.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}\u2588`;const D=this.userInput.slice(0,this._cursor),[t,...s]=this.userInput.slice(this._cursor);return`${D}${f.inverse(t)}${s.join("")}`}get options(){return typeof x(this,v)=="function"?x(this,v).call(this):x(this,v)}_isActionKey(D,t){return D===" "||this.multiple&&this.isNavigating&&t.name==="space"&&D!==void 0&&D!==""}deselectAll(){this.selectedValues=[]}toggleSelected(D){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(D)?this.selectedValues=this.selectedValues.filter(t=>t!==D):this.selectedValues=[...this.selectedValues,D]:this.selectedValues=[D])}}B=new WeakMap,k=new WeakMap,I=new WeakMap,v=new WeakMap,R=new WeakSet,ou=function(e,D){const t=D.name==="up",s=D.name==="down",i=D.name==="return";t||s?(m(this,B,Math.max(0,Math.min(x(this,B)+(t?-1:1),this.filteredOptions.length-1))),this.focusedValue=this.filteredOptions[x(this,B)]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):i?this.value=CD(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(D.name==="tab"||this.isNavigating&&D.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:this.focusedValue&&(this.selectedValues=[this.focusedValue])},K=new WeakSet,au=function(e){if(e!==x(this,k)){m(this,k,e);const D=this.options;e?this.filteredOptions=D.filter(t=>x(this,I).call(this,e,t)):this.filteredOptions=[...D],m(this,B,FD(this.focusedValue,this.filteredOptions)),this.focusedValue=this.filteredOptions[x(this,B)]?.value,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}};export{nD as AutocompletePrompt,Wu as ConfirmPrompt,Ku as GroupMultiSelectPrompt,Uu as MultiSelectPrompt,Hu as PasswordPrompt,p as Prompt,tD as SelectKeyPrompt,Xu as SelectPrompt,eD as TextPrompt,Mu as block,Ou as getColumns,Vu as isCancel,c as settings,Su as updateSettings};
//# sourceMappingURL=index.mjs.map
{
"name": "@clack/core",
"version": "1.0.0-alpha.0",
"version": "1.0.0-alpha.1",
"type": "module",

@@ -5,0 +5,0 @@ "main": "./dist/index.mjs",

Sorry, the diff of this file is too big to display