// Force strict mode and setup for ESM
"use strict";
import {
  theme
} from "./chunk-U25CMJYY.js";
import {
  require_jsx_runtime
} from "./chunk-SV5PQVQE.js";
import {
  Box_default,
  Text,
  use_is_screen_reader_enabled_default
} from "./chunk-2IIJTXYF.js";
import {
  require_react
} from "./chunk-5QWWOFGG.js";
import {
  formatHistoryGapNotice,
  indexGapsByChild
} from "./chunk-5LS57ZI3.js";
import {
  stringWidth
} from "./chunk-2MIN6GRR.js";
import {
  eastAsianWidth
} from "./chunk-QHTIBUWB.js";
import {
  formatDuration
} from "./chunk-3SH53ANB.js";
import {
  t
} from "./chunk-FAH5P34O.js";
import {
  getToolResponseDisplayText,
  stripTrailingUserPromptSubmitContextPart
} from "./chunk-VDNAD6JC.js";
import {
  stripAnsi
} from "./chunk-TWPJO254.js";
import {
  GoalPersistenceUnavailableError,
  parseGoalStateRecordPayloadV2
} from "./chunk-HFVW54NL.js";
import {
  ToolDisplayNames
} from "./chunk-CFDR3GNL.js";
import {
  init_esbuild_shims
} from "./chunk-5O2XNYP6.js";
import {
  __commonJS,
  __name,
  __toESM
} from "./chunk-J2S4EL5Y.js";

