{"version":3,"sources":["../../src/helpers/OutputText.ts"],"names":["OutputText","constructor","output","figlet","args","gradient","str","gradients","multilineGradient","multiline","animation","text","speed","chalkAnimation","widest","input","i","width","truncate","cliTruncate","apply","arguments","wrap","wrapAnsi","slice","sliceAnsi","widestLine","stringWidth","strip","stripAnsi"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BO,IAAMA,WAAAA,GAAN,MAAMA,WAAAA,CAAAA;AAETC,EAAAA,WAAAA,CAAsBC,MAAgB,EAAA;;SAAhBA,MAAAA,GAAAA,MAAAA;AAEtB;AAKA,EAAA,MAAMC,UAAUC,IAA2B,EAAA;AACvC,IAAQD,OAAAA,uBAAAA,CAAAA,GAAkBC,IAAAA,CAAAA;AAC9B;AAGAC,EAAAA,QAAAA,CAASA,UAAyBC,GAAqB,EAAA;AAAC,IAAOC,OAAAA,0BAAAA,CAAWF,QAAAA,CAAAA,CAAWC,GAAAA,CAAAA;AAAM;AAE3FE,EAAAA,iBAAAA,CAAkBH,UAAyBC,GAAqB,EAAA;AAAC,IAAA,OAAOC,0BAAWF,CAAAA,QAAAA,CAAWI,CAAAA,SAAAA,CAAUH,GAAAA,CAAAA;AAAM;EAE9GI,SAAUA,CAAAA,SAAAA,EAA0BC,MAAcC,KAA2B,EAAA;AAAC,IAAA,OAAOC,+BAAgBH,CAAAA,SAAAA,CAAYC,CAAAA,IAAAA,EAAMC,KAAAA,CAAAA;AAAO;AAE9HE,EAAAA,MAAAA,CAAOC,KAAyB,EAAA;AAC5B,IAAA,IAAID,MAAS,GAAA,CAAA;AACb,IAAA,KAAA,MAAYE,KAAKD,KAAQ,EAAA;AACrB,MAAIE,IAAAA,KAAAA,GAAQ,IAAKA,CAAAA,KAAAA,CAAMD,CAAAA,CAAAA;AAEvB,MAAKC,IAAAA,CAAAA,WAASH,MAAS,EAAA;AACnBA,QAASG,MAAAA,GAAAA,KAAAA;AACb;AACJ;AACA,IAAOH,OAAAA,MAAAA;AACX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCAI,EAAAA,QAAAA,CAAAA,GAAYd,IAAW,EAAA;AAAE,IAAOe,OAAAA,4BAAAA,CAAYC,KAAMD,CAAAA,4BAAAA,EAAYE,SAAAA,CAAAA;AAAY;;;;;;;;;;;;;;;;;AAkB1EC,EAAAA,IAAAA,CAAAA,GAAQlB,IAAW,EAAA;AAAE,IAAOmB,OAAAA,yBAAAA,CAASH,KAAMG,CAAAA,yBAAAA,EAASF,SAAAA,CAAAA;AAAY;;;;;;;;;;;;;;;;;;AAmBhEG,EAAAA,KAAAA,CAAAA,GAASpB,IAAW,EAAA;AAAE,IAAOqB,OAAAA,0BAAAA,CAAUL,KAAMK,CAAAA,0BAAAA,EAAUJ,SAAAA,CAAAA;AAAY;;;;;;;;;;;AAYnEK,EAAAA,UAAAA,CAAAA,GAActB,IAAW,EAAA;AAAE,IAAOsB,OAAAA,2BAAAA,CAAWN,KAAMM,CAAAA,2BAAAA,EAAWL,SAAAA,CAAAA;AAAY;;;;;;;;;;;;;;;;;;;AAoB1EJ,EAAAA,KAAAA,CAAAA,GAASb,IAAW,EAAA;AAAE,IAAOuB,OAAAA,4BAAAA,CAAYP,KAAMO,CAAAA,4BAAAA,EAAYN,SAAAA,CAAAA;AAAY;;;;;;;;;;;;AAavEO,EAAAA,KAAAA,CAAAA,GAASxB,IAAW,EAAA;AAAE,IAAOyB,OAAAA,0BAAAA,CAAUT,KAAMS,CAAAA,0BAAAA,EAAUR,SAAAA,CAAAA;AAAY;AACvE,CAAA;AAvJarB,wBAAAA,CAAAA,WAAAA,EAAAA,YAAAA,CAAAA;AAAAA,kBAAN,GAAA","file":"chunk-VBVLHGVC.cjs","sourcesContent":["import cliTruncate from 'cli-truncate';\nimport sliceAnsi from 'slice-ansi';\nimport stringWidth from 'string-width';\nimport stripAnsi from 'strip-ansi';\nimport widestLine from 'widest-line';\nimport wrapAnsi from 'wrap-ansi';\nimport type { Output } from './Output.js';\nimport { macroable } from '../utils/macroable.js';\nimport figlet from 'figlet'\nimport chalkAnimation  from 'chalk-animation'\nimport gradients ,{multiline} from 'gradient-string'\n//@ts-ignore\nimport type { AnimationFn,Animation } from 'chalk-animation';\n//@ts-ignore\n\nexport interface AliasGradientFunction {\n    (str: string): string;\n\n    multiline: (str: string) => string;\n}\n\nexport type GradientTypes = 'atlas' | 'cristal' | 'teen' | 'mind' | 'morning' | 'vice' | 'passion' | 'fruit' | 'instagram' | 'retro' | 'summer' | 'rainbow' | 'pastel';\n\nexport interface Gradients extends Record<GradientTypes, AliasGradientFunction> {\n    // default: typeof gradient\n}\nexport type AnimationType = 'rainbow' | 'pulse' | 'glitch' | 'radar' | 'neon' | 'karaoke';\nexport interface Animations extends Record<AnimationType,AnimationFn>{}\n\n\n@macroable()\nexport class OutputText {\n\n    constructor(protected output: Output) {\n\n    }\n\n    figlet(txt: string, font: figlet.Fonts, cb?: (error: Error | null, result?: string) => void): Promise<any>\n    figlet(txt: string, options: figlet.Options | undefined, cb?: (error: Error | null, result?: string) => void): Promise<any>\n    figlet(txt: string, cb?: (error: Error | null, result?: string) => void): Promise<any>\n    async figlet(...args: any[]): Promise<any> {\n        return (figlet as any)(...args);\n    }\n\n\n    gradient(gradient: GradientTypes, str: string): string {return gradients[ gradient ](str); }\n\n    multilineGradient(gradient: GradientTypes, str: string): string {return gradients[ gradient ].multiline(str); }\n\n    animation(animation: AnimationType, text: string, speed?: number): Animation {return chalkAnimation[ animation ](text, speed);}\n\n    widest(input: string[]): number {\n        let widest = 0;\n        for ( const i of input ) {\n            let width = this.width(i);\n            //@ts-ignore\n            if ( width => widest ) {\n                widest = width;\n            }\n        }\n        return widest;\n    }\n\n    /**\n     Truncate a string to a specific width in the terminal.\n\n     @param text - The text to truncate.\n     @param columns - The number of columns to occupy in the terminal.\n\n     @example\n\n     import cliTruncate from 'cli-truncate';\n\n     cliTruncate('unicorn', 4);\n     //=> 'uni…'\n\n     // Truncate at different positions\n     cliTruncate('unicorn', 4, {position='start'});\n     //=> '…orn'\n\n     cliTruncate('unicorn', 4, {position='middle'});\n     //=> 'un…n'\n\n     cliTruncate('\\u001B[31municorn\\u001B[39m', 4);\n     //=> '\\u001B[31muni\\u001B[39m…'\n\n     // Truncate Unicode surrogate pairs\n     cliTruncate('uni\\uD83C\\uDE00corn', 5);\n     //=> 'uni\\uD83C\\uDE00…'\n\n     // Truncate fullwidth characters\n     cliTruncate('안녕하세요', 3);\n     //=> '안…'\n\n     // Truncate the paragraph to the terminal width\n     const paragraph = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.';\n     cliTruncate(paragraph, process.stdout.columns);\n     //=> 'Lorem ipsum dolor sit amet, consectetuer adipiscing…'\n     */\n    truncate(...args:any[]){ return cliTruncate.apply(cliTruncate,arguments); }\n\n    /**\n     Wrap words to the specified column width.\n\n     @param string - A string with ANSI escape codes, like one styled by [`chalk`](https://github.com/chalk/chalk). Newline characters will be normalized to `\\n`.\n     @param columns - The number of columns to wrap the text to.\n\n     @method\n     @example\n     import chalk from 'chalk';\n     import wrapAnsi from 'wrap-ansi';\n\n     const input = 'The quick brown ' + chalk.red('fox jumped over ') +\n     'the lazy ' + chalk.green('dog and then ran away with the unicorn.');\n\n     console.log(wrapAnsi(input, 20));\n     */\n    wrap(...args:any[]){ return wrapAnsi.apply(wrapAnsi,arguments); }\n\n    /**\n     Slice a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles)\n\n     @param string - A string with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk).\n     @param startSlice - Zero-based index at which to start the slice.\n     @param endSlice - Zero-based index at which to end the slice.\n\n     @method\n     @example\n     import chalk from 'chalk';\n     import sliceAnsi from 'slice-ansi';\n\n     const string = 'The quick brown ' + chalk.red('fox jumped over ') +\n     'the lazy ' + chalk.green('dog and then ran away with the unicorn.');\n\n     console.log(sliceAnsi(string, 20, 30));\n     */\n    slice(...args:any[]){ return sliceAnsi.apply(sliceAnsi,arguments); }\n\n    /**\n     Get the visual width of the widest line in a string - the number of columns required to display it.\n\n     @method\n     @example\n     import widestLine from 'widest-line';\n\n     widestLine('古\\n\\u001B[1m@\\u001B[22m');\n     //=> 2\n     */\n    widestLine(...args:any[]){ return widestLine.apply(widestLine,arguments); }\n\n    /**\n     Get the visual width of a string - the number of columns required to display it.\n\n     Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.\n\n     @method\n     @example\n     import stringWidth from 'string-width';\n\n     stringWidth('a');\n     //=> 1\n\n     stringWidth('古');\n     //=> 2\n\n     stringWidth('\\u001B[1m古\\u001B[22m');\n     //=> 2\n     */\n    width(...args:any[]){ return stringWidth.apply(stringWidth,arguments); }\n\n    /**\n     * Strips ANSI escape codes from a string.\n     * @param {string} text - The text to strip\n     * @returns {string} The stripped text\n     * @example\n     * stripAnsi('\\u001B[4mUnicorn\\u001B[0m');\n     * //=> 'Unicorn'\n     *\n     * stripAnsi('\\u001B] 8;;https:// github. com\\u0007Click\\u001B] 8;;\\u0007');\n     * //=> 'Click'\n     */\n    strip(...args:any[]){ return stripAnsi.apply(stripAnsi,arguments); }\n}\n"]}