keycloakify 10.0.0-rc.73 → 10.0.0-rc.75

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,5 +1,5 @@
1
- exports.id = 772;
2
- exports.ids = [772,246];
1
+ exports.id = 304;
2
+ exports.ids = [304,720];
3
3
  exports.modules = {
4
4
 
5
5
  /***/ 76047:
@@ -344,7 +344,7 @@ if (process.platform === 'linux') {
344
344
 
345
345
  /***/ }),
346
346
 
347
- /***/ 41772:
347
+ /***/ 12304:
348
348
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
349
349
 
350
350
  "use strict";
@@ -361,11 +361,21 @@ __webpack_require__.d(__webpack_exports__, {
361
361
  // EXTERNAL MODULE: external "node:process"
362
362
  var external_node_process_ = __webpack_require__(97742);
363
363
  ;// CONCATENATED MODULE: ./node_modules/listr2/node_modules/ansi-escapes/index.js
364
+
365
+
364
366
  const ESC = '\u001B[';
365
367
  const OSC = '\u001B]';
366
368
  const BEL = '\u0007';
367
369
  const SEP = ';';
368
- const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal';
370
+
371
+ /* global window */
372
+ const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
373
+
374
+ const isTerminalApp = !isBrowser && external_node_process_.env.TERM_PROGRAM === 'Apple_Terminal';
375
+ const isWindows = !isBrowser && external_node_process_.platform === 'win32';
376
+ const cwdFunction = isBrowser ? () => {
377
+ throw new Error('`process.cwd()` only works in Node.js, not the browser.');
378
+ } : external_node_process_.cwd;
369
379
 
370
380
  const ansiEscapes = {};
371
381
 
@@ -378,7 +388,7 @@ ansiEscapes.cursorTo = (x, y) => {
378
388
  return ESC + (x + 1) + 'G';
379
389
  }
380
390
 
381
- return ESC + (y + 1) + ';' + (x + 1) + 'H';
391
+ return ESC + (y + 1) + SEP + (x + 1) + 'H';
382
392
  };
383
393
 
384
394
  ansiEscapes.cursorMove = (x, y) => {
@@ -442,32 +452,33 @@ ansiEscapes.scrollDown = ESC + 'T';
442
452
 
443
453
  ansiEscapes.clearScreen = '\u001Bc';
444
454
 
445
- ansiEscapes.clearTerminal = process.platform === 'win32' ?
446
- `${ansiEscapes.eraseScreen}${ESC}0f` :
455
+ ansiEscapes.clearTerminal = isWindows
456
+ ? `${ansiEscapes.eraseScreen}${ESC}0f`
447
457
  // 1. Erases the screen (Only done in case `2` is not supported)
448
458
  // 2. Erases the whole screen including scrollback buffer
449
459
  // 3. Moves cursor to the top-left position
450
460
  // More info: https://www.real-world-systems.com/docs/ANSIcode.html
451
- `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`;
461
+ : `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`;
462
+
463
+ ansiEscapes.enterAlternativeScreen = ESC + '?1049h';
464
+ ansiEscapes.exitAlternativeScreen = ESC + '?1049l';
452
465
 
453
466
  ansiEscapes.beep = BEL;
454
467
 
455
- ansiEscapes.link = (text, url) => {
456
- return [
457
- OSC,
458
- '8',
459
- SEP,
460
- SEP,
461
- url,
462
- BEL,
463
- text,
464
- OSC,
465
- '8',
466
- SEP,
467
- SEP,
468
- BEL
469
- ].join('');
470
- };
468
+ ansiEscapes.link = (text, url) => [
469
+ OSC,
470
+ '8',
471
+ SEP,
472
+ SEP,
473
+ url,
474
+ BEL,
475
+ text,
476
+ OSC,
477
+ '8',
478
+ SEP,
479
+ SEP,
480
+ BEL,
481
+ ].join('');
471
482
 
472
483
  ansiEscapes.image = (buffer, options = {}) => {
473
484
  let returnValue = `${OSC}1337;File=inline=1`;
@@ -488,9 +499,9 @@ ansiEscapes.image = (buffer, options = {}) => {
488
499
  };
489
500
 
490
501
  ansiEscapes.iTerm = {
491
- setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
502
+ setCwd: (cwd = cwdFunction()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
492
503
 
493
- annotation: (message, options = {}) => {
504
+ annotation(message, options = {}) {
494
505
  let returnValue = `${OSC}1337;`;
495
506
 
496
507
  const hasX = typeof options.x !== 'undefined';
@@ -504,16 +515,17 @@ ansiEscapes.iTerm = {
504
515
  returnValue += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';
505
516
 
506
517
  if (options.length > 0) {
507
- returnValue +=
508
- (hasX ?
509
- [message, options.length, options.x, options.y] :
510
- [options.length, message]).join('|');
518
+ returnValue += (
519
+ hasX
520
+ ? [message, options.length, options.x, options.y]
521
+ : [options.length, message]
522
+ ).join('|');
511
523
  } else {
512
524
  returnValue += message;
513
525
  }
514
526
 
515
527
  return returnValue + BEL;
516
- }
528
+ },
517
529
  };
518
530
 
519
531
  /* harmony default export */ const ansi_escapes = (ansiEscapes);
@@ -576,10 +588,192 @@ cliCursor.toggle = (force, writableStream) => {
576
588
 
577
589
  /* harmony default export */ const cli_cursor = (cliCursor);
578
590
 
579
- // EXTERNAL MODULE: ./node_modules/listr2/node_modules/wrap-ansi/index.js + 1 modules
580
- var wrap_ansi = __webpack_require__(19246);
581
- // EXTERNAL MODULE: ./node_modules/slice-ansi/index.js + 2 modules
582
- var slice_ansi = __webpack_require__(32470);
591
+ // EXTERNAL MODULE: ./node_modules/listr2/node_modules/wrap-ansi/index.js
592
+ var wrap_ansi = __webpack_require__(68720);
593
+ // EXTERNAL MODULE: ./node_modules/listr2/node_modules/ansi-styles/index.js
594
+ var ansi_styles = __webpack_require__(51284);
595
+ // EXTERNAL MODULE: ./node_modules/get-east-asian-width/index.js + 1 modules
596
+ var get_east_asian_width = __webpack_require__(39725);
597
+ ;// CONCATENATED MODULE: ./node_modules/listr2/node_modules/log-update/node_modules/is-fullwidth-code-point/index.js
598
+
599
+
600
+ function isFullwidthCodePoint(codePoint) {
601
+ if (!Number.isInteger(codePoint)) {
602
+ return false;
603
+ }
604
+
605
+ return (0,get_east_asian_width/* eastAsianWidth */.a5)(codePoint) === 2;
606
+ }
607
+
608
+ ;// CONCATENATED MODULE: ./node_modules/listr2/node_modules/log-update/node_modules/slice-ansi/index.js
609
+
610
+
611
+
612
+ // \x1b and \x9b
613
+ const ESCAPES = new Set([27, 155]);
614
+
615
+ const CODE_POINT_0 = '0'.codePointAt(0);
616
+ const CODE_POINT_9 = '9'.codePointAt(0);
617
+
618
+ const endCodesSet = new Set();
619
+ const endCodesMap = new Map();
620
+ for (const [start, end] of ansi_styles/* default.codes */.ZP.codes) {
621
+ endCodesSet.add(ansi_styles/* default.color.ansi */.ZP.color.ansi(end));
622
+ endCodesMap.set(ansi_styles/* default.color.ansi */.ZP.color.ansi(start), ansi_styles/* default.color.ansi */.ZP.color.ansi(end));
623
+ }
624
+
625
+ function getEndCode(code) {
626
+ if (endCodesSet.has(code)) {
627
+ return code;
628
+ }
629
+
630
+ if (endCodesMap.has(code)) {
631
+ return endCodesMap.get(code);
632
+ }
633
+
634
+ code = code.slice(2);
635
+ if (code.includes(';')) {
636
+ code = code[0] + '0';
637
+ }
638
+
639
+ const returnValue = ansi_styles/* default.codes.get */.ZP.codes.get(Number.parseInt(code, 10));
640
+ if (returnValue) {
641
+ return ansi_styles/* default.color.ansi */.ZP.color.ansi(returnValue);
642
+ }
643
+
644
+ return ansi_styles/* default.reset.open */.ZP.reset.open;
645
+ }
646
+
647
+ function findNumberIndex(string) {
648
+ for (let index = 0; index < string.length; index++) {
649
+ const codePoint = string.codePointAt(index);
650
+ if (codePoint >= CODE_POINT_0 && codePoint <= CODE_POINT_9) {
651
+ return index;
652
+ }
653
+ }
654
+
655
+ return -1;
656
+ }
657
+
658
+ function parseAnsiCode(string, offset) {
659
+ string = string.slice(offset, offset + 19);
660
+ const startIndex = findNumberIndex(string);
661
+ if (startIndex !== -1) {
662
+ let endIndex = string.indexOf('m', startIndex);
663
+ if (endIndex === -1) {
664
+ endIndex = string.length;
665
+ }
666
+
667
+ return string.slice(0, endIndex + 1);
668
+ }
669
+ }
670
+
671
+ function tokenize(string, endCharacter = Number.POSITIVE_INFINITY) {
672
+ const returnValue = [];
673
+
674
+ let index = 0;
675
+ let visibleCount = 0;
676
+ while (index < string.length) {
677
+ const codePoint = string.codePointAt(index);
678
+
679
+ if (ESCAPES.has(codePoint)) {
680
+ const code = parseAnsiCode(string, index);
681
+ if (code) {
682
+ returnValue.push({
683
+ type: 'ansi',
684
+ code,
685
+ endCode: getEndCode(code),
686
+ });
687
+ index += code.length;
688
+ continue;
689
+ }
690
+ }
691
+
692
+ const isFullWidth = isFullwidthCodePoint(codePoint);
693
+ const character = String.fromCodePoint(codePoint);
694
+
695
+ returnValue.push({
696
+ type: 'character',
697
+ value: character,
698
+ isFullWidth,
699
+ });
700
+
701
+ index += character.length;
702
+ visibleCount += isFullWidth ? 2 : character.length;
703
+
704
+ if (visibleCount >= endCharacter) {
705
+ break;
706
+ }
707
+ }
708
+
709
+ return returnValue;
710
+ }
711
+
712
+ function reduceAnsiCodes(codes) {
713
+ let returnValue = [];
714
+
715
+ for (const code of codes) {
716
+ if (code.code === ansi_styles/* default.reset.open */.ZP.reset.open) {
717
+ // Reset code, disable all codes
718
+ returnValue = [];
719
+ } else if (endCodesSet.has(code.code)) {
720
+ // This is an end code, disable all matching start codes
721
+ returnValue = returnValue.filter(returnValueCode => returnValueCode.endCode !== code.code);
722
+ } else {
723
+ // This is a start code. Disable all styles this "overrides", then enable it
724
+ returnValue = returnValue.filter(returnValueCode => returnValueCode.endCode !== code.endCode);
725
+ returnValue.push(code);
726
+ }
727
+ }
728
+
729
+ return returnValue;
730
+ }
731
+
732
+ function undoAnsiCodes(codes) {
733
+ const reduced = reduceAnsiCodes(codes);
734
+ const endCodes = reduced.map(({endCode}) => endCode);
735
+ return endCodes.reverse().join('');
736
+ }
737
+
738
+ function sliceAnsi(string, start, end) {
739
+ const tokens = tokenize(string, end);
740
+ let activeCodes = [];
741
+ let position = 0;
742
+ let returnValue = '';
743
+ let include = false;
744
+
745
+ for (const token of tokens) {
746
+ if (end !== undefined && position >= end) {
747
+ break;
748
+ }
749
+
750
+ if (token.type === 'ansi') {
751
+ activeCodes.push(token);
752
+ if (include) {
753
+ returnValue += token.code;
754
+ }
755
+ } else {
756
+ // Character
757
+ if (!include && position >= start) {
758
+ include = true;
759
+ // Simplify active codes
760
+ activeCodes = reduceAnsiCodes(activeCodes);
761
+ returnValue = activeCodes.map(({code}) => code).join('');
762
+ }
763
+
764
+ if (include) {
765
+ returnValue += token.value;
766
+ }
767
+
768
+ position += token.isFullWidth ? 2 : token.value.length;
769
+ }
770
+ }
771
+
772
+ // Disable active codes at the end
773
+ returnValue += undoAnsiCodes(activeCodes);
774
+ return returnValue;
775
+ }
776
+
583
777
  // EXTERNAL MODULE: ./node_modules/listr2/node_modules/strip-ansi/index.js + 1 modules
584
778
  var strip_ansi = __webpack_require__(5505);
585
779
  ;// CONCATENATED MODULE: ./node_modules/listr2/node_modules/log-update/index.js
@@ -603,7 +797,7 @@ const getWidth = stream => {
603
797
  };
604
798
 
605
799
  const fitToTerminalHeight = (stream, text) => {
606
- const terminalHeight = stream.rows || defaultTerminalHeight;
800
+ const terminalHeight = stream.rows ?? defaultTerminalHeight;
607
801
  const lines = text.split('\n');
608
802
 
609
803
  const toRemove = lines.length - terminalHeight;
@@ -611,7 +805,7 @@ const fitToTerminalHeight = (stream, text) => {
611
805
  return text;
612
806
  }
613
807
 
614
- return (0,slice_ansi/* default */.Z)(
808
+ return sliceAnsi(
615
809
  text,
616
810
  (0,strip_ansi/* default */.Z)(lines.slice(0, toRemove).join('\n')).length + 1,
617
811
  );
@@ -673,248 +867,17 @@ const logUpdateStderr = createLogUpdate(external_node_process_.stderr);
673
867
 
674
868
  /***/ }),
675
869
 
676
- /***/ 19246:
870
+ /***/ 68720:
677
871
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
678
872
 
679
873
  "use strict";
680
- // ESM COMPAT FLAG
681
874
  __webpack_require__.r(__webpack_exports__);
682
-
683
- // EXPORTS
684
- __webpack_require__.d(__webpack_exports__, {
685
- "default": () => (/* binding */ wrapAnsi)
686
- });
687
-
688
- // EXTERNAL MODULE: ./node_modules/listr2/node_modules/string-width/index.js
689
- var string_width = __webpack_require__(10509);
690
- // EXTERNAL MODULE: ./node_modules/listr2/node_modules/strip-ansi/index.js + 1 modules
691
- var strip_ansi = __webpack_require__(5505);
692
- ;// CONCATENATED MODULE: ./node_modules/listr2/node_modules/ansi-styles/index.js
693
- const ANSI_BACKGROUND_OFFSET = 10;
694
-
695
- const wrapAnsi16 = (offset = 0) => code => `\u001B[${code + offset}m`;
696
-
697
- const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`;
698
-
699
- const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
700
-
701
- const styles = {
702
- modifier: {
703
- reset: [0, 0],
704
- // 21 isn't widely supported and 22 does the same thing
705
- bold: [1, 22],
706
- dim: [2, 22],
707
- italic: [3, 23],
708
- underline: [4, 24],
709
- overline: [53, 55],
710
- inverse: [7, 27],
711
- hidden: [8, 28],
712
- strikethrough: [9, 29],
713
- },
714
- color: {
715
- black: [30, 39],
716
- red: [31, 39],
717
- green: [32, 39],
718
- yellow: [33, 39],
719
- blue: [34, 39],
720
- magenta: [35, 39],
721
- cyan: [36, 39],
722
- white: [37, 39],
723
-
724
- // Bright color
725
- blackBright: [90, 39],
726
- gray: [90, 39], // Alias of `blackBright`
727
- grey: [90, 39], // Alias of `blackBright`
728
- redBright: [91, 39],
729
- greenBright: [92, 39],
730
- yellowBright: [93, 39],
731
- blueBright: [94, 39],
732
- magentaBright: [95, 39],
733
- cyanBright: [96, 39],
734
- whiteBright: [97, 39],
735
- },
736
- bgColor: {
737
- bgBlack: [40, 49],
738
- bgRed: [41, 49],
739
- bgGreen: [42, 49],
740
- bgYellow: [43, 49],
741
- bgBlue: [44, 49],
742
- bgMagenta: [45, 49],
743
- bgCyan: [46, 49],
744
- bgWhite: [47, 49],
745
-
746
- // Bright color
747
- bgBlackBright: [100, 49],
748
- bgGray: [100, 49], // Alias of `bgBlackBright`
749
- bgGrey: [100, 49], // Alias of `bgBlackBright`
750
- bgRedBright: [101, 49],
751
- bgGreenBright: [102, 49],
752
- bgYellowBright: [103, 49],
753
- bgBlueBright: [104, 49],
754
- bgMagentaBright: [105, 49],
755
- bgCyanBright: [106, 49],
756
- bgWhiteBright: [107, 49],
757
- },
758
- };
759
-
760
- const modifierNames = Object.keys(styles.modifier);
761
- const foregroundColorNames = Object.keys(styles.color);
762
- const backgroundColorNames = Object.keys(styles.bgColor);
763
- const colorNames = [...foregroundColorNames, ...backgroundColorNames];
764
-
765
- function assembleStyles() {
766
- const codes = new Map();
767
-
768
- for (const [groupName, group] of Object.entries(styles)) {
769
- for (const [styleName, style] of Object.entries(group)) {
770
- styles[styleName] = {
771
- open: `\u001B[${style[0]}m`,
772
- close: `\u001B[${style[1]}m`,
773
- };
774
-
775
- group[styleName] = styles[styleName];
776
-
777
- codes.set(style[0], style[1]);
778
- }
779
-
780
- Object.defineProperty(styles, groupName, {
781
- value: group,
782
- enumerable: false,
783
- });
784
- }
785
-
786
- Object.defineProperty(styles, 'codes', {
787
- value: codes,
788
- enumerable: false,
789
- });
790
-
791
- styles.color.close = '\u001B[39m';
792
- styles.bgColor.close = '\u001B[49m';
793
-
794
- styles.color.ansi = wrapAnsi16();
795
- styles.color.ansi256 = wrapAnsi256();
796
- styles.color.ansi16m = wrapAnsi16m();
797
- styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
798
- styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
799
- styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
800
-
801
- // From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
802
- Object.defineProperties(styles, {
803
- rgbToAnsi256: {
804
- value: (red, green, blue) => {
805
- // We use the extended greyscale palette here, with the exception of
806
- // black and white. normal palette only has 4 greyscale shades.
807
- if (red === green && green === blue) {
808
- if (red < 8) {
809
- return 16;
810
- }
811
-
812
- if (red > 248) {
813
- return 231;
814
- }
815
-
816
- return Math.round(((red - 8) / 247) * 24) + 232;
817
- }
818
-
819
- return 16
820
- + (36 * Math.round(red / 255 * 5))
821
- + (6 * Math.round(green / 255 * 5))
822
- + Math.round(blue / 255 * 5);
823
- },
824
- enumerable: false,
825
- },
826
- hexToRgb: {
827
- value: hex => {
828
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
829
- if (!matches) {
830
- return [0, 0, 0];
831
- }
832
-
833
- let [colorString] = matches;
834
-
835
- if (colorString.length === 3) {
836
- colorString = [...colorString].map(character => character + character).join('');
837
- }
838
-
839
- const integer = Number.parseInt(colorString, 16);
840
-
841
- return [
842
- /* eslint-disable no-bitwise */
843
- (integer >> 16) & 0xFF,
844
- (integer >> 8) & 0xFF,
845
- integer & 0xFF,
846
- /* eslint-enable no-bitwise */
847
- ];
848
- },
849
- enumerable: false,
850
- },
851
- hexToAnsi256: {
852
- value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
853
- enumerable: false,
854
- },
855
- ansi256ToAnsi: {
856
- value: code => {
857
- if (code < 8) {
858
- return 30 + code;
859
- }
860
-
861
- if (code < 16) {
862
- return 90 + (code - 8);
863
- }
864
-
865
- let red;
866
- let green;
867
- let blue;
868
-
869
- if (code >= 232) {
870
- red = (((code - 232) * 10) + 8) / 255;
871
- green = red;
872
- blue = red;
873
- } else {
874
- code -= 16;
875
-
876
- const remainder = code % 36;
877
-
878
- red = Math.floor(code / 36) / 5;
879
- green = Math.floor(remainder / 6) / 5;
880
- blue = (remainder % 6) / 5;
881
- }
882
-
883
- const value = Math.max(red, green, blue) * 2;
884
-
885
- if (value === 0) {
886
- return 30;
887
- }
888
-
889
- // eslint-disable-next-line no-bitwise
890
- let result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));
891
-
892
- if (value === 2) {
893
- result += 60;
894
- }
895
-
896
- return result;
897
- },
898
- enumerable: false,
899
- },
900
- rgbToAnsi: {
901
- value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
902
- enumerable: false,
903
- },
904
- hexToAnsi: {
905
- value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
906
- enumerable: false,
907
- },
908
- });
909
-
910
- return styles;
911
- }
912
-
913
- const ansiStyles = assembleStyles();
914
-
915
- /* harmony default export */ const ansi_styles = (ansiStyles);
916
-
917
- ;// CONCATENATED MODULE: ./node_modules/listr2/node_modules/wrap-ansi/index.js
875
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
876
+ /* harmony export */ "default": () => (/* binding */ wrapAnsi)
877
+ /* harmony export */ });
878
+ /* harmony import */ var string_width__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10509);
879
+ /* harmony import */ var strip_ansi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5505);
880
+ /* harmony import */ var ansi_styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51284);
918
881
 
919
882
 
920
883
 
@@ -932,11 +895,11 @@ const ANSI_SGR_TERMINATOR = 'm';
932
895
  const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
933
896
 
934
897
  const wrapAnsiCode = code => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
935
- const wrapAnsiHyperlink = uri => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;
898
+ const wrapAnsiHyperlink = url => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
936
899
 
937
900
  // Calculate the length of words split on ' ', ignoring
938
901
  // the extra characters added by ansi escape codes
939
- const wordLengths = string => string.split(' ').map(character => (0,string_width/* default */.Z)(character));
902
+ const wordLengths = string => string.split(' ').map(character => (0,string_width__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(character));
940
903
 
941
904
  // Wrap a long word across multiple rows
942
905
  // Ansi escape codes do not count towards length
@@ -945,10 +908,10 @@ const wrapWord = (rows, word, columns) => {
945
908
 
946
909
  let isInsideEscape = false;
947
910
  let isInsideLinkEscape = false;
948
- let visible = (0,string_width/* default */.Z)((0,strip_ansi/* default */.Z)(rows[rows.length - 1]));
911
+ let visible = (0,string_width__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)((0,strip_ansi__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(rows.at(-1)));
949
912
 
950
913
  for (const [index, character] of characters.entries()) {
951
- const characterLength = (0,string_width/* default */.Z)(character);
914
+ const characterLength = (0,string_width__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(character);
952
915
 
953
916
  if (visible + characterLength <= columns) {
954
917
  rows[rows.length - 1] += character;
@@ -959,7 +922,9 @@ const wrapWord = (rows, word, columns) => {
959
922
 
960
923
  if (ESCAPES.has(character)) {
961
924
  isInsideEscape = true;
962
- isInsideLinkEscape = characters.slice(index + 1).join('').startsWith(ANSI_ESCAPE_LINK);
925
+
926
+ const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join('');
927
+ isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
963
928
  }
964
929
 
965
930
  if (isInsideEscape) {
@@ -985,7 +950,7 @@ const wrapWord = (rows, word, columns) => {
985
950
 
986
951
  // It's possible that the last row we copy over is only
987
952
  // ansi escape characters, handle this edge-case
988
- if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
953
+ if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
989
954
  rows[rows.length - 2] += rows.pop();
990
955
  }
991
956
  };
@@ -996,7 +961,7 @@ const stringVisibleTrimSpacesRight = string => {
996
961
  let last = words.length;
997
962
 
998
963
  while (last > 0) {
999
- if ((0,string_width/* default */.Z)(words[last - 1]) > 0) {
964
+ if ((0,string_width__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(words[last - 1]) > 0) {
1000
965
  break;
1001
966
  }
1002
967
 
@@ -1010,11 +975,11 @@ const stringVisibleTrimSpacesRight = string => {
1010
975
  return words.slice(0, last).join(' ') + words.slice(last).join('');
1011
976
  };
1012
977
 
1013
- // The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode
978
+ // The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode.
1014
979
  //
1015
- // 'hard' will never allow a string to take up more than columns characters
980
+ // 'hard' will never allow a string to take up more than columns characters.
1016
981
  //
1017
- // 'soft' allows long words to expand past the column length
982
+ // 'soft' allows long words to expand past the column length.
1018
983
  const exec = (string, columns, options = {}) => {
1019
984
  if (options.trim !== false && string.trim() === '') {
1020
985
  return '';
@@ -1029,10 +994,10 @@ const exec = (string, columns, options = {}) => {
1029
994
 
1030
995
  for (const [index, word] of string.split(' ').entries()) {
1031
996
  if (options.trim !== false) {
1032
- rows[rows.length - 1] = rows[rows.length - 1].trimStart();
997
+ rows[rows.length - 1] = rows.at(-1).trimStart();
1033
998
  }
1034
999
 
1035
- let rowLength = (0,string_width/* default */.Z)(rows[rows.length - 1]);
1000
+ let rowLength = (0,string_width__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(rows.at(-1));
1036
1001
 
1037
1002
  if (index !== 0) {
1038
1003
  if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
@@ -1081,13 +1046,17 @@ const exec = (string, columns, options = {}) => {
1081
1046
  rows = rows.map(row => stringVisibleTrimSpacesRight(row));
1082
1047
  }
1083
1048
 
1084
- const pre = [...rows.join('\n')];
1049
+ const preString = rows.join('\n');
1050
+ const pre = [...preString];
1051
+
1052
+ // We need to keep a separate index as `String#slice()` works on Unicode code units, while `pre` is an array of codepoints.
1053
+ let preStringIndex = 0;
1085
1054
 
1086
1055
  for (const [index, character] of pre.entries()) {
1087
1056
  returnValue += character;
1088
1057
 
1089
1058
  if (ESCAPES.has(character)) {
1090
- const {groups} = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join('')) || {groups: {}};
1059
+ const {groups} = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || {groups: {}};
1091
1060
  if (groups.code !== undefined) {
1092
1061
  const code = Number.parseFloat(groups.code);
1093
1062
  escapeCode = code === END_CODE ? undefined : code;
@@ -1096,7 +1065,7 @@ const exec = (string, columns, options = {}) => {
1096
1065
  }
1097
1066
  }
1098
1067
 
1099
- const code = ansi_styles.codes.get(Number(escapeCode));
1068
+ const code = ansi_styles__WEBPACK_IMPORTED_MODULE_1__/* ["default"].codes.get */ .ZP.codes.get(Number(escapeCode));
1100
1069
 
1101
1070
  if (pre[index + 1] === '\n') {
1102
1071
  if (escapeUrl) {
@@ -1115,6 +1084,8 @@ const exec = (string, columns, options = {}) => {
1115
1084
  returnValue += wrapAnsiHyperlink(escapeUrl);
1116
1085
  }
1117
1086
  }
1087
+
1088
+ preStringIndex += character.length;
1118
1089
  }
1119
1090
 
1120
1091
  return returnValue;
@@ -1124,400 +1095,13 @@ const exec = (string, columns, options = {}) => {
1124
1095
  function wrapAnsi(string, columns, options) {
1125
1096
  return String(string)
1126
1097
  .normalize()
1127
- .replace(/\r\n/g, '\n')
1098
+ .replaceAll('\r\n', '\n')
1128
1099
  .split('\n')
1129
1100
  .map(line => exec(line, columns, options))
1130
1101
  .join('\n');
1131
1102
  }
1132
1103
 
1133
1104
 
1134
- /***/ }),
1135
-
1136
- /***/ 32470:
1137
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1138
-
1139
- "use strict";
1140
-
1141
- // EXPORTS
1142
- __webpack_require__.d(__webpack_exports__, {
1143
- "Z": () => (/* binding */ sliceAnsi)
1144
- });
1145
-
1146
- ;// CONCATENATED MODULE: ./node_modules/slice-ansi/node_modules/is-fullwidth-code-point/index.js
1147
- /* eslint-disable yoda */
1148
-
1149
- function isFullwidthCodePoint(codePoint) {
1150
- if (!Number.isInteger(codePoint)) {
1151
- return false;
1152
- }
1153
-
1154
- // Code points are derived from:
1155
- // https://unicode.org/Public/UNIDATA/EastAsianWidth.txt
1156
- return codePoint >= 0x1100 && (
1157
- codePoint <= 0x115F || // Hangul Jamo
1158
- codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET
1159
- codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET
1160
- // CJK Radicals Supplement .. Enclosed CJK Letters and Months
1161
- (0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) ||
1162
- // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
1163
- (0x3250 <= codePoint && codePoint <= 0x4DBF) ||
1164
- // CJK Unified Ideographs .. Yi Radicals
1165
- (0x4E00 <= codePoint && codePoint <= 0xA4C6) ||
1166
- // Hangul Jamo Extended-A
1167
- (0xA960 <= codePoint && codePoint <= 0xA97C) ||
1168
- // Hangul Syllables
1169
- (0xAC00 <= codePoint && codePoint <= 0xD7A3) ||
1170
- // CJK Compatibility Ideographs
1171
- (0xF900 <= codePoint && codePoint <= 0xFAFF) ||
1172
- // Vertical Forms
1173
- (0xFE10 <= codePoint && codePoint <= 0xFE19) ||
1174
- // CJK Compatibility Forms .. Small Form Variants
1175
- (0xFE30 <= codePoint && codePoint <= 0xFE6B) ||
1176
- // Halfwidth and Fullwidth Forms
1177
- (0xFF01 <= codePoint && codePoint <= 0xFF60) ||
1178
- (0xFFE0 <= codePoint && codePoint <= 0xFFE6) ||
1179
- // Kana Supplement
1180
- (0x1B000 <= codePoint && codePoint <= 0x1B001) ||
1181
- // Enclosed Ideographic Supplement
1182
- (0x1F200 <= codePoint && codePoint <= 0x1F251) ||
1183
- // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
1184
- (0x20000 <= codePoint && codePoint <= 0x3FFFD)
1185
- );
1186
- }
1187
-
1188
- ;// CONCATENATED MODULE: ./node_modules/slice-ansi/node_modules/ansi-styles/index.js
1189
- const ANSI_BACKGROUND_OFFSET = 10;
1190
-
1191
- const wrapAnsi16 = (offset = 0) => code => `\u001B[${code + offset}m`;
1192
-
1193
- const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`;
1194
-
1195
- const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
1196
-
1197
- const styles = {
1198
- modifier: {
1199
- reset: [0, 0],
1200
- // 21 isn't widely supported and 22 does the same thing
1201
- bold: [1, 22],
1202
- dim: [2, 22],
1203
- italic: [3, 23],
1204
- underline: [4, 24],
1205
- overline: [53, 55],
1206
- inverse: [7, 27],
1207
- hidden: [8, 28],
1208
- strikethrough: [9, 29],
1209
- },
1210
- color: {
1211
- black: [30, 39],
1212
- red: [31, 39],
1213
- green: [32, 39],
1214
- yellow: [33, 39],
1215
- blue: [34, 39],
1216
- magenta: [35, 39],
1217
- cyan: [36, 39],
1218
- white: [37, 39],
1219
-
1220
- // Bright color
1221
- blackBright: [90, 39],
1222
- gray: [90, 39], // Alias of `blackBright`
1223
- grey: [90, 39], // Alias of `blackBright`
1224
- redBright: [91, 39],
1225
- greenBright: [92, 39],
1226
- yellowBright: [93, 39],
1227
- blueBright: [94, 39],
1228
- magentaBright: [95, 39],
1229
- cyanBright: [96, 39],
1230
- whiteBright: [97, 39],
1231
- },
1232
- bgColor: {
1233
- bgBlack: [40, 49],
1234
- bgRed: [41, 49],
1235
- bgGreen: [42, 49],
1236
- bgYellow: [43, 49],
1237
- bgBlue: [44, 49],
1238
- bgMagenta: [45, 49],
1239
- bgCyan: [46, 49],
1240
- bgWhite: [47, 49],
1241
-
1242
- // Bright color
1243
- bgBlackBright: [100, 49],
1244
- bgGray: [100, 49], // Alias of `bgBlackBright`
1245
- bgGrey: [100, 49], // Alias of `bgBlackBright`
1246
- bgRedBright: [101, 49],
1247
- bgGreenBright: [102, 49],
1248
- bgYellowBright: [103, 49],
1249
- bgBlueBright: [104, 49],
1250
- bgMagentaBright: [105, 49],
1251
- bgCyanBright: [106, 49],
1252
- bgWhiteBright: [107, 49],
1253
- },
1254
- };
1255
-
1256
- const modifierNames = Object.keys(styles.modifier);
1257
- const foregroundColorNames = Object.keys(styles.color);
1258
- const backgroundColorNames = Object.keys(styles.bgColor);
1259
- const colorNames = [...foregroundColorNames, ...backgroundColorNames];
1260
-
1261
- function assembleStyles() {
1262
- const codes = new Map();
1263
-
1264
- for (const [groupName, group] of Object.entries(styles)) {
1265
- for (const [styleName, style] of Object.entries(group)) {
1266
- styles[styleName] = {
1267
- open: `\u001B[${style[0]}m`,
1268
- close: `\u001B[${style[1]}m`,
1269
- };
1270
-
1271
- group[styleName] = styles[styleName];
1272
-
1273
- codes.set(style[0], style[1]);
1274
- }
1275
-
1276
- Object.defineProperty(styles, groupName, {
1277
- value: group,
1278
- enumerable: false,
1279
- });
1280
- }
1281
-
1282
- Object.defineProperty(styles, 'codes', {
1283
- value: codes,
1284
- enumerable: false,
1285
- });
1286
-
1287
- styles.color.close = '\u001B[39m';
1288
- styles.bgColor.close = '\u001B[49m';
1289
-
1290
- styles.color.ansi = wrapAnsi16();
1291
- styles.color.ansi256 = wrapAnsi256();
1292
- styles.color.ansi16m = wrapAnsi16m();
1293
- styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
1294
- styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
1295
- styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
1296
-
1297
- // From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
1298
- Object.defineProperties(styles, {
1299
- rgbToAnsi256: {
1300
- value: (red, green, blue) => {
1301
- // We use the extended greyscale palette here, with the exception of
1302
- // black and white. normal palette only has 4 greyscale shades.
1303
- if (red === green && green === blue) {
1304
- if (red < 8) {
1305
- return 16;
1306
- }
1307
-
1308
- if (red > 248) {
1309
- return 231;
1310
- }
1311
-
1312
- return Math.round(((red - 8) / 247) * 24) + 232;
1313
- }
1314
-
1315
- return 16
1316
- + (36 * Math.round(red / 255 * 5))
1317
- + (6 * Math.round(green / 255 * 5))
1318
- + Math.round(blue / 255 * 5);
1319
- },
1320
- enumerable: false,
1321
- },
1322
- hexToRgb: {
1323
- value: hex => {
1324
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
1325
- if (!matches) {
1326
- return [0, 0, 0];
1327
- }
1328
-
1329
- let [colorString] = matches;
1330
-
1331
- if (colorString.length === 3) {
1332
- colorString = [...colorString].map(character => character + character).join('');
1333
- }
1334
-
1335
- const integer = Number.parseInt(colorString, 16);
1336
-
1337
- return [
1338
- /* eslint-disable no-bitwise */
1339
- (integer >> 16) & 0xFF,
1340
- (integer >> 8) & 0xFF,
1341
- integer & 0xFF,
1342
- /* eslint-enable no-bitwise */
1343
- ];
1344
- },
1345
- enumerable: false,
1346
- },
1347
- hexToAnsi256: {
1348
- value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
1349
- enumerable: false,
1350
- },
1351
- ansi256ToAnsi: {
1352
- value: code => {
1353
- if (code < 8) {
1354
- return 30 + code;
1355
- }
1356
-
1357
- if (code < 16) {
1358
- return 90 + (code - 8);
1359
- }
1360
-
1361
- let red;
1362
- let green;
1363
- let blue;
1364
-
1365
- if (code >= 232) {
1366
- red = (((code - 232) * 10) + 8) / 255;
1367
- green = red;
1368
- blue = red;
1369
- } else {
1370
- code -= 16;
1371
-
1372
- const remainder = code % 36;
1373
-
1374
- red = Math.floor(code / 36) / 5;
1375
- green = Math.floor(remainder / 6) / 5;
1376
- blue = (remainder % 6) / 5;
1377
- }
1378
-
1379
- const value = Math.max(red, green, blue) * 2;
1380
-
1381
- if (value === 0) {
1382
- return 30;
1383
- }
1384
-
1385
- // eslint-disable-next-line no-bitwise
1386
- let result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));
1387
-
1388
- if (value === 2) {
1389
- result += 60;
1390
- }
1391
-
1392
- return result;
1393
- },
1394
- enumerable: false,
1395
- },
1396
- rgbToAnsi: {
1397
- value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
1398
- enumerable: false,
1399
- },
1400
- hexToAnsi: {
1401
- value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
1402
- enumerable: false,
1403
- },
1404
- });
1405
-
1406
- return styles;
1407
- }
1408
-
1409
- const ansiStyles = assembleStyles();
1410
-
1411
- /* harmony default export */ const ansi_styles = (ansiStyles);
1412
-
1413
- ;// CONCATENATED MODULE: ./node_modules/slice-ansi/index.js
1414
-
1415
-
1416
-
1417
- const astralRegex = /^[\uD800-\uDBFF][\uDC00-\uDFFF]$/;
1418
-
1419
- const ESCAPES = [
1420
- '\u001B',
1421
- '\u009B'
1422
- ];
1423
-
1424
- const wrapAnsi = code => `${ESCAPES[0]}[${code}m`;
1425
-
1426
- const checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => {
1427
- let output = [];
1428
- ansiCodes = [...ansiCodes];
1429
-
1430
- for (let ansiCode of ansiCodes) {
1431
- const ansiCodeOrigin = ansiCode;
1432
- if (ansiCode.includes(';')) {
1433
- ansiCode = ansiCode.split(';')[0][0] + '0';
1434
- }
1435
-
1436
- const item = ansi_styles.codes.get(Number.parseInt(ansiCode, 10));
1437
- if (item) {
1438
- const indexEscape = ansiCodes.indexOf(item.toString());
1439
- if (indexEscape === -1) {
1440
- output.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin));
1441
- } else {
1442
- ansiCodes.splice(indexEscape, 1);
1443
- }
1444
- } else if (isEscapes) {
1445
- output.push(wrapAnsi(0));
1446
- break;
1447
- } else {
1448
- output.push(wrapAnsi(ansiCodeOrigin));
1449
- }
1450
- }
1451
-
1452
- if (isEscapes) {
1453
- output = output.filter((element, index) => output.indexOf(element) === index);
1454
-
1455
- if (endAnsiCode !== undefined) {
1456
- const fistEscapeCode = wrapAnsi(ansi_styles.codes.get(Number.parseInt(endAnsiCode, 10)));
1457
- // TODO: Remove the use of `.reduce` here.
1458
- // eslint-disable-next-line unicorn/no-array-reduce
1459
- output = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []);
1460
- }
1461
- }
1462
-
1463
- return output.join('');
1464
- };
1465
-
1466
- function sliceAnsi(string, begin, end) {
1467
- const characters = [...string];
1468
- const ansiCodes = [];
1469
-
1470
- let stringEnd = typeof end === 'number' ? end : characters.length;
1471
- let isInsideEscape = false;
1472
- let ansiCode;
1473
- let visible = 0;
1474
- let output = '';
1475
-
1476
- for (const [index, character] of characters.entries()) {
1477
- let leftEscape = false;
1478
-
1479
- if (ESCAPES.includes(character)) {
1480
- const code = /\d[^m]*/.exec(string.slice(index, index + 18));
1481
- ansiCode = code && code.length > 0 ? code[0] : undefined;
1482
-
1483
- if (visible < stringEnd) {
1484
- isInsideEscape = true;
1485
-
1486
- if (ansiCode !== undefined) {
1487
- ansiCodes.push(ansiCode);
1488
- }
1489
- }
1490
- } else if (isInsideEscape && character === 'm') {
1491
- isInsideEscape = false;
1492
- leftEscape = true;
1493
- }
1494
-
1495
- if (!isInsideEscape && !leftEscape) {
1496
- visible++;
1497
- }
1498
-
1499
- if (!astralRegex.test(character) && isFullwidthCodePoint(character.codePointAt())) {
1500
- visible++;
1501
-
1502
- if (typeof end !== 'number') {
1503
- stringEnd++;
1504
- }
1505
- }
1506
-
1507
- if (visible > begin && visible <= stringEnd) {
1508
- output += character;
1509
- } else if (visible === begin && !isInsideEscape && ansiCode !== undefined) {
1510
- output = checkAnsi(ansiCodes);
1511
- } else if (visible >= stringEnd) {
1512
- output += checkAnsi(ansiCodes, true, ansiCode);
1513
- break;
1514
- }
1515
- }
1516
-
1517
- return output;
1518
- }
1519
-
1520
-
1521
1105
  /***/ })
1522
1106
 
1523
1107
  };