// node_modules/cli-spinners/spinners.json
var require_spinners = __commonJS({
  "node_modules/cli-spinners/spinners.json"(exports, module) {
    module.exports = {
      dots: {
        interval: 80,
        frames: [
          "\u280B",
          "\u2819",
          "\u2839",
          "\u2838",
          "\u283C",
          "\u2834",
          "\u2826",
          "\u2827",
          "\u2807",
          "\u280F"
        ]
      },
      dots2: {
        interval: 80,
        frames: [
          "\u28FE",
          "\u28FD",
          "\u28FB",
          "\u28BF",
          "\u287F",
          "\u28DF",
          "\u28EF",
          "\u28F7"
        ]
      },
      dots3: {
        interval: 80,
        frames: [
          "\u280B",
          "\u2819",
          "\u281A",
          "\u281E",
          "\u2816",
          "\u2826",
          "\u2834",
          "\u2832",
          "\u2833",
          "\u2813"
        ]
      },
      dots4: {
        interval: 80,
        frames: [
          "\u2804",
          "\u2806",
          "\u2807",
          "\u280B",
          "\u2819",
          "\u2838",
          "\u2830",
          "\u2820",
          "\u2830",
          "\u2838",
          "\u2819",
          "\u280B",
          "\u2807",
          "\u2806"
        ]
      },
      dots5: {
        interval: 80,
        frames: [
          "\u280B",
          "\u2819",
          "\u281A",
          "\u2812",
          "\u2802",
          "\u2802",
          "\u2812",
          "\u2832",
          "\u2834",
          "\u2826",
          "\u2816",
          "\u2812",
          "\u2810",
          "\u2810",
          "\u2812",
          "\u2813",
          "\u280B"
        ]
      },
      dots6: {
        interval: 80,
        frames: [
          "\u2801",
          "\u2809",
          "\u2819",
          "\u281A",
          "\u2812",
          "\u2802",
          "\u2802",
          "\u2812",
          "\u2832",
          "\u2834",
          "\u2824",
          "\u2804",
          "\u2804",
          "\u2824",
          "\u2834",
          "\u2832",
          "\u2812",
          "\u2802",
          "\u2802",
          "\u2812",
          "\u281A",
          "\u2819",
          "\u2809",
          "\u2801"
        ]
      },
      dots7: {
        interval: 80,
        frames: [
          "\u2808",
          "\u2809",
          "\u280B",
          "\u2813",
          "\u2812",
          "\u2810",
          "\u2810",
          "\u2812",
          "\u2816",
          "\u2826",
          "\u2824",
          "\u2820",
          "\u2820",
          "\u2824",
          "\u2826",
          "\u2816",
          "\u2812",
          "\u2810",
          "\u2810",
          "\u2812",
          "\u2813",
          "\u280B",
          "\u2809",
          "\u2808"
        ]
      },
      dots8: {
        interval: 80,
        frames: [
          "\u2801",
          "\u2801",
          "\u2809",
          "\u2819",
          "\u281A",
          "\u2812",
          "\u2802",
          "\u2802",
          "\u2812",
          "\u2832",
          "\u2834",
          "\u2824",
          "\u2804",
          "\u2804",
          "\u2824",
          "\u2820",
          "\u2820",
          "\u2824",
          "\u2826",
          "\u2816",
          "\u2812",
          "\u2810",
          "\u2810",
          "\u2812",
          "\u2813",
          "\u280B",
          "\u2809",
          "\u2808",
          "\u2808"
        ]
      },
      dots9: {
        interval: 80,
        frames: [
          "\u28B9",
          "\u28BA",
          "\u28BC",
          "\u28F8",
          "\u28C7",
          "\u2867",
          "\u2857",
          "\u284F"
        ]
      },
      dots10: {
        interval: 80,
        frames: [
          "\u2884",
          "\u2882",
          "\u2881",
          "\u2841",
          "\u2848",
          "\u2850",
          "\u2860"
        ]
      },
      dots11: {
        interval: 100,
        frames: [
          "\u2801",
          "\u2802",
          "\u2804",
          "\u2840",
          "\u2880",
          "\u2820",
          "\u2810",
          "\u2808"
        ]
      },
      dots12: {
        interval: 80,
        frames: [
          "\u2880\u2800",
          "\u2840\u2800",
          "\u2804\u2800",
          "\u2882\u2800",
          "\u2842\u2800",
          "\u2805\u2800",
          "\u2883\u2800",
          "\u2843\u2800",
          "\u280D\u2800",
          "\u288B\u2800",
          "\u284B\u2800",
          "\u280D\u2801",
          "\u288B\u2801",
          "\u284B\u2801",
          "\u280D\u2809",
          "\u280B\u2809",
          "\u280B\u2809",
          "\u2809\u2819",
          "\u2809\u2819",
          "\u2809\u2829",
          "\u2808\u2899",
          "\u2808\u2859",
          "\u2888\u2829",
          "\u2840\u2899",
          "\u2804\u2859",
          "\u2882\u2829",
          "\u2842\u2898",
          "\u2805\u2858",
          "\u2883\u2828",
          "\u2843\u2890",
          "\u280D\u2850",
          "\u288B\u2820",
          "\u284B\u2880",
          "\u280D\u2841",
          "\u288B\u2801",
          "\u284B\u2801",
          "\u280D\u2809",
          "\u280B\u2809",
          "\u280B\u2809",
          "\u2809\u2819",
          "\u2809\u2819",
          "\u2809\u2829",
          "\u2808\u2899",
          "\u2808\u2859",
          "\u2808\u2829",
          "\u2800\u2899",
          "\u2800\u2859",
          "\u2800\u2829",
          "\u2800\u2898",
          "\u2800\u2858",
          "\u2800\u2828",
          "\u2800\u2890",
          "\u2800\u2850",
          "\u2800\u2820",
          "\u2800\u2880",
          "\u2800\u2840"
        ]
      },
      dots13: {
        interval: 80,
        frames: [
          "\u28FC",
          "\u28F9",
          "\u28BB",
          "\u283F",
          "\u285F",
          "\u28CF",
          "\u28E7",
          "\u28F6"
        ]
      },
      dots8Bit: {
        interval: 80,
        frames: [
          "\u2800",
          "\u2801",
          "\u2802",
          "\u2803",
          "\u2804",
          "\u2805",
          "\u2806",
          "\u2807",
          "\u2840",
          "\u2841",
          "\u2842",
          "\u2843",
          "\u2844",
          "\u2845",
          "\u2846",
          "\u2847",
          "\u2808",
          "\u2809",
          "\u280A",
          "\u280B",
          "\u280C",
          "\u280D",
          "\u280E",
          "\u280F",
          "\u2848",
          "\u2849",
          "\u284A",
          "\u284B",
          "\u284C",
          "\u284D",
          "\u284E",
          "\u284F",
          "\u2810",
          "\u2811",
          "\u2812",
          "\u2813",
          "\u2814",
          "\u2815",
          "\u2816",
          "\u2817",
          "\u2850",
          "\u2851",
          "\u2852",
          "\u2853",
          "\u2854",
          "\u2855",
          "\u2856",
          "\u2857",
          "\u2818",
          "\u2819",
          "\u281A",
          "\u281B",
          "\u281C",
          "\u281D",
          "\u281E",
          "\u281F",
          "\u2858",
          "\u2859",
          "\u285A",
          "\u285B",
          "\u285C",
          "\u285D",
          "\u285E",
          "\u285F",
          "\u2820",
          "\u2821",
          "\u2822",
          "\u2823",
          "\u2824",
          "\u2825",
          "\u2826",
          "\u2827",
          "\u2860",
          "\u2861",
          "\u2862",
          "\u2863",
          "\u2864",
          "\u2865",
          "\u2866",
          "\u2867",
          "\u2828",
          "\u2829",
          "\u282A",
          "\u282B",
          "\u282C",
          "\u282D",
          "\u282E",
          "\u282F",
          "\u2868",
          "\u2869",
          "\u286A",
          "\u286B",
          "\u286C",
          "\u286D",
          "\u286E",
          "\u286F",
          "\u2830",
          "\u2831",
          "\u2832",
          "\u2833",
          "\u2834",
          "\u2835",
          "\u2836",
          "\u2837",
          "\u2870",
          "\u2871",
          "\u2872",
          "\u2873",
          "\u2874",
          "\u2875",
          "\u2876",
          "\u2877",
          "\u2838",
          "\u2839",
          "\u283A",
          "\u283B",
          "\u283C",
          "\u283D",
          "\u283E",
          "\u283F",
          "\u2878",
          "\u2879",
          "\u287A",
          "\u287B",
          "\u287C",
          "\u287D",
          "\u287E",
          "\u287F",
          "\u2880",
          "\u2881",
          "\u2882",
          "\u2883",
          "\u2884",
          "\u2885",
          "\u2886",
          "\u2887",
          "\u28C0",
          "\u28C1",
          "\u28C2",
          "\u28C3",
          "\u28C4",
          "\u28C5",
          "\u28C6",
          "\u28C7",
          "\u2888",
          "\u2889",
          "\u288A",
          "\u288B",
          "\u288C",
          "\u288D",
          "\u288E",
          "\u288F",
          "\u28C8",
          "\u28C9",
          "\u28CA",
          "\u28CB",
          "\u28CC",
          "\u28CD",
          "\u28CE",
          "\u28CF",
          "\u2890",
          "\u2891",
          "\u2892",
          "\u2893",
          "\u2894",
          "\u2895",
          "\u2896",
          "\u2897",
          "\u28D0",
          "\u28D1",
          "\u28D2",
          "\u28D3",
          "\u28D4",
          "\u28D5",
          "\u28D6",
          "\u28D7",
          "\u2898",
          "\u2899",
          "\u289A",
          "\u289B",
          "\u289C",
          "\u289D",
          "\u289E",
          "\u289F",
          "\u28D8",
          "\u28D9",
          "\u28DA",
          "\u28DB",
          "\u28DC",
          "\u28DD",
          "\u28DE",
          "\u28DF",
          "\u28A0",
          "\u28A1",
          "\u28A2",
          "\u28A3",
          "\u28A4",
          "\u28A5",
          "\u28A6",
          "\u28A7",
          "\u28E0",
          "\u28E1",
          "\u28E2",
          "\u28E3",
          "\u28E4",
          "\u28E5",
          "\u28E6",
          "\u28E7",
          "\u28A8",
          "\u28A9",
          "\u28AA",
          "\u28AB",
          "\u28AC",
          "\u28AD",
          "\u28AE",
          "\u28AF",
          "\u28E8",
          "\u28E9",
          "\u28EA",
          "\u28EB",
          "\u28EC",
          "\u28ED",
          "\u28EE",
          "\u28EF",
          "\u28B0",
          "\u28B1",
          "\u28B2",
          "\u28B3",
          "\u28B4",
          "\u28B5",
          "\u28B6",
          "\u28B7",
          "\u28F0",
          "\u28F1",
          "\u28F2",
          "\u28F3",
          "\u28F4",
          "\u28F5",
          "\u28F6",
          "\u28F7",
          "\u28B8",
          "\u28B9",
          "\u28BA",
          "\u28BB",
          "\u28BC",
          "\u28BD",
          "\u28BE",
          "\u28BF",
          "\u28F8",
          "\u28F9",
          "\u28FA",
          "\u28FB",
          "\u28FC",
          "\u28FD",
          "\u28FE",
          "\u28FF"
        ]
      },
      sand: {
        interval: 80,
        frames: [
          "\u2801",
          "\u2802",
          "\u2804",
          "\u2840",
          "\u2848",
          "\u2850",
          "\u2860",
          "\u28C0",
          "\u28C1",
          "\u28C2",
          "\u28C4",
          "\u28CC",
          "\u28D4",
          "\u28E4",
          "\u28E5",
          "\u28E6",
          "\u28EE",
          "\u28F6",
          "\u28F7",
          "\u28FF",
          "\u287F",
          "\u283F",
          "\u289F",
          "\u281F",
          "\u285B",
          "\u281B",
          "\u282B",
          "\u288B",
          "\u280B",
          "\u280D",
          "\u2849",
          "\u2809",
          "\u2811",
          "\u2821",
          "\u2881"
        ]
      },
      line: {
        interval: 130,
        frames: [
          "-",
          "\\",
          "|",
          "/"
        ]
      },
      line2: {
        interval: 100,
        frames: [
          "\u2802",
          "-",
          "\u2013",
          "\u2014",
          "\u2013",
          "-"
        ]
      },
      pipe: {
        interval: 100,
        frames: [
          "\u2524",
          "\u2518",
          "\u2534",
          "\u2514",
          "\u251C",
          "\u250C",
          "\u252C",
          "\u2510"
        ]
      },
      simpleDots: {
        interval: 400,
        frames: [
          ".  ",
          ".. ",
          "...",
          "   "
        ]
      },
      simpleDotsScrolling: {
        interval: 200,
        frames: [
          ".  ",
          ".. ",
          "...",
          " ..",
          "  .",
          "   "
        ]
      },
      star: {
        interval: 70,
        frames: [
          "\u2736",
          "\u2738",
          "\u2739",
          "\u273A",
          "\u2739",
          "\u2737"
        ]
      },
      star2: {
        interval: 80,
        frames: [
          "+",
          "x",
          "*"
        ]
      },
      flip: {
        interval: 70,
        frames: [
          "_",
          "_",
          "_",
          "-",
          "`",
          "`",
          "'",
          "\xB4",
          "-",
          "_",
          "_",
          "_"
        ]
      },
      hamburger: {
        interval: 100,
        frames: [
          "\u2631",
          "\u2632",
          "\u2634"
        ]
      },
      growVertical: {
        interval: 120,
        frames: [
          "\u2581",
          "\u2583",
          "\u2584",
          "\u2585",
          "\u2586",
          "\u2587",
          "\u2586",
          "\u2585",
          "\u2584",
          "\u2583"
        ]
      },
      growHorizontal: {
        interval: 120,
        frames: [
          "\u258F",
          "\u258E",
          "\u258D",
          "\u258C",
          "\u258B",
          "\u258A",
          "\u2589",
          "\u258A",
          "\u258B",
          "\u258C",
          "\u258D",
          "\u258E"
        ]
      },
      balloon: {
        interval: 140,
        frames: [
          " ",
          ".",
          "o",
          "O",
          "@",
          "*",
          " "
        ]
      },
      balloon2: {
        interval: 120,
        frames: [
          ".",
          "o",
          "O",
          "\xB0",
          "O",
          "o",
          "."
        ]
      },
      noise: {
        interval: 100,
        frames: [
          "\u2593",
          "\u2592",
          "\u2591"
        ]
      },
      bounce: {
        interval: 120,
        frames: [
          "\u2801",
          "\u2802",
          "\u2804",
          "\u2802"
        ]
      },
      boxBounce: {
        interval: 120,
        frames: [
          "\u2596",
          "\u2598",
          "\u259D",
          "\u2597"
        ]
      },
      boxBounce2: {
        interval: 100,
        frames: [
          "\u258C",
          "\u2580",
          "\u2590",
          "\u2584"
        ]
      },
      triangle: {
        interval: 50,
        frames: [
          "\u25E2",
          "\u25E3",
          "\u25E4",
          "\u25E5"
        ]
      },
      binary: {
        interval: 80,
        frames: [
          "010010",
          "001100",
          "100101",
          "111010",
          "111101",
          "010111",
          "101011",
          "111000",
          "110011",
          "110101"
        ]
      },
      arc: {
        interval: 100,
        frames: [
          "\u25DC",
          "\u25E0",
          "\u25DD",
          "\u25DE",
          "\u25E1",
          "\u25DF"
        ]
      },
      circle: {
        interval: 120,
        frames: [
          "\u25E1",
          "\u2299",
          "\u25E0"
        ]
      },
      squareCorners: {
        interval: 180,
        frames: [
          "\u25F0",
          "\u25F3",
          "\u25F2",
          "\u25F1"
        ]
      },
      circleQuarters: {
        interval: 120,
        frames: [
          "\u25F4",
          "\u25F7",
          "\u25F6",
          "\u25F5"
        ]
      },
      circleHalves: {
        interval: 50,
        frames: [
          "\u25D0",
          "\u25D3",
          "\u25D1",
          "\u25D2"
        ]
      },
      squish: {
        interval: 100,
        frames: [
          "\u256B",
          "\u256A"
        ]
      },
      toggle: {
        interval: 250,
        frames: [
          "\u22B6",
          "\u22B7"
        ]
      },
      toggle2: {
        interval: 80,
        frames: [
          "\u25AB",
          "\u25AA"
        ]
      },
      toggle3: {
        interval: 120,
        frames: [
          "\u25A1",
          "\u25A0"
        ]
      },
      toggle4: {
        interval: 100,
        frames: [
          "\u25A0",
          "\u25A1",
          "\u25AA",
          "\u25AB"
        ]
      },
      toggle5: {
        interval: 100,
        frames: [
          "\u25AE",
          "\u25AF"
        ]
      },
      toggle6: {
        interval: 300,
        frames: [
          "\u101D",
          "\u1040"
        ]
      },
      toggle7: {
        interval: 80,
        frames: [
          "\u29BE",
          "\u29BF"
        ]
      },
      toggle8: {
        interval: 100,
        frames: [
          "\u25CD",
          "\u25CC"
        ]
      },
      toggle9: {
        interval: 100,
        frames: [
          "\u25C9",
          "\u25CE"
        ]
      },
      toggle10: {
        interval: 100,
        frames: [
          "\u3282",
          "\u3280",
          "\u3281"
        ]
      },
      toggle11: {
        interval: 50,
        frames: [
          "\u29C7",
          "\u29C6"
        ]
      },
      toggle12: {
        interval: 120,
        frames: [
          "\u2617",
          "\u2616"
        ]
      },
      toggle13: {
        interval: 80,
        frames: [
          "=",
          "*",
          "-"
        ]
      },
      arrow: {
        interval: 100,
        frames: [
          "\u2190",
          "\u2196",
          "\u2191",
          "\u2197",
          "\u2192",
          "\u2198",
          "\u2193",
          "\u2199"
        ]
      },
      arrow2: {
        interval: 80,
        frames: [
          "\u2B06\uFE0F ",
          "\u2197\uFE0F ",
          "\u27A1\uFE0F ",
          "\u2198\uFE0F ",
          "\u2B07\uFE0F ",
          "\u2199\uFE0F ",
          "\u2B05\uFE0F ",
          "\u2196\uFE0F "
        ]
      },
      arrow3: {
        interval: 120,
        frames: [
          "\u25B9\u25B9\u25B9\u25B9\u25B9",
          "\u25B8\u25B9\u25B9\u25B9\u25B9",
          "\u25B9\u25B8\u25B9\u25B9\u25B9",
          "\u25B9\u25B9\u25B8\u25B9\u25B9",
          "\u25B9\u25B9\u25B9\u25B8\u25B9",
          "\u25B9\u25B9\u25B9\u25B9\u25B8"
        ]
      },
      bouncingBar: {
        interval: 80,
        frames: [
          "[    ]",
          "[=   ]",
          "[==  ]",
          "[=== ]",
          "[====]",
          "[ ===]",
          "[  ==]",
          "[   =]",
          "[    ]",
          "[   =]",
          "[  ==]",
          "[ ===]",
          "[====]",
          "[=== ]",
          "[==  ]",
          "[=   ]"
        ]
      },
      bouncingBall: {
        interval: 80,
        frames: [
          "( \u25CF    )",
          "(  \u25CF   )",
          "(   \u25CF  )",
          "(    \u25CF )",
          "(     \u25CF)",
          "(    \u25CF )",
          "(   \u25CF  )",
          "(  \u25CF   )",
          "( \u25CF    )",
          "(\u25CF     )"
        ]
      },
      smiley: {
        interval: 200,
        frames: [
          "\u{1F604} ",
          "\u{1F61D} "
        ]
      },
      monkey: {
        interval: 300,
        frames: [
          "\u{1F648} ",
          "\u{1F648} ",
          "\u{1F649} ",
          "\u{1F64A} "
        ]
      },
      hearts: {
        interval: 100,
        frames: [
          "\u{1F49B} ",
          "\u{1F499} ",
          "\u{1F49C} ",
          "\u{1F49A} ",
          "\u2764\uFE0F "
        ]
      },
      clock: {
        interval: 100,
        frames: [
          "\u{1F55B} ",
          "\u{1F550} ",
          "\u{1F551} ",
          "\u{1F552} ",
          "\u{1F553} ",
          "\u{1F554} ",
          "\u{1F555} ",
          "\u{1F556} ",
          "\u{1F557} ",
          "\u{1F558} ",
          "\u{1F559} ",
          "\u{1F55A} "
        ]
      },
      earth: {
        interval: 180,
        frames: [
          "\u{1F30D} ",
          "\u{1F30E} ",
          "\u{1F30F} "
        ]
      },
      material: {
        interval: 17,
        frames: [
          "\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581",
          "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581",
          "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581",
          "\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581",
          "\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588",
          "\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588",
          "\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588",
          "\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588",
          "\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588",
          "\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588",
          "\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588",
          "\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581",
          "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581",
          "\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
          "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"
        ]
      },
      moon: {
        interval: 80,
        frames: [
          "\u{1F311} ",
          "\u{1F312} ",
          "\u{1F313} ",
          "\u{1F314} ",
          "\u{1F315} ",
          "\u{1F316} ",
          "\u{1F317} ",
          "\u{1F318} "
        ]
      },
      runner: {
        interval: 140,
        frames: [
          "\u{1F6B6} ",
          "\u{1F3C3} "
        ]
      },
      pong: {
        interval: 80,
        frames: [
          "\u2590\u2802       \u258C",
          "\u2590\u2808       \u258C",
          "\u2590 \u2802      \u258C",
          "\u2590 \u2820      \u258C",
          "\u2590  \u2840     \u258C",
          "\u2590  \u2820     \u258C",
          "\u2590   \u2802    \u258C",
          "\u2590   \u2808    \u258C",
          "\u2590    \u2802   \u258C",
          "\u2590    \u2820   \u258C",
          "\u2590     \u2840  \u258C",
          "\u2590     \u2820  \u258C",
          "\u2590      \u2802 \u258C",
          "\u2590      \u2808 \u258C",
          "\u2590       \u2802\u258C",
          "\u2590       \u2820\u258C",
          "\u2590       \u2840\u258C",
          "\u2590      \u2820 \u258C",
          "\u2590      \u2802 \u258C",
          "\u2590     \u2808  \u258C",
          "\u2590     \u2802  \u258C",
          "\u2590    \u2820   \u258C",
          "\u2590    \u2840   \u258C",
          "\u2590   \u2820    \u258C",
          "\u2590   \u2802    \u258C",
          "\u2590  \u2808     \u258C",
          "\u2590  \u2802     \u258C",
          "\u2590 \u2820      \u258C",
          "\u2590 \u2840      \u258C",
          "\u2590\u2820       \u258C"
        ]
      },
      shark: {
        interval: 120,
        frames: [
          "\u2590|\\____________\u258C",
          "\u2590_|\\___________\u258C",
          "\u2590__|\\__________\u258C",
          "\u2590___|\\_________\u258C",
          "\u2590____|\\________\u258C",
          "\u2590_____|\\_______\u258C",
          "\u2590______|\\______\u258C",
          "\u2590_______|\\_____\u258C",
          "\u2590________|\\____\u258C",
          "\u2590_________|\\___\u258C",
          "\u2590__________|\\__\u258C",
          "\u2590___________|\\_\u258C",
          "\u2590____________|\\\u258C",
          "\u2590____________/|\u258C",
          "\u2590___________/|_\u258C",
          "\u2590__________/|__\u258C",
          "\u2590_________/|___\u258C",
          "\u2590________/|____\u258C",
          "\u2590_______/|_____\u258C",
          "\u2590______/|______\u258C",
          "\u2590_____/|_______\u258C",
          "\u2590____/|________\u258C",
          "\u2590___/|_________\u258C",
          "\u2590__/|__________\u258C",
          "\u2590_/|___________\u258C",
          "\u2590/|____________\u258C"
        ]
      },
      dqpb: {
        interval: 100,
        frames: [
          "d",
          "q",
          "p",
          "b"
        ]
      },
      weather: {
        interval: 100,
        frames: [
          "\u2600\uFE0F ",
          "\u2600\uFE0F ",
          "\u2600\uFE0F ",
          "\u{1F324} ",
          "\u26C5\uFE0F ",
          "\u{1F325} ",
          "\u2601\uFE0F ",
          "\u{1F327} ",
          "\u{1F328} ",
          "\u{1F327} ",
          "\u{1F328} ",
          "\u{1F327} ",
          "\u{1F328} ",
          "\u26C8 ",
          "\u{1F328} ",
          "\u{1F327} ",
          "\u{1F328} ",
          "\u2601\uFE0F ",
          "\u{1F325} ",
          "\u26C5\uFE0F ",
          "\u{1F324} ",
          "\u2600\uFE0F ",
          "\u2600\uFE0F "
        ]
      },
      christmas: {
        interval: 400,
        frames: [
          "\u{1F332}",
          "\u{1F384}"
        ]
      },
      grenade: {
        interval: 80,
        frames: [
          "\u060C  ",
          "\u2032  ",
          " \xB4 ",
          " \u203E ",
          "  \u2E0C",
          "  \u2E0A",
          "  |",
          "  \u204E",
          "  \u2055",
          " \u0DF4 ",
          "  \u2053",
          "   ",
          "   ",
          "   "
        ]
      },
      point: {
        interval: 125,
        frames: [
          "\u2219\u2219\u2219",
          "\u25CF\u2219\u2219",
          "\u2219\u25CF\u2219",
          "\u2219\u2219\u25CF",
          "\u2219\u2219\u2219"
        ]
      },
      layer: {
        interval: 150,
        frames: [
          "-",
          "=",
          "\u2261"
        ]
      },
      betaWave: {
        interval: 80,
        frames: [
          "\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2",
          "\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2",
          "\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2",
          "\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2",
          "\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2",
          "\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2",
          "\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"
        ]
      },
      fingerDance: {
        interval: 160,
        frames: [
          "\u{1F918} ",
          "\u{1F91F} ",
          "\u{1F596} ",
          "\u270B ",
          "\u{1F91A} ",
          "\u{1F446} "
        ]
      },
      fistBump: {
        interval: 80,
        frames: [
          "\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ",
          "\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ",
          "\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ",
          "\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ",
          "\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ",
          "\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ",
          "\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "
        ]
      },
      soccerHeader: {
        interval: 80,
        frames: [
          " \u{1F9D1}\u26BD\uFE0F       \u{1F9D1} ",
          "\u{1F9D1}  \u26BD\uFE0F      \u{1F9D1} ",
          "\u{1F9D1}   \u26BD\uFE0F     \u{1F9D1} ",
          "\u{1F9D1}    \u26BD\uFE0F    \u{1F9D1} ",
          "\u{1F9D1}     \u26BD\uFE0F   \u{1F9D1} ",
          "\u{1F9D1}      \u26BD\uFE0F  \u{1F9D1} ",
          "\u{1F9D1}       \u26BD\uFE0F\u{1F9D1}  ",
          "\u{1F9D1}      \u26BD\uFE0F  \u{1F9D1} ",
          "\u{1F9D1}     \u26BD\uFE0F   \u{1F9D1} ",
          "\u{1F9D1}    \u26BD\uFE0F    \u{1F9D1} ",
          "\u{1F9D1}   \u26BD\uFE0F     \u{1F9D1} ",
          "\u{1F9D1}  \u26BD\uFE0F      \u{1F9D1} "
        ]
      },
      mindblown: {
        interval: 160,
        frames: [
          "\u{1F610} ",
          "\u{1F610} ",
          "\u{1F62E} ",
          "\u{1F62E} ",
          "\u{1F626} ",
          "\u{1F626} ",
          "\u{1F627} ",
          "\u{1F627} ",
          "\u{1F92F} ",
          "\u{1F4A5} ",
          "\u2728 ",
          "\u3000 ",
          "\u3000 ",
          "\u3000 "
        ]
      },
      speaker: {
        interval: 160,
        frames: [
          "\u{1F508} ",
          "\u{1F509} ",
          "\u{1F50A} ",
          "\u{1F509} "
        ]
      },
      orangePulse: {
        interval: 100,
        frames: [
          "\u{1F538} ",
          "\u{1F536} ",
          "\u{1F7E0} ",
          "\u{1F7E0} ",
          "\u{1F536} "
        ]
      },
      bluePulse: {
        interval: 100,
        frames: [
          "\u{1F539} ",
          "\u{1F537} ",
          "\u{1F535} ",
          "\u{1F535} ",
          "\u{1F537} "
        ]
      },
      orangeBluePulse: {
        interval: 100,
        frames: [
          "\u{1F538} ",
          "\u{1F536} ",
          "\u{1F7E0} ",
          "\u{1F7E0} ",
          "\u{1F536} ",
          "\u{1F539} ",
          "\u{1F537} ",
          "\u{1F535} ",
          "\u{1F535} ",
          "\u{1F537} "
        ]
      },
      timeTravel: {
        interval: 100,
        frames: [
          "\u{1F55B} ",
          "\u{1F55A} ",
          "\u{1F559} ",
          "\u{1F558} ",
          "\u{1F557} ",
          "\u{1F556} ",
          "\u{1F555} ",
          "\u{1F554} ",
          "\u{1F553} ",
          "\u{1F552} ",
          "\u{1F551} ",
          "\u{1F550} "
        ]
      },
      aesthetic: {
        interval: 80,
        frames: [
          "\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1",
          "\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1",
          "\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1",
          "\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1",
          "\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1",
          "\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1",
          "\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0",
          "\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"
        ]
      },
      dwarfFortress: {
        interval: 80,
        frames: [
          " \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "  \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "  \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "  \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "  \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "  \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "  \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "  \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "  \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "  \u263A \u2588\u2588\u2588\xA3\xA3\xA3  ",
          "   \u263A\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "   \u263A\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "   \u263A\u2593\u2588\u2588\xA3\xA3\xA3  ",
          "   \u263A\u2593\u2588\u2588\xA3\xA3\xA3  ",
          "   \u263A\u2592\u2588\u2588\xA3\xA3\xA3  ",
          "   \u263A\u2592\u2588\u2588\xA3\xA3\xA3  ",
          "   \u263A\u2591\u2588\u2588\xA3\xA3\xA3  ",
          "   \u263A\u2591\u2588\u2588\xA3\xA3\xA3  ",
          "   \u263A \u2588\u2588\xA3\xA3\xA3  ",
          "    \u263A\u2588\u2588\xA3\xA3\xA3  ",
          "    \u263A\u2588\u2588\xA3\xA3\xA3  ",
          "    \u263A\u2593\u2588\xA3\xA3\xA3  ",
          "    \u263A\u2593\u2588\xA3\xA3\xA3  ",
          "    \u263A\u2592\u2588\xA3\xA3\xA3  ",
          "    \u263A\u2592\u2588\xA3\xA3\xA3  ",
          "    \u263A\u2591\u2588\xA3\xA3\xA3  ",
          "    \u263A\u2591\u2588\xA3\xA3\xA3  ",
          "    \u263A \u2588\xA3\xA3\xA3  ",
          "     \u263A\u2588\xA3\xA3\xA3  ",
          "     \u263A\u2588\xA3\xA3\xA3  ",
          "     \u263A\u2593\xA3\xA3\xA3  ",
          "     \u263A\u2593\xA3\xA3\xA3  ",
          "     \u263A\u2592\xA3\xA3\xA3  ",
          "     \u263A\u2592\xA3\xA3\xA3  ",
          "     \u263A\u2591\xA3\xA3\xA3  ",
          "     \u263A\u2591\xA3\xA3\xA3  ",
          "     \u263A \xA3\xA3\xA3  ",
          "      \u263A\xA3\xA3\xA3  ",
          "      \u263A\xA3\xA3\xA3  ",
          "      \u263A\u2593\xA3\xA3  ",
          "      \u263A\u2593\xA3\xA3  ",
          "      \u263A\u2592\xA3\xA3  ",
          "      \u263A\u2592\xA3\xA3  ",
          "      \u263A\u2591\xA3\xA3  ",
          "      \u263A\u2591\xA3\xA3  ",
          "      \u263A \xA3\xA3  ",
          "       \u263A\xA3\xA3  ",
          "       \u263A\xA3\xA3  ",
          "       \u263A\u2593\xA3  ",
          "       \u263A\u2593\xA3  ",
          "       \u263A\u2592\xA3  ",
          "       \u263A\u2592\xA3  ",
          "       \u263A\u2591\xA3  ",
          "       \u263A\u2591\xA3  ",
          "       \u263A \xA3  ",
          "        \u263A\xA3  ",
          "        \u263A\xA3  ",
          "        \u263A\u2593  ",
          "        \u263A\u2593  ",
          "        \u263A\u2592  ",
          "        \u263A\u2592  ",
          "        \u263A\u2591  ",
          "        \u263A\u2591  ",
          "        \u263A   ",
          "        \u263A  &",
          "        \u263A \u263C&",
          "       \u263A \u263C &",
          "       \u263A\u263C  &",
          "      \u263A\u263C  & ",
          "      \u203C   & ",
          "     \u263A   &  ",
          "    \u203C    &  ",
          "   \u263A    &   ",
          "  \u203C     &   ",
          " \u263A     &    ",
          "\u203C      &    ",
          "      &     ",
          "      &     ",
          "     &   \u2591  ",
          "     &   \u2592  ",
          "    &    \u2593  ",
          "    &    \xA3  ",
          "   &    \u2591\xA3  ",
          "   &    \u2592\xA3  ",
          "  &     \u2593\xA3  ",
          "  &     \xA3\xA3  ",
          " &     \u2591\xA3\xA3  ",
          " &     \u2592\xA3\xA3  ",
          "&      \u2593\xA3\xA3  ",
          "&      \xA3\xA3\xA3  ",
          "      \u2591\xA3\xA3\xA3  ",
          "      \u2592\xA3\xA3\xA3  ",
          "      \u2593\xA3\xA3\xA3  ",
          "      \u2588\xA3\xA3\xA3  ",
          "     \u2591\u2588\xA3\xA3\xA3  ",
          "     \u2592\u2588\xA3\xA3\xA3  ",
          "     \u2593\u2588\xA3\xA3\xA3  ",
          "     \u2588\u2588\xA3\xA3\xA3  ",
          "    \u2591\u2588\u2588\xA3\xA3\xA3  ",
          "    \u2592\u2588\u2588\xA3\xA3\xA3  ",
          "    \u2593\u2588\u2588\xA3\xA3\xA3  ",
          "    \u2588\u2588\u2588\xA3\xA3\xA3  ",
          "   \u2591\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "   \u2592\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "   \u2593\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "   \u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "  \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "  \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "  \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          "  \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  ",
          " \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3  "
        ]
      }
    };
  }
});

// node_modules/cli-spinners/index.js
var require_cli_spinners = __commonJS({
  "node_modules/cli-spinners/index.js"(exports, module) {
    "use strict";
    init_esbuild_shims();
    var spinners2 = Object.assign({}, require_spinners());
    var spinnersList = Object.keys(spinners2);
    Object.defineProperty(spinners2, "random", {
      get() {
        const randomIndex = Math.floor(Math.random() * spinnersList.length);
        const spinnerName = spinnersList[randomIndex];
        return spinners2[spinnerName];
      }
    });
    module.exports = spinners2;
  }
});

// packages/cli/src/ui/utils/resumeHistoryUtils.ts
init_esbuild_shims();
import * as path from "node:path";

// packages/cli/src/ui/components/messages/CompactToolGroupDisplay.tsx
init_esbuild_shims();

// packages/cli/node_modules/wrap-ansi/index.js
init_esbuild_shims();

// packages/cli/node_modules/wrap-ansi/node_modules/string-width/index.js
init_esbuild_shims();
var segmenter = new Intl.Segmenter();
var zeroWidthClusterRegex = new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Mark}|\\p{Surrogate})+$", "v");
var leadingNonPrintingRegex = new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+", "v");
var rgiEmojiRegex = new RegExp("^\\p{RGI_Emoji}$", "v");
var unqualifiedKeycapRegex = /^[\d#*]\u20E3$/;
var extendedPictographicRegex = new RegExp("\\p{Extended_Pictographic}", "gu");
function isDoubleWidthNonRgiEmojiSequence(segment) {
  if (segment.length > 50) {
    return false;
  }
  if (unqualifiedKeycapRegex.test(segment)) {
    return true;
  }
  if (segment.includes("\u200D")) {
    const pictographics = segment.match(extendedPictographicRegex);
    return pictographics !== null && pictographics.length >= 2;
  }
  return false;
}
__name(isDoubleWidthNonRgiEmojiSequence, "isDoubleWidthNonRgiEmojiSequence");
function baseVisible(segment) {
  return segment.replace(leadingNonPrintingRegex, "");
}
__name(baseVisible, "baseVisible");
function isZeroWidthCluster(segment) {
  return zeroWidthClusterRegex.test(segment);
}
__name(isZeroWidthCluster, "isZeroWidthCluster");
function isHangulLeadingJamo(codePoint) {
  return codePoint >= 4352 && codePoint <= 4447 || codePoint >= 43360 && codePoint <= 43388;
}
__name(isHangulLeadingJamo, "isHangulLeadingJamo");
function isHangulVowelJamo(codePoint) {
  return codePoint >= 4448 && codePoint <= 4519 || codePoint >= 55216 && codePoint <= 55238;
}
__name(isHangulVowelJamo, "isHangulVowelJamo");
function isHangulTrailingJamo(codePoint) {
  return codePoint >= 4520 && codePoint <= 4607 || codePoint >= 55243 && codePoint <= 55291;
}
__name(isHangulTrailingJamo, "isHangulTrailingJamo");
function isHangulJamo(codePoint) {
  return isHangulLeadingJamo(codePoint) || isHangulVowelJamo(codePoint) || isHangulTrailingJamo(codePoint);
}
__name(isHangulJamo, "isHangulJamo");
function hangulClusterWidth(visibleSegment, eastAsianWidthOptions) {
  const codePoints = [];
  for (const character of visibleSegment) {
    if (zeroWidthClusterRegex.test(character)) {
      continue;
    }
    codePoints.push(character.codePointAt(0));
  }
  if (codePoints.length === 0) {
    return void 0;
  }
  let width = 0;
  for (let index = 0; index < codePoints.length; index++) {
    const codePoint = codePoints[index];
    if (!isHangulJamo(codePoint)) {
      if (width === 0) {
        return void 0;
      }
      for (let remaining = index; remaining < codePoints.length; remaining++) {
        width += eastAsianWidth(codePoints[remaining], eastAsianWidthOptions);
      }
      return width;
    }
    if (isHangulLeadingJamo(codePoint) && isHangulVowelJamo(codePoints[index + 1])) {
      width += 2;
      index += isHangulTrailingJamo(codePoints[index + 2]) ? 2 : 1;
      continue;
    }
    width += eastAsianWidth(codePoint, eastAsianWidthOptions);
  }
  return width;
}
__name(hangulClusterWidth, "hangulClusterWidth");
function trailingHalfwidthWidth(visibleSegment, eastAsianWidthOptions) {
  let extra = 0;
  let first = true;
  for (const character of visibleSegment) {
    if (first) {
      first = false;
      continue;
    }
    if (character >= "\uFF00" && character <= "\uFFEF") {
      extra += eastAsianWidth(character.codePointAt(0), eastAsianWidthOptions);
    }
  }
  return extra;
}
__name(trailingHalfwidthWidth, "trailingHalfwidthWidth");
function stringWidth2(input, options = {}) {
  if (typeof input !== "string" || input.length === 0) {
    return 0;
  }
  const {
    ambiguousIsNarrow = true,
    countAnsiEscapeCodes = false
  } = options;
  let string = input;
  if (!countAnsiEscapeCodes && (string.includes("\x1B") || string.includes("\x9B"))) {
    string = stripAnsi(string);
  }
  if (string.length === 0) {
    return 0;
  }
  if (/^[\u0020-\u007E]*$/.test(string)) {
    return string.length;
  }
  let width = 0;
  const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
  for (const { segment } of segmenter.segment(string)) {
    if (isZeroWidthCluster(segment)) {
      continue;
    }
    if (rgiEmojiRegex.test(segment) || isDoubleWidthNonRgiEmojiSequence(segment)) {
      width += 2;
      continue;
    }
    const visibleSegment = baseVisible(segment);
    const hangulWidth = hangulClusterWidth(visibleSegment, eastAsianWidthOptions);
    if (hangulWidth !== void 0) {
      width += hangulWidth;
      continue;
    }
    const codePoint = visibleSegment.codePointAt(0);
    width += eastAsianWidth(codePoint, eastAsianWidthOptions);
    width += trailingHalfwidthWidth(visibleSegment, eastAsianWidthOptions);
  }
  return width;
}
__name(stringWidth2, "stringWidth");

// packages/cli/node_modules/ansi-styles/index.js
init_esbuild_shims();
var ANSI_BACKGROUND_OFFSET = 10;
var wrapAnsi16 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${code + offset}m`, "wrapAnsi16");
var wrapAnsi256 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`, "wrapAnsi256");
var wrapAnsi16m = /* @__PURE__ */ __name((offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`, "wrapAnsi16m");
var styles = {
  modifier: {
    reset: [0, 0],
    // 21 isn't widely supported and 22 does the same thing
    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],
    // Bright color
    blackBright: [90, 39],
    gray: [90, 39],
    // Alias of `blackBright`
    grey: [90, 39],
    // Alias of `blackBright`
    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],
    // Bright color
    bgBlackBright: [100, 49],
    bgGray: [100, 49],
    // Alias of `bgBlackBright`
    bgGrey: [100, 49],
    // Alias of `bgBlackBright`
    bgRedBright: [101, 49],
    bgGreenBright: [102, 49],
    bgYellowBright: [103, 49],
    bgBlueBright: [104, 49],
    bgMagentaBright: [105, 49],
    bgCyanBright: [106, 49],
    bgWhiteBright: [107, 49]
  }
};
var modifierNames = Object.keys(styles.modifier);
var foregroundColorNames = Object.keys(styles.color);
var backgroundColorNames = Object.keys(styles.bgColor);
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
function assembleStyles() {
  const codes = /* @__PURE__ */ new Map();
  for (const [groupName, group] of Object.entries(styles)) {
    for (const [styleName, style] of Object.entries(group)) {
      styles[styleName] = {
        open: `\x1B[${style[0]}m`,
        close: `\x1B[${style[1]}m`
      };
      group[styleName] = styles[styleName];
      codes.set(style[0], style[1]);
    }
    Object.defineProperty(styles, groupName, {
      value: group,
      enumerable: false
    });
  }
  Object.defineProperty(styles, "codes", {
    value: codes,
    enumerable: false
  });
  styles.color.close = "\x1B[39m";
  styles.bgColor.close = "\x1B[49m";
  styles.color.ansi = wrapAnsi16();
  styles.color.ansi256 = wrapAnsi256();
  styles.color.ansi16m = wrapAnsi16m();
  styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
  styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
  styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
  Object.defineProperties(styles, {
    rgbToAnsi256: {
      value(red, green, blue) {
        if (red === green && green === blue) {
          if (red < 8) {
            return 16;
          }
          if (red > 248) {
            return 231;
          }
          return Math.round((red - 8) / 247 * 24) + 232;
        }
        return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
      },
      enumerable: false
    },
    hexToRgb: {
      value(hex) {
        const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
        if (!matches) {
          return [0, 0, 0];
        }
        let [colorString] = matches;
        if (colorString.length === 3) {
          colorString = [...colorString].map((character) => character + character).join("");
        }
        const integer = Number.parseInt(colorString, 16);
        return [
          /* eslint-disable no-bitwise */
          integer >> 16 & 255,
          integer >> 8 & 255,
          integer & 255
          /* eslint-enable no-bitwise */
        ];
      },
      enumerable: false
    },
    hexToAnsi256: {
      value: /* @__PURE__ */ __name((hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), "value"),
      enumerable: false
    },
    ansi256ToAnsi: {
      value(code) {
        if (code < 8) {
          return 30 + code;
        }
        if (code < 16) {
          return 90 + (code - 8);
        }
        let red;
        let green;
        let blue;
        if (code >= 232) {
          red = ((code - 232) * 10 + 8) / 255;
          green = red;
          blue = red;
        } else {
          code -= 16;
          const remainder = code % 36;
          red = Math.floor(code / 36) / 5;
          green = Math.floor(remainder / 6) / 5;
          blue = remainder % 6 / 5;
        }
        const value = Math.max(red, green, blue) * 2;
        if (value === 0) {
          return 30;
        }
        let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
        if (value === 2) {
          result += 60;
        }
        return result;
      },
      enumerable: false
    },
    rgbToAnsi: {
      value: /* @__PURE__ */ __name((red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), "value"),
      enumerable: false
    },
    hexToAnsi: {
      value: /* @__PURE__ */ __name((hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), "value"),
      enumerable: false
    }
  });
  return styles;
}
__name(assembleStyles, "assembleStyles");
var ansiStyles = assembleStyles();
var ansi_styles_default = ansiStyles;

// packages/cli/node_modules/wrap-ansi/index.js
var ANSI_ESCAPE = "\x1B";
var ANSI_ESCAPE_CSI = "\x9B";
var ESCAPES = /* @__PURE__ */ new Set([
  ANSI_ESCAPE,
  ANSI_ESCAPE_CSI
]);
var ANSI_ESCAPE_BELL = "\x07";
var ANSI_CSI = "[";
var ANSI_OSC = "]";
var ANSI_SGR_TERMINATOR = "m";
var ANSI_SGR_RESET = 0;
var ANSI_SGR_RESET_FOREGROUND = 39;
var ANSI_SGR_RESET_BACKGROUND = 49;
var ANSI_SGR_RESET_UNDERLINE_COLOR = 59;
var ANSI_SGR_FOREGROUND_EXTENDED = 38;
var ANSI_SGR_BACKGROUND_EXTENDED = 48;
var ANSI_SGR_UNDERLINE_COLOR_EXTENDED = 58;
var ANSI_SGR_COLOR_MODE_256 = 5;
var ANSI_SGR_COLOR_MODE_RGB = 2;
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
var ANSI_ESCAPE_REGEX = new RegExp(`^\\u001B(?:\\${ANSI_CSI}(?<sgr>[0-9;]*)${ANSI_SGR_TERMINATOR}|${ANSI_ESCAPE_LINK}(?<uri>[^\\u0007\\u001B]*)(?:\\u0007|\\u001B\\\\))`);
var ANSI_ESCAPE_CSI_REGEX = new RegExp(`^\\u009B(?<sgr>[0-9;]*)${ANSI_SGR_TERMINATOR}`);
var ANSI_SGR_MODIFIER_CLOSE_CODES = new Set(ansi_styles_default.codes.values());
ANSI_SGR_MODIFIER_CLOSE_CODES.delete(ANSI_SGR_RESET);
var segmenter2 = new Intl.Segmenter();
var getGraphemes = /* @__PURE__ */ __name((string) => Array.from(segmenter2.segment(string), ({ segment }) => segment), "getGraphemes");
var TAB_SIZE = 8;
var wrapAnsiCode = /* @__PURE__ */ __name((code) => `${ANSI_ESCAPE}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, "wrapAnsiCode");
var wrapAnsiHyperlink = /* @__PURE__ */ __name((url) => `${ANSI_ESCAPE}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`, "wrapAnsiHyperlink");
var getSgrTokens = /* @__PURE__ */ __name((sgrParameters) => {
  const codes = sgrParameters.split(";").map((sgrParameter) => sgrParameter === "" ? ANSI_SGR_RESET : Number.parseInt(sgrParameter, 10));
  const sgrTokens = [];
  for (let index = 0; index < codes.length; index++) {
    const code = codes[index];
    if (!Number.isFinite(code)) {
      continue;
    }
    if (code === ANSI_SGR_FOREGROUND_EXTENDED || code === ANSI_SGR_BACKGROUND_EXTENDED || code === ANSI_SGR_UNDERLINE_COLOR_EXTENDED) {
      if (index + 1 >= codes.length) {
        break;
      }
      const mode = codes[index + 1];
      if (mode === ANSI_SGR_COLOR_MODE_256 && Number.isFinite(codes[index + 2])) {
        sgrTokens.push([code, mode, codes[index + 2]]);
        index += 2;
        continue;
      }
      const red = codes[index + 2];
      const green = codes[index + 3];
      const blue = codes[index + 4];
      if (mode === ANSI_SGR_COLOR_MODE_RGB && Number.isFinite(red) && Number.isFinite(green) && Number.isFinite(blue)) {
        sgrTokens.push([code, mode, red, green, blue]);
        index += 4;
        continue;
      }
      break;
    }
    sgrTokens.push([code]);
  }
  return sgrTokens;
}, "getSgrTokens");
var removeActiveStyle = /* @__PURE__ */ __name((activeStyles, family) => {
  const activeStyleIndex = activeStyles.findIndex((activeStyle) => activeStyle.family === family);
  if (activeStyleIndex !== -1) {
    activeStyles.splice(activeStyleIndex, 1);
  }
}, "removeActiveStyle");
var upsertActiveStyle = /* @__PURE__ */ __name((activeStyles, nextActiveStyle) => {
  removeActiveStyle(activeStyles, nextActiveStyle.family);
  activeStyles.push(nextActiveStyle);
}, "upsertActiveStyle");
var removeModifierStylesByClose = /* @__PURE__ */ __name((activeStyles, closeCode) => {
  for (let index = activeStyles.length - 1; index >= 0; index--) {
    const activeStyle = activeStyles[index];
    if (activeStyle.family.startsWith("modifier-") && activeStyle.close === closeCode) {
      activeStyles.splice(index, 1);
    }
  }
}, "removeModifierStylesByClose");
var getColorStyle = /* @__PURE__ */ __name((code, sgrToken) => {
  if (code >= 30 && code <= 37 || code >= 90 && code <= 97 || code === ANSI_SGR_FOREGROUND_EXTENDED && sgrToken.length > 1) {
    return {
      family: "foreground",
      open: sgrToken.join(";"),
      close: ANSI_SGR_RESET_FOREGROUND
    };
  }
  if (code >= 40 && code <= 47 || code >= 100 && code <= 107 || code === ANSI_SGR_BACKGROUND_EXTENDED && sgrToken.length > 1) {
    return {
      family: "background",
      open: sgrToken.join(";"),
      close: ANSI_SGR_RESET_BACKGROUND
    };
  }
  if (code === ANSI_SGR_UNDERLINE_COLOR_EXTENDED && sgrToken.length > 1) {
    return {
      family: "underlineColor",
      open: sgrToken.join(";"),
      close: ANSI_SGR_RESET_UNDERLINE_COLOR
    };
  }
}, "getColorStyle");
var applySgrResetCode = /* @__PURE__ */ __name((code, activeStyles) => {
  if (code === ANSI_SGR_RESET) {
    activeStyles.length = 0;
    return true;
  }
  if (code === ANSI_SGR_RESET_FOREGROUND) {
    removeActiveStyle(activeStyles, "foreground");
    return true;
  }
  if (code === ANSI_SGR_RESET_BACKGROUND) {
    removeActiveStyle(activeStyles, "background");
    return true;
  }
  if (code === ANSI_SGR_RESET_UNDERLINE_COLOR) {
    removeActiveStyle(activeStyles, "underlineColor");
    return true;
  }
  if (ANSI_SGR_MODIFIER_CLOSE_CODES.has(code)) {
    removeModifierStylesByClose(activeStyles, code);
    return true;
  }
  return false;
}, "applySgrResetCode");
var applySgrToken = /* @__PURE__ */ __name((sgrToken, activeStyles) => {
  const [code] = sgrToken;
  if (applySgrResetCode(code, activeStyles)) {
    return;
  }
  const colorStyle = getColorStyle(code, sgrToken);
  if (colorStyle) {
    upsertActiveStyle(activeStyles, colorStyle);
    return;
  }
  const close = ansi_styles_default.codes.get(code);
  if (close !== void 0 && close !== ANSI_SGR_RESET) {
    upsertActiveStyle(activeStyles, {
      family: `modifier-${code}`,
      open: sgrToken.join(";"),
      close
    });
  }
}, "applySgrToken");
var applySgrParameters = /* @__PURE__ */ __name((sgrParameters, activeStyles) => {
  for (const sgrToken of getSgrTokens(sgrParameters)) {
    applySgrToken(sgrToken, activeStyles);
  }
}, "applySgrParameters");
var applySgrResets = /* @__PURE__ */ __name((sgrParameters, activeStyles) => {
  for (const sgrToken of getSgrTokens(sgrParameters)) {
    const [code] = sgrToken;
    applySgrResetCode(code, activeStyles);
  }
}, "applySgrResets");
var applyLeadingSgrResets = /* @__PURE__ */ __name((string, activeStyles) => {
  let remainder = string;
  while (remainder.length > 0) {
    if (remainder.startsWith(ANSI_ESCAPE) && remainder[1] !== "\\") {
      const match = ANSI_ESCAPE_REGEX.exec(remainder);
      if (!match) {
        break;
      }
      if (match.groups.sgr !== void 0) {
        applySgrResets(match.groups.sgr, activeStyles);
      }
      remainder = remainder.slice(match[0].length);
      continue;
    }
    if (remainder.startsWith(ANSI_ESCAPE_CSI)) {
      const match = ANSI_ESCAPE_CSI_REGEX.exec(remainder);
      if (!match || match.groups.sgr === void 0) {
        break;
      }
      applySgrResets(match.groups.sgr, activeStyles);
      remainder = remainder.slice(match[0].length);
      continue;
    }
    break;
  }
}, "applyLeadingSgrResets");
var getClosingSgrSequence = /* @__PURE__ */ __name((activeStyles) => [...activeStyles].reverse().map((activeStyle) => wrapAnsiCode(activeStyle.close)).join(""), "getClosingSgrSequence");
var getOpeningSgrSequence = /* @__PURE__ */ __name((activeStyles) => activeStyles.map((activeStyle) => wrapAnsiCode(activeStyle.open)).join(""), "getOpeningSgrSequence");
var wordLengths = /* @__PURE__ */ __name((string) => string.split(" ").map((word) => stringWidth2(word)), "wordLengths");
var wrapWord = /* @__PURE__ */ __name((rows, word, columns) => {
  const characters = getGraphemes(word);
  let isInsideEscape = false;
  let isInsideLinkEscape = false;
  let visible = stringWidth2(stripAnsi(rows.at(-1)));
  for (const [index, character] of characters.entries()) {
    const characterLength = stringWidth2(character);
    if (visible + characterLength <= columns) {
      rows[rows.length - 1] += character;
    } else {
      rows.push(character);
      visible = 0;
    }
    if (ESCAPES.has(character) && !(isInsideLinkEscape && character === ANSI_ESCAPE && characters[index + 1] === "\\")) {
      isInsideEscape = true;
      const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join("");
      isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
    }
    if (isInsideEscape) {
      if (isInsideLinkEscape) {
        if (character === ANSI_ESCAPE_BELL || character === "\\" && index > 0 && characters[index - 1] === ANSI_ESCAPE) {
          isInsideEscape = false;
          isInsideLinkEscape = false;
        }
      } else if (character === ANSI_SGR_TERMINATOR) {
        isInsideEscape = false;
      }
      continue;
    }
    visible += characterLength;
    if (visible === columns && index < characters.length - 1) {
      rows.push("");
      visible = 0;
    }
  }
  if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
    rows[rows.length - 2] += rows.pop();
  }
}, "wrapWord");
var stringVisibleTrimSpacesRight = /* @__PURE__ */ __name((string) => {
  const words = string.split(" ");
  let last = words.length;
  while (last > 0) {
    if (stringWidth2(words[last - 1]) > 0) {
      break;
    }
    last--;
  }
  if (last === words.length) {
    return string;
  }
  return words.slice(0, last).join(" ") + words.slice(last).join("");
}, "stringVisibleTrimSpacesRight");
var expandTabs = /* @__PURE__ */ __name((line) => {
  if (!line.includes("	")) {
    return line;
  }
  const segments = line.split("	");
  let visible = 0;
  let expandedLine = "";
  for (const [index, segment] of segments.entries()) {
    expandedLine += segment;
    visible += stringWidth2(segment);
    if (index < segments.length - 1) {
      const spaces = TAB_SIZE - visible % TAB_SIZE;
      expandedLine += " ".repeat(spaces);
      visible += spaces;
    }
  }
  return expandedLine;
}, "expandTabs");
var exec = /* @__PURE__ */ __name((string, columns, options = {}) => {
  if (options.trim !== false && string.trim() === "") {
    return "";
  }
  let returnValue = "";
  let escapeUrl;
  const activeStyles = [];
  const lengths = wordLengths(string);
  let rows = [""];
  for (const [index, word] of string.split(" ").entries()) {
    if (options.trim !== false) {
      rows[rows.length - 1] = rows.at(-1).trimStart();
    }
    let rowLength = stringWidth2(rows.at(-1));
    if (index !== 0) {
      if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
        rows.push("");
        rowLength = 0;
      }
      if (rowLength > 0 || options.trim === false) {
        rows[rows.length - 1] += " ";
        rowLength++;
      }
    }
    if (options.hard && options.wordWrap !== false && lengths[index] > columns) {
      const remainingColumns = columns - rowLength;
      const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
      const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
      if (breaksStartingNextLine < breaksStartingThisLine) {
        rows.push("");
      }
      wrapWord(rows, word, columns);
      continue;
    }
    if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
      if (options.wordWrap === false && rowLength < columns) {
        wrapWord(rows, word, columns);
        continue;
      }
      rows.push("");
    }
    if (rowLength + lengths[index] > columns && options.wordWrap === false) {
      wrapWord(rows, word, columns);
      continue;
    }
    rows[rows.length - 1] += word;
  }
  if (options.trim !== false) {
    rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
  }
  const preString = rows.join("\n");
  const pre = getGraphemes(preString);
  let preStringIndex = 0;
  for (const [index, character] of pre.entries()) {
    returnValue += character;
    if (character === ANSI_ESCAPE && pre[index + 1] !== "\\") {
      const { groups } = ANSI_ESCAPE_REGEX.exec(preString.slice(preStringIndex)) || { groups: {} };
      if (groups.sgr !== void 0) {
        applySgrParameters(groups.sgr, activeStyles);
      } else if (groups.uri !== void 0) {
        escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
      }
    } else if (character === ANSI_ESCAPE_CSI) {
      const { groups } = ANSI_ESCAPE_CSI_REGEX.exec(preString.slice(preStringIndex)) || { groups: {} };
      if (groups.sgr !== void 0) {
        applySgrParameters(groups.sgr, activeStyles);
      }
    }
    if (pre[index + 1] === "\n") {
      if (escapeUrl) {
        returnValue += wrapAnsiHyperlink("");
      }
      returnValue += getClosingSgrSequence(activeStyles);
    } else if (character === "\n") {
      const openingStyles = [...activeStyles];
      applyLeadingSgrResets(preString.slice(preStringIndex + 1), openingStyles);
      returnValue += getOpeningSgrSequence(openingStyles);
      if (escapeUrl) {
        returnValue += wrapAnsiHyperlink(escapeUrl);
      }
    }
    preStringIndex += character.length;
  }
  return returnValue;
}, "exec");
function wrapAnsi(string, columns, options) {
  return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(expandTabs(line), columns, options)).join("\n");
}
__name(wrapAnsi, "wrapAnsi");

// packages/cli/src/ui/constants.ts
init_esbuild_shims();
var EstimatedArtWidth = 59;
var BoxBorderWidth = 1;
var BOX_PADDING_X = 1;
var UI_WIDTH = EstimatedArtWidth + BOX_PADDING_X * 2 + BoxBorderWidth * 2;
var SHELL_COMMAND_NAME = "Shell Command";
var SHELL_NAME = "Shell";
var TOOL_STATUS = {
  SUCCESS: "\u2713",
  PENDING: "o",
  EXECUTING: "\u22B7",
  CONFIRMING: "?",
  CANCELED: "-",
  ERROR: "x"
};
var _VS15 = "\uFE0E";
var ICON = {
  DIAMOND: `\u25C6${_VS15}`,
  CIRCLE_FILLED: `\u25CF${_VS15}`,
  TRIANGLE: `\u25B3${_VS15}`,
  CIRCLE_EMPTY: `\u25CB${_VS15}`,
  BULLSEYE: `\u25CE${_VS15}`,
  REFERENCE: `\u203B${_VS15}`,
  THEREFORE: `\u2234${_VS15}`,
  BECAUSE: `\u2235${_VS15}`,
  STAR: `\u2605${_VS15}`,
  RADIO_FILLED: `\u25C9${_VS15}`,
  CIRCLE_LEFT_HALF: `\u25D0${_VS15}`,
  CHECK: `\u2713${_VS15}`,
  CROSS: `\u2716${_VS15}`
};

// packages/cli/src/ui/components/shared/ToolStatusIndicator.tsx
init_esbuild_shims();

// packages/cli/src/ui/components/GeminiRespondingSpinner.tsx
init_esbuild_shims();
var import_react3 = __toESM(require_react(), 1);

// node_modules/ink-spinner/build/index.js
init_esbuild_shims();
var import_react = __toESM(require_react(), 1);
var import_cli_spinners = __toESM(require_cli_spinners(), 1);
function Spinner({ type = "dots" }) {
  const [frame, setFrame] = (0, import_react.useState)(0);
  const spinner = import_cli_spinners.default[type];
  (0, import_react.useEffect)(() => {
    const timer = setInterval(() => {
      setFrame((previousFrame) => {
        const isLastFrame = previousFrame === spinner.frames.length - 1;
        return isLastFrame ? 0 : previousFrame + 1;
      });
    }, spinner.interval);
    return () => {
      clearInterval(timer);
    };
  }, [spinner]);
  return import_react.default.createElement(Text, null, spinner.frames[frame]);
}
__name(Spinner, "Spinner");
var build_default = Spinner;

// packages/cli/src/ui/contexts/StreamingContext.tsx
init_esbuild_shims();
var import_react2 = __toESM(require_react(), 1);
var StreamingContext = (0, import_react2.createContext)(
  void 0
);
var useStreamingContext = /* @__PURE__ */ __name(() => {
  const context = import_react2.default.useContext(StreamingContext);
  if (context === void 0) {
    throw new Error(
      "useStreamingContext must be used within a StreamingContextProvider"
    );
  }
  return context;
}, "useStreamingContext");

// packages/cli/src/ui/textConstants.ts
init_esbuild_shims();
var SCREEN_READER_USER_PREFIX = "User: ";
var SCREEN_READER_MODEL_PREFIX = "Model: ";
var SCREEN_READER_LOADING = "loading";
var SCREEN_READER_RESPONDING = "responding";

// packages/cli/src/ui/components/GeminiRespondingSpinner.tsx
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
var TMUX_SPINNER_INTERVAL_MS = 750;
var TMUX_SPINNER_FRAMES = [". ", ".."];
var GeminiRespondingSpinner = /* @__PURE__ */ __name(({ nonRespondingDisplay, spinnerType = "dots" }) => {
  const streamingState = useStreamingContext();
  const isScreenReaderEnabled = use_is_screen_reader_enabled_default();
  if (streamingState === "responding" /* Responding */) {
    return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
      GeminiSpinner,
      {
        spinnerType,
        altText: SCREEN_READER_RESPONDING
      }
    );
  } else if (nonRespondingDisplay) {
    return isScreenReaderEnabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: SCREEN_READER_LOADING }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: theme.text.primary, children: nonRespondingDisplay });
  }
  return null;
}, "GeminiRespondingSpinner");
var GeminiSpinner = /* @__PURE__ */ __name(({
  spinnerType = "dots",
  altText
}) => {
  const isScreenReaderEnabled = use_is_screen_reader_enabled_default();
  const isTmux = Boolean(process.env["TMUX"]);
  const [tmuxFrameIndex, setTmuxFrameIndex] = (0, import_react3.useState)(0);
  (0, import_react3.useEffect)(() => {
    if (isScreenReaderEnabled || !isTmux) {
      return;
    }
    const interval = setInterval(() => {
      setTmuxFrameIndex((index) => (index + 1) % TMUX_SPINNER_FRAMES.length);
    }, TMUX_SPINNER_INTERVAL_MS);
    return () => clearInterval(interval);
  }, [isScreenReaderEnabled, isTmux]);
  if (isScreenReaderEnabled) {
    return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: altText });
  }
  if (isTmux) {
    return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: theme.text.primary, children: TMUX_SPINNER_FRAMES[tmuxFrameIndex] });
  }
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: theme.text.primary, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(build_default, { type: spinnerType }) });
}, "GeminiSpinner");

// packages/cli/src/ui/components/shared/ToolStatusIndicator.tsx
var import_jsx_runtime2 = (
  // minWidth (not width) so the box can grow for wider content like the
  // tmux spinner frames or test mocks; all production glyphs are ≤2 cols.
  __toESM(require_jsx_runtime(), 1)
);
var STATUS_INDICATOR_WIDTH = 2;
var ToolStatusIndicator = /* @__PURE__ */ __name(({
  status,
  name
}) => {
  const isShell = name === SHELL_COMMAND_NAME || name === SHELL_NAME;
  const statusColor = isShell ? theme.ui.symbol : theme.status.warning;
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { minWidth: STATUS_INDICATOR_WIDTH, flexShrink: 0, children: [
    status === "Pending" /* Pending */ && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: theme.status.success, children: TOOL_STATUS.PENDING }),
    status === "Executing" /* Executing */ && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
      GeminiRespondingSpinner,
      {
        spinnerType: "toggle",
        nonRespondingDisplay: TOOL_STATUS.EXECUTING
      }
    ),
    status === "Success" /* Success */ && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: theme.status.success, "aria-label": "Success:", children: TOOL_STATUS.SUCCESS }),
    status === "Confirming" /* Confirming */ && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: statusColor, "aria-label": "Confirming:", children: TOOL_STATUS.CONFIRMING }),
    status === "Canceled" /* Canceled */ && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: statusColor, "aria-label": "Canceled:", bold: true, children: TOOL_STATUS.CANCELED }),
    status === "Error" /* Error */ && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: theme.status.error, "aria-label": "Error:", bold: true, children: TOOL_STATUS.ERROR })
  ] });
}, "ToolStatusIndicator");

// packages/cli/src/ui/components/shared/ToolElapsedTime.tsx
init_esbuild_shims();
var import_react4 = __toESM(require_react(), 1);
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
var ToolElapsedTime = /* @__PURE__ */ __name(({
  status,
  executionStartTime,
  timeoutMs
}) => {
  const [elapsedSeconds, setElapsedSeconds] = (0, import_react4.useState)(0);
  (0, import_react4.useEffect)(() => {
    if (status !== "Executing" /* Executing */ || !executionStartTime) {
      setElapsedSeconds(0);
      return;
    }
    setElapsedSeconds(Math.floor((Date.now() - executionStartTime) / 1e3));
    const interval = setInterval(() => {
      setElapsedSeconds(Math.floor((Date.now() - executionStartTime) / 1e3));
    }, 1e3);
    return () => clearInterval(interval);
  }, [status, executionStartTime]);
  if (status !== "Executing" /* Executing */) return null;
  const hasTimeout = timeoutMs != null && timeoutMs > 0;
  if (!hasTimeout && elapsedSeconds < 3) return null;
  const elapsedStr = formatDuration(elapsedSeconds * 1e3, {
    hideTrailingZeros: true
  });
  const label = hasTimeout ? `(${elapsedStr} \xB7 timeout ${formatDuration(timeoutMs, { hideTrailingZeros: true })})` : elapsedStr;
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box_default, { flexShrink: 0, marginLeft: 1, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: theme.text.secondary, children: label }) });
}, "ToolElapsedTime");

// packages/cli/src/ui/components/messages/CompactToolGroupDisplay.tsx
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
var ELAPSED_TIME_MARGIN_LEFT = 1;
var EXECUTING_ELAPSED_TIME_RESERVED_LABEL = "99h 59m 59s";
function getOverallStatus(toolCalls) {
  if (toolCalls.some((t2) => t2.status === "Confirming" /* Confirming */))
    return "Confirming" /* Confirming */;
  if (toolCalls.some((t2) => t2.status === "Executing" /* Executing */))
    return "Executing" /* Executing */;
  if (toolCalls.some((t2) => t2.status === "Error" /* Error */))
    return "Error" /* Error */;
  if (toolCalls.some((t2) => t2.status === "Canceled" /* Canceled */))
    return "Canceled" /* Canceled */;
  if (toolCalls.some((t2) => t2.status === "Pending" /* Pending */))
    return "Pending" /* Pending */;
  return "Success" /* Success */;
}
__name(getOverallStatus, "getOverallStatus");
function getActiveTool(toolCalls) {
  return toolCalls.find((t2) => t2.status === "Confirming" /* Confirming */) ?? toolCalls.find((t2) => t2.status === "Executing" /* Executing */) ?? toolCalls[toolCalls.length - 1];
}
__name(getActiveTool, "getActiveTool");
function getShellTimeoutMs(tool) {
  const display = tool.resultDisplay;
  if (typeof display === "object" && display !== null && "ansiOutput" in display) {
    return display.timeoutMs;
  }
  return void 0;
}
__name(getShellTimeoutMs, "getShellTimeoutMs");
function isToolGroupActive(status) {
  return status === "Executing" /* Executing */ || status === "Pending" /* Pending */ || status === "Confirming" /* Confirming */;
}
__name(isToolGroupActive, "isToolGroupActive");
function getElapsedTimeReservedWidth(tool, status) {
  if (status !== "Executing" /* Executing */) return 0;
  const timeoutMs = getShellTimeoutMs(tool);
  let label = EXECUTING_ELAPSED_TIME_RESERVED_LABEL;
  if (timeoutMs != null && timeoutMs > 0) {
    const maxElapsedStr = formatDuration(timeoutMs, {
      hideTrailingZeros: true
    });
    label = `(${maxElapsedStr} \xB7 timeout ${maxElapsedStr})`;
  }
  return ELAPSED_TIME_MARGIN_LEFT + stringWidth(label);
}
__name(getElapsedTimeReservedWidth, "getElapsedTimeReservedWidth");
var TOOL_NAME_TO_CATEGORY = {
  [ToolDisplayNames.READ_FILE]: "read",
  [ToolDisplayNames.EDIT]: "edit",
  [ToolDisplayNames.WRITE_FILE]: "write",
  [ToolDisplayNames.NOTEBOOK_EDIT]: "edit",
  [ToolDisplayNames.GREP]: "search",
  [ToolDisplayNames.GLOB]: "search",
  [ToolDisplayNames.LS]: "list",
  [ToolDisplayNames.SHELL]: "command",
  [SHELL_COMMAND_NAME]: "command",
  [ToolDisplayNames.AGENT]: "agent",
  [ToolDisplayNames.WORKFLOW]: "agent",
  [ToolDisplayNames.SEND_MESSAGE]: "agent",
  "Read File": "read",
  "Read File(s)": "read",
  "Read Directory": "list",
  // Legacy display names (keys from ToolDisplayNamesMigration)
  SearchFiles: "search",
  FindFiles: "search",
  ReadFolder: "list",
  Task: "agent",
  TodoWrite: "other"
};
var CATEGORY_TEMPLATES = {
  read: {
    past: { one: "Read {{count}} file", many: "Read {{count}} files" },
    active: { one: "Reading {{count}} file", many: "Reading {{count}} files" },
    pastVerb: "Read",
    activeVerb: "Reading"
  },
  edit: {
    past: { one: "Edited {{count}} file", many: "Edited {{count}} files" },
    active: { one: "Editing {{count}} file", many: "Editing {{count}} files" },
    pastVerb: "Edited",
    activeVerb: "Editing"
  },
  write: {
    past: { one: "Wrote {{count}} file", many: "Wrote {{count}} files" },
    active: { one: "Writing {{count}} file", many: "Writing {{count}} files" },
    pastVerb: "Wrote",
    activeVerb: "Writing"
  },
  search: {
    past: {
      one: "Searched {{count}} pattern",
      many: "Searched {{count}} patterns"
    },
    active: {
      one: "Searching {{count}} pattern",
      many: "Searching {{count}} patterns"
    },
    pastVerb: "Searched",
    activeVerb: "Searching"
  },
  list: {
    past: {
      one: "Listed {{count}} directory",
      many: "Listed {{count}} directories"
    },
    active: {
      one: "Listing {{count}} directory",
      many: "Listing {{count}} directories"
    },
    pastVerb: "Listed",
    activeVerb: "Listing"
  },
  command: {
    past: { one: "Ran {{count}} command", many: "Ran {{count}} commands" },
    active: {
      one: "Running {{count}} command",
      many: "Running {{count}} commands"
    },
    pastVerb: "Ran",
    activeVerb: "Running"
  },
  agent: {
    past: { one: "Ran {{count}} agent", many: "Ran {{count}} agents" },
    active: {
      one: "Running {{count}} agent",
      many: "Running {{count}} agents"
    },
    pastVerb: "Ran",
    activeVerb: "Running"
  },
  other: {
    past: { one: "Used {{count}} tool", many: "Used {{count}} tools" },
    active: { one: "Using {{count}} tool", many: "Using {{count}} tools" },
    pastVerb: "Used",
    activeVerb: "Using"
  }
};
var CATEGORY_ORDER = [
  "search",
  "read",
  "list",
  "command",
  "edit",
  "write",
  "agent",
  "other"
];
var COLLAPSIBLE_CATEGORIES = /* @__PURE__ */ new Set([
  "read",
  "search",
  "list"
]);
function getToolCategory(toolName) {
  return TOOL_NAME_TO_CATEGORY[toolName] ?? "other";
}
__name(getToolCategory, "getToolCategory");
function isCollapsibleTool(toolName) {
  return COLLAPSIBLE_CATEGORIES.has(getToolCategory(toolName));
}
__name(isCollapsibleTool, "isCollapsibleTool");
function safeDescription(raw) {
  if (!raw) return void 0;
  const stripped = raw.replace(
    /\x1b\][^\x07]*\x07|\x1b[()][A-Z0-9]|\x1b\[[0-9;]*[a-zA-Z]|\x1b./g,
    ""
  );
  const cleaned = stripped.replace(/[\x00-\x1f\x7f]/g, " ").trim();
  if (cleaned.startsWith("{") || cleaned.startsWith("[")) {
    try {
      const parsed = JSON.parse(cleaned);
      if (typeof parsed === "object" && parsed !== null) return void 0;
    } catch {
    }
  }
  return cleaned || void 0;
}
__name(safeDescription, "safeDescription");
function categoryShowsDescriptionsInline(toolCalls, category) {
  const sameCategory = toolCalls.filter(
    (tc) => getToolCategory(tc.name) === category
  );
  if (sameCategory.length > DESCRIPTION_INLINE_LIMIT) return false;
  return sameCategory.every(
    (tc) => safeDescription(tc.description) !== void 0
  );
}
__name(categoryShowsDescriptionsInline, "categoryShowsDescriptionsInline");
function getActiveToolHint(toolCalls) {
  if (toolCalls.length < 2) return void 0;
  const statuses = [
    "Confirming" /* Confirming */,
    "Executing" /* Executing */,
    "Pending" /* Pending */
  ];
  for (const status of statuses) {
    for (let index = toolCalls.length - 1; index >= 0; index--) {
      const tool = toolCalls[index];
      if (tool.status === status) {
        const category = getToolCategory(tool.name);
        const hasCategoryPeers = toolCalls.some(
          (candidate, candidateIndex) => candidateIndex !== index && getToolCategory(candidate.name) === category
        );
        if (!hasCategoryPeers) return void 0;
        if (categoryShowsDescriptionsInline(toolCalls, category))
          return void 0;
        return safeDescription(tool.description);
      }
    }
  }
  return void 0;
}
__name(getActiveToolHint, "getActiveToolHint");
var DESCRIPTION_INLINE_LIMIT = 3;
var DESCRIPTION_PREVIEW_COUNT = 2;
function buildToolSummary(toolCalls, isActive) {
  if (toolCalls.length === 0) return "";
  const toolsByCategory = /* @__PURE__ */ new Map();
  for (const tool of toolCalls) {
    const cat = getToolCategory(tool.name);
    const arr = toolsByCategory.get(cat) ?? [];
    arr.push(tool);
    toolsByCategory.set(cat, arr);
  }
  const parts = [];
  for (const cat of CATEGORY_ORDER) {
    const tools = toolsByCategory.get(cat);
    if (!tools || tools.length === 0) continue;
    const template = CATEGORY_TEMPLATES[cat];
    const verb = isActive ? template.activeVerb : template.pastVerb;
    let part;
    if (tools.length === 1) {
      const safeDesc = safeDescription(tools[0].description);
      if (safeDesc !== void 0) {
        part = `${verb} ${safeDesc}`;
      } else {
        part = t(isActive ? template.active.one : template.past.one, {
          count: "1"
        });
      }
    } else if (tools.length <= DESCRIPTION_INLINE_LIMIT) {
      const descriptions = tools.map((tc) => safeDescription(tc.description)).filter((d) => d !== void 0);
      if (descriptions.length === tools.length) {
        part = `${verb} ${descriptions.join(", ")}`;
      } else {
        const forms = isActive ? template.active : template.past;
        part = t(forms.many, { count: String(tools.length) });
      }
    } else {
      const previewDescs = tools.slice(0, DESCRIPTION_PREVIEW_COUNT).map((tc) => safeDescription(tc.description)).filter((d) => d !== void 0);
      if (previewDescs.length === DESCRIPTION_PREVIEW_COUNT) {
        const remaining = tools.length - DESCRIPTION_PREVIEW_COUNT;
        const morePhrase = t("... and {{count}} more", {
          count: String(remaining)
        });
        part = `${verb} ${previewDescs.join(", ")}, ${morePhrase}`;
      } else {
        const forms = isActive ? template.active : template.past;
        part = t(forms.many, { count: String(tools.length) });
      }
    }
    if (parts.length > 0) {
      part = part.charAt(0).toLowerCase() + part.slice(1);
    }
    parts.push(part);
  }
  return parts.join(", ");
}
__name(buildToolSummary, "buildToolSummary");
function estimateCompactToolGroupHeight(toolCalls, contentWidth) {
  if (toolCalls.length === 0) return 0;
  const overallStatus = getOverallStatus(toolCalls);
  const activeTool = getActiveTool(toolCalls);
  const isActive = isToolGroupActive(overallStatus);
  const summary = `${buildToolSummary(toolCalls, isActive)}${isActive ? "\u2026" : ""}`;
  const hint = getActiveToolHint(toolCalls);
  const summaryWidth = Math.max(
    1,
    contentWidth - STATUS_INDICATOR_WIDTH - getElapsedTimeReservedWidth(activeTool, overallStatus)
  );
  const wrappedSummary = wrapAnsi(summary, summaryWidth, {
    hard: true,
    trim: false
  });
  return Math.max(1, wrappedSummary.split("\n").length) + (hint ? 1 : 0);
}
__name(estimateCompactToolGroupHeight, "estimateCompactToolGroupHeight");
var CompactToolGroupDisplay = /* @__PURE__ */ __name(({ toolCalls, contentWidth }) => {
  if (toolCalls.length === 0) return null;
  const overallStatus = getOverallStatus(toolCalls);
  const activeTool = getActiveTool(toolCalls);
  const isActive = isToolGroupActive(overallStatus);
  const hint = getActiveToolHint(toolCalls);
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { flexDirection: "column", width: contentWidth, gap: 0, children: [
    /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { flexDirection: "row", children: [
      /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ToolStatusIndicator, { status: overallStatus, name: activeTool.name }),
      /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { wrap: "wrap", bold: true, children: [
        buildToolSummary(toolCalls, isActive),
        isActive && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { children: "\u2026" }, "ellipsis")
      ] }) }),
      /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
        ToolElapsedTime,
        {
          status: overallStatus,
          executionStartTime: activeTool.executionStartTime,
          timeoutMs: getShellTimeoutMs(activeTool)
        }
      )
    ] }),
    hint && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { paddingLeft: STATUS_INDICATOR_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { dimColor: true, wrap: "truncate-end", children: [
      "\u23BF ",
      hint
    ] }) })
  ] });
}, "CompactToolGroupDisplay");

// packages/cli/src/ui/utils/goal-runtime.ts
init_esbuild_shims();
function shouldDisplayGoalStateCause(cause) {
  switch (cause) {
    case "turn_finished":
    case "verifier_accept":
      return false;
    case "verifier_reject":
    case "create":
    case "replace":
    case "edit":
    case "pause":
    case "resume":
    case "complete":
    case "blocked":
    case "usage_limited":
    case "clear":
    case "migrated":
      return true;
    default: {
      const exhaustive = cause;
      return exhaustive;
    }
  }
}
__name(shouldDisplayGoalStateCause, "shouldDisplayGoalStateCause");
async function waitForGoalRuntime(config) {
  try {
    await config.getGoalRuntimeReady();
  } catch (error) {
    if (!(error instanceof GoalPersistenceUnavailableError)) throw error;
  }
}
__name(waitForGoalRuntime, "waitForGoalRuntime");

// packages/cli/src/ui/utils/resumeHistoryUtils.ts
function extractUserRecordDisplayText(record) {
  const payload = record.systemPayload;
  if (payload?.displayText) {
    return payload.displayText;
  }
  const parts = record.message?.parts ?? [];
  return extractTextFromParts([
    ...stripTrailingUserPromptSubmitContextPart(parts)
  ]);
}
__name(extractUserRecordDisplayText, "extractUserRecordDisplayText");
function extractTextFromParts(parts) {
  if (!parts) return "";
  const textParts = [];
  for (const part of parts) {
    if ("text" in part && part.text) {
      if (!("thought" in part && part.thought)) {
        textParts.push(part.text);
      }
    }
  }
  return textParts.join("\n");
}
__name(extractTextFromParts, "extractTextFromParts");
function extractThoughtTextFromParts(parts) {
  if (!parts) return "";
  const thoughtParts = [];
  for (const part of parts) {
    if ("text" in part && part.text && "thought" in part && part.thought) {
      thoughtParts.push(part.text);
    }
  }
  return thoughtParts.join("\n");
}
__name(extractThoughtTextFromParts, "extractThoughtTextFromParts");
function extractFunctionCalls(parts) {
  if (!parts) return [];
  const calls = [];
  for (const part of parts) {
    if ("functionCall" in part && part.functionCall) {
      const fc = part.functionCall;
      calls.push({
        id: fc.id || `call-${calls.length}`,
        name: fc.name || "unknown",
        args: fc.args || {}
      });
    }
  }
  return calls;
}
__name(extractFunctionCalls, "extractFunctionCalls");
function getTool(config, name) {
  if (!config) return void 0;
  const toolRegistry = config.getToolRegistry();
  return toolRegistry.getTool(name);
}
__name(getTool, "getTool");
function formatToolDescription(tool, args) {
  try {
    const invocation = tool.build(args);
    return invocation.getDescription();
  } catch {
    if (typeof args["description"] === "string") {
      return args["description"];
    }
    return "";
  }
}
__name(formatToolDescription, "formatToolDescription");
function restoreHistoryItem(raw) {
  if (!raw || typeof raw !== "object") {
    return;
  }
  const clone = { ...raw };
  if ("timestamp" in clone) {
    const ts = clone["timestamp"];
    if (typeof ts === "string" || typeof ts === "number") {
      clone["timestamp"] = new Date(ts);
    }
  }
  if (typeof clone["type"] !== "string") {
    return;
  }
  return clone;
}
__name(restoreHistoryItem, "restoreHistoryItem");
function createHistoryGapItem(gap) {
  return {
    type: "info" /* INFO */,
    text: formatHistoryGapNotice(gap)
  };
}
__name(createHistoryGapItem, "createHistoryGapItem");
function convertToHistoryItems(conversation, config, historyGaps) {
  const items = [];
  const gapByChildUuid = indexGapsByChild(historyGaps);
  const pendingAtCommands = [];
  let atCommandCounter = 0;
  const pendingToolCalls = /* @__PURE__ */ new Map();
  let currentToolGroup = [];
  const buildAtCommandDisplays = /* @__PURE__ */ __name((payload) => {
    if (payload.status === "error") {
      atCommandCounter += 1;
      const filesLabel = payload.filesRead?.length ? payload.filesRead.join(", ") : "files";
      return [
        {
          callId: `at-command-${atCommandCounter}`,
          name: "Read File(s)",
          description: "Error attempting to read files",
          status: "Error" /* Error */,
          resultDisplay: payload.message || `Error reading files (${filesLabel})`,
          confirmationDetails: void 0
        }
      ];
    }
    if (!payload.filesRead?.length) {
      atCommandCounter += 1;
      return [
        {
          callId: `at-command-${atCommandCounter}`,
          name: "Read File",
          description: "Read File(s)",
          status: "Success" /* Success */,
          resultDisplay: void 0,
          confirmationDetails: void 0
        }
      ];
    }
    return payload.filesRead.map((filePath) => {
      atCommandCounter += 1;
      const isDir = filePath.endsWith("/");
      return {
        callId: `at-command-${atCommandCounter}`,
        name: isDir ? "Read Directory" : "Read File",
        description: isDir ? `Read directory ${path.basename(filePath)}` : `Read file ${path.basename(filePath)}`,
        status: "Success" /* Success */,
        resultDisplay: void 0,
        confirmationDetails: void 0
      };
    });
  }, "buildAtCommandDisplays");
  for (const record of conversation.messages) {
    const gap = gapByChildUuid.get(record.uuid);
    if (gap) {
      if (currentToolGroup.length > 0) {
        items.push({ type: "tool_group", tools: [...currentToolGroup] });
        currentToolGroup = [];
      }
      pendingAtCommands.length = 0;
      items.push(createHistoryGapItem(gap));
    }
    if (record.type === "system") {
      if (record.subtype === "goal_state") {
        const payload = parseGoalStateRecordPayloadV2(record.systemPayload);
        if (payload && shouldDisplayGoalStateCause(payload.cause)) {
          if (currentToolGroup.length > 0) {
            items.push({ type: "tool_group", tools: [...currentToolGroup] });
            currentToolGroup = [];
          }
          items.push({
            type: "goal_state",
            snapshot: payload.snapshot,
            cause: payload.cause
          });
        }
        continue;
      }
      if (record.subtype === "slash_command") {
        if (currentToolGroup.length > 0) {
          items.push({
            type: "tool_group",
            tools: [...currentToolGroup]
          });
          currentToolGroup = [];
        }
        const payload = record.systemPayload;
        if (!payload) continue;
        if (payload.phase === "invocation" && payload.rawCommand) {
          const sentToModel = typeof payload.sentToModel === "boolean" ? payload.sentToModel : void 0;
          items.push({
            type: "user",
            text: payload.rawCommand,
            ...sentToModel === void 0 ? {} : { sentToModel }
          });
        }
        if (payload.phase === "result") {
          const outputs = payload.outputHistoryItems ?? [];
          for (const raw of outputs) {
            const restored = restoreHistoryItem(raw);
            if (restored) {
              items.push(restored);
            }
          }
        }
      }
      if (record.subtype === "at_command") {
        const payload = record.systemPayload;
        if (!payload) continue;
        pendingAtCommands.push(payload);
      }
      if (record.subtype === "rewind") {
        items.push({ type: "info", text: "Conversation rewound." });
      }
      continue;
    }
    switch (record.type) {
      case "user": {
        if (record.subtype === "goal_runtime") break;
        if (record.subtype === "notification" || record.subtype === "cron") {
          const payload = record.systemPayload;
          const fallback = record.subtype === "cron" ? "Cron job fired" : "Background agent completed";
          const text2 = payload?.displayText || extractTextFromParts(record.message?.parts) || fallback;
          items.push({ type: "notification", text: text2 });
          break;
        }
        if (record.subtype === "mid_turn_user_message") {
          const payload = record.systemPayload;
          const text2 = payload?.displayText || extractTextFromParts(record.message?.parts);
          if (text2) {
            items.push({ type: "user" /* USER */, text: text2, sentToModel: false });
          }
          break;
        }
        if (pendingAtCommands.length > 0) {
          if (currentToolGroup.length > 0) {
            items.push({
              type: "tool_group",
              tools: [...currentToolGroup]
            });
            currentToolGroup = [];
          }
          const payload = pendingAtCommands.shift();
          const text2 = payload.userText || extractUserRecordDisplayText(record);
          if (text2) {
            items.push({ type: "user", text: text2 });
          }
          const toolDisplays = buildAtCommandDisplays(payload);
          if (toolDisplays.length > 0) {
            items.push({
              type: "tool_group",
              tools: toolDisplays
            });
          }
          break;
        }
        if (currentToolGroup.length > 0) {
          items.push({
            type: "tool_group",
            tools: [...currentToolGroup]
          });
          currentToolGroup = [];
        }
        const text = extractUserRecordDisplayText(record);
        if (text) {
          items.push({ type: "user", text });
        }
        break;
      }
      case "assistant": {
        const parts = record.message?.parts;
        const thoughtText = !config ? extractThoughtTextFromParts(parts) : "";
        const text = extractTextFromParts(parts);
        const functionCalls = extractFunctionCalls(parts);
        if (thoughtText) {
          if (currentToolGroup.length > 0) {
            items.push({
              type: "tool_group",
              tools: [...currentToolGroup]
            });
            currentToolGroup = [];
          }
          items.push({ type: "gemini_thought", text: thoughtText });
        }
        if (text) {
          if (currentToolGroup.length > 0) {
            items.push({
              type: "tool_group",
              tools: [...currentToolGroup]
            });
            currentToolGroup = [];
          }
          items.push({
            type: "gemini",
            text,
            timestamp: new Date(record.timestamp).getTime()
          });
        }
        for (const fc of functionCalls) {
          const tool = getTool(config, fc.name);
          pendingToolCalls.set(fc.id, { name: fc.name, args: fc.args });
          currentToolGroup.push({
            callId: fc.id,
            name: tool?.displayName || fc.name,
            description: tool ? formatToolDescription(tool, fc.args) : "",
            resultDisplay: void 0,
            status: "Success" /* Success */,
            // Will be updated by tool_result
            confirmationDetails: void 0
          });
        }
        break;
      }
      case "tool_result": {
        if (record.toolCallResult) {
          const callId = record.toolCallResult.callId;
          const toolCall = currentToolGroup.find((t2) => t2.callId === callId);
          if (toolCall) {
            const rawDisplay = record.toolCallResult.resultDisplay;
            toolCall.resultDisplay = rawDisplay;
            if (record.toolCallResult.visionBridgeNotice !== void 0) {
              toolCall.visionBridgeNotice = record.toolCallResult.visionBridgeNotice;
            }
            const rawStatus = record.toolCallResult["status"];
            toolCall.status = rawStatus === "error" ? "Error" /* Error */ : "Success" /* Success */;
            if (toolCall.status === "Success" /* Success */ && isCollapsibleTool(toolCall.name)) {
              toolCall.detailedDisplay = getToolResponseDisplayText(
                record.toolCallResult.responseParts ?? record.message?.parts
              );
            }
          }
          pendingToolCalls.delete(callId || "");
        }
        break;
      }
      default:
        break;
    }
  }
  if (pendingAtCommands.length > 0) {
    for (const payload of pendingAtCommands) {
      if (currentToolGroup.length > 0) {
        items.push({
          type: "tool_group",
          tools: [...currentToolGroup]
        });
        currentToolGroup = [];
      }
      const text = payload.userText;
      if (text) {
        items.push({ type: "user", text });
      }
      const toolDisplays = buildAtCommandDisplays(payload);
      if (toolDisplays.length > 0) {
        items.push({
          type: "tool_group",
          tools: toolDisplays
        });
      }
    }
  }
  if (currentToolGroup.length > 0) {
    items.push({
      type: "tool_group",
      tools: currentToolGroup
    });
  }
  return items;
}
__name(convertToHistoryItems, "convertToHistoryItems");
function buildResumedHistoryItems(sessionData, config, baseTimestamp = Date.now()) {
  const items = [];
  let idCounter = 1;
  const getNextId = /* @__PURE__ */ __name(() => baseTimestamp + idCounter++, "getNextId");
  const historyItems = convertToHistoryItems(
    sessionData.conversation,
    config,
    sessionData.historyGaps
  );
  for (const item of historyItems) {
    items.push({
      ...item,
      id: getNextId()
    });
  }
  return items;
}
__name(buildResumedHistoryItems, "buildResumedHistoryItems");
function applyResumeDisplayPolicy(items) {
  return items.map((item) => ({
    ...item,
    display: { ...item.display, suppressOnRestore: true }
  }));
}
__name(applyResumeDisplayPolicy, "applyResumeDisplayPolicy");
function createHistoryCollapseSummaryItem(messageCount) {
  const n = String(messageCount);
  return {
    type: "info" /* INFO */,
    text: t(
      "History collapsed: {{n}} messages hidden. Use /history expand-now to show.",
      { n }
    ),
    display: { kind: "collapse-summary" }
  };
}
__name(createHistoryCollapseSummaryItem, "createHistoryCollapseSummaryItem");
function stripSuppressOnRestore(item) {
  if (!item.display?.suppressOnRestore) return item;
  const { suppressOnRestore: _, ...rest } = item.display;
  return {
    ...item,
    display: Object.keys(rest).length > 0 ? rest : void 0
  };
}
__name(stripSuppressOnRestore, "stripSuppressOnRestore");
function expandCollapsedHistory(items) {
  return items.filter((item) => item.display?.kind !== "collapse-summary").map(stripSuppressOnRestore);
}
__name(expandCollapsedHistory, "expandCollapsedHistory");
function applyCollapsePolicyAndSummary(rawItems, collapseOnResume, collapsePreviewCount = 0) {
  if (!collapseOnResume) return rawItems;
  if (collapsePreviewCount === -1) return rawItems;
  let boundary = rawItems.length;
  if (collapsePreviewCount > 0) {
    let userTurnCount = 0;
    for (let i = rawItems.length - 1; i >= 0; i--) {
      const item = rawItems[i];
      if (item.type === "user" /* USER */ && item.sentToModel !== false) {
        userTurnCount++;
        if (userTurnCount === collapsePreviewCount) {
          boundary = i;
          break;
        }
      }
    }
    if (userTurnCount < collapsePreviewCount) {
      boundary = 0;
    }
  }
  const hiddenItems = applyResumeDisplayPolicy(rawItems.slice(0, boundary));
  const visibleItems = rawItems.slice(boundary);
  const uiHistoryItems = [...hiddenItems, ...visibleItems];
  if (boundary > 0) {
    const nextId = rawItems[rawItems.length - 1].id + 1;
    return [
      ...uiHistoryItems,
      { id: nextId, ...createHistoryCollapseSummaryItem(boundary) }
    ];
  }
  return uiHistoryItems;
}
__name(applyCollapsePolicyAndSummary, "applyCollapsePolicyAndSummary");

export {
  SHELL_COMMAND_NAME,
  SHELL_NAME,
  ICON,
  wrapAnsi,
  SCREEN_READER_USER_PREFIX,
  SCREEN_READER_MODEL_PREFIX,
  build_default,
  StreamingContext,
  useStreamingContext,
  GeminiRespondingSpinner,
  GeminiSpinner,
  STATUS_INDICATOR_WIDTH,
  ToolStatusIndicator,
  ToolElapsedTime,
  isCollapsibleTool,
  estimateCompactToolGroupHeight,
  CompactToolGroupDisplay,
  shouldDisplayGoalStateCause,
  waitForGoalRuntime,
  buildResumedHistoryItems,
  stripSuppressOnRestore,
  expandCollapsedHistory,
  applyCollapsePolicyAndSummary
};
/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
/**
 * @license
 * Copyright 2025 Qwen
 * SPDX-License-Identifier: Apache-2.0
 */
/**
 * @license
 * Copyright 2026 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */
/**
 * @license
 * Copyright 2025 Qwen Code
 * SPDX-License-Identifier: Apache-2.0
 */
