const {
  SvelteComponent: Kt,
  assign: Vt,
  create_slot: Gt,
  detach: Xt,
  element: Jt,
  get_all_dirty_from_scope: Yt,
  get_slot_changes: Zt,
  get_spread_update: Qt,
  init: $t,
  insert: ei,
  safe_not_equal: ti,
  set_dynamic_element_data: it,
  set_style: ae,
  toggle_class: fe,
  transition_in: Mt,
  transition_out: Tt,
  update_slot_base: ii
} = window.__gradio__svelte__internal;
function si(E) {
  let f, p, y;
  const D = (
    /*#slots*/
    E[18].default
  ), M = Gt(
    D,
    E,
    /*$$scope*/
    E[17],
    null
  );
  let k = [
    { "data-testid": (
      /*test_id*/
      E[7]
    ) },
    { id: (
      /*elem_id*/
      E[2]
    ) },
    {
      class: p = "block " + /*elem_classes*/
      E[3].join(" ") + " svelte-nl1om8"
    }
  ], i = {};
  for (let n = 0; n < k.length; n += 1)
    i = Vt(i, k[n]);
  return {
    c() {
      f = Jt(
        /*tag*/
        E[14]
      ), M && M.c(), it(
        /*tag*/
        E[14]
      )(f, i), fe(
        f,
        "hidden",
        /*visible*/
        E[10] === !1
      ), fe(
        f,
        "padded",
        /*padding*/
        E[6]
      ), fe(
        f,
        "border_focus",
        /*border_mode*/
        E[5] === "focus"
      ), fe(
        f,
        "border_contrast",
        /*border_mode*/
        E[5] === "contrast"
      ), fe(f, "hide-container", !/*explicit_call*/
      E[8] && !/*container*/
      E[9]), ae(
        f,
        "height",
        /*get_dimension*/
        E[15](
          /*height*/
          E[0]
        )
      ), ae(f, "width", typeof /*width*/
      E[1] == "number" ? `calc(min(${/*width*/
      E[1]}px, 100%))` : (
        /*get_dimension*/
        E[15](
          /*width*/
          E[1]
        )
      )), ae(
        f,
        "border-style",
        /*variant*/
        E[4]
      ), ae(
        f,
        "overflow",
        /*allow_overflow*/
        E[11] ? "visible" : "hidden"
      ), ae(
        f,
        "flex-grow",
        /*scale*/
        E[12]
      ), ae(f, "min-width", `calc(min(${/*min_width*/
      E[13]}px, 100%))`), ae(f, "border-width", "var(--block-border-width)");
    },
    m(n, o) {
      ei(n, f, o), M && M.m(f, null), y = !0;
    },
    p(n, o) {
      M && M.p && (!y || o & /*$$scope*/
      131072) && ii(
        M,
        D,
        n,
        /*$$scope*/
        n[17],
        y ? Zt(
          D,
          /*$$scope*/
          n[17],
          o,
          null
        ) : Yt(
          /*$$scope*/
          n[17]
        ),
        null
      ), it(
        /*tag*/
        n[14]
      )(f, i = Qt(k, [
        (!y || o & /*test_id*/
        128) && { "data-testid": (
          /*test_id*/
          n[7]
        ) },
        (!y || o & /*elem_id*/
        4) && { id: (
          /*elem_id*/
          n[2]
        ) },
        (!y || o & /*elem_classes*/
        8 && p !== (p = "block " + /*elem_classes*/
        n[3].join(" ") + " svelte-nl1om8")) && { class: p }
      ])), fe(
        f,
        "hidden",
        /*visible*/
        n[10] === !1
      ), fe(
        f,
        "padded",
        /*padding*/
        n[6]
      ), fe(
        f,
        "border_focus",
        /*border_mode*/
        n[5] === "focus"
      ), fe(
        f,
        "border_contrast",
        /*border_mode*/
        n[5] === "contrast"
      ), fe(f, "hide-container", !/*explicit_call*/
      n[8] && !/*container*/
      n[9]), o & /*height*/
      1 && ae(
        f,
        "height",
        /*get_dimension*/
        n[15](
          /*height*/
          n[0]
        )
      ), o & /*width*/
      2 && ae(f, "width", typeof /*width*/
      n[1] == "number" ? `calc(min(${/*width*/
      n[1]}px, 100%))` : (
        /*get_dimension*/
        n[15](
          /*width*/
          n[1]
        )
      )), o & /*variant*/
      16 && ae(
        f,
        "border-style",
        /*variant*/
        n[4]
      ), o & /*allow_overflow*/
      2048 && ae(
        f,
        "overflow",
        /*allow_overflow*/
        n[11] ? "visible" : "hidden"
      ), o & /*scale*/
      4096 && ae(
        f,
        "flex-grow",
        /*scale*/
        n[12]
      ), o & /*min_width*/
      8192 && ae(f, "min-width", `calc(min(${/*min_width*/
      n[13]}px, 100%))`);
    },
    i(n) {
      y || (Mt(M, n), y = !0);
    },
    o(n) {
      Tt(M, n), y = !1;
    },
    d(n) {
      n && Xt(f), M && M.d(n);
    }
  };
}
function ri(E) {
  let f, p = (
    /*tag*/
    E[14] && si(E)
  );
  return {
    c() {
      p && p.c();
    },
    m(y, D) {
      p && p.m(y, D), f = !0;
    },
    p(y, [D]) {
      /*tag*/
      y[14] && p.p(y, D);
    },
    i(y) {
      f || (Mt(p, y), f = !0);
    },
    o(y) {
      Tt(p, y), f = !1;
    },
    d(y) {
      p && p.d(y);
    }
  };
}
function ni(E, f, p) {
  let { $$slots: y = {}, $$scope: D } = f, { height: M = void 0 } = f, { width: k = void 0 } = f, { elem_id: i = "" } = f, { elem_classes: n = [] } = f, { variant: o = "solid" } = f, { border_mode: c = "base" } = f, { padding: a = !0 } = f, { type: d = "normal" } = f, { test_id: v = void 0 } = f, { explicit_call: m = !1 } = f, { container: l = !0 } = f, { visible: s = !0 } = f, { allow_overflow: r = !0 } = f, { scale: e = null } = f, { min_width: t = 0 } = f, h = d === "fieldset" ? "fieldset" : "div";
  const g = (u) => {
    if (u !== void 0) {
      if (typeof u == "number")
        return u + "px";
      if (typeof u == "string")
        return u;
    }
  };
  return E.$$set = (u) => {
    "height" in u && p(0, M = u.height), "width" in u && p(1, k = u.width), "elem_id" in u && p(2, i = u.elem_id), "elem_classes" in u && p(3, n = u.elem_classes), "variant" in u && p(4, o = u.variant), "border_mode" in u && p(5, c = u.border_mode), "padding" in u && p(6, a = u.padding), "type" in u && p(16, d = u.type), "test_id" in u && p(7, v = u.test_id), "explicit_call" in u && p(8, m = u.explicit_call), "container" in u && p(9, l = u.container), "visible" in u && p(10, s = u.visible), "allow_overflow" in u && p(11, r = u.allow_overflow), "scale" in u && p(12, e = u.scale), "min_width" in u && p(13, t = u.min_width), "$$scope" in u && p(17, D = u.$$scope);
  }, [
    M,
    k,
    i,
    n,
    o,
    c,
    a,
    v,
    m,
    l,
    s,
    r,
    e,
    t,
    h,
    g,
    d,
    D,
    y
  ];
}
class oi extends Kt {
  constructor(f) {
    super(), $t(this, f, ni, ri, ti, {
      height: 0,
      width: 1,
      elem_id: 2,
      elem_classes: 3,
      variant: 4,
      border_mode: 5,
      padding: 6,
      type: 16,
      test_id: 7,
      explicit_call: 8,
      container: 9,
      visible: 10,
      allow_overflow: 11,
      scale: 12,
      min_width: 13
    });
  }
}
const {
  SvelteComponent: ai,
  attr: hi,
  create_slot: li,
  detach: ci,
  element: _i,
  get_all_dirty_from_scope: di,
  get_slot_changes: ui,
  init: fi,
  insert: vi,
  safe_not_equal: gi,
  transition_in: mi,
  transition_out: pi,
  update_slot_base: Si
} = window.__gradio__svelte__internal;
function bi(E) {
  let f, p;
  const y = (
    /*#slots*/
    E[1].default
  ), D = li(
    y,
    E,
    /*$$scope*/
    E[0],
    null
  );
  return {
    c() {
      f = _i("div"), D && D.c(), hi(f, "class", "svelte-1hnfib2");
    },
    m(M, k) {
      vi(M, f, k), D && D.m(f, null), p = !0;
    },
    p(M, [k]) {
      D && D.p && (!p || k & /*$$scope*/
      1) && Si(
        D,
        y,
        M,
        /*$$scope*/
        M[0],
        p ? ui(
          y,
          /*$$scope*/
          M[0],
          k,
          null
        ) : di(
          /*$$scope*/
          M[0]
        ),
        null
      );
    },
    i(M) {
      p || (mi(D, M), p = !0);
    },
    o(M) {
      pi(D, M), p = !1;
    },
    d(M) {
      M && ci(f), D && D.d(M);
    }
  };
}
function Ci(E, f, p) {
  let { $$slots: y = {}, $$scope: D } = f;
  return E.$$set = (M) => {
    "$$scope" in M && p(0, D = M.$$scope);
  }, [D, y];
}
class wi extends ai {
  constructor(f) {
    super(), fi(this, f, Ci, bi, gi, {});
  }
}
const {
  SvelteComponent: yi,
  attr: st,
  check_outros: Ei,
  create_component: ki,
  create_slot: Li,
  destroy_component: xi,
  detach: Ne,
  element: Di,
  empty: Ri,
  get_all_dirty_from_scope: Ai,
  get_slot_changes: Bi,
  group_outros: Mi,
  init: Ti,
  insert: Ue,
  mount_component: Oi,
  safe_not_equal: Pi,
  set_data: Ii,
  space: Hi,
  text: Fi,
  toggle_class: ye,
  transition_in: Oe,
  transition_out: je,
  update_slot_base: Wi
} = window.__gradio__svelte__internal;
function rt(E) {
  let f, p;
  return f = new wi({
    props: {
      $$slots: { default: [Ni] },
      $$scope: { ctx: E }
    }
  }), {
    c() {
      ki(f.$$.fragment);
    },
    m(y, D) {
      Oi(f, y, D), p = !0;
    },
    p(y, D) {
      const M = {};
      D & /*$$scope, info*/
      10 && (M.$$scope = { dirty: D, ctx: y }), f.$set(M);
    },
    i(y) {
      p || (Oe(f.$$.fragment, y), p = !0);
    },
    o(y) {
      je(f.$$.fragment, y), p = !1;
    },
    d(y) {
      xi(f, y);
    }
  };
}
function Ni(E) {
  let f;
  return {
    c() {
      f = Fi(
        /*info*/
        E[1]
      );
    },
    m(p, y) {
      Ue(p, f, y);
    },
    p(p, y) {
      y & /*info*/
      2 && Ii(
        f,
        /*info*/
        p[1]
      );
    },
    d(p) {
      p && Ne(f);
    }
  };
}
function Ui(E) {
  let f, p, y, D;
  const M = (
    /*#slots*/
    E[2].default
  ), k = Li(
    M,
    E,
    /*$$scope*/
    E[3],
    null
  );
  let i = (
    /*info*/
    E[1] && rt(E)
  );
  return {
    c() {
      f = Di("span"), k && k.c(), p = Hi(), i && i.c(), y = Ri(), st(f, "data-testid", "block-info"), st(f, "class", "svelte-22c38v"), ye(f, "sr-only", !/*show_label*/
      E[0]), ye(f, "hide", !/*show_label*/
      E[0]), ye(
        f,
        "has-info",
        /*info*/
        E[1] != null
      );
    },
    m(n, o) {
      Ue(n, f, o), k && k.m(f, null), Ue(n, p, o), i && i.m(n, o), Ue(n, y, o), D = !0;
    },
    p(n, [o]) {
      k && k.p && (!D || o & /*$$scope*/
      8) && Wi(
        k,
        M,
        n,
        /*$$scope*/
        n[3],
        D ? Bi(
          M,
          /*$$scope*/
          n[3],
          o,
          null
        ) : Ai(
          /*$$scope*/
          n[3]
        ),
        null
      ), (!D || o & /*show_label*/
      1) && ye(f, "sr-only", !/*show_label*/
      n[0]), (!D || o & /*show_label*/
      1) && ye(f, "hide", !/*show_label*/
      n[0]), (!D || o & /*info*/
      2) && ye(
        f,
        "has-info",
        /*info*/
        n[1] != null
      ), /*info*/
      n[1] ? i ? (i.p(n, o), o & /*info*/
      2 && Oe(i, 1)) : (i = rt(n), i.c(), Oe(i, 1), i.m(y.parentNode, y)) : i && (Mi(), je(i, 1, 1, () => {
        i = null;
      }), Ei());
    },
    i(n) {
      D || (Oe(k, n), Oe(i), D = !0);
    },
    o(n) {
      je(k, n), je(i), D = !1;
    },
    d(n) {
      n && (Ne(f), Ne(p), Ne(y)), k && k.d(n), i && i.d(n);
    }
  };
}
function ji(E, f, p) {
  let { $$slots: y = {}, $$scope: D } = f, { show_label: M = !0 } = f, { info: k = void 0 } = f;
  return E.$$set = (i) => {
    "show_label" in i && p(0, M = i.show_label), "info" in i && p(1, k = i.info), "$$scope" in i && p(3, D = i.$$scope);
  }, [M, k, y, D];
}
class zi extends yi {
  constructor(f) {
    super(), Ti(this, f, ji, Ui, Pi, { show_label: 0, info: 1 });
  }
}
const qi = [
  { color: "red", primary: 600, secondary: 100 },
  { color: "green", primary: 600, secondary: 100 },
  { color: "blue", primary: 600, secondary: 100 },
  { color: "yellow", primary: 500, secondary: 100 },
  { color: "purple", primary: 600, secondary: 100 },
  { color: "teal", primary: 600, secondary: 100 },
  { color: "orange", primary: 600, secondary: 100 },
  { color: "cyan", primary: 600, secondary: 100 },
  { color: "lime", primary: 500, secondary: 100 },
  { color: "pink", primary: 600, secondary: 100 }
], nt = {
  inherit: "inherit",
  current: "currentColor",
  transparent: "transparent",
  black: "#000",
  white: "#fff",
  slate: {
    50: "#f8fafc",
    100: "#f1f5f9",
    200: "#e2e8f0",
    300: "#cbd5e1",
    400: "#94a3b8",
    500: "#64748b",
    600: "#475569",
    700: "#334155",
    800: "#1e293b",
    900: "#0f172a",
    950: "#020617"
  },
  gray: {
    50: "#f9fafb",
    100: "#f3f4f6",
    200: "#e5e7eb",
    300: "#d1d5db",
    400: "#9ca3af",
    500: "#6b7280",
    600: "#4b5563",
    700: "#374151",
    800: "#1f2937",
    900: "#111827",
    950: "#030712"
  },
  zinc: {
    50: "#fafafa",
    100: "#f4f4f5",
    200: "#e4e4e7",
    300: "#d4d4d8",
    400: "#a1a1aa",
    500: "#71717a",
    600: "#52525b",
    700: "#3f3f46",
    800: "#27272a",
    900: "#18181b",
    950: "#09090b"
  },
  neutral: {
    50: "#fafafa",
    100: "#f5f5f5",
    200: "#e5e5e5",
    300: "#d4d4d4",
    400: "#a3a3a3",
    500: "#737373",
    600: "#525252",
    700: "#404040",
    800: "#262626",
    900: "#171717",
    950: "#0a0a0a"
  },
  stone: {
    50: "#fafaf9",
    100: "#f5f5f4",
    200: "#e7e5e4",
    300: "#d6d3d1",
    400: "#a8a29e",
    500: "#78716c",
    600: "#57534e",
    700: "#44403c",
    800: "#292524",
    900: "#1c1917",
    950: "#0c0a09"
  },
  red: {
    50: "#fef2f2",
    100: "#fee2e2",
    200: "#fecaca",
    300: "#fca5a5",
    400: "#f87171",
    500: "#ef4444",
    600: "#dc2626",
    700: "#b91c1c",
    800: "#991b1b",
    900: "#7f1d1d",
    950: "#450a0a"
  },
  orange: {
    50: "#fff7ed",
    100: "#ffedd5",
    200: "#fed7aa",
    300: "#fdba74",
    400: "#fb923c",
    500: "#f97316",
    600: "#ea580c",
    700: "#c2410c",
    800: "#9a3412",
    900: "#7c2d12",
    950: "#431407"
  },
  amber: {
    50: "#fffbeb",
    100: "#fef3c7",
    200: "#fde68a",
    300: "#fcd34d",
    400: "#fbbf24",
    500: "#f59e0b",
    600: "#d97706",
    700: "#b45309",
    800: "#92400e",
    900: "#78350f",
    950: "#451a03"
  },
  yellow: {
    50: "#fefce8",
    100: "#fef9c3",
    200: "#fef08a",
    300: "#fde047",
    400: "#facc15",
    500: "#eab308",
    600: "#ca8a04",
    700: "#a16207",
    800: "#854d0e",
    900: "#713f12",
    950: "#422006"
  },
  lime: {
    50: "#f7fee7",
    100: "#ecfccb",
    200: "#d9f99d",
    300: "#bef264",
    400: "#a3e635",
    500: "#84cc16",
    600: "#65a30d",
    700: "#4d7c0f",
    800: "#3f6212",
    900: "#365314",
    950: "#1a2e05"
  },
  green: {
    50: "#f0fdf4",
    100: "#dcfce7",
    200: "#bbf7d0",
    300: "#86efac",
    400: "#4ade80",
    500: "#22c55e",
    600: "#16a34a",
    700: "#15803d",
    800: "#166534",
    900: "#14532d",
    950: "#052e16"
  },
  emerald: {
    50: "#ecfdf5",
    100: "#d1fae5",
    200: "#a7f3d0",
    300: "#6ee7b7",
    400: "#34d399",
    500: "#10b981",
    600: "#059669",
    700: "#047857",
    800: "#065f46",
    900: "#064e3b",
    950: "#022c22"
  },
  teal: {
    50: "#f0fdfa",
    100: "#ccfbf1",
    200: "#99f6e4",
    300: "#5eead4",
    400: "#2dd4bf",
    500: "#14b8a6",
    600: "#0d9488",
    700: "#0f766e",
    800: "#115e59",
    900: "#134e4a",
    950: "#042f2e"
  },
  cyan: {
    50: "#ecfeff",
    100: "#cffafe",
    200: "#a5f3fc",
    300: "#67e8f9",
    400: "#22d3ee",
    500: "#06b6d4",
    600: "#0891b2",
    700: "#0e7490",
    800: "#155e75",
    900: "#164e63",
    950: "#083344"
  },
  sky: {
    50: "#f0f9ff",
    100: "#e0f2fe",
    200: "#bae6fd",
    300: "#7dd3fc",
    400: "#38bdf8",
    500: "#0ea5e9",
    600: "#0284c7",
    700: "#0369a1",
    800: "#075985",
    900: "#0c4a6e",
    950: "#082f49"
  },
  blue: {
    50: "#eff6ff",
    100: "#dbeafe",
    200: "#bfdbfe",
    300: "#93c5fd",
    400: "#60a5fa",
    500: "#3b82f6",
    600: "#2563eb",
    700: "#1d4ed8",
    800: "#1e40af",
    900: "#1e3a8a",
    950: "#172554"
  },
  indigo: {
    50: "#eef2ff",
    100: "#e0e7ff",
    200: "#c7d2fe",
    300: "#a5b4fc",
    400: "#818cf8",
    500: "#6366f1",
    600: "#4f46e5",
    700: "#4338ca",
    800: "#3730a3",
    900: "#312e81",
    950: "#1e1b4b"
  },
  violet: {
    50: "#f5f3ff",
    100: "#ede9fe",
    200: "#ddd6fe",
    300: "#c4b5fd",
    400: "#a78bfa",
    500: "#8b5cf6",
    600: "#7c3aed",
    700: "#6d28d9",
    800: "#5b21b6",
    900: "#4c1d95",
    950: "#2e1065"
  },
  purple: {
    50: "#faf5ff",
    100: "#f3e8ff",
    200: "#e9d5ff",
    300: "#d8b4fe",
    400: "#c084fc",
    500: "#a855f7",
    600: "#9333ea",
    700: "#7e22ce",
    800: "#6b21a8",
    900: "#581c87",
    950: "#3b0764"
  },
  fuchsia: {
    50: "#fdf4ff",
    100: "#fae8ff",
    200: "#f5d0fe",
    300: "#f0abfc",
    400: "#e879f9",
    500: "#d946ef",
    600: "#c026d3",
    700: "#a21caf",
    800: "#86198f",
    900: "#701a75",
    950: "#4a044e"
  },
  pink: {
    50: "#fdf2f8",
    100: "#fce7f3",
    200: "#fbcfe8",
    300: "#f9a8d4",
    400: "#f472b6",
    500: "#ec4899",
    600: "#db2777",
    700: "#be185d",
    800: "#9d174d",
    900: "#831843",
    950: "#500724"
  },
  rose: {
    50: "#fff1f2",
    100: "#ffe4e6",
    200: "#fecdd3",
    300: "#fda4af",
    400: "#fb7185",
    500: "#f43f5e",
    600: "#e11d48",
    700: "#be123c",
    800: "#9f1239",
    900: "#881337",
    950: "#4c0519"
  }
};
qi.reduce(
  (E, { color: f, primary: p, secondary: y }) => ({
    ...E,
    [f]: {
      primary: nt[f][p],
      secondary: nt[f][y]
    }
  }),
  {}
);
function ke(E) {
  let f = ["", "k", "M", "G", "T", "P", "E", "Z"], p = 0;
  for (; E > 1e3 && p < f.length - 1; )
    E /= 1e3, p++;
  let y = f[p];
  return (Number.isInteger(E) ? E : E.toFixed(1)) + y;
}
function ze() {
}
function Ki(E, f) {
  return E != E ? f == f : E !== f || E && typeof E == "object" || typeof E == "function";
}
const Ot = typeof window < "u";
let ot = Ot ? () => window.performance.now() : () => Date.now(), Pt = Ot ? (E) => requestAnimationFrame(E) : ze;
const xe = /* @__PURE__ */ new Set();
function It(E) {
  xe.forEach((f) => {
    f.c(E) || (xe.delete(f), f.f());
  }), xe.size !== 0 && Pt(It);
}
function Vi(E) {
  let f;
  return xe.size === 0 && Pt(It), {
    promise: new Promise((p) => {
      xe.add(f = { c: E, f: p });
    }),
    abort() {
      xe.delete(f);
    }
  };
}
const Ee = [];
function Gi(E, f = ze) {
  let p;
  const y = /* @__PURE__ */ new Set();
  function D(i) {
    if (Ki(E, i) && (E = i, p)) {
      const n = !Ee.length;
      for (const o of y)
        o[1](), Ee.push(o, E);
      if (n) {
        for (let o = 0; o < Ee.length; o += 2)
          Ee[o][0](Ee[o + 1]);
        Ee.length = 0;
      }
    }
  }
  function M(i) {
    D(i(E));
  }
  function k(i, n = ze) {
    const o = [i, n];
    return y.add(o), y.size === 1 && (p = f(D, M) || ze), i(E), () => {
      y.delete(o), y.size === 0 && p && (p(), p = null);
    };
  }
  return { set: D, update: M, subscribe: k };
}
function at(E) {
  return Object.prototype.toString.call(E) === "[object Date]";
}
function Je(E, f, p, y) {
  if (typeof p == "number" || at(p)) {
    const D = y - p, M = (p - f) / (E.dt || 1 / 60), k = E.opts.stiffness * D, i = E.opts.damping * M, n = (k - i) * E.inv_mass, o = (M + n) * E.dt;
    return Math.abs(o) < E.opts.precision && Math.abs(D) < E.opts.precision ? y : (E.settled = !1, at(p) ? new Date(p.getTime() + o) : p + o);
  } else {
    if (Array.isArray(p))
      return p.map(
        (D, M) => Je(E, f[M], p[M], y[M])
      );
    if (typeof p == "object") {
      const D = {};
      for (const M in p)
        D[M] = Je(E, f[M], p[M], y[M]);
      return D;
    } else
      throw new Error(`Cannot spring ${typeof p} values`);
  }
}
function ht(E, f = {}) {
  const p = Gi(E), { stiffness: y = 0.15, damping: D = 0.8, precision: M = 0.01 } = f;
  let k, i, n, o = E, c = E, a = 1, d = 0, v = !1;
  function m(s, r = {}) {
    c = s;
    const e = n = {};
    return E == null || r.hard || l.stiffness >= 1 && l.damping >= 1 ? (v = !0, k = ot(), o = s, p.set(E = c), Promise.resolve()) : (r.soft && (d = 1 / ((r.soft === !0 ? 0.5 : +r.soft) * 60), a = 0), i || (k = ot(), v = !1, i = Vi((t) => {
      if (v)
        return v = !1, i = null, !1;
      a = Math.min(a + d, 1);
      const h = {
        inv_mass: a,
        opts: l,
        settled: !0,
        dt: (t - k) * 60 / 1e3
      }, g = Je(h, o, E, c);
      return k = t, o = E, p.set(E = g), h.settled && (i = null), !h.settled;
    })), new Promise((t) => {
      i.promise.then(() => {
        e === n && t();
      });
    }));
  }
  const l = {
    set: m,
    update: (s, r) => m(s(c, E), r),
    subscribe: p.subscribe,
    stiffness: y,
    damping: D,
    precision: M
  };
  return l;
}
const {
  SvelteComponent: Xi,
  append: _e,
  attr: te,
  component_subscribe: lt,
  detach: Ji,
  element: Yi,
  init: Zi,
  insert: Qi,
  noop: ct,
  safe_not_equal: $i,
  set_style: Fe,
  svg_element: de,
  toggle_class: _t
} = window.__gradio__svelte__internal, { onMount: es } = window.__gradio__svelte__internal;
function ts(E) {
  let f, p, y, D, M, k, i, n, o, c, a, d;
  return {
    c() {
      f = Yi("div"), p = de("svg"), y = de("g"), D = de("path"), M = de("path"), k = de("path"), i = de("path"), n = de("g"), o = de("path"), c = de("path"), a = de("path"), d = de("path"), te(D, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), te(D, "fill", "#FF7C00"), te(D, "fill-opacity", "0.4"), te(D, "class", "svelte-43sxxs"), te(M, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), te(M, "fill", "#FF7C00"), te(M, "class", "svelte-43sxxs"), te(k, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), te(k, "fill", "#FF7C00"), te(k, "fill-opacity", "0.4"), te(k, "class", "svelte-43sxxs"), te(i, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), te(i, "fill", "#FF7C00"), te(i, "class", "svelte-43sxxs"), Fe(y, "transform", "translate(" + /*$top*/
      E[1][0] + "px, " + /*$top*/
      E[1][1] + "px)"), te(o, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), te(o, "fill", "#FF7C00"), te(o, "fill-opacity", "0.4"), te(o, "class", "svelte-43sxxs"), te(c, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), te(c, "fill", "#FF7C00"), te(c, "class", "svelte-43sxxs"), te(a, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), te(a, "fill", "#FF7C00"), te(a, "fill-opacity", "0.4"), te(a, "class", "svelte-43sxxs"), te(d, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), te(d, "fill", "#FF7C00"), te(d, "class", "svelte-43sxxs"), Fe(n, "transform", "translate(" + /*$bottom*/
      E[2][0] + "px, " + /*$bottom*/
      E[2][1] + "px)"), te(p, "viewBox", "-1200 -1200 3000 3000"), te(p, "fill", "none"), te(p, "xmlns", "http://www.w3.org/2000/svg"), te(p, "class", "svelte-43sxxs"), te(f, "class", "svelte-43sxxs"), _t(
        f,
        "margin",
        /*margin*/
        E[0]
      );
    },
    m(v, m) {
      Qi(v, f, m), _e(f, p), _e(p, y), _e(y, D), _e(y, M), _e(y, k), _e(y, i), _e(p, n), _e(n, o), _e(n, c), _e(n, a), _e(n, d);
    },
    p(v, [m]) {
      m & /*$top*/
      2 && Fe(y, "transform", "translate(" + /*$top*/
      v[1][0] + "px, " + /*$top*/
      v[1][1] + "px)"), m & /*$bottom*/
      4 && Fe(n, "transform", "translate(" + /*$bottom*/
      v[2][0] + "px, " + /*$bottom*/
      v[2][1] + "px)"), m & /*margin*/
      1 && _t(
        f,
        "margin",
        /*margin*/
        v[0]
      );
    },
    i: ct,
    o: ct,
    d(v) {
      v && Ji(f);
    }
  };
}
function is(E, f, p) {
  let y, D, { margin: M = !0 } = f;
  const k = ht([0, 0]);
  lt(E, k, (d) => p(1, y = d));
  const i = ht([0, 0]);
  lt(E, i, (d) => p(2, D = d));
  let n;
  async function o() {
    await Promise.all([k.set([125, 140]), i.set([-125, -140])]), await Promise.all([k.set([-125, 140]), i.set([125, -140])]), await Promise.all([k.set([-125, 0]), i.set([125, -0])]), await Promise.all([k.set([125, 0]), i.set([-125, 0])]);
  }
  async function c() {
    await o(), n || c();
  }
  async function a() {
    await Promise.all([k.set([125, 0]), i.set([-125, 0])]), c();
  }
  return es(() => (a(), () => n = !0)), E.$$set = (d) => {
    "margin" in d && p(0, M = d.margin);
  }, [M, y, D, k, i];
}
class ss extends Xi {
  constructor(f) {
    super(), Zi(this, f, is, ts, $i, { margin: 0 });
  }
}
const {
  SvelteComponent: rs,
  append: Ce,
  attr: ve,
  binding_callbacks: dt,
  check_outros: Ht,
  create_component: ns,
  create_slot: os,
  destroy_component: as,
  destroy_each: Ft,
  detach: Q,
  element: me,
  empty: Ae,
  ensure_array_like: qe,
  get_all_dirty_from_scope: hs,
  get_slot_changes: ls,
  group_outros: Wt,
  init: cs,
  insert: $,
  mount_component: _s,
  noop: Ye,
  safe_not_equal: ds,
  set_data: ce,
  set_style: be,
  space: ge,
  text: ne,
  toggle_class: le,
  transition_in: De,
  transition_out: Re,
  update_slot_base: us
} = window.__gradio__svelte__internal, { tick: fs } = window.__gradio__svelte__internal, { onDestroy: vs } = window.__gradio__svelte__internal, gs = (E) => ({}), ut = (E) => ({});
function ft(E, f, p) {
  const y = E.slice();
  return y[38] = f[p], y[40] = p, y;
}
function vt(E, f, p) {
  const y = E.slice();
  return y[38] = f[p], y;
}
function ms(E) {
  let f, p = (
    /*i18n*/
    E[1]("common.error") + ""
  ), y, D, M;
  const k = (
    /*#slots*/
    E[29].error
  ), i = os(
    k,
    E,
    /*$$scope*/
    E[28],
    ut
  );
  return {
    c() {
      f = me("span"), y = ne(p), D = ge(), i && i.c(), ve(f, "class", "error svelte-1yserjw");
    },
    m(n, o) {
      $(n, f, o), Ce(f, y), $(n, D, o), i && i.m(n, o), M = !0;
    },
    p(n, o) {
      (!M || o[0] & /*i18n*/
      2) && p !== (p = /*i18n*/
      n[1]("common.error") + "") && ce(y, p), i && i.p && (!M || o[0] & /*$$scope*/
      268435456) && us(
        i,
        k,
        n,
        /*$$scope*/
        n[28],
        M ? ls(
          k,
          /*$$scope*/
          n[28],
          o,
          gs
        ) : hs(
          /*$$scope*/
          n[28]
        ),
        ut
      );
    },
    i(n) {
      M || (De(i, n), M = !0);
    },
    o(n) {
      Re(i, n), M = !1;
    },
    d(n) {
      n && (Q(f), Q(D)), i && i.d(n);
    }
  };
}
function ps(E) {
  let f, p, y, D, M, k, i, n, o, c = (
    /*variant*/
    E[8] === "default" && /*show_eta_bar*/
    E[18] && /*show_progress*/
    E[6] === "full" && gt(E)
  );
  function a(t, h) {
    if (
      /*progress*/
      t[7]
    )
      return Cs;
    if (
      /*queue_position*/
      t[2] !== null && /*queue_size*/
      t[3] !== void 0 && /*queue_position*/
      t[2] >= 0
    )
      return bs;
    if (
      /*queue_position*/
      t[2] === 0
    )
      return Ss;
  }
  let d = a(E), v = d && d(E), m = (
    /*timer*/
    E[5] && St(E)
  );
  const l = [ks, Es], s = [];
  function r(t, h) {
    return (
      /*last_progress_level*/
      t[15] != null ? 0 : (
        /*show_progress*/
        t[6] === "full" ? 1 : -1
      )
    );
  }
  ~(M = r(E)) && (k = s[M] = l[M](E));
  let e = !/*timer*/
  E[5] && Lt(E);
  return {
    c() {
      c && c.c(), f = ge(), p = me("div"), v && v.c(), y = ge(), m && m.c(), D = ge(), k && k.c(), i = ge(), e && e.c(), n = Ae(), ve(p, "class", "progress-text svelte-1yserjw"), le(
        p,
        "meta-text-center",
        /*variant*/
        E[8] === "center"
      ), le(
        p,
        "meta-text",
        /*variant*/
        E[8] === "default"
      );
    },
    m(t, h) {
      c && c.m(t, h), $(t, f, h), $(t, p, h), v && v.m(p, null), Ce(p, y), m && m.m(p, null), $(t, D, h), ~M && s[M].m(t, h), $(t, i, h), e && e.m(t, h), $(t, n, h), o = !0;
    },
    p(t, h) {
      /*variant*/
      t[8] === "default" && /*show_eta_bar*/
      t[18] && /*show_progress*/
      t[6] === "full" ? c ? c.p(t, h) : (c = gt(t), c.c(), c.m(f.parentNode, f)) : c && (c.d(1), c = null), d === (d = a(t)) && v ? v.p(t, h) : (v && v.d(1), v = d && d(t), v && (v.c(), v.m(p, y))), /*timer*/
      t[5] ? m ? m.p(t, h) : (m = St(t), m.c(), m.m(p, null)) : m && (m.d(1), m = null), (!o || h[0] & /*variant*/
      256) && le(
        p,
        "meta-text-center",
        /*variant*/
        t[8] === "center"
      ), (!o || h[0] & /*variant*/
      256) && le(
        p,
        "meta-text",
        /*variant*/
        t[8] === "default"
      );
      let g = M;
      M = r(t), M === g ? ~M && s[M].p(t, h) : (k && (Wt(), Re(s[g], 1, 1, () => {
        s[g] = null;
      }), Ht()), ~M ? (k = s[M], k ? k.p(t, h) : (k = s[M] = l[M](t), k.c()), De(k, 1), k.m(i.parentNode, i)) : k = null), /*timer*/
      t[5] ? e && (e.d(1), e = null) : e ? e.p(t, h) : (e = Lt(t), e.c(), e.m(n.parentNode, n));
    },
    i(t) {
      o || (De(k), o = !0);
    },
    o(t) {
      Re(k), o = !1;
    },
    d(t) {
      t && (Q(f), Q(p), Q(D), Q(i), Q(n)), c && c.d(t), v && v.d(), m && m.d(), ~M && s[M].d(t), e && e.d(t);
    }
  };
}
function gt(E) {
  let f, p = `translateX(${/*eta_level*/
  (E[17] || 0) * 100 - 100}%)`;
  return {
    c() {
      f = me("div"), ve(f, "class", "eta-bar svelte-1yserjw"), be(f, "transform", p);
    },
    m(y, D) {
      $(y, f, D);
    },
    p(y, D) {
      D[0] & /*eta_level*/
      131072 && p !== (p = `translateX(${/*eta_level*/
      (y[17] || 0) * 100 - 100}%)`) && be(f, "transform", p);
    },
    d(y) {
      y && Q(f);
    }
  };
}
function Ss(E) {
  let f;
  return {
    c() {
      f = ne("processing |");
    },
    m(p, y) {
      $(p, f, y);
    },
    p: Ye,
    d(p) {
      p && Q(f);
    }
  };
}
function bs(E) {
  let f, p = (
    /*queue_position*/
    E[2] + 1 + ""
  ), y, D, M, k;
  return {
    c() {
      f = ne("queue: "), y = ne(p), D = ne("/"), M = ne(
        /*queue_size*/
        E[3]
      ), k = ne(" |");
    },
    m(i, n) {
      $(i, f, n), $(i, y, n), $(i, D, n), $(i, M, n), $(i, k, n);
    },
    p(i, n) {
      n[0] & /*queue_position*/
      4 && p !== (p = /*queue_position*/
      i[2] + 1 + "") && ce(y, p), n[0] & /*queue_size*/
      8 && ce(
        M,
        /*queue_size*/
        i[3]
      );
    },
    d(i) {
      i && (Q(f), Q(y), Q(D), Q(M), Q(k));
    }
  };
}
function Cs(E) {
  let f, p = qe(
    /*progress*/
    E[7]
  ), y = [];
  for (let D = 0; D < p.length; D += 1)
    y[D] = pt(vt(E, p, D));
  return {
    c() {
      for (let D = 0; D < y.length; D += 1)
        y[D].c();
      f = Ae();
    },
    m(D, M) {
      for (let k = 0; k < y.length; k += 1)
        y[k] && y[k].m(D, M);
      $(D, f, M);
    },
    p(D, M) {
      if (M[0] & /*progress*/
      128) {
        p = qe(
          /*progress*/
          D[7]
        );
        let k;
        for (k = 0; k < p.length; k += 1) {
          const i = vt(D, p, k);
          y[k] ? y[k].p(i, M) : (y[k] = pt(i), y[k].c(), y[k].m(f.parentNode, f));
        }
        for (; k < y.length; k += 1)
          y[k].d(1);
        y.length = p.length;
      }
    },
    d(D) {
      D && Q(f), Ft(y, D);
    }
  };
}
function mt(E) {
  let f, p = (
    /*p*/
    E[38].unit + ""
  ), y, D, M = " ", k;
  function i(c, a) {
    return (
      /*p*/
      c[38].length != null ? ys : ws
    );
  }
  let n = i(E), o = n(E);
  return {
    c() {
      o.c(), f = ge(), y = ne(p), D = ne(" | "), k = ne(M);
    },
    m(c, a) {
      o.m(c, a), $(c, f, a), $(c, y, a), $(c, D, a), $(c, k, a);
    },
    p(c, a) {
      n === (n = i(c)) && o ? o.p(c, a) : (o.d(1), o = n(c), o && (o.c(), o.m(f.parentNode, f))), a[0] & /*progress*/
      128 && p !== (p = /*p*/
      c[38].unit + "") && ce(y, p);
    },
    d(c) {
      c && (Q(f), Q(y), Q(D), Q(k)), o.d(c);
    }
  };
}
function ws(E) {
  let f = ke(
    /*p*/
    E[38].index || 0
  ) + "", p;
  return {
    c() {
      p = ne(f);
    },
    m(y, D) {
      $(y, p, D);
    },
    p(y, D) {
      D[0] & /*progress*/
      128 && f !== (f = ke(
        /*p*/
        y[38].index || 0
      ) + "") && ce(p, f);
    },
    d(y) {
      y && Q(p);
    }
  };
}
function ys(E) {
  let f = ke(
    /*p*/
    E[38].index || 0
  ) + "", p, y, D = ke(
    /*p*/
    E[38].length
  ) + "", M;
  return {
    c() {
      p = ne(f), y = ne("/"), M = ne(D);
    },
    m(k, i) {
      $(k, p, i), $(k, y, i), $(k, M, i);
    },
    p(k, i) {
      i[0] & /*progress*/
      128 && f !== (f = ke(
        /*p*/
        k[38].index || 0
      ) + "") && ce(p, f), i[0] & /*progress*/
      128 && D !== (D = ke(
        /*p*/
        k[38].length
      ) + "") && ce(M, D);
    },
    d(k) {
      k && (Q(p), Q(y), Q(M));
    }
  };
}
function pt(E) {
  let f, p = (
    /*p*/
    E[38].index != null && mt(E)
  );
  return {
    c() {
      p && p.c(), f = Ae();
    },
    m(y, D) {
      p && p.m(y, D), $(y, f, D);
    },
    p(y, D) {
      /*p*/
      y[38].index != null ? p ? p.p(y, D) : (p = mt(y), p.c(), p.m(f.parentNode, f)) : p && (p.d(1), p = null);
    },
    d(y) {
      y && Q(f), p && p.d(y);
    }
  };
}
function St(E) {
  let f, p = (
    /*eta*/
    E[0] ? `/${/*formatted_eta*/
    E[19]}` : ""
  ), y, D;
  return {
    c() {
      f = ne(
        /*formatted_timer*/
        E[20]
      ), y = ne(p), D = ne("s");
    },
    m(M, k) {
      $(M, f, k), $(M, y, k), $(M, D, k);
    },
    p(M, k) {
      k[0] & /*formatted_timer*/
      1048576 && ce(
        f,
        /*formatted_timer*/
        M[20]
      ), k[0] & /*eta, formatted_eta*/
      524289 && p !== (p = /*eta*/
      M[0] ? `/${/*formatted_eta*/
      M[19]}` : "") && ce(y, p);
    },
    d(M) {
      M && (Q(f), Q(y), Q(D));
    }
  };
}
function Es(E) {
  let f, p;
  return f = new ss({
    props: { margin: (
      /*variant*/
      E[8] === "default"
    ) }
  }), {
    c() {
      ns(f.$$.fragment);
    },
    m(y, D) {
      _s(f, y, D), p = !0;
    },
    p(y, D) {
      const M = {};
      D[0] & /*variant*/
      256 && (M.margin = /*variant*/
      y[8] === "default"), f.$set(M);
    },
    i(y) {
      p || (De(f.$$.fragment, y), p = !0);
    },
    o(y) {
      Re(f.$$.fragment, y), p = !1;
    },
    d(y) {
      as(f, y);
    }
  };
}
function ks(E) {
  let f, p, y, D, M, k = `${/*last_progress_level*/
  E[15] * 100}%`, i = (
    /*progress*/
    E[7] != null && bt(E)
  );
  return {
    c() {
      f = me("div"), p = me("div"), i && i.c(), y = ge(), D = me("div"), M = me("div"), ve(p, "class", "progress-level-inner svelte-1yserjw"), ve(M, "class", "progress-bar svelte-1yserjw"), be(M, "width", k), ve(D, "class", "progress-bar-wrap svelte-1yserjw"), ve(f, "class", "progress-level svelte-1yserjw");
    },
    m(n, o) {
      $(n, f, o), Ce(f, p), i && i.m(p, null), Ce(f, y), Ce(f, D), Ce(D, M), E[30](M);
    },
    p(n, o) {
      /*progress*/
      n[7] != null ? i ? i.p(n, o) : (i = bt(n), i.c(), i.m(p, null)) : i && (i.d(1), i = null), o[0] & /*last_progress_level*/
      32768 && k !== (k = `${/*last_progress_level*/
      n[15] * 100}%`) && be(M, "width", k);
    },
    i: Ye,
    o: Ye,
    d(n) {
      n && Q(f), i && i.d(), E[30](null);
    }
  };
}
function bt(E) {
  let f, p = qe(
    /*progress*/
    E[7]
  ), y = [];
  for (let D = 0; D < p.length; D += 1)
    y[D] = kt(ft(E, p, D));
  return {
    c() {
      for (let D = 0; D < y.length; D += 1)
        y[D].c();
      f = Ae();
    },
    m(D, M) {
      for (let k = 0; k < y.length; k += 1)
        y[k] && y[k].m(D, M);
      $(D, f, M);
    },
    p(D, M) {
      if (M[0] & /*progress_level, progress*/
      16512) {
        p = qe(
          /*progress*/
          D[7]
        );
        let k;
        for (k = 0; k < p.length; k += 1) {
          const i = ft(D, p, k);
          y[k] ? y[k].p(i, M) : (y[k] = kt(i), y[k].c(), y[k].m(f.parentNode, f));
        }
        for (; k < y.length; k += 1)
          y[k].d(1);
        y.length = p.length;
      }
    },
    d(D) {
      D && Q(f), Ft(y, D);
    }
  };
}
function Ct(E) {
  let f, p, y, D, M = (
    /*i*/
    E[40] !== 0 && Ls()
  ), k = (
    /*p*/
    E[38].desc != null && wt(E)
  ), i = (
    /*p*/
    E[38].desc != null && /*progress_level*/
    E[14] && /*progress_level*/
    E[14][
      /*i*/
      E[40]
    ] != null && yt()
  ), n = (
    /*progress_level*/
    E[14] != null && Et(E)
  );
  return {
    c() {
      M && M.c(), f = ge(), k && k.c(), p = ge(), i && i.c(), y = ge(), n && n.c(), D = Ae();
    },
    m(o, c) {
      M && M.m(o, c), $(o, f, c), k && k.m(o, c), $(o, p, c), i && i.m(o, c), $(o, y, c), n && n.m(o, c), $(o, D, c);
    },
    p(o, c) {
      /*p*/
      o[38].desc != null ? k ? k.p(o, c) : (k = wt(o), k.c(), k.m(p.parentNode, p)) : k && (k.d(1), k = null), /*p*/
      o[38].desc != null && /*progress_level*/
      o[14] && /*progress_level*/
      o[14][
        /*i*/
        o[40]
      ] != null ? i || (i = yt(), i.c(), i.m(y.parentNode, y)) : i && (i.d(1), i = null), /*progress_level*/
      o[14] != null ? n ? n.p(o, c) : (n = Et(o), n.c(), n.m(D.parentNode, D)) : n && (n.d(1), n = null);
    },
    d(o) {
      o && (Q(f), Q(p), Q(y), Q(D)), M && M.d(o), k && k.d(o), i && i.d(o), n && n.d(o);
    }
  };
}
function Ls(E) {
  let f;
  return {
    c() {
      f = ne(" /");
    },
    m(p, y) {
      $(p, f, y);
    },
    d(p) {
      p && Q(f);
    }
  };
}
function wt(E) {
  let f = (
    /*p*/
    E[38].desc + ""
  ), p;
  return {
    c() {
      p = ne(f);
    },
    m(y, D) {
      $(y, p, D);
    },
    p(y, D) {
      D[0] & /*progress*/
      128 && f !== (f = /*p*/
      y[38].desc + "") && ce(p, f);
    },
    d(y) {
      y && Q(p);
    }
  };
}
function yt(E) {
  let f;
  return {
    c() {
      f = ne("-");
    },
    m(p, y) {
      $(p, f, y);
    },
    d(p) {
      p && Q(f);
    }
  };
}
function Et(E) {
  let f = (100 * /*progress_level*/
  (E[14][
    /*i*/
    E[40]
  ] || 0)).toFixed(1) + "", p, y;
  return {
    c() {
      p = ne(f), y = ne("%");
    },
    m(D, M) {
      $(D, p, M), $(D, y, M);
    },
    p(D, M) {
      M[0] & /*progress_level*/
      16384 && f !== (f = (100 * /*progress_level*/
      (D[14][
        /*i*/
        D[40]
      ] || 0)).toFixed(1) + "") && ce(p, f);
    },
    d(D) {
      D && (Q(p), Q(y));
    }
  };
}
function kt(E) {
  let f, p = (
    /*p*/
    (E[38].desc != null || /*progress_level*/
    E[14] && /*progress_level*/
    E[14][
      /*i*/
      E[40]
    ] != null) && Ct(E)
  );
  return {
    c() {
      p && p.c(), f = Ae();
    },
    m(y, D) {
      p && p.m(y, D), $(y, f, D);
    },
    p(y, D) {
      /*p*/
      y[38].desc != null || /*progress_level*/
      y[14] && /*progress_level*/
      y[14][
        /*i*/
        y[40]
      ] != null ? p ? p.p(y, D) : (p = Ct(y), p.c(), p.m(f.parentNode, f)) : p && (p.d(1), p = null);
    },
    d(y) {
      y && Q(f), p && p.d(y);
    }
  };
}
function Lt(E) {
  let f, p;
  return {
    c() {
      f = me("p"), p = ne(
        /*loading_text*/
        E[9]
      ), ve(f, "class", "loading svelte-1yserjw");
    },
    m(y, D) {
      $(y, f, D), Ce(f, p);
    },
    p(y, D) {
      D[0] & /*loading_text*/
      512 && ce(
        p,
        /*loading_text*/
        y[9]
      );
    },
    d(y) {
      y && Q(f);
    }
  };
}
function xs(E) {
  let f, p, y, D, M;
  const k = [ps, ms], i = [];
  function n(o, c) {
    return (
      /*status*/
      o[4] === "pending" ? 0 : (
        /*status*/
        o[4] === "error" ? 1 : -1
      )
    );
  }
  return ~(p = n(E)) && (y = i[p] = k[p](E)), {
    c() {
      f = me("div"), y && y.c(), ve(f, "class", D = "wrap " + /*variant*/
      E[8] + " " + /*show_progress*/
      E[6] + " svelte-1yserjw"), le(f, "hide", !/*status*/
      E[4] || /*status*/
      E[4] === "complete" || /*show_progress*/
      E[6] === "hidden"), le(
        f,
        "translucent",
        /*variant*/
        E[8] === "center" && /*status*/
        (E[4] === "pending" || /*status*/
        E[4] === "error") || /*translucent*/
        E[11] || /*show_progress*/
        E[6] === "minimal"
      ), le(
        f,
        "generating",
        /*status*/
        E[4] === "generating"
      ), le(
        f,
        "border",
        /*border*/
        E[12]
      ), be(
        f,
        "position",
        /*absolute*/
        E[10] ? "absolute" : "static"
      ), be(
        f,
        "padding",
        /*absolute*/
        E[10] ? "0" : "var(--size-8) 0"
      );
    },
    m(o, c) {
      $(o, f, c), ~p && i[p].m(f, null), E[31](f), M = !0;
    },
    p(o, c) {
      let a = p;
      p = n(o), p === a ? ~p && i[p].p(o, c) : (y && (Wt(), Re(i[a], 1, 1, () => {
        i[a] = null;
      }), Ht()), ~p ? (y = i[p], y ? y.p(o, c) : (y = i[p] = k[p](o), y.c()), De(y, 1), y.m(f, null)) : y = null), (!M || c[0] & /*variant, show_progress*/
      320 && D !== (D = "wrap " + /*variant*/
      o[8] + " " + /*show_progress*/
      o[6] + " svelte-1yserjw")) && ve(f, "class", D), (!M || c[0] & /*variant, show_progress, status, show_progress*/
      336) && le(f, "hide", !/*status*/
      o[4] || /*status*/
      o[4] === "complete" || /*show_progress*/
      o[6] === "hidden"), (!M || c[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
      2384) && le(
        f,
        "translucent",
        /*variant*/
        o[8] === "center" && /*status*/
        (o[4] === "pending" || /*status*/
        o[4] === "error") || /*translucent*/
        o[11] || /*show_progress*/
        o[6] === "minimal"
      ), (!M || c[0] & /*variant, show_progress, status*/
      336) && le(
        f,
        "generating",
        /*status*/
        o[4] === "generating"
      ), (!M || c[0] & /*variant, show_progress, border*/
      4416) && le(
        f,
        "border",
        /*border*/
        o[12]
      ), c[0] & /*absolute*/
      1024 && be(
        f,
        "position",
        /*absolute*/
        o[10] ? "absolute" : "static"
      ), c[0] & /*absolute*/
      1024 && be(
        f,
        "padding",
        /*absolute*/
        o[10] ? "0" : "var(--size-8) 0"
      );
    },
    i(o) {
      M || (De(y), M = !0);
    },
    o(o) {
      Re(y), M = !1;
    },
    d(o) {
      o && Q(f), ~p && i[p].d(), E[31](null);
    }
  };
}
let We = [], Xe = !1;
async function Ds(E, f = !0) {
  if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && f !== !0)) {
    if (We.push(E), !Xe)
      Xe = !0;
    else
      return;
    await fs(), requestAnimationFrame(() => {
      let p = [0, 0];
      for (let y = 0; y < We.length; y++) {
        const M = We[y].getBoundingClientRect();
        (y === 0 || M.top + window.scrollY <= p[0]) && (p[0] = M.top + window.scrollY, p[1] = y);
      }
      window.scrollTo({ top: p[0] - 20, behavior: "smooth" }), Xe = !1, We = [];
    });
  }
}
function Rs(E, f, p) {
  let y, { $$slots: D = {}, $$scope: M } = f, { i18n: k } = f, { eta: i = null } = f, { queue_position: n } = f, { queue_size: o } = f, { status: c } = f, { scroll_to_output: a = !1 } = f, { timer: d = !0 } = f, { show_progress: v = "full" } = f, { message: m = null } = f, { progress: l = null } = f, { variant: s = "default" } = f, { loading_text: r = "Loading..." } = f, { absolute: e = !0 } = f, { translucent: t = !1 } = f, { border: h = !1 } = f, { autoscroll: g } = f, u, S = !1, _ = 0, b = 0, R = null, B = null, T = 0, L = null, H, W = null, j = !0;
  const V = () => {
    p(0, i = p(26, R = p(19, x = null))), p(24, _ = performance.now()), p(25, b = 0), S = !0, z();
  };
  function z() {
    requestAnimationFrame(() => {
      p(25, b = (performance.now() - _) / 1e3), S && z();
    });
  }
  function C() {
    p(25, b = 0), p(0, i = p(26, R = p(19, x = null))), S && (S = !1);
  }
  vs(() => {
    S && C();
  });
  let x = null;
  function A(I) {
    dt[I ? "unshift" : "push"](() => {
      W = I, p(16, W), p(7, l), p(14, L), p(15, H);
    });
  }
  function O(I) {
    dt[I ? "unshift" : "push"](() => {
      u = I, p(13, u);
    });
  }
  return E.$$set = (I) => {
    "i18n" in I && p(1, k = I.i18n), "eta" in I && p(0, i = I.eta), "queue_position" in I && p(2, n = I.queue_position), "queue_size" in I && p(3, o = I.queue_size), "status" in I && p(4, c = I.status), "scroll_to_output" in I && p(21, a = I.scroll_to_output), "timer" in I && p(5, d = I.timer), "show_progress" in I && p(6, v = I.show_progress), "message" in I && p(22, m = I.message), "progress" in I && p(7, l = I.progress), "variant" in I && p(8, s = I.variant), "loading_text" in I && p(9, r = I.loading_text), "absolute" in I && p(10, e = I.absolute), "translucent" in I && p(11, t = I.translucent), "border" in I && p(12, h = I.border), "autoscroll" in I && p(23, g = I.autoscroll), "$$scope" in I && p(28, M = I.$$scope);
  }, E.$$.update = () => {
    E.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
    218103809 && (i === null && p(0, i = R), i != null && R !== i && (p(27, B = (performance.now() - _) / 1e3 + i), p(19, x = B.toFixed(1)), p(26, R = i))), E.$$.dirty[0] & /*eta_from_start, timer_diff*/
    167772160 && p(17, T = B === null || B <= 0 || !b ? null : Math.min(b / B, 1)), E.$$.dirty[0] & /*progress*/
    128 && l != null && p(18, j = !1), E.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
    114816 && (l != null ? p(14, L = l.map((I) => {
      if (I.index != null && I.length != null)
        return I.index / I.length;
      if (I.progress != null)
        return I.progress;
    })) : p(14, L = null), L ? (p(15, H = L[L.length - 1]), W && (H === 0 ? p(16, W.style.transition = "0", W) : p(16, W.style.transition = "150ms", W))) : p(15, H = void 0)), E.$$.dirty[0] & /*status*/
    16 && (c === "pending" ? V() : C()), E.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
    10493968 && u && a && (c === "pending" || c === "complete") && Ds(u, g), E.$$.dirty[0] & /*status, message*/
    4194320, E.$$.dirty[0] & /*timer_diff*/
    33554432 && p(20, y = b.toFixed(1));
  }, [
    i,
    k,
    n,
    o,
    c,
    d,
    v,
    l,
    s,
    r,
    e,
    t,
    h,
    u,
    L,
    H,
    W,
    T,
    j,
    x,
    y,
    a,
    m,
    g,
    _,
    b,
    R,
    B,
    M,
    D,
    A,
    O
  ];
}
class As extends rs {
  constructor(f) {
    super(), cs(
      this,
      f,
      Rs,
      xs,
      ds,
      {
        i18n: 1,
        eta: 0,
        queue_position: 2,
        queue_size: 3,
        status: 4,
        scroll_to_output: 21,
        timer: 5,
        show_progress: 6,
        message: 22,
        progress: 7,
        variant: 8,
        loading_text: 9,
        absolute: 10,
        translucent: 11,
        border: 12,
        autoscroll: 23
      },
      null,
      [-1, -1]
    );
  }
}
function Nt(E) {
  return E && E.__esModule && Object.prototype.hasOwnProperty.call(E, "default") ? E.default : E;
}
var Ut = { exports: {} };
(function(E, f) {
  (function(p, y) {
    E.exports = y();
  })(globalThis, () => (() => {
    var p = { 4567: function(k, i, n) {
      var o = this && this.__decorate || function(e, t, h, g) {
        var u, S = arguments.length, _ = S < 3 ? t : g === null ? g = Object.getOwnPropertyDescriptor(t, h) : g;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          _ = Reflect.decorate(e, t, h, g);
        else
          for (var b = e.length - 1; b >= 0; b--)
            (u = e[b]) && (_ = (S < 3 ? u(_) : S > 3 ? u(t, h, _) : u(t, h)) || _);
        return S > 3 && _ && Object.defineProperty(t, h, _), _;
      }, c = this && this.__param || function(e, t) {
        return function(h, g) {
          t(h, g, e);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.AccessibilityManager = void 0;
      const a = n(9042), d = n(9924), v = n(844), m = n(4725), l = n(2585), s = n(3656);
      let r = i.AccessibilityManager = class extends v.Disposable {
        constructor(e, t, h, g) {
          super(), this._terminal = e, this._coreBrowserService = h, this._renderService = g, this._rowColumns = /* @__PURE__ */ new WeakMap(), this._liveRegionLineCount = 0, this._charsToConsume = [], this._charsToAnnounce = "", this._accessibilityContainer = this._coreBrowserService.mainDocument.createElement("div"), this._accessibilityContainer.classList.add("xterm-accessibility"), this._rowContainer = this._coreBrowserService.mainDocument.createElement("div"), this._rowContainer.setAttribute("role", "list"), this._rowContainer.classList.add("xterm-accessibility-tree"), this._rowElements = [];
          for (let u = 0; u < this._terminal.rows; u++)
            this._rowElements[u] = this._createAccessibilityTreeNode(), this._rowContainer.appendChild(this._rowElements[u]);
          if (this._topBoundaryFocusListener = (u) => this._handleBoundaryFocus(u, 0), this._bottomBoundaryFocusListener = (u) => this._handleBoundaryFocus(u, 1), this._rowElements[0].addEventListener("focus", this._topBoundaryFocusListener), this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._refreshRowsDimensions(), this._accessibilityContainer.appendChild(this._rowContainer), this._liveRegion = this._coreBrowserService.mainDocument.createElement("div"), this._liveRegion.classList.add("live-region"), this._liveRegion.setAttribute("aria-live", "assertive"), this._accessibilityContainer.appendChild(this._liveRegion), this._liveRegionDebouncer = this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))), !this._terminal.element)
            throw new Error("Cannot enable accessibility before Terminal.open");
          this._terminal.element.insertAdjacentElement("afterbegin", this._accessibilityContainer), this.register(this._terminal.onResize((u) => this._handleResize(u.rows))), this.register(this._terminal.onRender((u) => this._refreshRows(u.start, u.end))), this.register(this._terminal.onScroll(() => this._refreshRows())), this.register(this._terminal.onA11yChar((u) => this._handleChar(u))), this.register(this._terminal.onLineFeed(() => this._handleChar(`
`))), this.register(this._terminal.onA11yTab((u) => this._handleTab(u))), this.register(this._terminal.onKey((u) => this._handleKey(u.key))), this.register(this._terminal.onBlur(() => this._clearLiveRegion())), this.register(this._renderService.onDimensionsChange(() => this._refreshRowsDimensions())), this.register((0, s.addDisposableDomListener)(document, "selectionchange", () => this._handleSelectionChange())), this.register(this._coreBrowserService.onDprChange(() => this._refreshRowsDimensions())), this._refreshRows(), this.register((0, v.toDisposable)(() => {
            this._accessibilityContainer.remove(), this._rowElements.length = 0;
          }));
        }
        _handleTab(e) {
          for (let t = 0; t < e; t++)
            this._handleChar(" ");
        }
        _handleChar(e) {
          this._liveRegionLineCount < 21 && (this._charsToConsume.length > 0 ? this._charsToConsume.shift() !== e && (this._charsToAnnounce += e) : this._charsToAnnounce += e, e === `
` && (this._liveRegionLineCount++, this._liveRegionLineCount === 21 && (this._liveRegion.textContent += a.tooMuchOutput)));
        }
        _clearLiveRegion() {
          this._liveRegion.textContent = "", this._liveRegionLineCount = 0;
        }
        _handleKey(e) {
          this._clearLiveRegion(), new RegExp("\\p{Control}", "u").test(e) || this._charsToConsume.push(e);
        }
        _refreshRows(e, t) {
          this._liveRegionDebouncer.refresh(e, t, this._terminal.rows);
        }
        _renderRows(e, t) {
          const h = this._terminal.buffer, g = h.lines.length.toString();
          for (let u = e; u <= t; u++) {
            const S = h.lines.get(h.ydisp + u), _ = [], b = (S == null ? void 0 : S.translateToString(!0, void 0, void 0, _)) || "", R = (h.ydisp + u + 1).toString(), B = this._rowElements[u];
            B && (b.length === 0 ? (B.innerText = " ", this._rowColumns.set(B, [0, 1])) : (B.textContent = b, this._rowColumns.set(B, _)), B.setAttribute("aria-posinset", R), B.setAttribute("aria-setsize", g));
          }
          this._announceCharacters();
        }
        _announceCharacters() {
          this._charsToAnnounce.length !== 0 && (this._liveRegion.textContent += this._charsToAnnounce, this._charsToAnnounce = "");
        }
        _handleBoundaryFocus(e, t) {
          const h = e.target, g = this._rowElements[t === 0 ? 1 : this._rowElements.length - 2];
          if (h.getAttribute("aria-posinset") === (t === 0 ? "1" : `${this._terminal.buffer.lines.length}`) || e.relatedTarget !== g)
            return;
          let u, S;
          if (t === 0 ? (u = h, S = this._rowElements.pop(), this._rowContainer.removeChild(S)) : (u = this._rowElements.shift(), S = h, this._rowContainer.removeChild(u)), u.removeEventListener("focus", this._topBoundaryFocusListener), S.removeEventListener("focus", this._bottomBoundaryFocusListener), t === 0) {
            const _ = this._createAccessibilityTreeNode();
            this._rowElements.unshift(_), this._rowContainer.insertAdjacentElement("afterbegin", _);
          } else {
            const _ = this._createAccessibilityTreeNode();
            this._rowElements.push(_), this._rowContainer.appendChild(_);
          }
          this._rowElements[0].addEventListener("focus", this._topBoundaryFocusListener), this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._terminal.scrollLines(t === 0 ? -1 : 1), this._rowElements[t === 0 ? 1 : this._rowElements.length - 2].focus(), e.preventDefault(), e.stopImmediatePropagation();
        }
        _handleSelectionChange() {
          var b;
          if (this._rowElements.length === 0)
            return;
          const e = document.getSelection();
          if (!e)
            return;
          if (e.isCollapsed)
            return void (this._rowContainer.contains(e.anchorNode) && this._terminal.clearSelection());
          if (!e.anchorNode || !e.focusNode)
            return void console.error("anchorNode and/or focusNode are null");
          let t = { node: e.anchorNode, offset: e.anchorOffset }, h = { node: e.focusNode, offset: e.focusOffset };
          if ((t.node.compareDocumentPosition(h.node) & Node.DOCUMENT_POSITION_PRECEDING || t.node === h.node && t.offset > h.offset) && ([t, h] = [h, t]), t.node.compareDocumentPosition(this._rowElements[0]) & (Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_FOLLOWING) && (t = { node: this._rowElements[0].childNodes[0], offset: 0 }), !this._rowContainer.contains(t.node))
            return;
          const g = this._rowElements.slice(-1)[0];
          if (h.node.compareDocumentPosition(g) & (Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_PRECEDING) && (h = { node: g, offset: ((b = g.textContent) == null ? void 0 : b.length) ?? 0 }), !this._rowContainer.contains(h.node))
            return;
          const u = ({ node: R, offset: B }) => {
            const T = R instanceof Text ? R.parentNode : R;
            let L = parseInt(T == null ? void 0 : T.getAttribute("aria-posinset"), 10) - 1;
            if (isNaN(L))
              return console.warn("row is invalid. Race condition?"), null;
            const H = this._rowColumns.get(T);
            if (!H)
              return console.warn("columns is null. Race condition?"), null;
            let W = B < H.length ? H[B] : H.slice(-1)[0] + 1;
            return W >= this._terminal.cols && (++L, W = 0), { row: L, column: W };
          }, S = u(t), _ = u(h);
          if (S && _) {
            if (S.row > _.row || S.row === _.row && S.column >= _.column)
              throw new Error("invalid range");
            this._terminal.select(S.column, S.row, (_.row - S.row) * this._terminal.cols - S.column + _.column);
          }
        }
        _handleResize(e) {
          this._rowElements[this._rowElements.length - 1].removeEventListener("focus", this._bottomBoundaryFocusListener);
          for (let t = this._rowContainer.children.length; t < this._terminal.rows; t++)
            this._rowElements[t] = this._createAccessibilityTreeNode(), this._rowContainer.appendChild(this._rowElements[t]);
          for (; this._rowElements.length > e; )
            this._rowContainer.removeChild(this._rowElements.pop());
          this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._refreshRowsDimensions();
        }
        _createAccessibilityTreeNode() {
          const e = this._coreBrowserService.mainDocument.createElement("div");
          return e.setAttribute("role", "listitem"), e.tabIndex = -1, this._refreshRowDimensions(e), e;
        }
        _refreshRowsDimensions() {
          if (this._renderService.dimensions.css.cell.height) {
            this._accessibilityContainer.style.width = `${this._renderService.dimensions.css.canvas.width}px`, this._rowElements.length !== this._terminal.rows && this._handleResize(this._terminal.rows);
            for (let e = 0; e < this._terminal.rows; e++)
              this._refreshRowDimensions(this._rowElements[e]);
          }
        }
        _refreshRowDimensions(e) {
          e.style.height = `${this._renderService.dimensions.css.cell.height}px`;
        }
      };
      i.AccessibilityManager = r = o([c(1, l.IInstantiationService), c(2, m.ICoreBrowserService), c(3, m.IRenderService)], r);
    }, 3614: (k, i) => {
      function n(d) {
        return d.replace(/\r?\n/g, "\r");
      }
      function o(d, v) {
        return v ? "\x1B[200~" + d + "\x1B[201~" : d;
      }
      function c(d, v, m, l) {
        d = o(d = n(d), m.decPrivateModes.bracketedPasteMode && l.rawOptions.ignoreBracketedPasteMode !== !0), m.triggerDataEvent(d, !0), v.value = "";
      }
      function a(d, v, m) {
        const l = m.getBoundingClientRect(), s = d.clientX - l.left - 10, r = d.clientY - l.top - 10;
        v.style.width = "20px", v.style.height = "20px", v.style.left = `${s}px`, v.style.top = `${r}px`, v.style.zIndex = "1000", v.focus();
      }
      Object.defineProperty(i, "__esModule", { value: !0 }), i.rightClickHandler = i.moveTextAreaUnderMouseCursor = i.paste = i.handlePasteEvent = i.copyHandler = i.bracketTextForPaste = i.prepareTextForTerminal = void 0, i.prepareTextForTerminal = n, i.bracketTextForPaste = o, i.copyHandler = function(d, v) {
        d.clipboardData && d.clipboardData.setData("text/plain", v.selectionText), d.preventDefault();
      }, i.handlePasteEvent = function(d, v, m, l) {
        d.stopPropagation(), d.clipboardData && c(d.clipboardData.getData("text/plain"), v, m, l);
      }, i.paste = c, i.moveTextAreaUnderMouseCursor = a, i.rightClickHandler = function(d, v, m, l, s) {
        a(d, v, m), s && l.rightClickSelect(d), v.value = l.selectionText, v.select();
      };
    }, 7239: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.ColorContrastCache = void 0;
      const o = n(1505);
      i.ColorContrastCache = class {
        constructor() {
          this._color = new o.TwoKeyMap(), this._css = new o.TwoKeyMap();
        }
        setCss(c, a, d) {
          this._css.set(c, a, d);
        }
        getCss(c, a) {
          return this._css.get(c, a);
        }
        setColor(c, a, d) {
          this._color.set(c, a, d);
        }
        getColor(c, a) {
          return this._color.get(c, a);
        }
        clear() {
          this._color.clear(), this._css.clear();
        }
      };
    }, 3656: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.addDisposableDomListener = void 0, i.addDisposableDomListener = function(n, o, c, a) {
        n.addEventListener(o, c, a);
        let d = !1;
        return { dispose: () => {
          d || (d = !0, n.removeEventListener(o, c, a));
        } };
      };
    }, 3551: function(k, i, n) {
      var o = this && this.__decorate || function(r, e, t, h) {
        var g, u = arguments.length, S = u < 3 ? e : h === null ? h = Object.getOwnPropertyDescriptor(e, t) : h;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          S = Reflect.decorate(r, e, t, h);
        else
          for (var _ = r.length - 1; _ >= 0; _--)
            (g = r[_]) && (S = (u < 3 ? g(S) : u > 3 ? g(e, t, S) : g(e, t)) || S);
        return u > 3 && S && Object.defineProperty(e, t, S), S;
      }, c = this && this.__param || function(r, e) {
        return function(t, h) {
          e(t, h, r);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.Linkifier = void 0;
      const a = n(3656), d = n(8460), v = n(844), m = n(2585), l = n(4725);
      let s = i.Linkifier = class extends v.Disposable {
        get currentLink() {
          return this._currentLink;
        }
        constructor(r, e, t, h, g) {
          super(), this._element = r, this._mouseService = e, this._renderService = t, this._bufferService = h, this._linkProviderService = g, this._linkCacheDisposables = [], this._isMouseOut = !0, this._wasResized = !1, this._activeLine = -1, this._onShowLinkUnderline = this.register(new d.EventEmitter()), this.onShowLinkUnderline = this._onShowLinkUnderline.event, this._onHideLinkUnderline = this.register(new d.EventEmitter()), this.onHideLinkUnderline = this._onHideLinkUnderline.event, this.register((0, v.getDisposeArrayDisposable)(this._linkCacheDisposables)), this.register((0, v.toDisposable)(() => {
            var u;
            this._lastMouseEvent = void 0, (u = this._activeProviderReplies) == null || u.clear();
          })), this.register(this._bufferService.onResize(() => {
            this._clearCurrentLink(), this._wasResized = !0;
          })), this.register((0, a.addDisposableDomListener)(this._element, "mouseleave", () => {
            this._isMouseOut = !0, this._clearCurrentLink();
          })), this.register((0, a.addDisposableDomListener)(this._element, "mousemove", this._handleMouseMove.bind(this))), this.register((0, a.addDisposableDomListener)(this._element, "mousedown", this._handleMouseDown.bind(this))), this.register((0, a.addDisposableDomListener)(this._element, "mouseup", this._handleMouseUp.bind(this)));
        }
        _handleMouseMove(r) {
          this._lastMouseEvent = r;
          const e = this._positionFromMouseEvent(r, this._element, this._mouseService);
          if (!e)
            return;
          this._isMouseOut = !1;
          const t = r.composedPath();
          for (let h = 0; h < t.length; h++) {
            const g = t[h];
            if (g.classList.contains("xterm"))
              break;
            if (g.classList.contains("xterm-hover"))
              return;
          }
          this._lastBufferCell && e.x === this._lastBufferCell.x && e.y === this._lastBufferCell.y || (this._handleHover(e), this._lastBufferCell = e);
        }
        _handleHover(r) {
          if (this._activeLine !== r.y || this._wasResized)
            return this._clearCurrentLink(), this._askForLink(r, !1), void (this._wasResized = !1);
          this._currentLink && this._linkAtPosition(this._currentLink.link, r) || (this._clearCurrentLink(), this._askForLink(r, !0));
        }
        _askForLink(r, e) {
          var h, g;
          this._activeProviderReplies && e || ((h = this._activeProviderReplies) == null || h.forEach((u) => {
            u == null || u.forEach((S) => {
              S.link.dispose && S.link.dispose();
            });
          }), this._activeProviderReplies = /* @__PURE__ */ new Map(), this._activeLine = r.y);
          let t = !1;
          for (const [u, S] of this._linkProviderService.linkProviders.entries())
            e ? (g = this._activeProviderReplies) != null && g.get(u) && (t = this._checkLinkProviderResult(u, r, t)) : S.provideLinks(r.y, (_) => {
              var R, B;
              if (this._isMouseOut)
                return;
              const b = _ == null ? void 0 : _.map((T) => ({ link: T }));
              (R = this._activeProviderReplies) == null || R.set(u, b), t = this._checkLinkProviderResult(u, r, t), ((B = this._activeProviderReplies) == null ? void 0 : B.size) === this._linkProviderService.linkProviders.length && this._removeIntersectingLinks(r.y, this._activeProviderReplies);
            });
        }
        _removeIntersectingLinks(r, e) {
          const t = /* @__PURE__ */ new Set();
          for (let h = 0; h < e.size; h++) {
            const g = e.get(h);
            if (g)
              for (let u = 0; u < g.length; u++) {
                const S = g[u], _ = S.link.range.start.y < r ? 0 : S.link.range.start.x, b = S.link.range.end.y > r ? this._bufferService.cols : S.link.range.end.x;
                for (let R = _; R <= b; R++) {
                  if (t.has(R)) {
                    g.splice(u--, 1);
                    break;
                  }
                  t.add(R);
                }
              }
          }
        }
        _checkLinkProviderResult(r, e, t) {
          var u;
          if (!this._activeProviderReplies)
            return t;
          const h = this._activeProviderReplies.get(r);
          let g = !1;
          for (let S = 0; S < r; S++)
            this._activeProviderReplies.has(S) && !this._activeProviderReplies.get(S) || (g = !0);
          if (!g && h) {
            const S = h.find((_) => this._linkAtPosition(_.link, e));
            S && (t = !0, this._handleNewLink(S));
          }
          if (this._activeProviderReplies.size === this._linkProviderService.linkProviders.length && !t)
            for (let S = 0; S < this._activeProviderReplies.size; S++) {
              const _ = (u = this._activeProviderReplies.get(S)) == null ? void 0 : u.find((b) => this._linkAtPosition(b.link, e));
              if (_) {
                t = !0, this._handleNewLink(_);
                break;
              }
            }
          return t;
        }
        _handleMouseDown() {
          this._mouseDownLink = this._currentLink;
        }
        _handleMouseUp(r) {
          if (!this._currentLink)
            return;
          const e = this._positionFromMouseEvent(r, this._element, this._mouseService);
          e && this._mouseDownLink === this._currentLink && this._linkAtPosition(this._currentLink.link, e) && this._currentLink.link.activate(r, this._currentLink.link.text);
        }
        _clearCurrentLink(r, e) {
          this._currentLink && this._lastMouseEvent && (!r || !e || this._currentLink.link.range.start.y >= r && this._currentLink.link.range.end.y <= e) && (this._linkLeave(this._element, this._currentLink.link, this._lastMouseEvent), this._currentLink = void 0, (0, v.disposeArray)(this._linkCacheDisposables));
        }
        _handleNewLink(r) {
          if (!this._lastMouseEvent)
            return;
          const e = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService);
          e && this._linkAtPosition(r.link, e) && (this._currentLink = r, this._currentLink.state = { decorations: { underline: r.link.decorations === void 0 || r.link.decorations.underline, pointerCursor: r.link.decorations === void 0 || r.link.decorations.pointerCursor }, isHovered: !0 }, this._linkHover(this._element, r.link, this._lastMouseEvent), r.link.decorations = {}, Object.defineProperties(r.link.decorations, { pointerCursor: { get: () => {
            var t, h;
            return (h = (t = this._currentLink) == null ? void 0 : t.state) == null ? void 0 : h.decorations.pointerCursor;
          }, set: (t) => {
            var h;
            (h = this._currentLink) != null && h.state && this._currentLink.state.decorations.pointerCursor !== t && (this._currentLink.state.decorations.pointerCursor = t, this._currentLink.state.isHovered && this._element.classList.toggle("xterm-cursor-pointer", t));
          } }, underline: { get: () => {
            var t, h;
            return (h = (t = this._currentLink) == null ? void 0 : t.state) == null ? void 0 : h.decorations.underline;
          }, set: (t) => {
            var h, g, u;
            (h = this._currentLink) != null && h.state && ((u = (g = this._currentLink) == null ? void 0 : g.state) == null ? void 0 : u.decorations.underline) !== t && (this._currentLink.state.decorations.underline = t, this._currentLink.state.isHovered && this._fireUnderlineEvent(r.link, t));
          } } }), this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((t) => {
            if (!this._currentLink)
              return;
            const h = t.start === 0 ? 0 : t.start + 1 + this._bufferService.buffer.ydisp, g = this._bufferService.buffer.ydisp + 1 + t.end;
            if (this._currentLink.link.range.start.y >= h && this._currentLink.link.range.end.y <= g && (this._clearCurrentLink(h, g), this._lastMouseEvent)) {
              const u = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService);
              u && this._askForLink(u, !1);
            }
          })));
        }
        _linkHover(r, e, t) {
          var h;
          (h = this._currentLink) != null && h.state && (this._currentLink.state.isHovered = !0, this._currentLink.state.decorations.underline && this._fireUnderlineEvent(e, !0), this._currentLink.state.decorations.pointerCursor && r.classList.add("xterm-cursor-pointer")), e.hover && e.hover(t, e.text);
        }
        _fireUnderlineEvent(r, e) {
          const t = r.range, h = this._bufferService.buffer.ydisp, g = this._createLinkUnderlineEvent(t.start.x - 1, t.start.y - h - 1, t.end.x, t.end.y - h - 1, void 0);
          (e ? this._onShowLinkUnderline : this._onHideLinkUnderline).fire(g);
        }
        _linkLeave(r, e, t) {
          var h;
          (h = this._currentLink) != null && h.state && (this._currentLink.state.isHovered = !1, this._currentLink.state.decorations.underline && this._fireUnderlineEvent(e, !1), this._currentLink.state.decorations.pointerCursor && r.classList.remove("xterm-cursor-pointer")), e.leave && e.leave(t, e.text);
        }
        _linkAtPosition(r, e) {
          const t = r.range.start.y * this._bufferService.cols + r.range.start.x, h = r.range.end.y * this._bufferService.cols + r.range.end.x, g = e.y * this._bufferService.cols + e.x;
          return t <= g && g <= h;
        }
        _positionFromMouseEvent(r, e, t) {
          const h = t.getCoords(r, e, this._bufferService.cols, this._bufferService.rows);
          if (h)
            return { x: h[0], y: h[1] + this._bufferService.buffer.ydisp };
        }
        _createLinkUnderlineEvent(r, e, t, h, g) {
          return { x1: r, y1: e, x2: t, y2: h, cols: this._bufferService.cols, fg: g };
        }
      };
      i.Linkifier = s = o([c(1, l.IMouseService), c(2, l.IRenderService), c(3, m.IBufferService), c(4, l.ILinkProviderService)], s);
    }, 9042: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.tooMuchOutput = i.promptLabel = void 0, i.promptLabel = "Terminal input", i.tooMuchOutput = "Too much output to announce, navigate to rows manually to read";
    }, 3730: function(k, i, n) {
      var o = this && this.__decorate || function(l, s, r, e) {
        var t, h = arguments.length, g = h < 3 ? s : e === null ? e = Object.getOwnPropertyDescriptor(s, r) : e;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          g = Reflect.decorate(l, s, r, e);
        else
          for (var u = l.length - 1; u >= 0; u--)
            (t = l[u]) && (g = (h < 3 ? t(g) : h > 3 ? t(s, r, g) : t(s, r)) || g);
        return h > 3 && g && Object.defineProperty(s, r, g), g;
      }, c = this && this.__param || function(l, s) {
        return function(r, e) {
          s(r, e, l);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.OscLinkProvider = void 0;
      const a = n(511), d = n(2585);
      let v = i.OscLinkProvider = class {
        constructor(l, s, r) {
          this._bufferService = l, this._optionsService = s, this._oscLinkService = r;
        }
        provideLinks(l, s) {
          var b;
          const r = this._bufferService.buffer.lines.get(l - 1);
          if (!r)
            return void s(void 0);
          const e = [], t = this._optionsService.rawOptions.linkHandler, h = new a.CellData(), g = r.getTrimmedLength();
          let u = -1, S = -1, _ = !1;
          for (let R = 0; R < g; R++)
            if (S !== -1 || r.hasContent(R)) {
              if (r.loadCell(R, h), h.hasExtendedAttrs() && h.extended.urlId) {
                if (S === -1) {
                  S = R, u = h.extended.urlId;
                  continue;
                }
                _ = h.extended.urlId !== u;
              } else
                S !== -1 && (_ = !0);
              if (_ || S !== -1 && R === g - 1) {
                const B = (b = this._oscLinkService.getLinkData(u)) == null ? void 0 : b.uri;
                if (B) {
                  const T = { start: { x: S + 1, y: l }, end: { x: R + (_ || R !== g - 1 ? 0 : 1), y: l } };
                  let L = !1;
                  if (!(t != null && t.allowNonHttpProtocols))
                    try {
                      const H = new URL(B);
                      ["http:", "https:"].includes(H.protocol) || (L = !0);
                    } catch {
                      L = !0;
                    }
                  L || e.push({ text: B, range: T, activate: (H, W) => t ? t.activate(H, W, T) : m(0, W), hover: (H, W) => {
                    var j;
                    return (j = t == null ? void 0 : t.hover) == null ? void 0 : j.call(t, H, W, T);
                  }, leave: (H, W) => {
                    var j;
                    return (j = t == null ? void 0 : t.leave) == null ? void 0 : j.call(t, H, W, T);
                  } });
                }
                _ = !1, h.hasExtendedAttrs() && h.extended.urlId ? (S = R, u = h.extended.urlId) : (S = -1, u = -1);
              }
            }
          s(e);
        }
      };
      function m(l, s) {
        if (confirm(`Do you want to navigate to ${s}?

WARNING: This link could potentially be dangerous`)) {
          const r = window.open();
          if (r) {
            try {
              r.opener = null;
            } catch {
            }
            r.location.href = s;
          } else
            console.warn("Opening link blocked as opener could not be cleared");
        }
      }
      i.OscLinkProvider = v = o([c(0, d.IBufferService), c(1, d.IOptionsService), c(2, d.IOscLinkService)], v);
    }, 6193: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.RenderDebouncer = void 0, i.RenderDebouncer = class {
        constructor(n, o) {
          this._renderCallback = n, this._coreBrowserService = o, this._refreshCallbacks = [];
        }
        dispose() {
          this._animationFrame && (this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame), this._animationFrame = void 0);
        }
        addRefreshCallback(n) {
          return this._refreshCallbacks.push(n), this._animationFrame || (this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._innerRefresh())), this._animationFrame;
        }
        refresh(n, o, c) {
          this._rowCount = c, n = n !== void 0 ? n : 0, o = o !== void 0 ? o : this._rowCount - 1, this._rowStart = this._rowStart !== void 0 ? Math.min(this._rowStart, n) : n, this._rowEnd = this._rowEnd !== void 0 ? Math.max(this._rowEnd, o) : o, this._animationFrame || (this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._innerRefresh()));
        }
        _innerRefresh() {
          if (this._animationFrame = void 0, this._rowStart === void 0 || this._rowEnd === void 0 || this._rowCount === void 0)
            return void this._runRefreshCallbacks();
          const n = Math.max(this._rowStart, 0), o = Math.min(this._rowEnd, this._rowCount - 1);
          this._rowStart = void 0, this._rowEnd = void 0, this._renderCallback(n, o), this._runRefreshCallbacks();
        }
        _runRefreshCallbacks() {
          for (const n of this._refreshCallbacks)
            n(0);
          this._refreshCallbacks = [];
        }
      };
    }, 3236: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.Terminal = void 0;
      const o = n(3614), c = n(3656), a = n(3551), d = n(9042), v = n(3730), m = n(1680), l = n(3107), s = n(5744), r = n(2950), e = n(1296), t = n(428), h = n(4269), g = n(5114), u = n(8934), S = n(3230), _ = n(9312), b = n(4725), R = n(6731), B = n(8055), T = n(8969), L = n(8460), H = n(844), W = n(6114), j = n(8437), V = n(2584), z = n(7399), C = n(5941), x = n(9074), A = n(2585), O = n(5435), I = n(4567), q = n(779);
      class X extends T.CoreTerminal {
        get onFocus() {
          return this._onFocus.event;
        }
        get onBlur() {
          return this._onBlur.event;
        }
        get onA11yChar() {
          return this._onA11yCharEmitter.event;
        }
        get onA11yTab() {
          return this._onA11yTabEmitter.event;
        }
        get onWillOpen() {
          return this._onWillOpen.event;
        }
        constructor(P = {}) {
          super(P), this.browser = W, this._keyDownHandled = !1, this._keyDownSeen = !1, this._keyPressHandled = !1, this._unprocessedDeadKey = !1, this._accessibilityManager = this.register(new H.MutableDisposable()), this._onCursorMove = this.register(new L.EventEmitter()), this.onCursorMove = this._onCursorMove.event, this._onKey = this.register(new L.EventEmitter()), this.onKey = this._onKey.event, this._onRender = this.register(new L.EventEmitter()), this.onRender = this._onRender.event, this._onSelectionChange = this.register(new L.EventEmitter()), this.onSelectionChange = this._onSelectionChange.event, this._onTitleChange = this.register(new L.EventEmitter()), this.onTitleChange = this._onTitleChange.event, this._onBell = this.register(new L.EventEmitter()), this.onBell = this._onBell.event, this._onFocus = this.register(new L.EventEmitter()), this._onBlur = this.register(new L.EventEmitter()), this._onA11yCharEmitter = this.register(new L.EventEmitter()), this._onA11yTabEmitter = this.register(new L.EventEmitter()), this._onWillOpen = this.register(new L.EventEmitter()), this._setup(), this._decorationService = this._instantiationService.createInstance(x.DecorationService), this._instantiationService.setService(A.IDecorationService, this._decorationService), this._linkProviderService = this._instantiationService.createInstance(q.LinkProviderService), this._instantiationService.setService(b.ILinkProviderService, this._linkProviderService), this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)), this.register(this._inputHandler.onRequestBell(() => this._onBell.fire())), this.register(this._inputHandler.onRequestRefreshRows((w, U) => this.refresh(w, U))), this.register(this._inputHandler.onRequestSendFocus(() => this._reportFocus())), this.register(this._inputHandler.onRequestReset(() => this.reset())), this.register(this._inputHandler.onRequestWindowsOptionsReport((w) => this._reportWindowsOptions(w))), this.register(this._inputHandler.onColor((w) => this._handleColorEvent(w))), this.register((0, L.forwardEvent)(this._inputHandler.onCursorMove, this._onCursorMove)), this.register((0, L.forwardEvent)(this._inputHandler.onTitleChange, this._onTitleChange)), this.register((0, L.forwardEvent)(this._inputHandler.onA11yChar, this._onA11yCharEmitter)), this.register((0, L.forwardEvent)(this._inputHandler.onA11yTab, this._onA11yTabEmitter)), this.register(this._bufferService.onResize((w) => this._afterResize(w.cols, w.rows))), this.register((0, H.toDisposable)(() => {
            var w, U;
            this._customKeyEventHandler = void 0, (U = (w = this.element) == null ? void 0 : w.parentNode) == null || U.removeChild(this.element);
          }));
        }
        _handleColorEvent(P) {
          if (this._themeService)
            for (const w of P) {
              let U, F = "";
              switch (w.index) {
                case 256:
                  U = "foreground", F = "10";
                  break;
                case 257:
                  U = "background", F = "11";
                  break;
                case 258:
                  U = "cursor", F = "12";
                  break;
                default:
                  U = "ansi", F = "4;" + w.index;
              }
              switch (w.type) {
                case 0:
                  const G = B.color.toColorRGB(U === "ansi" ? this._themeService.colors.ansi[w.index] : this._themeService.colors[U]);
                  this.coreService.triggerDataEvent(`${V.C0.ESC}]${F};${(0, C.toRgbString)(G)}${V.C1_ESCAPED.ST}`);
                  break;
                case 1:
                  if (U === "ansi")
                    this._themeService.modifyColors((K) => K.ansi[w.index] = B.channels.toColor(...w.color));
                  else {
                    const K = U;
                    this._themeService.modifyColors((ee) => ee[K] = B.channels.toColor(...w.color));
                  }
                  break;
                case 2:
                  this._themeService.restoreColor(w.index);
              }
            }
        }
        _setup() {
          super._setup(), this._customKeyEventHandler = void 0;
        }
        get buffer() {
          return this.buffers.active;
        }
        focus() {
          this.textarea && this.textarea.focus({ preventScroll: !0 });
        }
        _handleScreenReaderModeOptionChange(P) {
          P ? !this._accessibilityManager.value && this._renderService && (this._accessibilityManager.value = this._instantiationService.createInstance(I.AccessibilityManager, this)) : this._accessibilityManager.clear();
        }
        _handleTextAreaFocus(P) {
          this.coreService.decPrivateModes.sendFocus && this.coreService.triggerDataEvent(V.C0.ESC + "[I"), this.element.classList.add("focus"), this._showCursor(), this._onFocus.fire();
        }
        blur() {
          var P;
          return (P = this.textarea) == null ? void 0 : P.blur();
        }
        _handleTextAreaBlur() {
          this.textarea.value = "", this.refresh(this.buffer.y, this.buffer.y), this.coreService.decPrivateModes.sendFocus && this.coreService.triggerDataEvent(V.C0.ESC + "[O"), this.element.classList.remove("focus"), this._onBlur.fire();
        }
        _syncTextArea() {
          if (!this.textarea || !this.buffer.isCursorInViewport || this._compositionHelper.isComposing || !this._renderService)
            return;
          const P = this.buffer.ybase + this.buffer.y, w = this.buffer.lines.get(P);
          if (!w)
            return;
          const U = Math.min(this.buffer.x, this.cols - 1), F = this._renderService.dimensions.css.cell.height, G = w.getWidth(U), K = this._renderService.dimensions.css.cell.width * G, ee = this.buffer.y * this._renderService.dimensions.css.cell.height, se = U * this._renderService.dimensions.css.cell.width;
          this.textarea.style.left = se + "px", this.textarea.style.top = ee + "px", this.textarea.style.width = K + "px", this.textarea.style.height = F + "px", this.textarea.style.lineHeight = F + "px", this.textarea.style.zIndex = "-5";
        }
        _initGlobal() {
          this._bindKeys(), this.register((0, c.addDisposableDomListener)(this.element, "copy", (w) => {
            this.hasSelection() && (0, o.copyHandler)(w, this._selectionService);
          }));
          const P = (w) => (0, o.handlePasteEvent)(w, this.textarea, this.coreService, this.optionsService);
          this.register((0, c.addDisposableDomListener)(this.textarea, "paste", P)), this.register((0, c.addDisposableDomListener)(this.element, "paste", P)), W.isFirefox ? this.register((0, c.addDisposableDomListener)(this.element, "mousedown", (w) => {
            w.button === 2 && (0, o.rightClickHandler)(w, this.textarea, this.screenElement, this._selectionService, this.options.rightClickSelectsWord);
          })) : this.register((0, c.addDisposableDomListener)(this.element, "contextmenu", (w) => {
            (0, o.rightClickHandler)(w, this.textarea, this.screenElement, this._selectionService, this.options.rightClickSelectsWord);
          })), W.isLinux && this.register((0, c.addDisposableDomListener)(this.element, "auxclick", (w) => {
            w.button === 1 && (0, o.moveTextAreaUnderMouseCursor)(w, this.textarea, this.screenElement);
          }));
        }
        _bindKeys() {
          this.register((0, c.addDisposableDomListener)(this.textarea, "keyup", (P) => this._keyUp(P), !0)), this.register((0, c.addDisposableDomListener)(this.textarea, "keydown", (P) => this._keyDown(P), !0)), this.register((0, c.addDisposableDomListener)(this.textarea, "keypress", (P) => this._keyPress(P), !0)), this.register((0, c.addDisposableDomListener)(this.textarea, "compositionstart", () => this._compositionHelper.compositionstart())), this.register((0, c.addDisposableDomListener)(this.textarea, "compositionupdate", (P) => this._compositionHelper.compositionupdate(P))), this.register((0, c.addDisposableDomListener)(this.textarea, "compositionend", () => this._compositionHelper.compositionend())), this.register((0, c.addDisposableDomListener)(this.textarea, "input", (P) => this._inputEvent(P), !0)), this.register(this.onRender(() => this._compositionHelper.updateCompositionElements()));
        }
        open(P) {
          var U;
          if (!P)
            throw new Error("Terminal requires a parent element.");
          if (P.isConnected || this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"), ((U = this.element) == null ? void 0 : U.ownerDocument.defaultView) && this._coreBrowserService)
            return void (this.element.ownerDocument.defaultView !== this._coreBrowserService.window && (this._coreBrowserService.window = this.element.ownerDocument.defaultView));
          this._document = P.ownerDocument, this.options.documentOverride && this.options.documentOverride instanceof Document && (this._document = this.optionsService.rawOptions.documentOverride), this.element = this._document.createElement("div"), this.element.dir = "ltr", this.element.classList.add("terminal"), this.element.classList.add("xterm"), P.appendChild(this.element);
          const w = this._document.createDocumentFragment();
          this._viewportElement = this._document.createElement("div"), this._viewportElement.classList.add("xterm-viewport"), w.appendChild(this._viewportElement), this._viewportScrollArea = this._document.createElement("div"), this._viewportScrollArea.classList.add("xterm-scroll-area"), this._viewportElement.appendChild(this._viewportScrollArea), this.screenElement = this._document.createElement("div"), this.screenElement.classList.add("xterm-screen"), this.register((0, c.addDisposableDomListener)(this.screenElement, "mousemove", (F) => this.updateCursorStyle(F))), this._helperContainer = this._document.createElement("div"), this._helperContainer.classList.add("xterm-helpers"), this.screenElement.appendChild(this._helperContainer), w.appendChild(this.screenElement), this.textarea = this._document.createElement("textarea"), this.textarea.classList.add("xterm-helper-textarea"), this.textarea.setAttribute("aria-label", d.promptLabel), W.isChromeOS || this.textarea.setAttribute("aria-multiline", "false"), this.textarea.setAttribute("autocorrect", "off"), this.textarea.setAttribute("autocapitalize", "off"), this.textarea.setAttribute("spellcheck", "false"), this.textarea.tabIndex = 0, this._coreBrowserService = this.register(this._instantiationService.createInstance(g.CoreBrowserService, this.textarea, P.ownerDocument.defaultView ?? window, this._document ?? typeof window < "u" ? window.document : null)), this._instantiationService.setService(b.ICoreBrowserService, this._coreBrowserService), this.register((0, c.addDisposableDomListener)(this.textarea, "focus", (F) => this._handleTextAreaFocus(F))), this.register((0, c.addDisposableDomListener)(this.textarea, "blur", () => this._handleTextAreaBlur())), this._helperContainer.appendChild(this.textarea), this._charSizeService = this._instantiationService.createInstance(t.CharSizeService, this._document, this._helperContainer), this._instantiationService.setService(b.ICharSizeService, this._charSizeService), this._themeService = this._instantiationService.createInstance(R.ThemeService), this._instantiationService.setService(b.IThemeService, this._themeService), this._characterJoinerService = this._instantiationService.createInstance(h.CharacterJoinerService), this._instantiationService.setService(b.ICharacterJoinerService, this._characterJoinerService), this._renderService = this.register(this._instantiationService.createInstance(S.RenderService, this.rows, this.screenElement)), this._instantiationService.setService(b.IRenderService, this._renderService), this.register(this._renderService.onRenderedViewportChange((F) => this._onRender.fire(F))), this.onResize((F) => this._renderService.resize(F.cols, F.rows)), this._compositionView = this._document.createElement("div"), this._compositionView.classList.add("composition-view"), this._compositionHelper = this._instantiationService.createInstance(r.CompositionHelper, this.textarea, this._compositionView), this._helperContainer.appendChild(this._compositionView), this._mouseService = this._instantiationService.createInstance(u.MouseService), this._instantiationService.setService(b.IMouseService, this._mouseService), this.linkifier = this.register(this._instantiationService.createInstance(a.Linkifier, this.screenElement)), this.element.appendChild(w);
          try {
            this._onWillOpen.fire(this.element);
          } catch {
          }
          this._renderService.hasRenderer() || this._renderService.setRenderer(this._createRenderer()), this.viewport = this._instantiationService.createInstance(m.Viewport, this._viewportElement, this._viewportScrollArea), this.viewport.onRequestScrollLines((F) => this.scrollLines(F.amount, F.suppressScrollEvent, 1)), this.register(this._inputHandler.onRequestSyncScrollBar(() => this.viewport.syncScrollArea())), this.register(this.viewport), this.register(this.onCursorMove(() => {
            this._renderService.handleCursorMove(), this._syncTextArea();
          })), this.register(this.onResize(() => this._renderService.handleResize(this.cols, this.rows))), this.register(this.onBlur(() => this._renderService.handleBlur())), this.register(this.onFocus(() => this._renderService.handleFocus())), this.register(this._renderService.onDimensionsChange(() => this.viewport.syncScrollArea())), this._selectionService = this.register(this._instantiationService.createInstance(_.SelectionService, this.element, this.screenElement, this.linkifier)), this._instantiationService.setService(b.ISelectionService, this._selectionService), this.register(this._selectionService.onRequestScrollLines((F) => this.scrollLines(F.amount, F.suppressScrollEvent))), this.register(this._selectionService.onSelectionChange(() => this._onSelectionChange.fire())), this.register(this._selectionService.onRequestRedraw((F) => this._renderService.handleSelectionChanged(F.start, F.end, F.columnSelectMode))), this.register(this._selectionService.onLinuxMouseSelection((F) => {
            this.textarea.value = F, this.textarea.focus(), this.textarea.select();
          })), this.register(this._onScroll.event((F) => {
            this.viewport.syncScrollArea(), this._selectionService.refresh();
          })), this.register((0, c.addDisposableDomListener)(this._viewportElement, "scroll", () => this._selectionService.refresh())), this.register(this._instantiationService.createInstance(l.BufferDecorationRenderer, this.screenElement)), this.register((0, c.addDisposableDomListener)(this.element, "mousedown", (F) => this._selectionService.handleMouseDown(F))), this.coreMouseService.areMouseEventsActive ? (this._selectionService.disable(), this.element.classList.add("enable-mouse-events")) : this._selectionService.enable(), this.options.screenReaderMode && (this._accessibilityManager.value = this._instantiationService.createInstance(I.AccessibilityManager, this)), this.register(this.optionsService.onSpecificOptionChange("screenReaderMode", (F) => this._handleScreenReaderModeOptionChange(F))), this.options.overviewRulerWidth && (this._overviewRulerRenderer = this.register(this._instantiationService.createInstance(s.OverviewRulerRenderer, this._viewportElement, this.screenElement))), this.optionsService.onSpecificOptionChange("overviewRulerWidth", (F) => {
            !this._overviewRulerRenderer && F && this._viewportElement && this.screenElement && (this._overviewRulerRenderer = this.register(this._instantiationService.createInstance(s.OverviewRulerRenderer, this._viewportElement, this.screenElement)));
          }), this._charSizeService.measure(), this.refresh(0, this.rows - 1), this._initGlobal(), this.bindMouse();
        }
        _createRenderer() {
          return this._instantiationService.createInstance(e.DomRenderer, this, this._document, this.element, this.screenElement, this._viewportElement, this._helperContainer, this.linkifier);
        }
        bindMouse() {
          const P = this, w = this.element;
          function U(K) {
            const ee = P._mouseService.getMouseReportCoords(K, P.screenElement);
            if (!ee)
              return !1;
            let se, ie;
            switch (K.overrideType || K.type) {
              case "mousemove":
                ie = 32, K.buttons === void 0 ? (se = 3, K.button !== void 0 && (se = K.button < 3 ? K.button : 3)) : se = 1 & K.buttons ? 0 : 4 & K.buttons ? 1 : 2 & K.buttons ? 2 : 3;
                break;
              case "mouseup":
                ie = 0, se = K.button < 3 ? K.button : 3;
                break;
              case "mousedown":
                ie = 1, se = K.button < 3 ? K.button : 3;
                break;
              case "wheel":
                if (P._customWheelEventHandler && P._customWheelEventHandler(K) === !1 || P.viewport.getLinesScrolled(K) === 0)
                  return !1;
                ie = K.deltaY < 0 ? 0 : 1, se = 4;
                break;
              default:
                return !1;
            }
            return !(ie === void 0 || se === void 0 || se > 4) && P.coreMouseService.triggerMouseEvent({ col: ee.col, row: ee.row, x: ee.x, y: ee.y, button: se, action: ie, ctrl: K.ctrlKey, alt: K.altKey, shift: K.shiftKey });
          }
          const F = { mouseup: null, wheel: null, mousedrag: null, mousemove: null }, G = { mouseup: (K) => (U(K), K.buttons || (this._document.removeEventListener("mouseup", F.mouseup), F.mousedrag && this._document.removeEventListener("mousemove", F.mousedrag)), this.cancel(K)), wheel: (K) => (U(K), this.cancel(K, !0)), mousedrag: (K) => {
            K.buttons && U(K);
          }, mousemove: (K) => {
            K.buttons || U(K);
          } };
          this.register(this.coreMouseService.onProtocolChange((K) => {
            K ? (this.optionsService.rawOptions.logLevel === "debug" && this._logService.debug("Binding to mouse events:", this.coreMouseService.explainEvents(K)), this.element.classList.add("enable-mouse-events"), this._selectionService.disable()) : (this._logService.debug("Unbinding from mouse events."), this.element.classList.remove("enable-mouse-events"), this._selectionService.enable()), 8 & K ? F.mousemove || (w.addEventListener("mousemove", G.mousemove), F.mousemove = G.mousemove) : (w.removeEventListener("mousemove", F.mousemove), F.mousemove = null), 16 & K ? F.wheel || (w.addEventListener("wheel", G.wheel, { passive: !1 }), F.wheel = G.wheel) : (w.removeEventListener("wheel", F.wheel), F.wheel = null), 2 & K ? F.mouseup || (F.mouseup = G.mouseup) : (this._document.removeEventListener("mouseup", F.mouseup), F.mouseup = null), 4 & K ? F.mousedrag || (F.mousedrag = G.mousedrag) : (this._document.removeEventListener("mousemove", F.mousedrag), F.mousedrag = null);
          })), this.coreMouseService.activeProtocol = this.coreMouseService.activeProtocol, this.register((0, c.addDisposableDomListener)(w, "mousedown", (K) => {
            if (K.preventDefault(), this.focus(), this.coreMouseService.areMouseEventsActive && !this._selectionService.shouldForceSelection(K))
              return U(K), F.mouseup && this._document.addEventListener("mouseup", F.mouseup), F.mousedrag && this._document.addEventListener("mousemove", F.mousedrag), this.cancel(K);
          })), this.register((0, c.addDisposableDomListener)(w, "wheel", (K) => {
            if (!F.wheel) {
              if (this._customWheelEventHandler && this._customWheelEventHandler(K) === !1)
                return !1;
              if (!this.buffer.hasScrollback) {
                const ee = this.viewport.getLinesScrolled(K);
                if (ee === 0)
                  return;
                const se = V.C0.ESC + (this.coreService.decPrivateModes.applicationCursorKeys ? "O" : "[") + (K.deltaY < 0 ? "A" : "B");
                let ie = "";
                for (let oe = 0; oe < Math.abs(ee); oe++)
                  ie += se;
                return this.coreService.triggerDataEvent(ie, !0), this.cancel(K, !0);
              }
              return this.viewport.handleWheel(K) ? this.cancel(K) : void 0;
            }
          }, { passive: !1 })), this.register((0, c.addDisposableDomListener)(w, "touchstart", (K) => {
            if (!this.coreMouseService.areMouseEventsActive)
              return this.viewport.handleTouchStart(K), this.cancel(K);
          }, { passive: !0 })), this.register((0, c.addDisposableDomListener)(w, "touchmove", (K) => {
            if (!this.coreMouseService.areMouseEventsActive)
              return this.viewport.handleTouchMove(K) ? void 0 : this.cancel(K);
          }, { passive: !1 }));
        }
        refresh(P, w) {
          var U;
          (U = this._renderService) == null || U.refreshRows(P, w);
        }
        updateCursorStyle(P) {
          var w;
          (w = this._selectionService) != null && w.shouldColumnSelect(P) ? this.element.classList.add("column-select") : this.element.classList.remove("column-select");
        }
        _showCursor() {
          this.coreService.isCursorInitialized || (this.coreService.isCursorInitialized = !0, this.refresh(this.buffer.y, this.buffer.y));
        }
        scrollLines(P, w, U = 0) {
          var F;
          U === 1 ? (super.scrollLines(P, w, U), this.refresh(0, this.rows - 1)) : (F = this.viewport) == null || F.scrollLines(P);
        }
        paste(P) {
          (0, o.paste)(P, this.textarea, this.coreService, this.optionsService);
        }
        attachCustomKeyEventHandler(P) {
          this._customKeyEventHandler = P;
        }
        attachCustomWheelEventHandler(P) {
          this._customWheelEventHandler = P;
        }
        registerLinkProvider(P) {
          return this._linkProviderService.registerLinkProvider(P);
        }
        registerCharacterJoiner(P) {
          if (!this._characterJoinerService)
            throw new Error("Terminal must be opened first");
          const w = this._characterJoinerService.register(P);
          return this.refresh(0, this.rows - 1), w;
        }
        deregisterCharacterJoiner(P) {
          if (!this._characterJoinerService)
            throw new Error("Terminal must be opened first");
          this._characterJoinerService.deregister(P) && this.refresh(0, this.rows - 1);
        }
        get markers() {
          return this.buffer.markers;
        }
        registerMarker(P) {
          return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + P);
        }
        registerDecoration(P) {
          return this._decorationService.registerDecoration(P);
        }
        hasSelection() {
          return !!this._selectionService && this._selectionService.hasSelection;
        }
        select(P, w, U) {
          this._selectionService.setSelection(P, w, U);
        }
        getSelection() {
          return this._selectionService ? this._selectionService.selectionText : "";
        }
        getSelectionPosition() {
          if (this._selectionService && this._selectionService.hasSelection)
            return { start: { x: this._selectionService.selectionStart[0], y: this._selectionService.selectionStart[1] }, end: { x: this._selectionService.selectionEnd[0], y: this._selectionService.selectionEnd[1] } };
        }
        clearSelection() {
          var P;
          (P = this._selectionService) == null || P.clearSelection();
        }
        selectAll() {
          var P;
          (P = this._selectionService) == null || P.selectAll();
        }
        selectLines(P, w) {
          var U;
          (U = this._selectionService) == null || U.selectLines(P, w);
        }
        _keyDown(P) {
          if (this._keyDownHandled = !1, this._keyDownSeen = !0, this._customKeyEventHandler && this._customKeyEventHandler(P) === !1)
            return !1;
          const w = this.browser.isMac && this.options.macOptionIsMeta && P.altKey;
          if (!w && !this._compositionHelper.keydown(P))
            return this.options.scrollOnUserInput && this.buffer.ybase !== this.buffer.ydisp && this.scrollToBottom(), !1;
          w || P.key !== "Dead" && P.key !== "AltGraph" || (this._unprocessedDeadKey = !0);
          const U = (0, z.evaluateKeyboardEvent)(P, this.coreService.decPrivateModes.applicationCursorKeys, this.browser.isMac, this.options.macOptionIsMeta);
          if (this.updateCursorStyle(P), U.type === 3 || U.type === 2) {
            const F = this.rows - 1;
            return this.scrollLines(U.type === 2 ? -F : F), this.cancel(P, !0);
          }
          return U.type === 1 && this.selectAll(), !!this._isThirdLevelShift(this.browser, P) || (U.cancel && this.cancel(P, !0), !U.key || !!(P.key && !P.ctrlKey && !P.altKey && !P.metaKey && P.key.length === 1 && P.key.charCodeAt(0) >= 65 && P.key.charCodeAt(0) <= 90) || (this._unprocessedDeadKey ? (this._unprocessedDeadKey = !1, !0) : (U.key !== V.C0.ETX && U.key !== V.C0.CR || (this.textarea.value = ""), this._onKey.fire({ key: U.key, domEvent: P }), this._showCursor(), this.coreService.triggerDataEvent(U.key, !0), !this.optionsService.rawOptions.screenReaderMode || P.altKey || P.ctrlKey ? this.cancel(P, !0) : void (this._keyDownHandled = !0))));
        }
        _isThirdLevelShift(P, w) {
          const U = P.isMac && !this.options.macOptionIsMeta && w.altKey && !w.ctrlKey && !w.metaKey || P.isWindows && w.altKey && w.ctrlKey && !w.metaKey || P.isWindows && w.getModifierState("AltGraph");
          return w.type === "keypress" ? U : U && (!w.keyCode || w.keyCode > 47);
        }
        _keyUp(P) {
          this._keyDownSeen = !1, this._customKeyEventHandler && this._customKeyEventHandler(P) === !1 || (function(w) {
            return w.keyCode === 16 || w.keyCode === 17 || w.keyCode === 18;
          }(P) || this.focus(), this.updateCursorStyle(P), this._keyPressHandled = !1);
        }
        _keyPress(P) {
          let w;
          if (this._keyPressHandled = !1, this._keyDownHandled || this._customKeyEventHandler && this._customKeyEventHandler(P) === !1)
            return !1;
          if (this.cancel(P), P.charCode)
            w = P.charCode;
          else if (P.which === null || P.which === void 0)
            w = P.keyCode;
          else {
            if (P.which === 0 || P.charCode === 0)
              return !1;
            w = P.which;
          }
          return !(!w || (P.altKey || P.ctrlKey || P.metaKey) && !this._isThirdLevelShift(this.browser, P) || (w = String.fromCharCode(w), this._onKey.fire({ key: w, domEvent: P }), this._showCursor(), this.coreService.triggerDataEvent(w, !0), this._keyPressHandled = !0, this._unprocessedDeadKey = !1, 0));
        }
        _inputEvent(P) {
          if (P.data && P.inputType === "insertText" && (!P.composed || !this._keyDownSeen) && !this.optionsService.rawOptions.screenReaderMode) {
            if (this._keyPressHandled)
              return !1;
            this._unprocessedDeadKey = !1;
            const w = P.data;
            return this.coreService.triggerDataEvent(w, !0), this.cancel(P), !0;
          }
          return !1;
        }
        resize(P, w) {
          P !== this.cols || w !== this.rows ? super.resize(P, w) : this._charSizeService && !this._charSizeService.hasValidSize && this._charSizeService.measure();
        }
        _afterResize(P, w) {
          var U, F;
          (U = this._charSizeService) == null || U.measure(), (F = this.viewport) == null || F.syncScrollArea(!0);
        }
        clear() {
          var P;
          if (this.buffer.ybase !== 0 || this.buffer.y !== 0) {
            this.buffer.clearAllMarkers(), this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y)), this.buffer.lines.length = 1, this.buffer.ydisp = 0, this.buffer.ybase = 0, this.buffer.y = 0;
            for (let w = 1; w < this.rows; w++)
              this.buffer.lines.push(this.buffer.getBlankLine(j.DEFAULT_ATTR_DATA));
            this._onScroll.fire({ position: this.buffer.ydisp, source: 0 }), (P = this.viewport) == null || P.reset(), this.refresh(0, this.rows - 1);
          }
        }
        reset() {
          var w, U;
          this.options.rows = this.rows, this.options.cols = this.cols;
          const P = this._customKeyEventHandler;
          this._setup(), super.reset(), (w = this._selectionService) == null || w.reset(), this._decorationService.reset(), (U = this.viewport) == null || U.reset(), this._customKeyEventHandler = P, this.refresh(0, this.rows - 1);
        }
        clearTextureAtlas() {
          var P;
          (P = this._renderService) == null || P.clearTextureAtlas();
        }
        _reportFocus() {
          var P;
          (P = this.element) != null && P.classList.contains("focus") ? this.coreService.triggerDataEvent(V.C0.ESC + "[I") : this.coreService.triggerDataEvent(V.C0.ESC + "[O");
        }
        _reportWindowsOptions(P) {
          if (this._renderService)
            switch (P) {
              case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:
                const w = this._renderService.dimensions.css.canvas.width.toFixed(0), U = this._renderService.dimensions.css.canvas.height.toFixed(0);
                this.coreService.triggerDataEvent(`${V.C0.ESC}[4;${U};${w}t`);
                break;
              case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:
                const F = this._renderService.dimensions.css.cell.width.toFixed(0), G = this._renderService.dimensions.css.cell.height.toFixed(0);
                this.coreService.triggerDataEvent(`${V.C0.ESC}[6;${G};${F}t`);
            }
        }
        cancel(P, w) {
          if (this.options.cancelEvents || w)
            return P.preventDefault(), P.stopPropagation(), !1;
        }
      }
      i.Terminal = X;
    }, 9924: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.TimeBasedDebouncer = void 0, i.TimeBasedDebouncer = class {
        constructor(n, o = 1e3) {
          this._renderCallback = n, this._debounceThresholdMS = o, this._lastRefreshMs = 0, this._additionalRefreshRequested = !1;
        }
        dispose() {
          this._refreshTimeoutID && clearTimeout(this._refreshTimeoutID);
        }
        refresh(n, o, c) {
          this._rowCount = c, n = n !== void 0 ? n : 0, o = o !== void 0 ? o : this._rowCount - 1, this._rowStart = this._rowStart !== void 0 ? Math.min(this._rowStart, n) : n, this._rowEnd = this._rowEnd !== void 0 ? Math.max(this._rowEnd, o) : o;
          const a = Date.now();
          if (a - this._lastRefreshMs >= this._debounceThresholdMS)
            this._lastRefreshMs = a, this._innerRefresh();
          else if (!this._additionalRefreshRequested) {
            const d = a - this._lastRefreshMs, v = this._debounceThresholdMS - d;
            this._additionalRefreshRequested = !0, this._refreshTimeoutID = window.setTimeout(() => {
              this._lastRefreshMs = Date.now(), this._innerRefresh(), this._additionalRefreshRequested = !1, this._refreshTimeoutID = void 0;
            }, v);
          }
        }
        _innerRefresh() {
          if (this._rowStart === void 0 || this._rowEnd === void 0 || this._rowCount === void 0)
            return;
          const n = Math.max(this._rowStart, 0), o = Math.min(this._rowEnd, this._rowCount - 1);
          this._rowStart = void 0, this._rowEnd = void 0, this._renderCallback(n, o);
        }
      };
    }, 1680: function(k, i, n) {
      var o = this && this.__decorate || function(r, e, t, h) {
        var g, u = arguments.length, S = u < 3 ? e : h === null ? h = Object.getOwnPropertyDescriptor(e, t) : h;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          S = Reflect.decorate(r, e, t, h);
        else
          for (var _ = r.length - 1; _ >= 0; _--)
            (g = r[_]) && (S = (u < 3 ? g(S) : u > 3 ? g(e, t, S) : g(e, t)) || S);
        return u > 3 && S && Object.defineProperty(e, t, S), S;
      }, c = this && this.__param || function(r, e) {
        return function(t, h) {
          e(t, h, r);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.Viewport = void 0;
      const a = n(3656), d = n(4725), v = n(8460), m = n(844), l = n(2585);
      let s = i.Viewport = class extends m.Disposable {
        constructor(r, e, t, h, g, u, S, _) {
          super(), this._viewportElement = r, this._scrollArea = e, this._bufferService = t, this._optionsService = h, this._charSizeService = g, this._renderService = u, this._coreBrowserService = S, this.scrollBarWidth = 0, this._currentRowHeight = 0, this._currentDeviceCellHeight = 0, this._lastRecordedBufferLength = 0, this._lastRecordedViewportHeight = 0, this._lastRecordedBufferHeight = 0, this._lastTouchY = 0, this._lastScrollTop = 0, this._wheelPartialScroll = 0, this._refreshAnimationFrame = null, this._ignoreNextScrollEvent = !1, this._smoothScrollState = { startTime: 0, origin: -1, target: -1 }, this._onRequestScrollLines = this.register(new v.EventEmitter()), this.onRequestScrollLines = this._onRequestScrollLines.event, this.scrollBarWidth = this._viewportElement.offsetWidth - this._scrollArea.offsetWidth || 15, this.register((0, a.addDisposableDomListener)(this._viewportElement, "scroll", this._handleScroll.bind(this))), this._activeBuffer = this._bufferService.buffer, this.register(this._bufferService.buffers.onBufferActivate((b) => this._activeBuffer = b.activeBuffer)), this._renderDimensions = this._renderService.dimensions, this.register(this._renderService.onDimensionsChange((b) => this._renderDimensions = b)), this._handleThemeChange(_.colors), this.register(_.onChangeColors((b) => this._handleThemeChange(b))), this.register(this._optionsService.onSpecificOptionChange("scrollback", () => this.syncScrollArea())), setTimeout(() => this.syncScrollArea());
        }
        _handleThemeChange(r) {
          this._viewportElement.style.backgroundColor = r.background.css;
        }
        reset() {
          this._currentRowHeight = 0, this._currentDeviceCellHeight = 0, this._lastRecordedBufferLength = 0, this._lastRecordedViewportHeight = 0, this._lastRecordedBufferHeight = 0, this._lastTouchY = 0, this._lastScrollTop = 0, this._coreBrowserService.window.requestAnimationFrame(() => this.syncScrollArea());
        }
        _refresh(r) {
          if (r)
            return this._innerRefresh(), void (this._refreshAnimationFrame !== null && this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));
          this._refreshAnimationFrame === null && (this._refreshAnimationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._innerRefresh()));
        }
        _innerRefresh() {
          if (this._charSizeService.height > 0) {
            this._currentRowHeight = this._renderDimensions.device.cell.height / this._coreBrowserService.dpr, this._currentDeviceCellHeight = this._renderDimensions.device.cell.height, this._lastRecordedViewportHeight = this._viewportElement.offsetHeight;
            const e = Math.round(this._currentRowHeight * this._lastRecordedBufferLength) + (this._lastRecordedViewportHeight - this._renderDimensions.css.canvas.height);
            this._lastRecordedBufferHeight !== e && (this._lastRecordedBufferHeight = e, this._scrollArea.style.height = this._lastRecordedBufferHeight + "px");
          }
          const r = this._bufferService.buffer.ydisp * this._currentRowHeight;
          this._viewportElement.scrollTop !== r && (this._ignoreNextScrollEvent = !0, this._viewportElement.scrollTop = r), this._refreshAnimationFrame = null;
        }
        syncScrollArea(r = !1) {
          if (this._lastRecordedBufferLength !== this._bufferService.buffer.lines.length)
            return this._lastRecordedBufferLength = this._bufferService.buffer.lines.length, void this._refresh(r);
          this._lastRecordedViewportHeight === this._renderService.dimensions.css.canvas.height && this._lastScrollTop === this._activeBuffer.ydisp * this._currentRowHeight && this._renderDimensions.device.cell.height === this._currentDeviceCellHeight || this._refresh(r);
        }
        _handleScroll(r) {
          if (this._lastScrollTop = this._viewportElement.scrollTop, !this._viewportElement.offsetParent)
            return;
          if (this._ignoreNextScrollEvent)
            return this._ignoreNextScrollEvent = !1, void this._onRequestScrollLines.fire({ amount: 0, suppressScrollEvent: !0 });
          const e = Math.round(this._lastScrollTop / this._currentRowHeight) - this._bufferService.buffer.ydisp;
          this._onRequestScrollLines.fire({ amount: e, suppressScrollEvent: !0 });
        }
        _smoothScroll() {
          if (this._isDisposed || this._smoothScrollState.origin === -1 || this._smoothScrollState.target === -1)
            return;
          const r = this._smoothScrollPercent();
          this._viewportElement.scrollTop = this._smoothScrollState.origin + Math.round(r * (this._smoothScrollState.target - this._smoothScrollState.origin)), r < 1 ? this._coreBrowserService.window.requestAnimationFrame(() => this._smoothScroll()) : this._clearSmoothScrollState();
        }
        _smoothScrollPercent() {
          return this._optionsService.rawOptions.smoothScrollDuration && this._smoothScrollState.startTime ? Math.max(Math.min((Date.now() - this._smoothScrollState.startTime) / this._optionsService.rawOptions.smoothScrollDuration, 1), 0) : 1;
        }
        _clearSmoothScrollState() {
          this._smoothScrollState.startTime = 0, this._smoothScrollState.origin = -1, this._smoothScrollState.target = -1;
        }
        _bubbleScroll(r, e) {
          const t = this._viewportElement.scrollTop + this._lastRecordedViewportHeight;
          return !(e < 0 && this._viewportElement.scrollTop !== 0 || e > 0 && t < this._lastRecordedBufferHeight) || (r.cancelable && r.preventDefault(), !1);
        }
        handleWheel(r) {
          const e = this._getPixelsScrolled(r);
          return e !== 0 && (this._optionsService.rawOptions.smoothScrollDuration ? (this._smoothScrollState.startTime = Date.now(), this._smoothScrollPercent() < 1 ? (this._smoothScrollState.origin = this._viewportElement.scrollTop, this._smoothScrollState.target === -1 ? this._smoothScrollState.target = this._viewportElement.scrollTop + e : this._smoothScrollState.target += e, this._smoothScrollState.target = Math.max(Math.min(this._smoothScrollState.target, this._viewportElement.scrollHeight), 0), this._smoothScroll()) : this._clearSmoothScrollState()) : this._viewportElement.scrollTop += e, this._bubbleScroll(r, e));
        }
        scrollLines(r) {
          if (r !== 0)
            if (this._optionsService.rawOptions.smoothScrollDuration) {
              const e = r * this._currentRowHeight;
              this._smoothScrollState.startTime = Date.now(), this._smoothScrollPercent() < 1 ? (this._smoothScrollState.origin = this._viewportElement.scrollTop, this._smoothScrollState.target = this._smoothScrollState.origin + e, this._smoothScrollState.target = Math.max(Math.min(this._smoothScrollState.target, this._viewportElement.scrollHeight), 0), this._smoothScroll()) : this._clearSmoothScrollState();
            } else
              this._onRequestScrollLines.fire({ amount: r, suppressScrollEvent: !1 });
        }
        _getPixelsScrolled(r) {
          if (r.deltaY === 0 || r.shiftKey)
            return 0;
          let e = this._applyScrollModifier(r.deltaY, r);
          return r.deltaMode === WheelEvent.DOM_DELTA_LINE ? e *= this._currentRowHeight : r.deltaMode === WheelEvent.DOM_DELTA_PAGE && (e *= this._currentRowHeight * this._bufferService.rows), e;
        }
        getBufferElements(r, e) {
          var _;
          let t, h = "";
          const g = [], u = e ?? this._bufferService.buffer.lines.length, S = this._bufferService.buffer.lines;
          for (let b = r; b < u; b++) {
            const R = S.get(b);
            if (!R)
              continue;
            const B = (_ = S.get(b + 1)) == null ? void 0 : _.isWrapped;
            if (h += R.translateToString(!B), !B || b === S.length - 1) {
              const T = document.createElement("div");
              T.textContent = h, g.push(T), h.length > 0 && (t = T), h = "";
            }
          }
          return { bufferElements: g, cursorElement: t };
        }
        getLinesScrolled(r) {
          if (r.deltaY === 0 || r.shiftKey)
            return 0;
          let e = this._applyScrollModifier(r.deltaY, r);
          return r.deltaMode === WheelEvent.DOM_DELTA_PIXEL ? (e /= this._currentRowHeight + 0, this._wheelPartialScroll += e, e = Math.floor(Math.abs(this._wheelPartialScroll)) * (this._wheelPartialScroll > 0 ? 1 : -1), this._wheelPartialScroll %= 1) : r.deltaMode === WheelEvent.DOM_DELTA_PAGE && (e *= this._bufferService.rows), e;
        }
        _applyScrollModifier(r, e) {
          const t = this._optionsService.rawOptions.fastScrollModifier;
          return t === "alt" && e.altKey || t === "ctrl" && e.ctrlKey || t === "shift" && e.shiftKey ? r * this._optionsService.rawOptions.fastScrollSensitivity * this._optionsService.rawOptions.scrollSensitivity : r * this._optionsService.rawOptions.scrollSensitivity;
        }
        handleTouchStart(r) {
          this._lastTouchY = r.touches[0].pageY;
        }
        handleTouchMove(r) {
          const e = this._lastTouchY - r.touches[0].pageY;
          return this._lastTouchY = r.touches[0].pageY, e !== 0 && (this._viewportElement.scrollTop += e, this._bubbleScroll(r, e));
        }
      };
      i.Viewport = s = o([c(2, l.IBufferService), c(3, l.IOptionsService), c(4, d.ICharSizeService), c(5, d.IRenderService), c(6, d.ICoreBrowserService), c(7, d.IThemeService)], s);
    }, 3107: function(k, i, n) {
      var o = this && this.__decorate || function(l, s, r, e) {
        var t, h = arguments.length, g = h < 3 ? s : e === null ? e = Object.getOwnPropertyDescriptor(s, r) : e;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          g = Reflect.decorate(l, s, r, e);
        else
          for (var u = l.length - 1; u >= 0; u--)
            (t = l[u]) && (g = (h < 3 ? t(g) : h > 3 ? t(s, r, g) : t(s, r)) || g);
        return h > 3 && g && Object.defineProperty(s, r, g), g;
      }, c = this && this.__param || function(l, s) {
        return function(r, e) {
          s(r, e, l);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.BufferDecorationRenderer = void 0;
      const a = n(4725), d = n(844), v = n(2585);
      let m = i.BufferDecorationRenderer = class extends d.Disposable {
        constructor(l, s, r, e, t) {
          super(), this._screenElement = l, this._bufferService = s, this._coreBrowserService = r, this._decorationService = e, this._renderService = t, this._decorationElements = /* @__PURE__ */ new Map(), this._altBufferIsActive = !1, this._dimensionsChanged = !1, this._container = document.createElement("div"), this._container.classList.add("xterm-decoration-container"), this._screenElement.appendChild(this._container), this.register(this._renderService.onRenderedViewportChange(() => this._doRefreshDecorations())), this.register(this._renderService.onDimensionsChange(() => {
            this._dimensionsChanged = !0, this._queueRefresh();
          })), this.register(this._coreBrowserService.onDprChange(() => this._queueRefresh())), this.register(this._bufferService.buffers.onBufferActivate(() => {
            this._altBufferIsActive = this._bufferService.buffer === this._bufferService.buffers.alt;
          })), this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh())), this.register(this._decorationService.onDecorationRemoved((h) => this._removeDecoration(h))), this.register((0, d.toDisposable)(() => {
            this._container.remove(), this._decorationElements.clear();
          }));
        }
        _queueRefresh() {
          this._animationFrame === void 0 && (this._animationFrame = this._renderService.addRefreshCallback(() => {
            this._doRefreshDecorations(), this._animationFrame = void 0;
          }));
        }
        _doRefreshDecorations() {
          for (const l of this._decorationService.decorations)
            this._renderDecoration(l);
          this._dimensionsChanged = !1;
        }
        _renderDecoration(l) {
          this._refreshStyle(l), this._dimensionsChanged && this._refreshXPosition(l);
        }
        _createElement(l) {
          var e;
          const s = this._coreBrowserService.mainDocument.createElement("div");
          s.classList.add("xterm-decoration"), s.classList.toggle("xterm-decoration-top-layer", ((e = l == null ? void 0 : l.options) == null ? void 0 : e.layer) === "top"), s.style.width = `${Math.round((l.options.width || 1) * this._renderService.dimensions.css.cell.width)}px`, s.style.height = (l.options.height || 1) * this._renderService.dimensions.css.cell.height + "px", s.style.top = (l.marker.line - this._bufferService.buffers.active.ydisp) * this._renderService.dimensions.css.cell.height + "px", s.style.lineHeight = `${this._renderService.dimensions.css.cell.height}px`;
          const r = l.options.x ?? 0;
          return r && r > this._bufferService.cols && (s.style.display = "none"), this._refreshXPosition(l, s), s;
        }
        _refreshStyle(l) {
          const s = l.marker.line - this._bufferService.buffers.active.ydisp;
          if (s < 0 || s >= this._bufferService.rows)
            l.element && (l.element.style.display = "none", l.onRenderEmitter.fire(l.element));
          else {
            let r = this._decorationElements.get(l);
            r || (r = this._createElement(l), l.element = r, this._decorationElements.set(l, r), this._container.appendChild(r), l.onDispose(() => {
              this._decorationElements.delete(l), r.remove();
            })), r.style.top = s * this._renderService.dimensions.css.cell.height + "px", r.style.display = this._altBufferIsActive ? "none" : "block", l.onRenderEmitter.fire(r);
          }
        }
        _refreshXPosition(l, s = l.element) {
          if (!s)
            return;
          const r = l.options.x ?? 0;
          (l.options.anchor || "left") === "right" ? s.style.right = r ? r * this._renderService.dimensions.css.cell.width + "px" : "" : s.style.left = r ? r * this._renderService.dimensions.css.cell.width + "px" : "";
        }
        _removeDecoration(l) {
          var s;
          (s = this._decorationElements.get(l)) == null || s.remove(), this._decorationElements.delete(l), l.dispose();
        }
      };
      i.BufferDecorationRenderer = m = o([c(1, v.IBufferService), c(2, a.ICoreBrowserService), c(3, v.IDecorationService), c(4, a.IRenderService)], m);
    }, 5871: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.ColorZoneStore = void 0, i.ColorZoneStore = class {
        constructor() {
          this._zones = [], this._zonePool = [], this._zonePoolIndex = 0, this._linePadding = { full: 0, left: 0, center: 0, right: 0 };
        }
        get zones() {
          return this._zonePool.length = Math.min(this._zonePool.length, this._zones.length), this._zones;
        }
        clear() {
          this._zones.length = 0, this._zonePoolIndex = 0;
        }
        addDecoration(n) {
          if (n.options.overviewRulerOptions) {
            for (const o of this._zones)
              if (o.color === n.options.overviewRulerOptions.color && o.position === n.options.overviewRulerOptions.position) {
                if (this._lineIntersectsZone(o, n.marker.line))
                  return;
                if (this._lineAdjacentToZone(o, n.marker.line, n.options.overviewRulerOptions.position))
                  return void this._addLineToZone(o, n.marker.line);
              }
            if (this._zonePoolIndex < this._zonePool.length)
              return this._zonePool[this._zonePoolIndex].color = n.options.overviewRulerOptions.color, this._zonePool[this._zonePoolIndex].position = n.options.overviewRulerOptions.position, this._zonePool[this._zonePoolIndex].startBufferLine = n.marker.line, this._zonePool[this._zonePoolIndex].endBufferLine = n.marker.line, void this._zones.push(this._zonePool[this._zonePoolIndex++]);
            this._zones.push({ color: n.options.overviewRulerOptions.color, position: n.options.overviewRulerOptions.position, startBufferLine: n.marker.line, endBufferLine: n.marker.line }), this._zonePool.push(this._zones[this._zones.length - 1]), this._zonePoolIndex++;
          }
        }
        setPadding(n) {
          this._linePadding = n;
        }
        _lineIntersectsZone(n, o) {
          return o >= n.startBufferLine && o <= n.endBufferLine;
        }
        _lineAdjacentToZone(n, o, c) {
          return o >= n.startBufferLine - this._linePadding[c || "full"] && o <= n.endBufferLine + this._linePadding[c || "full"];
        }
        _addLineToZone(n, o) {
          n.startBufferLine = Math.min(n.startBufferLine, o), n.endBufferLine = Math.max(n.endBufferLine, o);
        }
      };
    }, 5744: function(k, i, n) {
      var o = this && this.__decorate || function(t, h, g, u) {
        var S, _ = arguments.length, b = _ < 3 ? h : u === null ? u = Object.getOwnPropertyDescriptor(h, g) : u;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          b = Reflect.decorate(t, h, g, u);
        else
          for (var R = t.length - 1; R >= 0; R--)
            (S = t[R]) && (b = (_ < 3 ? S(b) : _ > 3 ? S(h, g, b) : S(h, g)) || b);
        return _ > 3 && b && Object.defineProperty(h, g, b), b;
      }, c = this && this.__param || function(t, h) {
        return function(g, u) {
          h(g, u, t);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.OverviewRulerRenderer = void 0;
      const a = n(5871), d = n(4725), v = n(844), m = n(2585), l = { full: 0, left: 0, center: 0, right: 0 }, s = { full: 0, left: 0, center: 0, right: 0 }, r = { full: 0, left: 0, center: 0, right: 0 };
      let e = i.OverviewRulerRenderer = class extends v.Disposable {
        get _width() {
          return this._optionsService.options.overviewRulerWidth || 0;
        }
        constructor(t, h, g, u, S, _, b) {
          var B;
          super(), this._viewportElement = t, this._screenElement = h, this._bufferService = g, this._decorationService = u, this._renderService = S, this._optionsService = _, this._coreBrowserService = b, this._colorZoneStore = new a.ColorZoneStore(), this._shouldUpdateDimensions = !0, this._shouldUpdateAnchor = !0, this._lastKnownBufferLength = 0, this._canvas = this._coreBrowserService.mainDocument.createElement("canvas"), this._canvas.classList.add("xterm-decoration-overview-ruler"), this._refreshCanvasDimensions(), (B = this._viewportElement.parentElement) == null || B.insertBefore(this._canvas, this._viewportElement);
          const R = this._canvas.getContext("2d");
          if (!R)
            throw new Error("Ctx cannot be null");
          this._ctx = R, this._registerDecorationListeners(), this._registerBufferChangeListeners(), this._registerDimensionChangeListeners(), this.register((0, v.toDisposable)(() => {
            var T;
            (T = this._canvas) == null || T.remove();
          }));
        }
        _registerDecorationListeners() {
          this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh(void 0, !0))), this.register(this._decorationService.onDecorationRemoved(() => this._queueRefresh(void 0, !0)));
        }
        _registerBufferChangeListeners() {
          this.register(this._renderService.onRenderedViewportChange(() => this._queueRefresh())), this.register(this._bufferService.buffers.onBufferActivate(() => {
            this._canvas.style.display = this._bufferService.buffer === this._bufferService.buffers.alt ? "none" : "block";
          })), this.register(this._bufferService.onScroll(() => {
            this._lastKnownBufferLength !== this._bufferService.buffers.normal.lines.length && (this._refreshDrawHeightConstants(), this._refreshColorZonePadding());
          }));
        }
        _registerDimensionChangeListeners() {
          this.register(this._renderService.onRender(() => {
            this._containerHeight && this._containerHeight === this._screenElement.clientHeight || (this._queueRefresh(!0), this._containerHeight = this._screenElement.clientHeight);
          })), this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth", () => this._queueRefresh(!0))), this.register(this._coreBrowserService.onDprChange(() => this._queueRefresh(!0))), this._queueRefresh(!0);
        }
        _refreshDrawConstants() {
          const t = Math.floor(this._canvas.width / 3), h = Math.ceil(this._canvas.width / 3);
          s.full = this._canvas.width, s.left = t, s.center = h, s.right = t, this._refreshDrawHeightConstants(), r.full = 0, r.left = 0, r.center = s.left, r.right = s.left + s.center;
        }
        _refreshDrawHeightConstants() {
          l.full = Math.round(2 * this._coreBrowserService.dpr);
          const t = this._canvas.height / this._bufferService.buffer.lines.length, h = Math.round(Math.max(Math.min(t, 12), 6) * this._coreBrowserService.dpr);
          l.left = h, l.center = h, l.right = h;
        }
        _refreshColorZonePadding() {
          this._colorZoneStore.setPadding({ full: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * l.full), left: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * l.left), center: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * l.center), right: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * l.right) }), this._lastKnownBufferLength = this._bufferService.buffers.normal.lines.length;
        }
        _refreshCanvasDimensions() {
          this._canvas.style.width = `${this._width}px`, this._canvas.width = Math.round(this._width * this._coreBrowserService.dpr), this._canvas.style.height = `${this._screenElement.clientHeight}px`, this._canvas.height = Math.round(this._screenElement.clientHeight * this._coreBrowserService.dpr), this._refreshDrawConstants(), this._refreshColorZonePadding();
        }
        _refreshDecorations() {
          this._shouldUpdateDimensions && this._refreshCanvasDimensions(), this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height), this._colorZoneStore.clear();
          for (const h of this._decorationService.decorations)
            this._colorZoneStore.addDecoration(h);
          this._ctx.lineWidth = 1;
          const t = this._colorZoneStore.zones;
          for (const h of t)
            h.position !== "full" && this._renderColorZone(h);
          for (const h of t)
            h.position === "full" && this._renderColorZone(h);
          this._shouldUpdateDimensions = !1, this._shouldUpdateAnchor = !1;
        }
        _renderColorZone(t) {
          this._ctx.fillStyle = t.color, this._ctx.fillRect(r[t.position || "full"], Math.round((this._canvas.height - 1) * (t.startBufferLine / this._bufferService.buffers.active.lines.length) - l[t.position || "full"] / 2), s[t.position || "full"], Math.round((this._canvas.height - 1) * ((t.endBufferLine - t.startBufferLine) / this._bufferService.buffers.active.lines.length) + l[t.position || "full"]));
        }
        _queueRefresh(t, h) {
          this._shouldUpdateDimensions = t || this._shouldUpdateDimensions, this._shouldUpdateAnchor = h || this._shouldUpdateAnchor, this._animationFrame === void 0 && (this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {
            this._refreshDecorations(), this._animationFrame = void 0;
          }));
        }
      };
      i.OverviewRulerRenderer = e = o([c(2, m.IBufferService), c(3, m.IDecorationService), c(4, d.IRenderService), c(5, m.IOptionsService), c(6, d.ICoreBrowserService)], e);
    }, 2950: function(k, i, n) {
      var o = this && this.__decorate || function(l, s, r, e) {
        var t, h = arguments.length, g = h < 3 ? s : e === null ? e = Object.getOwnPropertyDescriptor(s, r) : e;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          g = Reflect.decorate(l, s, r, e);
        else
          for (var u = l.length - 1; u >= 0; u--)
            (t = l[u]) && (g = (h < 3 ? t(g) : h > 3 ? t(s, r, g) : t(s, r)) || g);
        return h > 3 && g && Object.defineProperty(s, r, g), g;
      }, c = this && this.__param || function(l, s) {
        return function(r, e) {
          s(r, e, l);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.CompositionHelper = void 0;
      const a = n(4725), d = n(2585), v = n(2584);
      let m = i.CompositionHelper = class {
        get isComposing() {
          return this._isComposing;
        }
        constructor(l, s, r, e, t, h) {
          this._textarea = l, this._compositionView = s, this._bufferService = r, this._optionsService = e, this._coreService = t, this._renderService = h, this._isComposing = !1, this._isSendingComposition = !1, this._compositionPosition = { start: 0, end: 0 }, this._dataAlreadySent = "";
        }
        compositionstart() {
          this._isComposing = !0, this._compositionPosition.start = this._textarea.value.length, this._compositionView.textContent = "", this._dataAlreadySent = "", this._compositionView.classList.add("active");
        }
        compositionupdate(l) {
          this._compositionView.textContent = l.data, this.updateCompositionElements(), setTimeout(() => {
            this._compositionPosition.end = this._textarea.value.length;
          }, 0);
        }
        compositionend() {
          this._finalizeComposition(!0);
        }
        keydown(l) {
          if (this._isComposing || this._isSendingComposition) {
            if (l.keyCode === 229 || l.keyCode === 16 || l.keyCode === 17 || l.keyCode === 18)
              return !1;
            this._finalizeComposition(!1);
          }
          return l.keyCode !== 229 || (this._handleAnyTextareaChanges(), !1);
        }
        _finalizeComposition(l) {
          if (this._compositionView.classList.remove("active"), this._isComposing = !1, l) {
            const s = { start: this._compositionPosition.start, end: this._compositionPosition.end };
            this._isSendingComposition = !0, setTimeout(() => {
              if (this._isSendingComposition) {
                let r;
                this._isSendingComposition = !1, s.start += this._dataAlreadySent.length, r = this._isComposing ? this._textarea.value.substring(s.start, s.end) : this._textarea.value.substring(s.start), r.length > 0 && this._coreService.triggerDataEvent(r, !0);
              }
            }, 0);
          } else {
            this._isSendingComposition = !1;
            const s = this._textarea.value.substring(this._compositionPosition.start, this._compositionPosition.end);
            this._coreService.triggerDataEvent(s, !0);
          }
        }
        _handleAnyTextareaChanges() {
          const l = this._textarea.value;
          setTimeout(() => {
            if (!this._isComposing) {
              const s = this._textarea.value, r = s.replace(l, "");
              this._dataAlreadySent = r, s.length > l.length ? this._coreService.triggerDataEvent(r, !0) : s.length < l.length ? this._coreService.triggerDataEvent(`${v.C0.DEL}`, !0) : s.length === l.length && s !== l && this._coreService.triggerDataEvent(s, !0);
            }
          }, 0);
        }
        updateCompositionElements(l) {
          if (this._isComposing) {
            if (this._bufferService.buffer.isCursorInViewport) {
              const s = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1), r = this._renderService.dimensions.css.cell.height, e = this._bufferService.buffer.y * this._renderService.dimensions.css.cell.height, t = s * this._renderService.dimensions.css.cell.width;
              this._compositionView.style.left = t + "px", this._compositionView.style.top = e + "px", this._compositionView.style.height = r + "px", this._compositionView.style.lineHeight = r + "px", this._compositionView.style.fontFamily = this._optionsService.rawOptions.fontFamily, this._compositionView.style.fontSize = this._optionsService.rawOptions.fontSize + "px";
              const h = this._compositionView.getBoundingClientRect();
              this._textarea.style.left = t + "px", this._textarea.style.top = e + "px", this._textarea.style.width = Math.max(h.width, 1) + "px", this._textarea.style.height = Math.max(h.height, 1) + "px", this._textarea.style.lineHeight = h.height + "px";
            }
            l || setTimeout(() => this.updateCompositionElements(!0), 0);
          }
        }
      };
      i.CompositionHelper = m = o([c(2, d.IBufferService), c(3, d.IOptionsService), c(4, d.ICoreService), c(5, a.IRenderService)], m);
    }, 9806: (k, i) => {
      function n(o, c, a) {
        const d = a.getBoundingClientRect(), v = o.getComputedStyle(a), m = parseInt(v.getPropertyValue("padding-left")), l = parseInt(v.getPropertyValue("padding-top"));
        return [c.clientX - d.left - m, c.clientY - d.top - l];
      }
      Object.defineProperty(i, "__esModule", { value: !0 }), i.getCoords = i.getCoordsRelativeToElement = void 0, i.getCoordsRelativeToElement = n, i.getCoords = function(o, c, a, d, v, m, l, s, r) {
        if (!m)
          return;
        const e = n(o, c, a);
        return e ? (e[0] = Math.ceil((e[0] + (r ? l / 2 : 0)) / l), e[1] = Math.ceil(e[1] / s), e[0] = Math.min(Math.max(e[0], 1), d + (r ? 1 : 0)), e[1] = Math.min(Math.max(e[1], 1), v), e) : void 0;
      };
    }, 9504: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.moveToCellSequence = void 0;
      const o = n(2584);
      function c(s, r, e, t) {
        const h = s - a(s, e), g = r - a(r, e), u = Math.abs(h - g) - function(S, _, b) {
          let R = 0;
          const B = S - a(S, b), T = _ - a(_, b);
          for (let L = 0; L < Math.abs(B - T); L++) {
            const H = d(S, _) === "A" ? -1 : 1, W = b.buffer.lines.get(B + H * L);
            W != null && W.isWrapped && R++;
          }
          return R;
        }(s, r, e);
        return l(u, m(d(s, r), t));
      }
      function a(s, r) {
        let e = 0, t = r.buffer.lines.get(s), h = t == null ? void 0 : t.isWrapped;
        for (; h && s >= 0 && s < r.rows; )
          e++, t = r.buffer.lines.get(--s), h = t == null ? void 0 : t.isWrapped;
        return e;
      }
      function d(s, r) {
        return s > r ? "A" : "B";
      }
      function v(s, r, e, t, h, g) {
        let u = s, S = r, _ = "";
        for (; u !== e || S !== t; )
          u += h ? 1 : -1, h && u > g.cols - 1 ? (_ += g.buffer.translateBufferLineToString(S, !1, s, u), u = 0, s = 0, S++) : !h && u < 0 && (_ += g.buffer.translateBufferLineToString(S, !1, 0, s + 1), u = g.cols - 1, s = u, S--);
        return _ + g.buffer.translateBufferLineToString(S, !1, s, u);
      }
      function m(s, r) {
        const e = r ? "O" : "[";
        return o.C0.ESC + e + s;
      }
      function l(s, r) {
        s = Math.floor(s);
        let e = "";
        for (let t = 0; t < s; t++)
          e += r;
        return e;
      }
      i.moveToCellSequence = function(s, r, e, t) {
        const h = e.buffer.x, g = e.buffer.y;
        if (!e.buffer.hasScrollback)
          return function(_, b, R, B, T, L) {
            return c(b, B, T, L).length === 0 ? "" : l(v(_, b, _, b - a(b, T), !1, T).length, m("D", L));
          }(h, g, 0, r, e, t) + c(g, r, e, t) + function(_, b, R, B, T, L) {
            let H;
            H = c(b, B, T, L).length > 0 ? B - a(B, T) : b;
            const W = B, j = function(V, z, C, x, A, O) {
              let I;
              return I = c(C, x, A, O).length > 0 ? x - a(x, A) : z, V < C && I <= x || V >= C && I < x ? "C" : "D";
            }(_, b, R, B, T, L);
            return l(v(_, H, R, W, j === "C", T).length, m(j, L));
          }(h, g, s, r, e, t);
        let u;
        if (g === r)
          return u = h > s ? "D" : "C", l(Math.abs(h - s), m(u, t));
        u = g > r ? "D" : "C";
        const S = Math.abs(g - r);
        return l(function(_, b) {
          return b.cols - _;
        }(g > r ? s : h, e) + (S - 1) * e.cols + 1 + ((g > r ? h : s) - 1), m(u, t));
      };
    }, 1296: function(k, i, n) {
      var o = this && this.__decorate || function(L, H, W, j) {
        var V, z = arguments.length, C = z < 3 ? H : j === null ? j = Object.getOwnPropertyDescriptor(H, W) : j;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          C = Reflect.decorate(L, H, W, j);
        else
          for (var x = L.length - 1; x >= 0; x--)
            (V = L[x]) && (C = (z < 3 ? V(C) : z > 3 ? V(H, W, C) : V(H, W)) || C);
        return z > 3 && C && Object.defineProperty(H, W, C), C;
      }, c = this && this.__param || function(L, H) {
        return function(W, j) {
          H(W, j, L);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.DomRenderer = void 0;
      const a = n(3787), d = n(2550), v = n(2223), m = n(6171), l = n(6052), s = n(4725), r = n(8055), e = n(8460), t = n(844), h = n(2585), g = "xterm-dom-renderer-owner-", u = "xterm-rows", S = "xterm-fg-", _ = "xterm-bg-", b = "xterm-focus", R = "xterm-selection";
      let B = 1, T = i.DomRenderer = class extends t.Disposable {
        constructor(L, H, W, j, V, z, C, x, A, O, I, q, X) {
          super(), this._terminal = L, this._document = H, this._element = W, this._screenElement = j, this._viewportElement = V, this._helperContainer = z, this._linkifier2 = C, this._charSizeService = A, this._optionsService = O, this._bufferService = I, this._coreBrowserService = q, this._themeService = X, this._terminalClass = B++, this._rowElements = [], this._selectionRenderModel = (0, l.createSelectionRenderModel)(), this.onRequestRedraw = this.register(new e.EventEmitter()).event, this._rowContainer = this._document.createElement("div"), this._rowContainer.classList.add(u), this._rowContainer.style.lineHeight = "normal", this._rowContainer.setAttribute("aria-hidden", "true"), this._refreshRowElements(this._bufferService.cols, this._bufferService.rows), this._selectionContainer = this._document.createElement("div"), this._selectionContainer.classList.add(R), this._selectionContainer.setAttribute("aria-hidden", "true"), this.dimensions = (0, m.createRenderDimensions)(), this._updateDimensions(), this.register(this._optionsService.onOptionChange(() => this._handleOptionsChanged())), this.register(this._themeService.onChangeColors((J) => this._injectCss(J))), this._injectCss(this._themeService.colors), this._rowFactory = x.createInstance(a.DomRendererRowFactory, document), this._element.classList.add(g + this._terminalClass), this._screenElement.appendChild(this._rowContainer), this._screenElement.appendChild(this._selectionContainer), this.register(this._linkifier2.onShowLinkUnderline((J) => this._handleLinkHover(J))), this.register(this._linkifier2.onHideLinkUnderline((J) => this._handleLinkLeave(J))), this.register((0, t.toDisposable)(() => {
            this._element.classList.remove(g + this._terminalClass), this._rowContainer.remove(), this._selectionContainer.remove(), this._widthCache.dispose(), this._themeStyleElement.remove(), this._dimensionsStyleElement.remove();
          })), this._widthCache = new d.WidthCache(this._document, this._helperContainer), this._widthCache.setFont(this._optionsService.rawOptions.fontFamily, this._optionsService.rawOptions.fontSize, this._optionsService.rawOptions.fontWeight, this._optionsService.rawOptions.fontWeightBold), this._setDefaultSpacing();
        }
        _updateDimensions() {
          const L = this._coreBrowserService.dpr;
          this.dimensions.device.char.width = this._charSizeService.width * L, this.dimensions.device.char.height = Math.ceil(this._charSizeService.height * L), this.dimensions.device.cell.width = this.dimensions.device.char.width + Math.round(this._optionsService.rawOptions.letterSpacing), this.dimensions.device.cell.height = Math.floor(this.dimensions.device.char.height * this._optionsService.rawOptions.lineHeight), this.dimensions.device.char.left = 0, this.dimensions.device.char.top = 0, this.dimensions.device.canvas.width = this.dimensions.device.cell.width * this._bufferService.cols, this.dimensions.device.canvas.height = this.dimensions.device.cell.height * this._bufferService.rows, this.dimensions.css.canvas.width = Math.round(this.dimensions.device.canvas.width / L), this.dimensions.css.canvas.height = Math.round(this.dimensions.device.canvas.height / L), this.dimensions.css.cell.width = this.dimensions.css.canvas.width / this._bufferService.cols, this.dimensions.css.cell.height = this.dimensions.css.canvas.height / this._bufferService.rows;
          for (const W of this._rowElements)
            W.style.width = `${this.dimensions.css.canvas.width}px`, W.style.height = `${this.dimensions.css.cell.height}px`, W.style.lineHeight = `${this.dimensions.css.cell.height}px`, W.style.overflow = "hidden";
          this._dimensionsStyleElement || (this._dimensionsStyleElement = this._document.createElement("style"), this._screenElement.appendChild(this._dimensionsStyleElement));
          const H = `${this._terminalSelector} .${u} span { display: inline-block; height: 100%; vertical-align: top;}`;
          this._dimensionsStyleElement.textContent = H, this._selectionContainer.style.height = this._viewportElement.style.height, this._screenElement.style.width = `${this.dimensions.css.canvas.width}px`, this._screenElement.style.height = `${this.dimensions.css.canvas.height}px`;
        }
        _injectCss(L) {
          this._themeStyleElement || (this._themeStyleElement = this._document.createElement("style"), this._screenElement.appendChild(this._themeStyleElement));
          let H = `${this._terminalSelector} .${u} { color: ${L.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;
          H += `${this._terminalSelector} .${u} .xterm-dim { color: ${r.color.multiplyOpacity(L.foreground, 0.5).css};}`, H += `${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;
          const W = `blink_underline_${this._terminalClass}`, j = `blink_bar_${this._terminalClass}`, V = `blink_block_${this._terminalClass}`;
          H += `@keyframes ${W} { 50% {  border-bottom-style: hidden; }}`, H += `@keyframes ${j} { 50% {  box-shadow: none; }}`, H += `@keyframes ${V} { 0% {  background-color: ${L.cursor.css};  color: ${L.cursorAccent.css}; } 50% {  background-color: inherit;  color: ${L.cursor.css}; }}`, H += `${this._terminalSelector} .${u}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${u}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${j} 1s step-end infinite;}${this._terminalSelector} .${u}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-block { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css};}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${L.cursor.css} !important; color: ${L.cursorAccent.css} !important;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${L.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${L.cursor.css} inset;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${L.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`, H += `${this._terminalSelector} .${R} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${R} div { position: absolute; background-color: ${L.selectionBackgroundOpaque.css};}${this._terminalSelector} .${R} div { position: absolute; background-color: ${L.selectionInactiveBackgroundOpaque.css};}`;
          for (const [z, C] of L.ansi.entries())
            H += `${this._terminalSelector} .${S}${z} { color: ${C.css}; }${this._terminalSelector} .${S}${z}.xterm-dim { color: ${r.color.multiplyOpacity(C, 0.5).css}; }${this._terminalSelector} .${_}${z} { background-color: ${C.css}; }`;
          H += `${this._terminalSelector} .${S}${v.INVERTED_DEFAULT_COLOR} { color: ${r.color.opaque(L.background).css}; }${this._terminalSelector} .${S}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${r.color.multiplyOpacity(r.color.opaque(L.background), 0.5).css}; }${this._terminalSelector} .${_}${v.INVERTED_DEFAULT_COLOR} { background-color: ${L.foreground.css}; }`, this._themeStyleElement.textContent = H;
        }
        _setDefaultSpacing() {
          const L = this.dimensions.css.cell.width - this._widthCache.get("W", !1, !1);
          this._rowContainer.style.letterSpacing = `${L}px`, this._rowFactory.defaultSpacing = L;
        }
        handleDevicePixelRatioChange() {
          this._updateDimensions(), this._widthCache.clear(), this._setDefaultSpacing();
        }
        _refreshRowElements(L, H) {
          for (let W = this._rowElements.length; W <= H; W++) {
            const j = this._document.createElement("div");
            this._rowContainer.appendChild(j), this._rowElements.push(j);
          }
          for (; this._rowElements.length > H; )
            this._rowContainer.removeChild(this._rowElements.pop());
        }
        handleResize(L, H) {
          this._refreshRowElements(L, H), this._updateDimensions(), this.handleSelectionChanged(this._selectionRenderModel.selectionStart, this._selectionRenderModel.selectionEnd, this._selectionRenderModel.columnSelectMode);
        }
        handleCharSizeChanged() {
          this._updateDimensions(), this._widthCache.clear(), this._setDefaultSpacing();
        }
        handleBlur() {
          this._rowContainer.classList.remove(b), this.renderRows(0, this._bufferService.rows - 1);
        }
        handleFocus() {
          this._rowContainer.classList.add(b), this.renderRows(this._bufferService.buffer.y, this._bufferService.buffer.y);
        }
        handleSelectionChanged(L, H, W) {
          if (this._selectionContainer.replaceChildren(), this._rowFactory.handleSelectionChanged(L, H, W), this.renderRows(0, this._bufferService.rows - 1), !L || !H)
            return;
          this._selectionRenderModel.update(this._terminal, L, H, W);
          const j = this._selectionRenderModel.viewportStartRow, V = this._selectionRenderModel.viewportEndRow, z = this._selectionRenderModel.viewportCappedStartRow, C = this._selectionRenderModel.viewportCappedEndRow;
          if (z >= this._bufferService.rows || C < 0)
            return;
          const x = this._document.createDocumentFragment();
          if (W) {
            const A = L[0] > H[0];
            x.appendChild(this._createSelectionElement(z, A ? H[0] : L[0], A ? L[0] : H[0], C - z + 1));
          } else {
            const A = j === z ? L[0] : 0, O = z === V ? H[0] : this._bufferService.cols;
            x.appendChild(this._createSelectionElement(z, A, O));
            const I = C - z - 1;
            if (x.appendChild(this._createSelectionElement(z + 1, 0, this._bufferService.cols, I)), z !== C) {
              const q = V === C ? H[0] : this._bufferService.cols;
              x.appendChild(this._createSelectionElement(C, 0, q));
            }
          }
          this._selectionContainer.appendChild(x);
        }
        _createSelectionElement(L, H, W, j = 1) {
          const V = this._document.createElement("div"), z = H * this.dimensions.css.cell.width;
          let C = this.dimensions.css.cell.width * (W - H);
          return z + C > this.dimensions.css.canvas.width && (C = this.dimensions.css.canvas.width - z), V.style.height = j * this.dimensions.css.cell.height + "px", V.style.top = L * this.dimensions.css.cell.height + "px", V.style.left = `${z}px`, V.style.width = `${C}px`, V;
        }
        handleCursorMove() {
        }
        _handleOptionsChanged() {
          this._updateDimensions(), this._injectCss(this._themeService.colors), this._widthCache.setFont(this._optionsService.rawOptions.fontFamily, this._optionsService.rawOptions.fontSize, this._optionsService.rawOptions.fontWeight, this._optionsService.rawOptions.fontWeightBold), this._setDefaultSpacing();
        }
        clear() {
          for (const L of this._rowElements)
            L.replaceChildren();
        }
        renderRows(L, H) {
          const W = this._bufferService.buffer, j = W.ybase + W.y, V = Math.min(W.x, this._bufferService.cols - 1), z = this._optionsService.rawOptions.cursorBlink, C = this._optionsService.rawOptions.cursorStyle, x = this._optionsService.rawOptions.cursorInactiveStyle;
          for (let A = L; A <= H; A++) {
            const O = A + W.ydisp, I = this._rowElements[A], q = W.lines.get(O);
            if (!I || !q)
              break;
            I.replaceChildren(...this._rowFactory.createRow(q, O, O === j, C, x, V, z, this.dimensions.css.cell.width, this._widthCache, -1, -1));
          }
        }
        get _terminalSelector() {
          return `.${g}${this._terminalClass}`;
        }
        _handleLinkHover(L) {
          this._setCellUnderline(L.x1, L.x2, L.y1, L.y2, L.cols, !0);
        }
        _handleLinkLeave(L) {
          this._setCellUnderline(L.x1, L.x2, L.y1, L.y2, L.cols, !1);
        }
        _setCellUnderline(L, H, W, j, V, z) {
          W < 0 && (L = 0), j < 0 && (H = 0);
          const C = this._bufferService.rows - 1;
          W = Math.max(Math.min(W, C), 0), j = Math.max(Math.min(j, C), 0), V = Math.min(V, this._bufferService.cols);
          const x = this._bufferService.buffer, A = x.ybase + x.y, O = Math.min(x.x, V - 1), I = this._optionsService.rawOptions.cursorBlink, q = this._optionsService.rawOptions.cursorStyle, X = this._optionsService.rawOptions.cursorInactiveStyle;
          for (let J = W; J <= j; ++J) {
            const P = J + x.ydisp, w = this._rowElements[J], U = x.lines.get(P);
            if (!w || !U)
              break;
            w.replaceChildren(...this._rowFactory.createRow(U, P, P === A, q, X, O, I, this.dimensions.css.cell.width, this._widthCache, z ? J === W ? L : 0 : -1, z ? (J === j ? H : V) - 1 : -1));
          }
        }
      };
      i.DomRenderer = T = o([c(7, h.IInstantiationService), c(8, s.ICharSizeService), c(9, h.IOptionsService), c(10, h.IBufferService), c(11, s.ICoreBrowserService), c(12, s.IThemeService)], T);
    }, 3787: function(k, i, n) {
      var o = this && this.__decorate || function(u, S, _, b) {
        var R, B = arguments.length, T = B < 3 ? S : b === null ? b = Object.getOwnPropertyDescriptor(S, _) : b;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          T = Reflect.decorate(u, S, _, b);
        else
          for (var L = u.length - 1; L >= 0; L--)
            (R = u[L]) && (T = (B < 3 ? R(T) : B > 3 ? R(S, _, T) : R(S, _)) || T);
        return B > 3 && T && Object.defineProperty(S, _, T), T;
      }, c = this && this.__param || function(u, S) {
        return function(_, b) {
          S(_, b, u);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.DomRendererRowFactory = void 0;
      const a = n(2223), d = n(643), v = n(511), m = n(2585), l = n(8055), s = n(4725), r = n(4269), e = n(6171), t = n(3734);
      let h = i.DomRendererRowFactory = class {
        constructor(u, S, _, b, R, B, T) {
          this._document = u, this._characterJoinerService = S, this._optionsService = _, this._coreBrowserService = b, this._coreService = R, this._decorationService = B, this._themeService = T, this._workCell = new v.CellData(), this._columnSelectMode = !1, this.defaultSpacing = 0;
        }
        handleSelectionChanged(u, S, _) {
          this._selectionStart = u, this._selectionEnd = S, this._columnSelectMode = _;
        }
        createRow(u, S, _, b, R, B, T, L, H, W, j) {
          const V = [], z = this._characterJoinerService.getJoinedCharacters(S), C = this._themeService.colors;
          let x, A = u.getNoBgTrimmedLength();
          _ && A < B + 1 && (A = B + 1);
          let O = 0, I = "", q = 0, X = 0, J = 0, P = !1, w = 0, U = !1, F = 0;
          const G = [], K = W !== -1 && j !== -1;
          for (let ee = 0; ee < A; ee++) {
            u.loadCell(ee, this._workCell);
            let se = this._workCell.getWidth();
            if (se === 0)
              continue;
            let ie = !1, oe = ee, Z = this._workCell;
            if (z.length > 0 && ee === z[0][0]) {
              ie = !0;
              const re = z.shift();
              Z = new r.JoinedCellData(this._workCell, u.translateToString(!0, re[0], re[1]), re[1] - re[0]), oe = re[1] - 1, se = Z.getWidth();
            }
            const N = this._isCellInSelection(ee, S), we = _ && ee === B, Ke = K && ee >= W && ee <= j;
            let Ve = !1;
            this._decorationService.forEachDecorationAtCell(ee, S, void 0, (re) => {
              Ve = !0;
            });
            let Ie = Z.getChars() || d.WHITESPACE_CELL_CHAR;
            if (Ie === " " && (Z.isUnderline() || Z.isOverline()) && (Ie = " "), F = se * L - H.get(Ie, Z.isBold(), Z.isItalic()), x) {
              if (O && (N && U || !N && !U && Z.bg === q) && (N && U && C.selectionForeground || Z.fg === X) && Z.extended.ext === J && Ke === P && F === w && !we && !ie && !Ve) {
                Z.isInvisible() ? I += d.WHITESPACE_CELL_CHAR : I += Ie, O++;
                continue;
              }
              O && (x.textContent = I), x = this._document.createElement("span"), O = 0, I = "";
            } else
              x = this._document.createElement("span");
            if (q = Z.bg, X = Z.fg, J = Z.extended.ext, P = Ke, w = F, U = N, ie && B >= ee && B <= oe && (B = ee), !this._coreService.isCursorHidden && we && this._coreService.isCursorInitialized) {
              if (G.push("xterm-cursor"), this._coreBrowserService.isFocused)
                T && G.push("xterm-cursor-blink"), G.push(b === "bar" ? "xterm-cursor-bar" : b === "underline" ? "xterm-cursor-underline" : "xterm-cursor-block");
              else if (R)
                switch (R) {
                  case "outline":
                    G.push("xterm-cursor-outline");
                    break;
                  case "block":
                    G.push("xterm-cursor-block");
                    break;
                  case "bar":
                    G.push("xterm-cursor-bar");
                    break;
                  case "underline":
                    G.push("xterm-cursor-underline");
                }
            }
            if (Z.isBold() && G.push("xterm-bold"), Z.isItalic() && G.push("xterm-italic"), Z.isDim() && G.push("xterm-dim"), I = Z.isInvisible() ? d.WHITESPACE_CELL_CHAR : Z.getChars() || d.WHITESPACE_CELL_CHAR, Z.isUnderline() && (G.push(`xterm-underline-${Z.extended.underlineStyle}`), I === " " && (I = " "), !Z.isUnderlineColorDefault()))
              if (Z.isUnderlineColorRGB())
                x.style.textDecorationColor = `rgb(${t.AttributeData.toColorRGB(Z.getUnderlineColor()).join(",")})`;
              else {
                let re = Z.getUnderlineColor();
                this._optionsService.rawOptions.drawBoldTextInBrightColors && Z.isBold() && re < 8 && (re += 8), x.style.textDecorationColor = C.ansi[re].css;
              }
            Z.isOverline() && (G.push("xterm-overline"), I === " " && (I = " ")), Z.isStrikethrough() && G.push("xterm-strikethrough"), Ke && (x.style.textDecoration = "underline");
            let he = Z.getFgColor(), Be = Z.getFgColorMode(), ue = Z.getBgColor(), Me = Z.getBgColorMode();
            const Ge = !!Z.isInverse();
            if (Ge) {
              const re = he;
              he = ue, ue = re;
              const qt = Be;
              Be = Me, Me = qt;
            }
            let pe, He, Se, Te = !1;
            switch (this._decorationService.forEachDecorationAtCell(ee, S, void 0, (re) => {
              re.options.layer !== "top" && Te || (re.backgroundColorRGB && (Me = 50331648, ue = re.backgroundColorRGB.rgba >> 8 & 16777215, pe = re.backgroundColorRGB), re.foregroundColorRGB && (Be = 50331648, he = re.foregroundColorRGB.rgba >> 8 & 16777215, He = re.foregroundColorRGB), Te = re.options.layer === "top");
            }), !Te && N && (pe = this._coreBrowserService.isFocused ? C.selectionBackgroundOpaque : C.selectionInactiveBackgroundOpaque, ue = pe.rgba >> 8 & 16777215, Me = 50331648, Te = !0, C.selectionForeground && (Be = 50331648, he = C.selectionForeground.rgba >> 8 & 16777215, He = C.selectionForeground)), Te && G.push("xterm-decoration-top"), Me) {
              case 16777216:
              case 33554432:
                Se = C.ansi[ue], G.push(`xterm-bg-${ue}`);
                break;
              case 50331648:
                Se = l.channels.toColor(ue >> 16, ue >> 8 & 255, 255 & ue), this._addStyle(x, `background-color:#${g((ue >>> 0).toString(16), "0", 6)}`);
                break;
              default:
                Ge ? (Se = C.foreground, G.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)) : Se = C.background;
            }
            switch (pe || Z.isDim() && (pe = l.color.multiplyOpacity(Se, 0.5)), Be) {
              case 16777216:
              case 33554432:
                Z.isBold() && he < 8 && this._optionsService.rawOptions.drawBoldTextInBrightColors && (he += 8), this._applyMinimumContrast(x, Se, C.ansi[he], Z, pe, void 0) || G.push(`xterm-fg-${he}`);
                break;
              case 50331648:
                const re = l.channels.toColor(he >> 16 & 255, he >> 8 & 255, 255 & he);
                this._applyMinimumContrast(x, Se, re, Z, pe, He) || this._addStyle(x, `color:#${g(he.toString(16), "0", 6)}`);
                break;
              default:
                this._applyMinimumContrast(x, Se, C.foreground, Z, pe, He) || Ge && G.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`);
            }
            G.length && (x.className = G.join(" "), G.length = 0), we || ie || Ve ? x.textContent = I : O++, F !== this.defaultSpacing && (x.style.letterSpacing = `${F}px`), V.push(x), ee = oe;
          }
          return x && O && (x.textContent = I), V;
        }
        _applyMinimumContrast(u, S, _, b, R, B) {
          if (this._optionsService.rawOptions.minimumContrastRatio === 1 || (0, e.treatGlyphAsBackgroundColor)(b.getCode()))
            return !1;
          const T = this._getContrastCache(b);
          let L;
          if (R || B || (L = T.getColor(S.rgba, _.rgba)), L === void 0) {
            const H = this._optionsService.rawOptions.minimumContrastRatio / (b.isDim() ? 2 : 1);
            L = l.color.ensureContrastRatio(R || S, B || _, H), T.setColor((R || S).rgba, (B || _).rgba, L ?? null);
          }
          return !!L && (this._addStyle(u, `color:${L.css}`), !0);
        }
        _getContrastCache(u) {
          return u.isDim() ? this._themeService.colors.halfContrastCache : this._themeService.colors.contrastCache;
        }
        _addStyle(u, S) {
          u.setAttribute("style", `${u.getAttribute("style") || ""}${S};`);
        }
        _isCellInSelection(u, S) {
          const _ = this._selectionStart, b = this._selectionEnd;
          return !(!_ || !b) && (this._columnSelectMode ? _[0] <= b[0] ? u >= _[0] && S >= _[1] && u < b[0] && S <= b[1] : u < _[0] && S >= _[1] && u >= b[0] && S <= b[1] : S > _[1] && S < b[1] || _[1] === b[1] && S === _[1] && u >= _[0] && u < b[0] || _[1] < b[1] && S === b[1] && u < b[0] || _[1] < b[1] && S === _[1] && u >= _[0]);
        }
      };
      function g(u, S, _) {
        for (; u.length < _; )
          u = S + u;
        return u;
      }
      i.DomRendererRowFactory = h = o([c(1, s.ICharacterJoinerService), c(2, m.IOptionsService), c(3, s.ICoreBrowserService), c(4, m.ICoreService), c(5, m.IDecorationService), c(6, s.IThemeService)], h);
    }, 2550: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.WidthCache = void 0, i.WidthCache = class {
        constructor(n, o) {
          this._flat = new Float32Array(256), this._font = "", this._fontSize = 0, this._weight = "normal", this._weightBold = "bold", this._measureElements = [], this._container = n.createElement("div"), this._container.classList.add("xterm-width-cache-measure-container"), this._container.setAttribute("aria-hidden", "true"), this._container.style.whiteSpace = "pre", this._container.style.fontKerning = "none";
          const c = n.createElement("span");
          c.classList.add("xterm-char-measure-element");
          const a = n.createElement("span");
          a.classList.add("xterm-char-measure-element"), a.style.fontWeight = "bold";
          const d = n.createElement("span");
          d.classList.add("xterm-char-measure-element"), d.style.fontStyle = "italic";
          const v = n.createElement("span");
          v.classList.add("xterm-char-measure-element"), v.style.fontWeight = "bold", v.style.fontStyle = "italic", this._measureElements = [c, a, d, v], this._container.appendChild(c), this._container.appendChild(a), this._container.appendChild(d), this._container.appendChild(v), o.appendChild(this._container), this.clear();
        }
        dispose() {
          this._container.remove(), this._measureElements.length = 0, this._holey = void 0;
        }
        clear() {
          this._flat.fill(-9999), this._holey = /* @__PURE__ */ new Map();
        }
        setFont(n, o, c, a) {
          n === this._font && o === this._fontSize && c === this._weight && a === this._weightBold || (this._font = n, this._fontSize = o, this._weight = c, this._weightBold = a, this._container.style.fontFamily = this._font, this._container.style.fontSize = `${this._fontSize}px`, this._measureElements[0].style.fontWeight = `${c}`, this._measureElements[1].style.fontWeight = `${a}`, this._measureElements[2].style.fontWeight = `${c}`, this._measureElements[3].style.fontWeight = `${a}`, this.clear());
        }
        get(n, o, c) {
          let a = 0;
          if (!o && !c && n.length === 1 && (a = n.charCodeAt(0)) < 256) {
            if (this._flat[a] !== -9999)
              return this._flat[a];
            const m = this._measure(n, 0);
            return m > 0 && (this._flat[a] = m), m;
          }
          let d = n;
          o && (d += "B"), c && (d += "I");
          let v = this._holey.get(d);
          if (v === void 0) {
            let m = 0;
            o && (m |= 1), c && (m |= 2), v = this._measure(n, m), v > 0 && this._holey.set(d, v);
          }
          return v;
        }
        _measure(n, o) {
          const c = this._measureElements[o];
          return c.textContent = n.repeat(32), c.offsetWidth / 32;
        }
      };
    }, 2223: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.TEXT_BASELINE = i.DIM_OPACITY = i.INVERTED_DEFAULT_COLOR = void 0;
      const o = n(6114);
      i.INVERTED_DEFAULT_COLOR = 257, i.DIM_OPACITY = 0.5, i.TEXT_BASELINE = o.isFirefox || o.isLegacyEdge ? "bottom" : "ideographic";
    }, 6171: (k, i) => {
      function n(c) {
        return 57508 <= c && c <= 57558;
      }
      function o(c) {
        return c >= 128512 && c <= 128591 || c >= 127744 && c <= 128511 || c >= 128640 && c <= 128767 || c >= 9728 && c <= 9983 || c >= 9984 && c <= 10175 || c >= 65024 && c <= 65039 || c >= 129280 && c <= 129535 || c >= 127462 && c <= 127487;
      }
      Object.defineProperty(i, "__esModule", { value: !0 }), i.computeNextVariantOffset = i.createRenderDimensions = i.treatGlyphAsBackgroundColor = i.allowRescaling = i.isEmoji = i.isRestrictedPowerlineGlyph = i.isPowerlineGlyph = i.throwIfFalsy = void 0, i.throwIfFalsy = function(c) {
        if (!c)
          throw new Error("value must not be falsy");
        return c;
      }, i.isPowerlineGlyph = n, i.isRestrictedPowerlineGlyph = function(c) {
        return 57520 <= c && c <= 57527;
      }, i.isEmoji = o, i.allowRescaling = function(c, a, d, v) {
        return a === 1 && d > Math.ceil(1.5 * v) && c !== void 0 && c > 255 && !o(c) && !n(c) && !function(m) {
          return 57344 <= m && m <= 63743;
        }(c);
      }, i.treatGlyphAsBackgroundColor = function(c) {
        return n(c) || function(a) {
          return 9472 <= a && a <= 9631;
        }(c);
      }, i.createRenderDimensions = function() {
        return { css: { canvas: { width: 0, height: 0 }, cell: { width: 0, height: 0 } }, device: { canvas: { width: 0, height: 0 }, cell: { width: 0, height: 0 }, char: { width: 0, height: 0, left: 0, top: 0 } } };
      }, i.computeNextVariantOffset = function(c, a, d = 0) {
        return (c - (2 * Math.round(a) - d)) % (2 * Math.round(a));
      };
    }, 6052: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.createSelectionRenderModel = void 0;
      class n {
        constructor() {
          this.clear();
        }
        clear() {
          this.hasSelection = !1, this.columnSelectMode = !1, this.viewportStartRow = 0, this.viewportEndRow = 0, this.viewportCappedStartRow = 0, this.viewportCappedEndRow = 0, this.startCol = 0, this.endCol = 0, this.selectionStart = void 0, this.selectionEnd = void 0;
        }
        update(c, a, d, v = !1) {
          if (this.selectionStart = a, this.selectionEnd = d, !a || !d || a[0] === d[0] && a[1] === d[1])
            return void this.clear();
          const m = c.buffers.active.ydisp, l = a[1] - m, s = d[1] - m, r = Math.max(l, 0), e = Math.min(s, c.rows - 1);
          r >= c.rows || e < 0 ? this.clear() : (this.hasSelection = !0, this.columnSelectMode = v, this.viewportStartRow = l, this.viewportEndRow = s, this.viewportCappedStartRow = r, this.viewportCappedEndRow = e, this.startCol = a[0], this.endCol = d[0]);
        }
        isCellSelected(c, a, d) {
          return !!this.hasSelection && (d -= c.buffer.active.viewportY, this.columnSelectMode ? this.startCol <= this.endCol ? a >= this.startCol && d >= this.viewportCappedStartRow && a < this.endCol && d <= this.viewportCappedEndRow : a < this.startCol && d >= this.viewportCappedStartRow && a >= this.endCol && d <= this.viewportCappedEndRow : d > this.viewportStartRow && d < this.viewportEndRow || this.viewportStartRow === this.viewportEndRow && d === this.viewportStartRow && a >= this.startCol && a < this.endCol || this.viewportStartRow < this.viewportEndRow && d === this.viewportEndRow && a < this.endCol || this.viewportStartRow < this.viewportEndRow && d === this.viewportStartRow && a >= this.startCol);
        }
      }
      i.createSelectionRenderModel = function() {
        return new n();
      };
    }, 456: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.SelectionModel = void 0, i.SelectionModel = class {
        constructor(n) {
          this._bufferService = n, this.isSelectAllActive = !1, this.selectionStartLength = 0;
        }
        clearSelection() {
          this.selectionStart = void 0, this.selectionEnd = void 0, this.isSelectAllActive = !1, this.selectionStartLength = 0;
        }
        get finalSelectionStart() {
          return this.isSelectAllActive ? [0, 0] : this.selectionEnd && this.selectionStart && this.areSelectionValuesReversed() ? this.selectionEnd : this.selectionStart;
        }
        get finalSelectionEnd() {
          if (this.isSelectAllActive)
            return [this._bufferService.cols, this._bufferService.buffer.ybase + this._bufferService.rows - 1];
          if (this.selectionStart) {
            if (!this.selectionEnd || this.areSelectionValuesReversed()) {
              const n = this.selectionStart[0] + this.selectionStartLength;
              return n > this._bufferService.cols ? n % this._bufferService.cols == 0 ? [this._bufferService.cols, this.selectionStart[1] + Math.floor(n / this._bufferService.cols) - 1] : [n % this._bufferService.cols, this.selectionStart[1] + Math.floor(n / this._bufferService.cols)] : [n, this.selectionStart[1]];
            }
            if (this.selectionStartLength && this.selectionEnd[1] === this.selectionStart[1]) {
              const n = this.selectionStart[0] + this.selectionStartLength;
              return n > this._bufferService.cols ? [n % this._bufferService.cols, this.selectionStart[1] + Math.floor(n / this._bufferService.cols)] : [Math.max(n, this.selectionEnd[0]), this.selectionEnd[1]];
            }
            return this.selectionEnd;
          }
        }
        areSelectionValuesReversed() {
          const n = this.selectionStart, o = this.selectionEnd;
          return !(!n || !o) && (n[1] > o[1] || n[1] === o[1] && n[0] > o[0]);
        }
        handleTrim(n) {
          return this.selectionStart && (this.selectionStart[1] -= n), this.selectionEnd && (this.selectionEnd[1] -= n), this.selectionEnd && this.selectionEnd[1] < 0 ? (this.clearSelection(), !0) : (this.selectionStart && this.selectionStart[1] < 0 && (this.selectionStart[1] = 0), !1);
        }
      };
    }, 428: function(k, i, n) {
      var o = this && this.__decorate || function(e, t, h, g) {
        var u, S = arguments.length, _ = S < 3 ? t : g === null ? g = Object.getOwnPropertyDescriptor(t, h) : g;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          _ = Reflect.decorate(e, t, h, g);
        else
          for (var b = e.length - 1; b >= 0; b--)
            (u = e[b]) && (_ = (S < 3 ? u(_) : S > 3 ? u(t, h, _) : u(t, h)) || _);
        return S > 3 && _ && Object.defineProperty(t, h, _), _;
      }, c = this && this.__param || function(e, t) {
        return function(h, g) {
          t(h, g, e);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.CharSizeService = void 0;
      const a = n(2585), d = n(8460), v = n(844);
      let m = i.CharSizeService = class extends v.Disposable {
        get hasValidSize() {
          return this.width > 0 && this.height > 0;
        }
        constructor(e, t, h) {
          super(), this._optionsService = h, this.width = 0, this.height = 0, this._onCharSizeChange = this.register(new d.EventEmitter()), this.onCharSizeChange = this._onCharSizeChange.event;
          try {
            this._measureStrategy = this.register(new r(this._optionsService));
          } catch {
            this._measureStrategy = this.register(new s(e, t, this._optionsService));
          }
          this.register(this._optionsService.onMultipleOptionChange(["fontFamily", "fontSize"], () => this.measure()));
        }
        measure() {
          const e = this._measureStrategy.measure();
          e.width === this.width && e.height === this.height || (this.width = e.width, this.height = e.height, this._onCharSizeChange.fire());
        }
      };
      i.CharSizeService = m = o([c(2, a.IOptionsService)], m);
      class l extends v.Disposable {
        constructor() {
          super(...arguments), this._result = { width: 0, height: 0 };
        }
        _validateAndSet(t, h) {
          t !== void 0 && t > 0 && h !== void 0 && h > 0 && (this._result.width = t, this._result.height = h);
        }
      }
      class s extends l {
        constructor(t, h, g) {
          super(), this._document = t, this._parentElement = h, this._optionsService = g, this._measureElement = this._document.createElement("span"), this._measureElement.classList.add("xterm-char-measure-element"), this._measureElement.textContent = "W".repeat(32), this._measureElement.setAttribute("aria-hidden", "true"), this._measureElement.style.whiteSpace = "pre", this._measureElement.style.fontKerning = "none", this._parentElement.appendChild(this._measureElement);
        }
        measure() {
          return this._measureElement.style.fontFamily = this._optionsService.rawOptions.fontFamily, this._measureElement.style.fontSize = `${this._optionsService.rawOptions.fontSize}px`, this._validateAndSet(Number(this._measureElement.offsetWidth) / 32, Number(this._measureElement.offsetHeight)), this._result;
        }
      }
      class r extends l {
        constructor(t) {
          super(), this._optionsService = t, this._canvas = new OffscreenCanvas(100, 100), this._ctx = this._canvas.getContext("2d");
          const h = this._ctx.measureText("W");
          if (!("width" in h && "fontBoundingBoxAscent" in h && "fontBoundingBoxDescent" in h))
            throw new Error("Required font metrics not supported");
        }
        measure() {
          this._ctx.font = `${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;
          const t = this._ctx.measureText("W");
          return this._validateAndSet(t.width, t.fontBoundingBoxAscent + t.fontBoundingBoxDescent), this._result;
        }
      }
    }, 4269: function(k, i, n) {
      var o = this && this.__decorate || function(r, e, t, h) {
        var g, u = arguments.length, S = u < 3 ? e : h === null ? h = Object.getOwnPropertyDescriptor(e, t) : h;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          S = Reflect.decorate(r, e, t, h);
        else
          for (var _ = r.length - 1; _ >= 0; _--)
            (g = r[_]) && (S = (u < 3 ? g(S) : u > 3 ? g(e, t, S) : g(e, t)) || S);
        return u > 3 && S && Object.defineProperty(e, t, S), S;
      }, c = this && this.__param || function(r, e) {
        return function(t, h) {
          e(t, h, r);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.CharacterJoinerService = i.JoinedCellData = void 0;
      const a = n(3734), d = n(643), v = n(511), m = n(2585);
      class l extends a.AttributeData {
        constructor(e, t, h) {
          super(), this.content = 0, this.combinedData = "", this.fg = e.fg, this.bg = e.bg, this.combinedData = t, this._width = h;
        }
        isCombined() {
          return 2097152;
        }
        getWidth() {
          return this._width;
        }
        getChars() {
          return this.combinedData;
        }
        getCode() {
          return 2097151;
        }
        setFromCharData(e) {
          throw new Error("not implemented");
        }
        getAsCharData() {
          return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
        }
      }
      i.JoinedCellData = l;
      let s = i.CharacterJoinerService = class jt {
        constructor(e) {
          this._bufferService = e, this._characterJoiners = [], this._nextCharacterJoinerId = 0, this._workCell = new v.CellData();
        }
        register(e) {
          const t = { id: this._nextCharacterJoinerId++, handler: e };
          return this._characterJoiners.push(t), t.id;
        }
        deregister(e) {
          for (let t = 0; t < this._characterJoiners.length; t++)
            if (this._characterJoiners[t].id === e)
              return this._characterJoiners.splice(t, 1), !0;
          return !1;
        }
        getJoinedCharacters(e) {
          if (this._characterJoiners.length === 0)
            return [];
          const t = this._bufferService.buffer.lines.get(e);
          if (!t || t.length === 0)
            return [];
          const h = [], g = t.translateToString(!0);
          let u = 0, S = 0, _ = 0, b = t.getFg(0), R = t.getBg(0);
          for (let B = 0; B < t.getTrimmedLength(); B++)
            if (t.loadCell(B, this._workCell), this._workCell.getWidth() !== 0) {
              if (this._workCell.fg !== b || this._workCell.bg !== R) {
                if (B - u > 1) {
                  const T = this._getJoinedRanges(g, _, S, t, u);
                  for (let L = 0; L < T.length; L++)
                    h.push(T[L]);
                }
                u = B, _ = S, b = this._workCell.fg, R = this._workCell.bg;
              }
              S += this._workCell.getChars().length || d.WHITESPACE_CELL_CHAR.length;
            }
          if (this._bufferService.cols - u > 1) {
            const B = this._getJoinedRanges(g, _, S, t, u);
            for (let T = 0; T < B.length; T++)
              h.push(B[T]);
          }
          return h;
        }
        _getJoinedRanges(e, t, h, g, u) {
          const S = e.substring(t, h);
          let _ = [];
          try {
            _ = this._characterJoiners[0].handler(S);
          } catch (b) {
            console.error(b);
          }
          for (let b = 1; b < this._characterJoiners.length; b++)
            try {
              const R = this._characterJoiners[b].handler(S);
              for (let B = 0; B < R.length; B++)
                jt._mergeRanges(_, R[B]);
            } catch (R) {
              console.error(R);
            }
          return this._stringRangesToCellRanges(_, g, u), _;
        }
        _stringRangesToCellRanges(e, t, h) {
          let g = 0, u = !1, S = 0, _ = e[g];
          if (_) {
            for (let b = h; b < this._bufferService.cols; b++) {
              const R = t.getWidth(b), B = t.getString(b).length || d.WHITESPACE_CELL_CHAR.length;
              if (R !== 0) {
                if (!u && _[0] <= S && (_[0] = b, u = !0), _[1] <= S) {
                  if (_[1] = b, _ = e[++g], !_)
                    break;
                  _[0] <= S ? (_[0] = b, u = !0) : u = !1;
                }
                S += B;
              }
            }
            _ && (_[1] = this._bufferService.cols);
          }
        }
        static _mergeRanges(e, t) {
          let h = !1;
          for (let g = 0; g < e.length; g++) {
            const u = e[g];
            if (h) {
              if (t[1] <= u[0])
                return e[g - 1][1] = t[1], e;
              if (t[1] <= u[1])
                return e[g - 1][1] = Math.max(t[1], u[1]), e.splice(g, 1), e;
              e.splice(g, 1), g--;
            } else {
              if (t[1] <= u[0])
                return e.splice(g, 0, t), e;
              if (t[1] <= u[1])
                return u[0] = Math.min(t[0], u[0]), e;
              t[0] < u[1] && (u[0] = Math.min(t[0], u[0]), h = !0);
            }
          }
          return h ? e[e.length - 1][1] = t[1] : e.push(t), e;
        }
      };
      i.CharacterJoinerService = s = o([c(0, m.IBufferService)], s);
    }, 5114: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.CoreBrowserService = void 0;
      const o = n(844), c = n(8460), a = n(3656);
      class d extends o.Disposable {
        constructor(l, s, r) {
          super(), this._textarea = l, this._window = s, this.mainDocument = r, this._isFocused = !1, this._cachedIsFocused = void 0, this._screenDprMonitor = new v(this._window), this._onDprChange = this.register(new c.EventEmitter()), this.onDprChange = this._onDprChange.event, this._onWindowChange = this.register(new c.EventEmitter()), this.onWindowChange = this._onWindowChange.event, this.register(this.onWindowChange((e) => this._screenDprMonitor.setWindow(e))), this.register((0, c.forwardEvent)(this._screenDprMonitor.onDprChange, this._onDprChange)), this._textarea.addEventListener("focus", () => this._isFocused = !0), this._textarea.addEventListener("blur", () => this._isFocused = !1);
        }
        get window() {
          return this._window;
        }
        set window(l) {
          this._window !== l && (this._window = l, this._onWindowChange.fire(this._window));
        }
        get dpr() {
          return this.window.devicePixelRatio;
        }
        get isFocused() {
          return this._cachedIsFocused === void 0 && (this._cachedIsFocused = this._isFocused && this._textarea.ownerDocument.hasFocus(), queueMicrotask(() => this._cachedIsFocused = void 0)), this._cachedIsFocused;
        }
      }
      i.CoreBrowserService = d;
      class v extends o.Disposable {
        constructor(l) {
          super(), this._parentWindow = l, this._windowResizeListener = this.register(new o.MutableDisposable()), this._onDprChange = this.register(new c.EventEmitter()), this.onDprChange = this._onDprChange.event, this._outerListener = () => this._setDprAndFireIfDiffers(), this._currentDevicePixelRatio = this._parentWindow.devicePixelRatio, this._updateDpr(), this._setWindowResizeListener(), this.register((0, o.toDisposable)(() => this.clearListener()));
        }
        setWindow(l) {
          this._parentWindow = l, this._setWindowResizeListener(), this._setDprAndFireIfDiffers();
        }
        _setWindowResizeListener() {
          this._windowResizeListener.value = (0, a.addDisposableDomListener)(this._parentWindow, "resize", () => this._setDprAndFireIfDiffers());
        }
        _setDprAndFireIfDiffers() {
          this._parentWindow.devicePixelRatio !== this._currentDevicePixelRatio && this._onDprChange.fire(this._parentWindow.devicePixelRatio), this._updateDpr();
        }
        _updateDpr() {
          var l;
          this._outerListener && ((l = this._resolutionMediaMatchList) == null || l.removeListener(this._outerListener), this._currentDevicePixelRatio = this._parentWindow.devicePixelRatio, this._resolutionMediaMatchList = this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`), this._resolutionMediaMatchList.addListener(this._outerListener));
        }
        clearListener() {
          this._resolutionMediaMatchList && this._outerListener && (this._resolutionMediaMatchList.removeListener(this._outerListener), this._resolutionMediaMatchList = void 0, this._outerListener = void 0);
        }
      }
    }, 779: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.LinkProviderService = void 0;
      const o = n(844);
      class c extends o.Disposable {
        constructor() {
          super(), this.linkProviders = [], this.register((0, o.toDisposable)(() => this.linkProviders.length = 0));
        }
        registerLinkProvider(d) {
          return this.linkProviders.push(d), { dispose: () => {
            const v = this.linkProviders.indexOf(d);
            v !== -1 && this.linkProviders.splice(v, 1);
          } };
        }
      }
      i.LinkProviderService = c;
    }, 8934: function(k, i, n) {
      var o = this && this.__decorate || function(m, l, s, r) {
        var e, t = arguments.length, h = t < 3 ? l : r === null ? r = Object.getOwnPropertyDescriptor(l, s) : r;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          h = Reflect.decorate(m, l, s, r);
        else
          for (var g = m.length - 1; g >= 0; g--)
            (e = m[g]) && (h = (t < 3 ? e(h) : t > 3 ? e(l, s, h) : e(l, s)) || h);
        return t > 3 && h && Object.defineProperty(l, s, h), h;
      }, c = this && this.__param || function(m, l) {
        return function(s, r) {
          l(s, r, m);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.MouseService = void 0;
      const a = n(4725), d = n(9806);
      let v = i.MouseService = class {
        constructor(m, l) {
          this._renderService = m, this._charSizeService = l;
        }
        getCoords(m, l, s, r, e) {
          return (0, d.getCoords)(window, m, l, s, r, this._charSizeService.hasValidSize, this._renderService.dimensions.css.cell.width, this._renderService.dimensions.css.cell.height, e);
        }
        getMouseReportCoords(m, l) {
          const s = (0, d.getCoordsRelativeToElement)(window, m, l);
          if (this._charSizeService.hasValidSize)
            return s[0] = Math.min(Math.max(s[0], 0), this._renderService.dimensions.css.canvas.width - 1), s[1] = Math.min(Math.max(s[1], 0), this._renderService.dimensions.css.canvas.height - 1), { col: Math.floor(s[0] / this._renderService.dimensions.css.cell.width), row: Math.floor(s[1] / this._renderService.dimensions.css.cell.height), x: Math.floor(s[0]), y: Math.floor(s[1]) };
        }
      };
      i.MouseService = v = o([c(0, a.IRenderService), c(1, a.ICharSizeService)], v);
    }, 3230: function(k, i, n) {
      var o = this && this.__decorate || function(e, t, h, g) {
        var u, S = arguments.length, _ = S < 3 ? t : g === null ? g = Object.getOwnPropertyDescriptor(t, h) : g;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          _ = Reflect.decorate(e, t, h, g);
        else
          for (var b = e.length - 1; b >= 0; b--)
            (u = e[b]) && (_ = (S < 3 ? u(_) : S > 3 ? u(t, h, _) : u(t, h)) || _);
        return S > 3 && _ && Object.defineProperty(t, h, _), _;
      }, c = this && this.__param || function(e, t) {
        return function(h, g) {
          t(h, g, e);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.RenderService = void 0;
      const a = n(6193), d = n(4725), v = n(8460), m = n(844), l = n(7226), s = n(2585);
      let r = i.RenderService = class extends m.Disposable {
        get dimensions() {
          return this._renderer.value.dimensions;
        }
        constructor(e, t, h, g, u, S, _, b) {
          super(), this._rowCount = e, this._charSizeService = g, this._renderer = this.register(new m.MutableDisposable()), this._pausedResizeTask = new l.DebouncedIdleTask(), this._observerDisposable = this.register(new m.MutableDisposable()), this._isPaused = !1, this._needsFullRefresh = !1, this._isNextRenderRedrawOnly = !0, this._needsSelectionRefresh = !1, this._canvasWidth = 0, this._canvasHeight = 0, this._selectionState = { start: void 0, end: void 0, columnSelectMode: !1 }, this._onDimensionsChange = this.register(new v.EventEmitter()), this.onDimensionsChange = this._onDimensionsChange.event, this._onRenderedViewportChange = this.register(new v.EventEmitter()), this.onRenderedViewportChange = this._onRenderedViewportChange.event, this._onRender = this.register(new v.EventEmitter()), this.onRender = this._onRender.event, this._onRefreshRequest = this.register(new v.EventEmitter()), this.onRefreshRequest = this._onRefreshRequest.event, this._renderDebouncer = new a.RenderDebouncer((R, B) => this._renderRows(R, B), _), this.register(this._renderDebouncer), this.register(_.onDprChange(() => this.handleDevicePixelRatioChange())), this.register(S.onResize(() => this._fullRefresh())), this.register(S.buffers.onBufferActivate(() => {
            var R;
            return (R = this._renderer.value) == null ? void 0 : R.clear();
          })), this.register(h.onOptionChange(() => this._handleOptionsChanged())), this.register(this._charSizeService.onCharSizeChange(() => this.handleCharSizeChanged())), this.register(u.onDecorationRegistered(() => this._fullRefresh())), this.register(u.onDecorationRemoved(() => this._fullRefresh())), this.register(h.onMultipleOptionChange(["customGlyphs", "drawBoldTextInBrightColors", "letterSpacing", "lineHeight", "fontFamily", "fontSize", "fontWeight", "fontWeightBold", "minimumContrastRatio", "rescaleOverlappingGlyphs"], () => {
            this.clear(), this.handleResize(S.cols, S.rows), this._fullRefresh();
          })), this.register(h.onMultipleOptionChange(["cursorBlink", "cursorStyle"], () => this.refreshRows(S.buffer.y, S.buffer.y, !0))), this.register(b.onChangeColors(() => this._fullRefresh())), this._registerIntersectionObserver(_.window, t), this.register(_.onWindowChange((R) => this._registerIntersectionObserver(R, t)));
        }
        _registerIntersectionObserver(e, t) {
          if ("IntersectionObserver" in e) {
            const h = new e.IntersectionObserver((g) => this._handleIntersectionChange(g[g.length - 1]), { threshold: 0 });
            h.observe(t), this._observerDisposable.value = (0, m.toDisposable)(() => h.disconnect());
          }
        }
        _handleIntersectionChange(e) {
          this._isPaused = e.isIntersecting === void 0 ? e.intersectionRatio === 0 : !e.isIntersecting, this._isPaused || this._charSizeService.hasValidSize || this._charSizeService.measure(), !this._isPaused && this._needsFullRefresh && (this._pausedResizeTask.flush(), this.refreshRows(0, this._rowCount - 1), this._needsFullRefresh = !1);
        }
        refreshRows(e, t, h = !1) {
          this._isPaused ? this._needsFullRefresh = !0 : (h || (this._isNextRenderRedrawOnly = !1), this._renderDebouncer.refresh(e, t, this._rowCount));
        }
        _renderRows(e, t) {
          this._renderer.value && (e = Math.min(e, this._rowCount - 1), t = Math.min(t, this._rowCount - 1), this._renderer.value.renderRows(e, t), this._needsSelectionRefresh && (this._renderer.value.handleSelectionChanged(this._selectionState.start, this._selectionState.end, this._selectionState.columnSelectMode), this._needsSelectionRefresh = !1), this._isNextRenderRedrawOnly || this._onRenderedViewportChange.fire({ start: e, end: t }), this._onRender.fire({ start: e, end: t }), this._isNextRenderRedrawOnly = !0);
        }
        resize(e, t) {
          this._rowCount = t, this._fireOnCanvasResize();
        }
        _handleOptionsChanged() {
          this._renderer.value && (this.refreshRows(0, this._rowCount - 1), this._fireOnCanvasResize());
        }
        _fireOnCanvasResize() {
          this._renderer.value && (this._renderer.value.dimensions.css.canvas.width === this._canvasWidth && this._renderer.value.dimensions.css.canvas.height === this._canvasHeight || this._onDimensionsChange.fire(this._renderer.value.dimensions));
        }
        hasRenderer() {
          return !!this._renderer.value;
        }
        setRenderer(e) {
          this._renderer.value = e, this._renderer.value && (this._renderer.value.onRequestRedraw((t) => this.refreshRows(t.start, t.end, !0)), this._needsSelectionRefresh = !0, this._fullRefresh());
        }
        addRefreshCallback(e) {
          return this._renderDebouncer.addRefreshCallback(e);
        }
        _fullRefresh() {
          this._isPaused ? this._needsFullRefresh = !0 : this.refreshRows(0, this._rowCount - 1);
        }
        clearTextureAtlas() {
          var e, t;
          this._renderer.value && ((t = (e = this._renderer.value).clearTextureAtlas) == null || t.call(e), this._fullRefresh());
        }
        handleDevicePixelRatioChange() {
          this._charSizeService.measure(), this._renderer.value && (this._renderer.value.handleDevicePixelRatioChange(), this.refreshRows(0, this._rowCount - 1));
        }
        handleResize(e, t) {
          this._renderer.value && (this._isPaused ? this._pausedResizeTask.set(() => {
            var h;
            return (h = this._renderer.value) == null ? void 0 : h.handleResize(e, t);
          }) : this._renderer.value.handleResize(e, t), this._fullRefresh());
        }
        handleCharSizeChanged() {
          var e;
          (e = this._renderer.value) == null || e.handleCharSizeChanged();
        }
        handleBlur() {
          var e;
          (e = this._renderer.value) == null || e.handleBlur();
        }
        handleFocus() {
          var e;
          (e = this._renderer.value) == null || e.handleFocus();
        }
        handleSelectionChanged(e, t, h) {
          var g;
          this._selectionState.start = e, this._selectionState.end = t, this._selectionState.columnSelectMode = h, (g = this._renderer.value) == null || g.handleSelectionChanged(e, t, h);
        }
        handleCursorMove() {
          var e;
          (e = this._renderer.value) == null || e.handleCursorMove();
        }
        clear() {
          var e;
          (e = this._renderer.value) == null || e.clear();
        }
      };
      i.RenderService = r = o([c(2, s.IOptionsService), c(3, d.ICharSizeService), c(4, s.IDecorationService), c(5, s.IBufferService), c(6, d.ICoreBrowserService), c(7, d.IThemeService)], r);
    }, 9312: function(k, i, n) {
      var o = this && this.__decorate || function(_, b, R, B) {
        var T, L = arguments.length, H = L < 3 ? b : B === null ? B = Object.getOwnPropertyDescriptor(b, R) : B;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          H = Reflect.decorate(_, b, R, B);
        else
          for (var W = _.length - 1; W >= 0; W--)
            (T = _[W]) && (H = (L < 3 ? T(H) : L > 3 ? T(b, R, H) : T(b, R)) || H);
        return L > 3 && H && Object.defineProperty(b, R, H), H;
      }, c = this && this.__param || function(_, b) {
        return function(R, B) {
          b(R, B, _);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.SelectionService = void 0;
      const a = n(9806), d = n(9504), v = n(456), m = n(4725), l = n(8460), s = n(844), r = n(6114), e = n(4841), t = n(511), h = n(2585), g = " ", u = new RegExp(g, "g");
      let S = i.SelectionService = class extends s.Disposable {
        constructor(_, b, R, B, T, L, H, W, j) {
          super(), this._element = _, this._screenElement = b, this._linkifier = R, this._bufferService = B, this._coreService = T, this._mouseService = L, this._optionsService = H, this._renderService = W, this._coreBrowserService = j, this._dragScrollAmount = 0, this._enabled = !0, this._workCell = new t.CellData(), this._mouseDownTimeStamp = 0, this._oldHasSelection = !1, this._oldSelectionStart = void 0, this._oldSelectionEnd = void 0, this._onLinuxMouseSelection = this.register(new l.EventEmitter()), this.onLinuxMouseSelection = this._onLinuxMouseSelection.event, this._onRedrawRequest = this.register(new l.EventEmitter()), this.onRequestRedraw = this._onRedrawRequest.event, this._onSelectionChange = this.register(new l.EventEmitter()), this.onSelectionChange = this._onSelectionChange.event, this._onRequestScrollLines = this.register(new l.EventEmitter()), this.onRequestScrollLines = this._onRequestScrollLines.event, this._mouseMoveListener = (V) => this._handleMouseMove(V), this._mouseUpListener = (V) => this._handleMouseUp(V), this._coreService.onUserInput(() => {
            this.hasSelection && this.clearSelection();
          }), this._trimListener = this._bufferService.buffer.lines.onTrim((V) => this._handleTrim(V)), this.register(this._bufferService.buffers.onBufferActivate((V) => this._handleBufferActivate(V))), this.enable(), this._model = new v.SelectionModel(this._bufferService), this._activeSelectionMode = 0, this.register((0, s.toDisposable)(() => {
            this._removeMouseDownListeners();
          }));
        }
        reset() {
          this.clearSelection();
        }
        disable() {
          this.clearSelection(), this._enabled = !1;
        }
        enable() {
          this._enabled = !0;
        }
        get selectionStart() {
          return this._model.finalSelectionStart;
        }
        get selectionEnd() {
          return this._model.finalSelectionEnd;
        }
        get hasSelection() {
          const _ = this._model.finalSelectionStart, b = this._model.finalSelectionEnd;
          return !(!_ || !b || _[0] === b[0] && _[1] === b[1]);
        }
        get selectionText() {
          const _ = this._model.finalSelectionStart, b = this._model.finalSelectionEnd;
          if (!_ || !b)
            return "";
          const R = this._bufferService.buffer, B = [];
          if (this._activeSelectionMode === 3) {
            if (_[0] === b[0])
              return "";
            const T = _[0] < b[0] ? _[0] : b[0], L = _[0] < b[0] ? b[0] : _[0];
            for (let H = _[1]; H <= b[1]; H++) {
              const W = R.translateBufferLineToString(H, !0, T, L);
              B.push(W);
            }
          } else {
            const T = _[1] === b[1] ? b[0] : void 0;
            B.push(R.translateBufferLineToString(_[1], !0, _[0], T));
            for (let L = _[1] + 1; L <= b[1] - 1; L++) {
              const H = R.lines.get(L), W = R.translateBufferLineToString(L, !0);
              H != null && H.isWrapped ? B[B.length - 1] += W : B.push(W);
            }
            if (_[1] !== b[1]) {
              const L = R.lines.get(b[1]), H = R.translateBufferLineToString(b[1], !0, 0, b[0]);
              L && L.isWrapped ? B[B.length - 1] += H : B.push(H);
            }
          }
          return B.map((T) => T.replace(u, " ")).join(r.isWindows ? `\r
` : `
`);
        }
        clearSelection() {
          this._model.clearSelection(), this._removeMouseDownListeners(), this.refresh(), this._onSelectionChange.fire();
        }
        refresh(_) {
          this._refreshAnimationFrame || (this._refreshAnimationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._refresh())), r.isLinux && _ && this.selectionText.length && this._onLinuxMouseSelection.fire(this.selectionText);
        }
        _refresh() {
          this._refreshAnimationFrame = void 0, this._onRedrawRequest.fire({ start: this._model.finalSelectionStart, end: this._model.finalSelectionEnd, columnSelectMode: this._activeSelectionMode === 3 });
        }
        _isClickInSelection(_) {
          const b = this._getMouseBufferCoords(_), R = this._model.finalSelectionStart, B = this._model.finalSelectionEnd;
          return !!(R && B && b) && this._areCoordsInSelection(b, R, B);
        }
        isCellInSelection(_, b) {
          const R = this._model.finalSelectionStart, B = this._model.finalSelectionEnd;
          return !(!R || !B) && this._areCoordsInSelection([_, b], R, B);
        }
        _areCoordsInSelection(_, b, R) {
          return _[1] > b[1] && _[1] < R[1] || b[1] === R[1] && _[1] === b[1] && _[0] >= b[0] && _[0] < R[0] || b[1] < R[1] && _[1] === R[1] && _[0] < R[0] || b[1] < R[1] && _[1] === b[1] && _[0] >= b[0];
        }
        _selectWordAtCursor(_, b) {
          var T, L;
          const R = (L = (T = this._linkifier.currentLink) == null ? void 0 : T.link) == null ? void 0 : L.range;
          if (R)
            return this._model.selectionStart = [R.start.x - 1, R.start.y - 1], this._model.selectionStartLength = (0, e.getRangeLength)(R, this._bufferService.cols), this._model.selectionEnd = void 0, !0;
          const B = this._getMouseBufferCoords(_);
          return !!B && (this._selectWordAt(B, b), this._model.selectionEnd = void 0, !0);
        }
        selectAll() {
          this._model.isSelectAllActive = !0, this.refresh(), this._onSelectionChange.fire();
        }
        selectLines(_, b) {
          this._model.clearSelection(), _ = Math.max(_, 0), b = Math.min(b, this._bufferService.buffer.lines.length - 1), this._model.selectionStart = [0, _], this._model.selectionEnd = [this._bufferService.cols, b], this.refresh(), this._onSelectionChange.fire();
        }
        _handleTrim(_) {
          this._model.handleTrim(_) && this.refresh();
        }
        _getMouseBufferCoords(_) {
          const b = this._mouseService.getCoords(_, this._screenElement, this._bufferService.cols, this._bufferService.rows, !0);
          if (b)
            return b[0]--, b[1]--, b[1] += this._bufferService.buffer.ydisp, b;
        }
        _getMouseEventScrollAmount(_) {
          let b = (0, a.getCoordsRelativeToElement)(this._coreBrowserService.window, _, this._screenElement)[1];
          const R = this._renderService.dimensions.css.canvas.height;
          return b >= 0 && b <= R ? 0 : (b > R && (b -= R), b = Math.min(Math.max(b, -50), 50), b /= 50, b / Math.abs(b) + Math.round(14 * b));
        }
        shouldForceSelection(_) {
          return r.isMac ? _.altKey && this._optionsService.rawOptions.macOptionClickForcesSelection : _.shiftKey;
        }
        handleMouseDown(_) {
          if (this._mouseDownTimeStamp = _.timeStamp, (_.button !== 2 || !this.hasSelection) && _.button === 0) {
            if (!this._enabled) {
              if (!this.shouldForceSelection(_))
                return;
              _.stopPropagation();
            }
            _.preventDefault(), this._dragScrollAmount = 0, this._enabled && _.shiftKey ? this._handleIncrementalClick(_) : _.detail === 1 ? this._handleSingleClick(_) : _.detail === 2 ? this._handleDoubleClick(_) : _.detail === 3 && this._handleTripleClick(_), this._addMouseDownListeners(), this.refresh(!0);
          }
        }
        _addMouseDownListeners() {
          this._screenElement.ownerDocument && (this._screenElement.ownerDocument.addEventListener("mousemove", this._mouseMoveListener), this._screenElement.ownerDocument.addEventListener("mouseup", this._mouseUpListener)), this._dragScrollIntervalTimer = this._coreBrowserService.window.setInterval(() => this._dragScroll(), 50);
        }
        _removeMouseDownListeners() {
          this._screenElement.ownerDocument && (this._screenElement.ownerDocument.removeEventListener("mousemove", this._mouseMoveListener), this._screenElement.ownerDocument.removeEventListener("mouseup", this._mouseUpListener)), this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer), this._dragScrollIntervalTimer = void 0;
        }
        _handleIncrementalClick(_) {
          this._model.selectionStart && (this._model.selectionEnd = this._getMouseBufferCoords(_));
        }
        _handleSingleClick(_) {
          if (this._model.selectionStartLength = 0, this._model.isSelectAllActive = !1, this._activeSelectionMode = this.shouldColumnSelect(_) ? 3 : 0, this._model.selectionStart = this._getMouseBufferCoords(_), !this._model.selectionStart)
            return;
          this._model.selectionEnd = void 0;
          const b = this._bufferService.buffer.lines.get(this._model.selectionStart[1]);
          b && b.length !== this._model.selectionStart[0] && b.hasWidth(this._model.selectionStart[0]) === 0 && this._model.selectionStart[0]++;
        }
        _handleDoubleClick(_) {
          this._selectWordAtCursor(_, !0) && (this._activeSelectionMode = 1);
        }
        _handleTripleClick(_) {
          const b = this._getMouseBufferCoords(_);
          b && (this._activeSelectionMode = 2, this._selectLineAt(b[1]));
        }
        shouldColumnSelect(_) {
          return _.altKey && !(r.isMac && this._optionsService.rawOptions.macOptionClickForcesSelection);
        }
        _handleMouseMove(_) {
          if (_.stopImmediatePropagation(), !this._model.selectionStart)
            return;
          const b = this._model.selectionEnd ? [this._model.selectionEnd[0], this._model.selectionEnd[1]] : null;
          if (this._model.selectionEnd = this._getMouseBufferCoords(_), !this._model.selectionEnd)
            return void this.refresh(!0);
          this._activeSelectionMode === 2 ? this._model.selectionEnd[1] < this._model.selectionStart[1] ? this._model.selectionEnd[0] = 0 : this._model.selectionEnd[0] = this._bufferService.cols : this._activeSelectionMode === 1 && this._selectToWordAt(this._model.selectionEnd), this._dragScrollAmount = this._getMouseEventScrollAmount(_), this._activeSelectionMode !== 3 && (this._dragScrollAmount > 0 ? this._model.selectionEnd[0] = this._bufferService.cols : this._dragScrollAmount < 0 && (this._model.selectionEnd[0] = 0));
          const R = this._bufferService.buffer;
          if (this._model.selectionEnd[1] < R.lines.length) {
            const B = R.lines.get(this._model.selectionEnd[1]);
            B && B.hasWidth(this._model.selectionEnd[0]) === 0 && this._model.selectionEnd[0] < this._bufferService.cols && this._model.selectionEnd[0]++;
          }
          b && b[0] === this._model.selectionEnd[0] && b[1] === this._model.selectionEnd[1] || this.refresh(!0);
        }
        _dragScroll() {
          if (this._model.selectionEnd && this._model.selectionStart && this._dragScrollAmount) {
            this._onRequestScrollLines.fire({ amount: this._dragScrollAmount, suppressScrollEvent: !1 });
            const _ = this._bufferService.buffer;
            this._dragScrollAmount > 0 ? (this._activeSelectionMode !== 3 && (this._model.selectionEnd[0] = this._bufferService.cols), this._model.selectionEnd[1] = Math.min(_.ydisp + this._bufferService.rows, _.lines.length - 1)) : (this._activeSelectionMode !== 3 && (this._model.selectionEnd[0] = 0), this._model.selectionEnd[1] = _.ydisp), this.refresh();
          }
        }
        _handleMouseUp(_) {
          const b = _.timeStamp - this._mouseDownTimeStamp;
          if (this._removeMouseDownListeners(), this.selectionText.length <= 1 && b < 500 && _.altKey && this._optionsService.rawOptions.altClickMovesCursor) {
            if (this._bufferService.buffer.ybase === this._bufferService.buffer.ydisp) {
              const R = this._mouseService.getCoords(_, this._element, this._bufferService.cols, this._bufferService.rows, !1);
              if (R && R[0] !== void 0 && R[1] !== void 0) {
                const B = (0, d.moveToCellSequence)(R[0] - 1, R[1] - 1, this._bufferService, this._coreService.decPrivateModes.applicationCursorKeys);
                this._coreService.triggerDataEvent(B, !0);
              }
            }
          } else
            this._fireEventIfSelectionChanged();
        }
        _fireEventIfSelectionChanged() {
          const _ = this._model.finalSelectionStart, b = this._model.finalSelectionEnd, R = !(!_ || !b || _[0] === b[0] && _[1] === b[1]);
          R ? _ && b && (this._oldSelectionStart && this._oldSelectionEnd && _[0] === this._oldSelectionStart[0] && _[1] === this._oldSelectionStart[1] && b[0] === this._oldSelectionEnd[0] && b[1] === this._oldSelectionEnd[1] || this._fireOnSelectionChange(_, b, R)) : this._oldHasSelection && this._fireOnSelectionChange(_, b, R);
        }
        _fireOnSelectionChange(_, b, R) {
          this._oldSelectionStart = _, this._oldSelectionEnd = b, this._oldHasSelection = R, this._onSelectionChange.fire();
        }
        _handleBufferActivate(_) {
          this.clearSelection(), this._trimListener.dispose(), this._trimListener = _.activeBuffer.lines.onTrim((b) => this._handleTrim(b));
        }
        _convertViewportColToCharacterIndex(_, b) {
          let R = b;
          for (let B = 0; b >= B; B++) {
            const T = _.loadCell(B, this._workCell).getChars().length;
            this._workCell.getWidth() === 0 ? R-- : T > 1 && b !== B && (R += T - 1);
          }
          return R;
        }
        setSelection(_, b, R) {
          this._model.clearSelection(), this._removeMouseDownListeners(), this._model.selectionStart = [_, b], this._model.selectionStartLength = R, this.refresh(), this._fireEventIfSelectionChanged();
        }
        rightClickSelect(_) {
          this._isClickInSelection(_) || (this._selectWordAtCursor(_, !1) && this.refresh(!0), this._fireEventIfSelectionChanged());
        }
        _getWordAt(_, b, R = !0, B = !0) {
          if (_[0] >= this._bufferService.cols)
            return;
          const T = this._bufferService.buffer, L = T.lines.get(_[1]);
          if (!L)
            return;
          const H = T.translateBufferLineToString(_[1], !1);
          let W = this._convertViewportColToCharacterIndex(L, _[0]), j = W;
          const V = _[0] - W;
          let z = 0, C = 0, x = 0, A = 0;
          if (H.charAt(W) === " ") {
            for (; W > 0 && H.charAt(W - 1) === " "; )
              W--;
            for (; j < H.length && H.charAt(j + 1) === " "; )
              j++;
          } else {
            let q = _[0], X = _[0];
            L.getWidth(q) === 0 && (z++, q--), L.getWidth(X) === 2 && (C++, X++);
            const J = L.getString(X).length;
            for (J > 1 && (A += J - 1, j += J - 1); q > 0 && W > 0 && !this._isCharWordSeparator(L.loadCell(q - 1, this._workCell)); ) {
              L.loadCell(q - 1, this._workCell);
              const P = this._workCell.getChars().length;
              this._workCell.getWidth() === 0 ? (z++, q--) : P > 1 && (x += P - 1, W -= P - 1), W--, q--;
            }
            for (; X < L.length && j + 1 < H.length && !this._isCharWordSeparator(L.loadCell(X + 1, this._workCell)); ) {
              L.loadCell(X + 1, this._workCell);
              const P = this._workCell.getChars().length;
              this._workCell.getWidth() === 2 ? (C++, X++) : P > 1 && (A += P - 1, j += P - 1), j++, X++;
            }
          }
          j++;
          let O = W + V - z + x, I = Math.min(this._bufferService.cols, j - W + z + C - x - A);
          if (b || H.slice(W, j).trim() !== "") {
            if (R && O === 0 && L.getCodePoint(0) !== 32) {
              const q = T.lines.get(_[1] - 1);
              if (q && L.isWrapped && q.getCodePoint(this._bufferService.cols - 1) !== 32) {
                const X = this._getWordAt([this._bufferService.cols - 1, _[1] - 1], !1, !0, !1);
                if (X) {
                  const J = this._bufferService.cols - X.start;
                  O -= J, I += J;
                }
              }
            }
            if (B && O + I === this._bufferService.cols && L.getCodePoint(this._bufferService.cols - 1) !== 32) {
              const q = T.lines.get(_[1] + 1);
              if (q != null && q.isWrapped && q.getCodePoint(0) !== 32) {
                const X = this._getWordAt([0, _[1] + 1], !1, !1, !0);
                X && (I += X.length);
              }
            }
            return { start: O, length: I };
          }
        }
        _selectWordAt(_, b) {
          const R = this._getWordAt(_, b);
          if (R) {
            for (; R.start < 0; )
              R.start += this._bufferService.cols, _[1]--;
            this._model.selectionStart = [R.start, _[1]], this._model.selectionStartLength = R.length;
          }
        }
        _selectToWordAt(_) {
          const b = this._getWordAt(_, !0);
          if (b) {
            let R = _[1];
            for (; b.start < 0; )
              b.start += this._bufferService.cols, R--;
            if (!this._model.areSelectionValuesReversed())
              for (; b.start + b.length > this._bufferService.cols; )
                b.length -= this._bufferService.cols, R++;
            this._model.selectionEnd = [this._model.areSelectionValuesReversed() ? b.start : b.start + b.length, R];
          }
        }
        _isCharWordSeparator(_) {
          return _.getWidth() !== 0 && this._optionsService.rawOptions.wordSeparator.indexOf(_.getChars()) >= 0;
        }
        _selectLineAt(_) {
          const b = this._bufferService.buffer.getWrappedRangeForLine(_), R = { start: { x: 0, y: b.first }, end: { x: this._bufferService.cols - 1, y: b.last } };
          this._model.selectionStart = [0, b.first], this._model.selectionEnd = void 0, this._model.selectionStartLength = (0, e.getRangeLength)(R, this._bufferService.cols);
        }
      };
      i.SelectionService = S = o([c(3, h.IBufferService), c(4, h.ICoreService), c(5, m.IMouseService), c(6, h.IOptionsService), c(7, m.IRenderService), c(8, m.ICoreBrowserService)], S);
    }, 4725: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.ILinkProviderService = i.IThemeService = i.ICharacterJoinerService = i.ISelectionService = i.IRenderService = i.IMouseService = i.ICoreBrowserService = i.ICharSizeService = void 0;
      const o = n(8343);
      i.ICharSizeService = (0, o.createDecorator)("CharSizeService"), i.ICoreBrowserService = (0, o.createDecorator)("CoreBrowserService"), i.IMouseService = (0, o.createDecorator)("MouseService"), i.IRenderService = (0, o.createDecorator)("RenderService"), i.ISelectionService = (0, o.createDecorator)("SelectionService"), i.ICharacterJoinerService = (0, o.createDecorator)("CharacterJoinerService"), i.IThemeService = (0, o.createDecorator)("ThemeService"), i.ILinkProviderService = (0, o.createDecorator)("LinkProviderService");
    }, 6731: function(k, i, n) {
      var o = this && this.__decorate || function(S, _, b, R) {
        var B, T = arguments.length, L = T < 3 ? _ : R === null ? R = Object.getOwnPropertyDescriptor(_, b) : R;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          L = Reflect.decorate(S, _, b, R);
        else
          for (var H = S.length - 1; H >= 0; H--)
            (B = S[H]) && (L = (T < 3 ? B(L) : T > 3 ? B(_, b, L) : B(_, b)) || L);
        return T > 3 && L && Object.defineProperty(_, b, L), L;
      }, c = this && this.__param || function(S, _) {
        return function(b, R) {
          _(b, R, S);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.ThemeService = i.DEFAULT_ANSI_COLORS = void 0;
      const a = n(7239), d = n(8055), v = n(8460), m = n(844), l = n(2585), s = d.css.toColor("#ffffff"), r = d.css.toColor("#000000"), e = d.css.toColor("#ffffff"), t = d.css.toColor("#000000"), h = { css: "rgba(255, 255, 255, 0.3)", rgba: 4294967117 };
      i.DEFAULT_ANSI_COLORS = Object.freeze((() => {
        const S = [d.css.toColor("#2e3436"), d.css.toColor("#cc0000"), d.css.toColor("#4e9a06"), d.css.toColor("#c4a000"), d.css.toColor("#3465a4"), d.css.toColor("#75507b"), d.css.toColor("#06989a"), d.css.toColor("#d3d7cf"), d.css.toColor("#555753"), d.css.toColor("#ef2929"), d.css.toColor("#8ae234"), d.css.toColor("#fce94f"), d.css.toColor("#729fcf"), d.css.toColor("#ad7fa8"), d.css.toColor("#34e2e2"), d.css.toColor("#eeeeec")], _ = [0, 95, 135, 175, 215, 255];
        for (let b = 0; b < 216; b++) {
          const R = _[b / 36 % 6 | 0], B = _[b / 6 % 6 | 0], T = _[b % 6];
          S.push({ css: d.channels.toCss(R, B, T), rgba: d.channels.toRgba(R, B, T) });
        }
        for (let b = 0; b < 24; b++) {
          const R = 8 + 10 * b;
          S.push({ css: d.channels.toCss(R, R, R), rgba: d.channels.toRgba(R, R, R) });
        }
        return S;
      })());
      let g = i.ThemeService = class extends m.Disposable {
        get colors() {
          return this._colors;
        }
        constructor(S) {
          super(), this._optionsService = S, this._contrastCache = new a.ColorContrastCache(), this._halfContrastCache = new a.ColorContrastCache(), this._onChangeColors = this.register(new v.EventEmitter()), this.onChangeColors = this._onChangeColors.event, this._colors = { foreground: s, background: r, cursor: e, cursorAccent: t, selectionForeground: void 0, selectionBackgroundTransparent: h, selectionBackgroundOpaque: d.color.blend(r, h), selectionInactiveBackgroundTransparent: h, selectionInactiveBackgroundOpaque: d.color.blend(r, h), ansi: i.DEFAULT_ANSI_COLORS.slice(), contrastCache: this._contrastCache, halfContrastCache: this._halfContrastCache }, this._updateRestoreColors(), this._setTheme(this._optionsService.rawOptions.theme), this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio", () => this._contrastCache.clear())), this.register(this._optionsService.onSpecificOptionChange("theme", () => this._setTheme(this._optionsService.rawOptions.theme)));
        }
        _setTheme(S = {}) {
          const _ = this._colors;
          if (_.foreground = u(S.foreground, s), _.background = u(S.background, r), _.cursor = u(S.cursor, e), _.cursorAccent = u(S.cursorAccent, t), _.selectionBackgroundTransparent = u(S.selectionBackground, h), _.selectionBackgroundOpaque = d.color.blend(_.background, _.selectionBackgroundTransparent), _.selectionInactiveBackgroundTransparent = u(S.selectionInactiveBackground, _.selectionBackgroundTransparent), _.selectionInactiveBackgroundOpaque = d.color.blend(_.background, _.selectionInactiveBackgroundTransparent), _.selectionForeground = S.selectionForeground ? u(S.selectionForeground, d.NULL_COLOR) : void 0, _.selectionForeground === d.NULL_COLOR && (_.selectionForeground = void 0), d.color.isOpaque(_.selectionBackgroundTransparent) && (_.selectionBackgroundTransparent = d.color.opacity(_.selectionBackgroundTransparent, 0.3)), d.color.isOpaque(_.selectionInactiveBackgroundTransparent) && (_.selectionInactiveBackgroundTransparent = d.color.opacity(_.selectionInactiveBackgroundTransparent, 0.3)), _.ansi = i.DEFAULT_ANSI_COLORS.slice(), _.ansi[0] = u(S.black, i.DEFAULT_ANSI_COLORS[0]), _.ansi[1] = u(S.red, i.DEFAULT_ANSI_COLORS[1]), _.ansi[2] = u(S.green, i.DEFAULT_ANSI_COLORS[2]), _.ansi[3] = u(S.yellow, i.DEFAULT_ANSI_COLORS[3]), _.ansi[4] = u(S.blue, i.DEFAULT_ANSI_COLORS[4]), _.ansi[5] = u(S.magenta, i.DEFAULT_ANSI_COLORS[5]), _.ansi[6] = u(S.cyan, i.DEFAULT_ANSI_COLORS[6]), _.ansi[7] = u(S.white, i.DEFAULT_ANSI_COLORS[7]), _.ansi[8] = u(S.brightBlack, i.DEFAULT_ANSI_COLORS[8]), _.ansi[9] = u(S.brightRed, i.DEFAULT_ANSI_COLORS[9]), _.ansi[10] = u(S.brightGreen, i.DEFAULT_ANSI_COLORS[10]), _.ansi[11] = u(S.brightYellow, i.DEFAULT_ANSI_COLORS[11]), _.ansi[12] = u(S.brightBlue, i.DEFAULT_ANSI_COLORS[12]), _.ansi[13] = u(S.brightMagenta, i.DEFAULT_ANSI_COLORS[13]), _.ansi[14] = u(S.brightCyan, i.DEFAULT_ANSI_COLORS[14]), _.ansi[15] = u(S.brightWhite, i.DEFAULT_ANSI_COLORS[15]), S.extendedAnsi) {
            const b = Math.min(_.ansi.length - 16, S.extendedAnsi.length);
            for (let R = 0; R < b; R++)
              _.ansi[R + 16] = u(S.extendedAnsi[R], i.DEFAULT_ANSI_COLORS[R + 16]);
          }
          this._contrastCache.clear(), this._halfContrastCache.clear(), this._updateRestoreColors(), this._onChangeColors.fire(this.colors);
        }
        restoreColor(S) {
          this._restoreColor(S), this._onChangeColors.fire(this.colors);
        }
        _restoreColor(S) {
          if (S !== void 0)
            switch (S) {
              case 256:
                this._colors.foreground = this._restoreColors.foreground;
                break;
              case 257:
                this._colors.background = this._restoreColors.background;
                break;
              case 258:
                this._colors.cursor = this._restoreColors.cursor;
                break;
              default:
                this._colors.ansi[S] = this._restoreColors.ansi[S];
            }
          else
            for (let _ = 0; _ < this._restoreColors.ansi.length; ++_)
              this._colors.ansi[_] = this._restoreColors.ansi[_];
        }
        modifyColors(S) {
          S(this._colors), this._onChangeColors.fire(this.colors);
        }
        _updateRestoreColors() {
          this._restoreColors = { foreground: this._colors.foreground, background: this._colors.background, cursor: this._colors.cursor, ansi: this._colors.ansi.slice() };
        }
      };
      function u(S, _) {
        if (S !== void 0)
          try {
            return d.css.toColor(S);
          } catch {
          }
        return _;
      }
      i.ThemeService = g = o([c(0, l.IOptionsService)], g);
    }, 6349: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.CircularList = void 0;
      const o = n(8460), c = n(844);
      class a extends c.Disposable {
        constructor(v) {
          super(), this._maxLength = v, this.onDeleteEmitter = this.register(new o.EventEmitter()), this.onDelete = this.onDeleteEmitter.event, this.onInsertEmitter = this.register(new o.EventEmitter()), this.onInsert = this.onInsertEmitter.event, this.onTrimEmitter = this.register(new o.EventEmitter()), this.onTrim = this.onTrimEmitter.event, this._array = new Array(this._maxLength), this._startIndex = 0, this._length = 0;
        }
        get maxLength() {
          return this._maxLength;
        }
        set maxLength(v) {
          if (this._maxLength === v)
            return;
          const m = new Array(v);
          for (let l = 0; l < Math.min(v, this.length); l++)
            m[l] = this._array[this._getCyclicIndex(l)];
          this._array = m, this._maxLength = v, this._startIndex = 0;
        }
        get length() {
          return this._length;
        }
        set length(v) {
          if (v > this._length)
            for (let m = this._length; m < v; m++)
              this._array[m] = void 0;
          this._length = v;
        }
        get(v) {
          return this._array[this._getCyclicIndex(v)];
        }
        set(v, m) {
          this._array[this._getCyclicIndex(v)] = m;
        }
        push(v) {
          this._array[this._getCyclicIndex(this._length)] = v, this._length === this._maxLength ? (this._startIndex = ++this._startIndex % this._maxLength, this.onTrimEmitter.fire(1)) : this._length++;
        }
        recycle() {
          if (this._length !== this._maxLength)
            throw new Error("Can only recycle when the buffer is full");
          return this._startIndex = ++this._startIndex % this._maxLength, this.onTrimEmitter.fire(1), this._array[this._getCyclicIndex(this._length - 1)];
        }
        get isFull() {
          return this._length === this._maxLength;
        }
        pop() {
          return this._array[this._getCyclicIndex(this._length-- - 1)];
        }
        splice(v, m, ...l) {
          if (m) {
            for (let s = v; s < this._length - m; s++)
              this._array[this._getCyclicIndex(s)] = this._array[this._getCyclicIndex(s + m)];
            this._length -= m, this.onDeleteEmitter.fire({ index: v, amount: m });
          }
          for (let s = this._length - 1; s >= v; s--)
            this._array[this._getCyclicIndex(s + l.length)] = this._array[this._getCyclicIndex(s)];
          for (let s = 0; s < l.length; s++)
            this._array[this._getCyclicIndex(v + s)] = l[s];
          if (l.length && this.onInsertEmitter.fire({ index: v, amount: l.length }), this._length + l.length > this._maxLength) {
            const s = this._length + l.length - this._maxLength;
            this._startIndex += s, this._length = this._maxLength, this.onTrimEmitter.fire(s);
          } else
            this._length += l.length;
        }
        trimStart(v) {
          v > this._length && (v = this._length), this._startIndex += v, this._length -= v, this.onTrimEmitter.fire(v);
        }
        shiftElements(v, m, l) {
          if (!(m <= 0)) {
            if (v < 0 || v >= this._length)
              throw new Error("start argument out of range");
            if (v + l < 0)
              throw new Error("Cannot shift elements in list beyond index 0");
            if (l > 0) {
              for (let r = m - 1; r >= 0; r--)
                this.set(v + r + l, this.get(v + r));
              const s = v + m + l - this._length;
              if (s > 0)
                for (this._length += s; this._length > this._maxLength; )
                  this._length--, this._startIndex++, this.onTrimEmitter.fire(1);
            } else
              for (let s = 0; s < m; s++)
                this.set(v + s + l, this.get(v + s));
          }
        }
        _getCyclicIndex(v) {
          return (this._startIndex + v) % this._maxLength;
        }
      }
      i.CircularList = a;
    }, 1439: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.clone = void 0, i.clone = function n(o, c = 5) {
        if (typeof o != "object")
          return o;
        const a = Array.isArray(o) ? [] : {};
        for (const d in o)
          a[d] = c <= 1 ? o[d] : o[d] && n(o[d], c - 1);
        return a;
      };
    }, 8055: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.contrastRatio = i.toPaddedHex = i.rgba = i.rgb = i.css = i.color = i.channels = i.NULL_COLOR = void 0;
      let n = 0, o = 0, c = 0, a = 0;
      var d, v, m, l, s;
      function r(t) {
        const h = t.toString(16);
        return h.length < 2 ? "0" + h : h;
      }
      function e(t, h) {
        return t < h ? (h + 0.05) / (t + 0.05) : (t + 0.05) / (h + 0.05);
      }
      i.NULL_COLOR = { css: "#00000000", rgba: 0 }, function(t) {
        t.toCss = function(h, g, u, S) {
          return S !== void 0 ? `#${r(h)}${r(g)}${r(u)}${r(S)}` : `#${r(h)}${r(g)}${r(u)}`;
        }, t.toRgba = function(h, g, u, S = 255) {
          return (h << 24 | g << 16 | u << 8 | S) >>> 0;
        }, t.toColor = function(h, g, u, S) {
          return { css: t.toCss(h, g, u, S), rgba: t.toRgba(h, g, u, S) };
        };
      }(d || (i.channels = d = {})), function(t) {
        function h(g, u) {
          return a = Math.round(255 * u), [n, o, c] = s.toChannels(g.rgba), { css: d.toCss(n, o, c, a), rgba: d.toRgba(n, o, c, a) };
        }
        t.blend = function(g, u) {
          if (a = (255 & u.rgba) / 255, a === 1)
            return { css: u.css, rgba: u.rgba };
          const S = u.rgba >> 24 & 255, _ = u.rgba >> 16 & 255, b = u.rgba >> 8 & 255, R = g.rgba >> 24 & 255, B = g.rgba >> 16 & 255, T = g.rgba >> 8 & 255;
          return n = R + Math.round((S - R) * a), o = B + Math.round((_ - B) * a), c = T + Math.round((b - T) * a), { css: d.toCss(n, o, c), rgba: d.toRgba(n, o, c) };
        }, t.isOpaque = function(g) {
          return (255 & g.rgba) == 255;
        }, t.ensureContrastRatio = function(g, u, S) {
          const _ = s.ensureContrastRatio(g.rgba, u.rgba, S);
          if (_)
            return d.toColor(_ >> 24 & 255, _ >> 16 & 255, _ >> 8 & 255);
        }, t.opaque = function(g) {
          const u = (255 | g.rgba) >>> 0;
          return [n, o, c] = s.toChannels(u), { css: d.toCss(n, o, c), rgba: u };
        }, t.opacity = h, t.multiplyOpacity = function(g, u) {
          return a = 255 & g.rgba, h(g, a * u / 255);
        }, t.toColorRGB = function(g) {
          return [g.rgba >> 24 & 255, g.rgba >> 16 & 255, g.rgba >> 8 & 255];
        };
      }(v || (i.color = v = {})), function(t) {
        let h, g;
        try {
          const u = document.createElement("canvas");
          u.width = 1, u.height = 1;
          const S = u.getContext("2d", { willReadFrequently: !0 });
          S && (h = S, h.globalCompositeOperation = "copy", g = h.createLinearGradient(0, 0, 1, 1));
        } catch {
        }
        t.toColor = function(u) {
          if (u.match(/#[\da-f]{3,8}/i))
            switch (u.length) {
              case 4:
                return n = parseInt(u.slice(1, 2).repeat(2), 16), o = parseInt(u.slice(2, 3).repeat(2), 16), c = parseInt(u.slice(3, 4).repeat(2), 16), d.toColor(n, o, c);
              case 5:
                return n = parseInt(u.slice(1, 2).repeat(2), 16), o = parseInt(u.slice(2, 3).repeat(2), 16), c = parseInt(u.slice(3, 4).repeat(2), 16), a = parseInt(u.slice(4, 5).repeat(2), 16), d.toColor(n, o, c, a);
              case 7:
                return { css: u, rgba: (parseInt(u.slice(1), 16) << 8 | 255) >>> 0 };
              case 9:
                return { css: u, rgba: parseInt(u.slice(1), 16) >>> 0 };
            }
          const S = u.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);
          if (S)
            return n = parseInt(S[1]), o = parseInt(S[2]), c = parseInt(S[3]), a = Math.round(255 * (S[5] === void 0 ? 1 : parseFloat(S[5]))), d.toColor(n, o, c, a);
          if (!h || !g)
            throw new Error("css.toColor: Unsupported css format");
          if (h.fillStyle = g, h.fillStyle = u, typeof h.fillStyle != "string")
            throw new Error("css.toColor: Unsupported css format");
          if (h.fillRect(0, 0, 1, 1), [n, o, c, a] = h.getImageData(0, 0, 1, 1).data, a !== 255)
            throw new Error("css.toColor: Unsupported css format");
          return { rgba: d.toRgba(n, o, c, a), css: u };
        };
      }(m || (i.css = m = {})), function(t) {
        function h(g, u, S) {
          const _ = g / 255, b = u / 255, R = S / 255;
          return 0.2126 * (_ <= 0.03928 ? _ / 12.92 : Math.pow((_ + 0.055) / 1.055, 2.4)) + 0.7152 * (b <= 0.03928 ? b / 12.92 : Math.pow((b + 0.055) / 1.055, 2.4)) + 0.0722 * (R <= 0.03928 ? R / 12.92 : Math.pow((R + 0.055) / 1.055, 2.4));
        }
        t.relativeLuminance = function(g) {
          return h(g >> 16 & 255, g >> 8 & 255, 255 & g);
        }, t.relativeLuminance2 = h;
      }(l || (i.rgb = l = {})), function(t) {
        function h(u, S, _) {
          const b = u >> 24 & 255, R = u >> 16 & 255, B = u >> 8 & 255;
          let T = S >> 24 & 255, L = S >> 16 & 255, H = S >> 8 & 255, W = e(l.relativeLuminance2(T, L, H), l.relativeLuminance2(b, R, B));
          for (; W < _ && (T > 0 || L > 0 || H > 0); )
            T -= Math.max(0, Math.ceil(0.1 * T)), L -= Math.max(0, Math.ceil(0.1 * L)), H -= Math.max(0, Math.ceil(0.1 * H)), W = e(l.relativeLuminance2(T, L, H), l.relativeLuminance2(b, R, B));
          return (T << 24 | L << 16 | H << 8 | 255) >>> 0;
        }
        function g(u, S, _) {
          const b = u >> 24 & 255, R = u >> 16 & 255, B = u >> 8 & 255;
          let T = S >> 24 & 255, L = S >> 16 & 255, H = S >> 8 & 255, W = e(l.relativeLuminance2(T, L, H), l.relativeLuminance2(b, R, B));
          for (; W < _ && (T < 255 || L < 255 || H < 255); )
            T = Math.min(255, T + Math.ceil(0.1 * (255 - T))), L = Math.min(255, L + Math.ceil(0.1 * (255 - L))), H = Math.min(255, H + Math.ceil(0.1 * (255 - H))), W = e(l.relativeLuminance2(T, L, H), l.relativeLuminance2(b, R, B));
          return (T << 24 | L << 16 | H << 8 | 255) >>> 0;
        }
        t.blend = function(u, S) {
          if (a = (255 & S) / 255, a === 1)
            return S;
          const _ = S >> 24 & 255, b = S >> 16 & 255, R = S >> 8 & 255, B = u >> 24 & 255, T = u >> 16 & 255, L = u >> 8 & 255;
          return n = B + Math.round((_ - B) * a), o = T + Math.round((b - T) * a), c = L + Math.round((R - L) * a), d.toRgba(n, o, c);
        }, t.ensureContrastRatio = function(u, S, _) {
          const b = l.relativeLuminance(u >> 8), R = l.relativeLuminance(S >> 8);
          if (e(b, R) < _) {
            if (R < b) {
              const L = h(u, S, _), H = e(b, l.relativeLuminance(L >> 8));
              if (H < _) {
                const W = g(u, S, _);
                return H > e(b, l.relativeLuminance(W >> 8)) ? L : W;
              }
              return L;
            }
            const B = g(u, S, _), T = e(b, l.relativeLuminance(B >> 8));
            if (T < _) {
              const L = h(u, S, _);
              return T > e(b, l.relativeLuminance(L >> 8)) ? B : L;
            }
            return B;
          }
        }, t.reduceLuminance = h, t.increaseLuminance = g, t.toChannels = function(u) {
          return [u >> 24 & 255, u >> 16 & 255, u >> 8 & 255, 255 & u];
        };
      }(s || (i.rgba = s = {})), i.toPaddedHex = r, i.contrastRatio = e;
    }, 8969: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.CoreTerminal = void 0;
      const o = n(844), c = n(2585), a = n(4348), d = n(7866), v = n(744), m = n(7302), l = n(6975), s = n(8460), r = n(1753), e = n(1480), t = n(7994), h = n(9282), g = n(5435), u = n(5981), S = n(2660);
      let _ = !1;
      class b extends o.Disposable {
        get onScroll() {
          return this._onScrollApi || (this._onScrollApi = this.register(new s.EventEmitter()), this._onScroll.event((B) => {
            var T;
            (T = this._onScrollApi) == null || T.fire(B.position);
          })), this._onScrollApi.event;
        }
        get cols() {
          return this._bufferService.cols;
        }
        get rows() {
          return this._bufferService.rows;
        }
        get buffers() {
          return this._bufferService.buffers;
        }
        get options() {
          return this.optionsService.options;
        }
        set options(B) {
          for (const T in B)
            this.optionsService.options[T] = B[T];
        }
        constructor(B) {
          super(), this._windowsWrappingHeuristics = this.register(new o.MutableDisposable()), this._onBinary = this.register(new s.EventEmitter()), this.onBinary = this._onBinary.event, this._onData = this.register(new s.EventEmitter()), this.onData = this._onData.event, this._onLineFeed = this.register(new s.EventEmitter()), this.onLineFeed = this._onLineFeed.event, this._onResize = this.register(new s.EventEmitter()), this.onResize = this._onResize.event, this._onWriteParsed = this.register(new s.EventEmitter()), this.onWriteParsed = this._onWriteParsed.event, this._onScroll = this.register(new s.EventEmitter()), this._instantiationService = new a.InstantiationService(), this.optionsService = this.register(new m.OptionsService(B)), this._instantiationService.setService(c.IOptionsService, this.optionsService), this._bufferService = this.register(this._instantiationService.createInstance(v.BufferService)), this._instantiationService.setService(c.IBufferService, this._bufferService), this._logService = this.register(this._instantiationService.createInstance(d.LogService)), this._instantiationService.setService(c.ILogService, this._logService), this.coreService = this.register(this._instantiationService.createInstance(l.CoreService)), this._instantiationService.setService(c.ICoreService, this.coreService), this.coreMouseService = this.register(this._instantiationService.createInstance(r.CoreMouseService)), this._instantiationService.setService(c.ICoreMouseService, this.coreMouseService), this.unicodeService = this.register(this._instantiationService.createInstance(e.UnicodeService)), this._instantiationService.setService(c.IUnicodeService, this.unicodeService), this._charsetService = this._instantiationService.createInstance(t.CharsetService), this._instantiationService.setService(c.ICharsetService, this._charsetService), this._oscLinkService = this._instantiationService.createInstance(S.OscLinkService), this._instantiationService.setService(c.IOscLinkService, this._oscLinkService), this._inputHandler = this.register(new g.InputHandler(this._bufferService, this._charsetService, this.coreService, this._logService, this.optionsService, this._oscLinkService, this.coreMouseService, this.unicodeService)), this.register((0, s.forwardEvent)(this._inputHandler.onLineFeed, this._onLineFeed)), this.register(this._inputHandler), this.register((0, s.forwardEvent)(this._bufferService.onResize, this._onResize)), this.register((0, s.forwardEvent)(this.coreService.onData, this._onData)), this.register((0, s.forwardEvent)(this.coreService.onBinary, this._onBinary)), this.register(this.coreService.onRequestScrollToBottom(() => this.scrollToBottom())), this.register(this.coreService.onUserInput(() => this._writeBuffer.handleUserInput())), this.register(this.optionsService.onMultipleOptionChange(["windowsMode", "windowsPty"], () => this._handleWindowsPtyOptionChange())), this.register(this._bufferService.onScroll((T) => {
            this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: 0 }), this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);
          })), this.register(this._inputHandler.onScroll((T) => {
            this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: 0 }), this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);
          })), this._writeBuffer = this.register(new u.WriteBuffer((T, L) => this._inputHandler.parse(T, L))), this.register((0, s.forwardEvent)(this._writeBuffer.onWriteParsed, this._onWriteParsed));
        }
        write(B, T) {
          this._writeBuffer.write(B, T);
        }
        writeSync(B, T) {
          this._logService.logLevel <= c.LogLevelEnum.WARN && !_ && (this._logService.warn("writeSync is unreliable and will be removed soon."), _ = !0), this._writeBuffer.writeSync(B, T);
        }
        input(B, T = !0) {
          this.coreService.triggerDataEvent(B, T);
        }
        resize(B, T) {
          isNaN(B) || isNaN(T) || (B = Math.max(B, v.MINIMUM_COLS), T = Math.max(T, v.MINIMUM_ROWS), this._bufferService.resize(B, T));
        }
        scroll(B, T = !1) {
          this._bufferService.scroll(B, T);
        }
        scrollLines(B, T, L) {
          this._bufferService.scrollLines(B, T, L);
        }
        scrollPages(B) {
          this.scrollLines(B * (this.rows - 1));
        }
        scrollToTop() {
          this.scrollLines(-this._bufferService.buffer.ydisp);
        }
        scrollToBottom() {
          this.scrollLines(this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp);
        }
        scrollToLine(B) {
          const T = B - this._bufferService.buffer.ydisp;
          T !== 0 && this.scrollLines(T);
        }
        registerEscHandler(B, T) {
          return this._inputHandler.registerEscHandler(B, T);
        }
        registerDcsHandler(B, T) {
          return this._inputHandler.registerDcsHandler(B, T);
        }
        registerCsiHandler(B, T) {
          return this._inputHandler.registerCsiHandler(B, T);
        }
        registerOscHandler(B, T) {
          return this._inputHandler.registerOscHandler(B, T);
        }
        _setup() {
          this._handleWindowsPtyOptionChange();
        }
        reset() {
          this._inputHandler.reset(), this._bufferService.reset(), this._charsetService.reset(), this.coreService.reset(), this.coreMouseService.reset();
        }
        _handleWindowsPtyOptionChange() {
          let B = !1;
          const T = this.optionsService.rawOptions.windowsPty;
          T && T.buildNumber !== void 0 && T.buildNumber !== void 0 ? B = T.backend === "conpty" && T.buildNumber < 21376 : this.optionsService.rawOptions.windowsMode && (B = !0), B ? this._enableWindowsWrappingHeuristics() : this._windowsWrappingHeuristics.clear();
        }
        _enableWindowsWrappingHeuristics() {
          if (!this._windowsWrappingHeuristics.value) {
            const B = [];
            B.push(this.onLineFeed(h.updateWindowsModeWrappedState.bind(null, this._bufferService))), B.push(this.registerCsiHandler({ final: "H" }, () => ((0, h.updateWindowsModeWrappedState)(this._bufferService), !1))), this._windowsWrappingHeuristics.value = (0, o.toDisposable)(() => {
              for (const T of B)
                T.dispose();
            });
          }
        }
      }
      i.CoreTerminal = b;
    }, 8460: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.runAndSubscribe = i.forwardEvent = i.EventEmitter = void 0, i.EventEmitter = class {
        constructor() {
          this._listeners = [], this._disposed = !1;
        }
        get event() {
          return this._event || (this._event = (n) => (this._listeners.push(n), { dispose: () => {
            if (!this._disposed) {
              for (let o = 0; o < this._listeners.length; o++)
                if (this._listeners[o] === n)
                  return void this._listeners.splice(o, 1);
            }
          } })), this._event;
        }
        fire(n, o) {
          const c = [];
          for (let a = 0; a < this._listeners.length; a++)
            c.push(this._listeners[a]);
          for (let a = 0; a < c.length; a++)
            c[a].call(void 0, n, o);
        }
        dispose() {
          this.clearListeners(), this._disposed = !0;
        }
        clearListeners() {
          this._listeners && (this._listeners.length = 0);
        }
      }, i.forwardEvent = function(n, o) {
        return n((c) => o.fire(c));
      }, i.runAndSubscribe = function(n, o) {
        return o(void 0), n((c) => o(c));
      };
    }, 5435: function(k, i, n) {
      var o = this && this.__decorate || function(z, C, x, A) {
        var O, I = arguments.length, q = I < 3 ? C : A === null ? A = Object.getOwnPropertyDescriptor(C, x) : A;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          q = Reflect.decorate(z, C, x, A);
        else
          for (var X = z.length - 1; X >= 0; X--)
            (O = z[X]) && (q = (I < 3 ? O(q) : I > 3 ? O(C, x, q) : O(C, x)) || q);
        return I > 3 && q && Object.defineProperty(C, x, q), q;
      }, c = this && this.__param || function(z, C) {
        return function(x, A) {
          C(x, A, z);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.InputHandler = i.WindowsOptionsReportType = void 0;
      const a = n(2584), d = n(7116), v = n(2015), m = n(844), l = n(482), s = n(8437), r = n(8460), e = n(643), t = n(511), h = n(3734), g = n(2585), u = n(1480), S = n(6242), _ = n(6351), b = n(5941), R = { "(": 0, ")": 1, "*": 2, "+": 3, "-": 1, ".": 2 }, B = 131072;
      function T(z, C) {
        if (z > 24)
          return C.setWinLines || !1;
        switch (z) {
          case 1:
            return !!C.restoreWin;
          case 2:
            return !!C.minimizeWin;
          case 3:
            return !!C.setWinPosition;
          case 4:
            return !!C.setWinSizePixels;
          case 5:
            return !!C.raiseWin;
          case 6:
            return !!C.lowerWin;
          case 7:
            return !!C.refreshWin;
          case 8:
            return !!C.setWinSizeChars;
          case 9:
            return !!C.maximizeWin;
          case 10:
            return !!C.fullscreenWin;
          case 11:
            return !!C.getWinState;
          case 13:
            return !!C.getWinPosition;
          case 14:
            return !!C.getWinSizePixels;
          case 15:
            return !!C.getScreenSizePixels;
          case 16:
            return !!C.getCellSizePixels;
          case 18:
            return !!C.getWinSizeChars;
          case 19:
            return !!C.getScreenSizeChars;
          case 20:
            return !!C.getIconTitle;
          case 21:
            return !!C.getWinTitle;
          case 22:
            return !!C.pushTitle;
          case 23:
            return !!C.popTitle;
          case 24:
            return !!C.setWinLines;
        }
        return !1;
      }
      var L;
      (function(z) {
        z[z.GET_WIN_SIZE_PIXELS = 0] = "GET_WIN_SIZE_PIXELS", z[z.GET_CELL_SIZE_PIXELS = 1] = "GET_CELL_SIZE_PIXELS";
      })(L || (i.WindowsOptionsReportType = L = {}));
      let H = 0;
      class W extends m.Disposable {
        getAttrData() {
          return this._curAttrData;
        }
        constructor(C, x, A, O, I, q, X, J, P = new v.EscapeSequenceParser()) {
          super(), this._bufferService = C, this._charsetService = x, this._coreService = A, this._logService = O, this._optionsService = I, this._oscLinkService = q, this._coreMouseService = X, this._unicodeService = J, this._parser = P, this._parseBuffer = new Uint32Array(4096), this._stringDecoder = new l.StringToUtf32(), this._utf8Decoder = new l.Utf8ToUtf32(), this._workCell = new t.CellData(), this._windowTitle = "", this._iconName = "", this._windowTitleStack = [], this._iconNameStack = [], this._curAttrData = s.DEFAULT_ATTR_DATA.clone(), this._eraseAttrDataInternal = s.DEFAULT_ATTR_DATA.clone(), this._onRequestBell = this.register(new r.EventEmitter()), this.onRequestBell = this._onRequestBell.event, this._onRequestRefreshRows = this.register(new r.EventEmitter()), this.onRequestRefreshRows = this._onRequestRefreshRows.event, this._onRequestReset = this.register(new r.EventEmitter()), this.onRequestReset = this._onRequestReset.event, this._onRequestSendFocus = this.register(new r.EventEmitter()), this.onRequestSendFocus = this._onRequestSendFocus.event, this._onRequestSyncScrollBar = this.register(new r.EventEmitter()), this.onRequestSyncScrollBar = this._onRequestSyncScrollBar.event, this._onRequestWindowsOptionsReport = this.register(new r.EventEmitter()), this.onRequestWindowsOptionsReport = this._onRequestWindowsOptionsReport.event, this._onA11yChar = this.register(new r.EventEmitter()), this.onA11yChar = this._onA11yChar.event, this._onA11yTab = this.register(new r.EventEmitter()), this.onA11yTab = this._onA11yTab.event, this._onCursorMove = this.register(new r.EventEmitter()), this.onCursorMove = this._onCursorMove.event, this._onLineFeed = this.register(new r.EventEmitter()), this.onLineFeed = this._onLineFeed.event, this._onScroll = this.register(new r.EventEmitter()), this.onScroll = this._onScroll.event, this._onTitleChange = this.register(new r.EventEmitter()), this.onTitleChange = this._onTitleChange.event, this._onColor = this.register(new r.EventEmitter()), this.onColor = this._onColor.event, this._parseStack = { paused: !1, cursorStartX: 0, cursorStartY: 0, decodedLength: 0, position: 0 }, this._specialColors = [256, 257, 258], this.register(this._parser), this._dirtyRowTracker = new j(this._bufferService), this._activeBuffer = this._bufferService.buffer, this.register(this._bufferService.buffers.onBufferActivate((w) => this._activeBuffer = w.activeBuffer)), this._parser.setCsiHandlerFallback((w, U) => {
            this._logService.debug("Unknown CSI code: ", { identifier: this._parser.identToString(w), params: U.toArray() });
          }), this._parser.setEscHandlerFallback((w) => {
            this._logService.debug("Unknown ESC code: ", { identifier: this._parser.identToString(w) });
          }), this._parser.setExecuteHandlerFallback((w) => {
            this._logService.debug("Unknown EXECUTE code: ", { code: w });
          }), this._parser.setOscHandlerFallback((w, U, F) => {
            this._logService.debug("Unknown OSC code: ", { identifier: w, action: U, data: F });
          }), this._parser.setDcsHandlerFallback((w, U, F) => {
            U === "HOOK" && (F = F.toArray()), this._logService.debug("Unknown DCS code: ", { identifier: this._parser.identToString(w), action: U, payload: F });
          }), this._parser.setPrintHandler((w, U, F) => this.print(w, U, F)), this._parser.registerCsiHandler({ final: "@" }, (w) => this.insertChars(w)), this._parser.registerCsiHandler({ intermediates: " ", final: "@" }, (w) => this.scrollLeft(w)), this._parser.registerCsiHandler({ final: "A" }, (w) => this.cursorUp(w)), this._parser.registerCsiHandler({ intermediates: " ", final: "A" }, (w) => this.scrollRight(w)), this._parser.registerCsiHandler({ final: "B" }, (w) => this.cursorDown(w)), this._parser.registerCsiHandler({ final: "C" }, (w) => this.cursorForward(w)), this._parser.registerCsiHandler({ final: "D" }, (w) => this.cursorBackward(w)), this._parser.registerCsiHandler({ final: "E" }, (w) => this.cursorNextLine(w)), this._parser.registerCsiHandler({ final: "F" }, (w) => this.cursorPrecedingLine(w)), this._parser.registerCsiHandler({ final: "G" }, (w) => this.cursorCharAbsolute(w)), this._parser.registerCsiHandler({ final: "H" }, (w) => this.cursorPosition(w)), this._parser.registerCsiHandler({ final: "I" }, (w) => this.cursorForwardTab(w)), this._parser.registerCsiHandler({ final: "J" }, (w) => this.eraseInDisplay(w, !1)), this._parser.registerCsiHandler({ prefix: "?", final: "J" }, (w) => this.eraseInDisplay(w, !0)), this._parser.registerCsiHandler({ final: "K" }, (w) => this.eraseInLine(w, !1)), this._parser.registerCsiHandler({ prefix: "?", final: "K" }, (w) => this.eraseInLine(w, !0)), this._parser.registerCsiHandler({ final: "L" }, (w) => this.insertLines(w)), this._parser.registerCsiHandler({ final: "M" }, (w) => this.deleteLines(w)), this._parser.registerCsiHandler({ final: "P" }, (w) => this.deleteChars(w)), this._parser.registerCsiHandler({ final: "S" }, (w) => this.scrollUp(w)), this._parser.registerCsiHandler({ final: "T" }, (w) => this.scrollDown(w)), this._parser.registerCsiHandler({ final: "X" }, (w) => this.eraseChars(w)), this._parser.registerCsiHandler({ final: "Z" }, (w) => this.cursorBackwardTab(w)), this._parser.registerCsiHandler({ final: "`" }, (w) => this.charPosAbsolute(w)), this._parser.registerCsiHandler({ final: "a" }, (w) => this.hPositionRelative(w)), this._parser.registerCsiHandler({ final: "b" }, (w) => this.repeatPrecedingCharacter(w)), this._parser.registerCsiHandler({ final: "c" }, (w) => this.sendDeviceAttributesPrimary(w)), this._parser.registerCsiHandler({ prefix: ">", final: "c" }, (w) => this.sendDeviceAttributesSecondary(w)), this._parser.registerCsiHandler({ final: "d" }, (w) => this.linePosAbsolute(w)), this._parser.registerCsiHandler({ final: "e" }, (w) => this.vPositionRelative(w)), this._parser.registerCsiHandler({ final: "f" }, (w) => this.hVPosition(w)), this._parser.registerCsiHandler({ final: "g" }, (w) => this.tabClear(w)), this._parser.registerCsiHandler({ final: "h" }, (w) => this.setMode(w)), this._parser.registerCsiHandler({ prefix: "?", final: "h" }, (w) => this.setModePrivate(w)), this._parser.registerCsiHandler({ final: "l" }, (w) => this.resetMode(w)), this._parser.registerCsiHandler({ prefix: "?", final: "l" }, (w) => this.resetModePrivate(w)), this._parser.registerCsiHandler({ final: "m" }, (w) => this.charAttributes(w)), this._parser.registerCsiHandler({ final: "n" }, (w) => this.deviceStatus(w)), this._parser.registerCsiHandler({ prefix: "?", final: "n" }, (w) => this.deviceStatusPrivate(w)), this._parser.registerCsiHandler({ intermediates: "!", final: "p" }, (w) => this.softReset(w)), this._parser.registerCsiHandler({ intermediates: " ", final: "q" }, (w) => this.setCursorStyle(w)), this._parser.registerCsiHandler({ final: "r" }, (w) => this.setScrollRegion(w)), this._parser.registerCsiHandler({ final: "s" }, (w) => this.saveCursor(w)), this._parser.registerCsiHandler({ final: "t" }, (w) => this.windowOptions(w)), this._parser.registerCsiHandler({ final: "u" }, (w) => this.restoreCursor(w)), this._parser.registerCsiHandler({ intermediates: "'", final: "}" }, (w) => this.insertColumns(w)), this._parser.registerCsiHandler({ intermediates: "'", final: "~" }, (w) => this.deleteColumns(w)), this._parser.registerCsiHandler({ intermediates: '"', final: "q" }, (w) => this.selectProtected(w)), this._parser.registerCsiHandler({ intermediates: "$", final: "p" }, (w) => this.requestMode(w, !0)), this._parser.registerCsiHandler({ prefix: "?", intermediates: "$", final: "p" }, (w) => this.requestMode(w, !1)), this._parser.setExecuteHandler(a.C0.BEL, () => this.bell()), this._parser.setExecuteHandler(a.C0.LF, () => this.lineFeed()), this._parser.setExecuteHandler(a.C0.VT, () => this.lineFeed()), this._parser.setExecuteHandler(a.C0.FF, () => this.lineFeed()), this._parser.setExecuteHandler(a.C0.CR, () => this.carriageReturn()), this._parser.setExecuteHandler(a.C0.BS, () => this.backspace()), this._parser.setExecuteHandler(a.C0.HT, () => this.tab()), this._parser.setExecuteHandler(a.C0.SO, () => this.shiftOut()), this._parser.setExecuteHandler(a.C0.SI, () => this.shiftIn()), this._parser.setExecuteHandler(a.C1.IND, () => this.index()), this._parser.setExecuteHandler(a.C1.NEL, () => this.nextLine()), this._parser.setExecuteHandler(a.C1.HTS, () => this.tabSet()), this._parser.registerOscHandler(0, new S.OscHandler((w) => (this.setTitle(w), this.setIconName(w), !0))), this._parser.registerOscHandler(1, new S.OscHandler((w) => this.setIconName(w))), this._parser.registerOscHandler(2, new S.OscHandler((w) => this.setTitle(w))), this._parser.registerOscHandler(4, new S.OscHandler((w) => this.setOrReportIndexedColor(w))), this._parser.registerOscHandler(8, new S.OscHandler((w) => this.setHyperlink(w))), this._parser.registerOscHandler(10, new S.OscHandler((w) => this.setOrReportFgColor(w))), this._parser.registerOscHandler(11, new S.OscHandler((w) => this.setOrReportBgColor(w))), this._parser.registerOscHandler(12, new S.OscHandler((w) => this.setOrReportCursorColor(w))), this._parser.registerOscHandler(104, new S.OscHandler((w) => this.restoreIndexedColor(w))), this._parser.registerOscHandler(110, new S.OscHandler((w) => this.restoreFgColor(w))), this._parser.registerOscHandler(111, new S.OscHandler((w) => this.restoreBgColor(w))), this._parser.registerOscHandler(112, new S.OscHandler((w) => this.restoreCursorColor(w))), this._parser.registerEscHandler({ final: "7" }, () => this.saveCursor()), this._parser.registerEscHandler({ final: "8" }, () => this.restoreCursor()), this._parser.registerEscHandler({ final: "D" }, () => this.index()), this._parser.registerEscHandler({ final: "E" }, () => this.nextLine()), this._parser.registerEscHandler({ final: "H" }, () => this.tabSet()), this._parser.registerEscHandler({ final: "M" }, () => this.reverseIndex()), this._parser.registerEscHandler({ final: "=" }, () => this.keypadApplicationMode()), this._parser.registerEscHandler({ final: ">" }, () => this.keypadNumericMode()), this._parser.registerEscHandler({ final: "c" }, () => this.fullReset()), this._parser.registerEscHandler({ final: "n" }, () => this.setgLevel(2)), this._parser.registerEscHandler({ final: "o" }, () => this.setgLevel(3)), this._parser.registerEscHandler({ final: "|" }, () => this.setgLevel(3)), this._parser.registerEscHandler({ final: "}" }, () => this.setgLevel(2)), this._parser.registerEscHandler({ final: "~" }, () => this.setgLevel(1)), this._parser.registerEscHandler({ intermediates: "%", final: "@" }, () => this.selectDefaultCharset()), this._parser.registerEscHandler({ intermediates: "%", final: "G" }, () => this.selectDefaultCharset());
          for (const w in d.CHARSETS)
            this._parser.registerEscHandler({ intermediates: "(", final: w }, () => this.selectCharset("(" + w)), this._parser.registerEscHandler({ intermediates: ")", final: w }, () => this.selectCharset(")" + w)), this._parser.registerEscHandler({ intermediates: "*", final: w }, () => this.selectCharset("*" + w)), this._parser.registerEscHandler({ intermediates: "+", final: w }, () => this.selectCharset("+" + w)), this._parser.registerEscHandler({ intermediates: "-", final: w }, () => this.selectCharset("-" + w)), this._parser.registerEscHandler({ intermediates: ".", final: w }, () => this.selectCharset("." + w)), this._parser.registerEscHandler({ intermediates: "/", final: w }, () => this.selectCharset("/" + w));
          this._parser.registerEscHandler({ intermediates: "#", final: "8" }, () => this.screenAlignmentPattern()), this._parser.setErrorHandler((w) => (this._logService.error("Parsing error: ", w), w)), this._parser.registerDcsHandler({ intermediates: "$", final: "q" }, new _.DcsHandler((w, U) => this.requestStatusString(w, U)));
        }
        _preserveStack(C, x, A, O) {
          this._parseStack.paused = !0, this._parseStack.cursorStartX = C, this._parseStack.cursorStartY = x, this._parseStack.decodedLength = A, this._parseStack.position = O;
        }
        _logSlowResolvingAsync(C) {
          this._logService.logLevel <= g.LogLevelEnum.WARN && Promise.race([C, new Promise((x, A) => setTimeout(() => A("#SLOW_TIMEOUT"), 5e3))]).catch((x) => {
            if (x !== "#SLOW_TIMEOUT")
              throw x;
            console.warn("async parser handler taking longer than 5000 ms");
          });
        }
        _getCurrentLinkId() {
          return this._curAttrData.extended.urlId;
        }
        parse(C, x) {
          let A, O = this._activeBuffer.x, I = this._activeBuffer.y, q = 0;
          const X = this._parseStack.paused;
          if (X) {
            if (A = this._parser.parse(this._parseBuffer, this._parseStack.decodedLength, x))
              return this._logSlowResolvingAsync(A), A;
            O = this._parseStack.cursorStartX, I = this._parseStack.cursorStartY, this._parseStack.paused = !1, C.length > B && (q = this._parseStack.position + B);
          }
          if (this._logService.logLevel <= g.LogLevelEnum.DEBUG && this._logService.debug("parsing data" + (typeof C == "string" ? ` "${C}"` : ` "${Array.prototype.map.call(C, (w) => String.fromCharCode(w)).join("")}"`), typeof C == "string" ? C.split("").map((w) => w.charCodeAt(0)) : C), this._parseBuffer.length < C.length && this._parseBuffer.length < B && (this._parseBuffer = new Uint32Array(Math.min(C.length, B))), X || this._dirtyRowTracker.clearRange(), C.length > B)
            for (let w = q; w < C.length; w += B) {
              const U = w + B < C.length ? w + B : C.length, F = typeof C == "string" ? this._stringDecoder.decode(C.substring(w, U), this._parseBuffer) : this._utf8Decoder.decode(C.subarray(w, U), this._parseBuffer);
              if (A = this._parser.parse(this._parseBuffer, F))
                return this._preserveStack(O, I, F, w), this._logSlowResolvingAsync(A), A;
            }
          else if (!X) {
            const w = typeof C == "string" ? this._stringDecoder.decode(C, this._parseBuffer) : this._utf8Decoder.decode(C, this._parseBuffer);
            if (A = this._parser.parse(this._parseBuffer, w))
              return this._preserveStack(O, I, w, 0), this._logSlowResolvingAsync(A), A;
          }
          this._activeBuffer.x === O && this._activeBuffer.y === I || this._onCursorMove.fire();
          const J = this._dirtyRowTracker.end + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp), P = this._dirtyRowTracker.start + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp);
          P < this._bufferService.rows && this._onRequestRefreshRows.fire(Math.min(P, this._bufferService.rows - 1), Math.min(J, this._bufferService.rows - 1));
        }
        print(C, x, A) {
          let O, I;
          const q = this._charsetService.charset, X = this._optionsService.rawOptions.screenReaderMode, J = this._bufferService.cols, P = this._coreService.decPrivateModes.wraparound, w = this._coreService.modes.insertMode, U = this._curAttrData;
          let F = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
          this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._activeBuffer.x && A - x > 0 && F.getWidth(this._activeBuffer.x - 1) === 2 && F.setCellFromCodepoint(this._activeBuffer.x - 1, 0, 1, U);
          let G = this._parser.precedingJoinState;
          for (let K = x; K < A; ++K) {
            if (O = C[K], O < 127 && q) {
              const oe = q[String.fromCharCode(O)];
              oe && (O = oe.charCodeAt(0));
            }
            const ee = this._unicodeService.charProperties(O, G);
            I = u.UnicodeService.extractWidth(ee);
            const se = u.UnicodeService.extractShouldJoin(ee), ie = se ? u.UnicodeService.extractWidth(G) : 0;
            if (G = ee, X && this._onA11yChar.fire((0, l.stringFromCodePoint)(O)), this._getCurrentLinkId() && this._oscLinkService.addLineToLink(this._getCurrentLinkId(), this._activeBuffer.ybase + this._activeBuffer.y), this._activeBuffer.x + I - ie > J) {
              if (P) {
                const oe = F;
                let Z = this._activeBuffer.x - ie;
                for (this._activeBuffer.x = ie, this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData(), !0)) : (this._activeBuffer.y >= this._bufferService.rows && (this._activeBuffer.y = this._bufferService.rows - 1), this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = !0), F = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y), ie > 0 && F instanceof s.BufferLine && F.copyCellsFrom(oe, Z, 0, ie, !1); Z < J; )
                  oe.setCellFromCodepoint(Z++, 0, 1, U);
              } else if (this._activeBuffer.x = J - 1, I === 2)
                continue;
            }
            if (se && this._activeBuffer.x) {
              const oe = F.getWidth(this._activeBuffer.x - 1) ? 1 : 2;
              F.addCodepointToCell(this._activeBuffer.x - oe, O, I);
              for (let Z = I - ie; --Z >= 0; )
                F.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, U);
            } else if (w && (F.insertCells(this._activeBuffer.x, I - ie, this._activeBuffer.getNullCell(U)), F.getWidth(J - 1) === 2 && F.setCellFromCodepoint(J - 1, e.NULL_CELL_CODE, e.NULL_CELL_WIDTH, U)), F.setCellFromCodepoint(this._activeBuffer.x++, O, I, U), I > 0)
              for (; --I; )
                F.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, U);
          }
          this._parser.precedingJoinState = G, this._activeBuffer.x < J && A - x > 0 && F.getWidth(this._activeBuffer.x) === 0 && !F.hasContent(this._activeBuffer.x) && F.setCellFromCodepoint(this._activeBuffer.x, 0, 1, U), this._dirtyRowTracker.markDirty(this._activeBuffer.y);
        }
        registerCsiHandler(C, x) {
          return C.final !== "t" || C.prefix || C.intermediates ? this._parser.registerCsiHandler(C, x) : this._parser.registerCsiHandler(C, (A) => !T(A.params[0], this._optionsService.rawOptions.windowOptions) || x(A));
        }
        registerDcsHandler(C, x) {
          return this._parser.registerDcsHandler(C, new _.DcsHandler(x));
        }
        registerEscHandler(C, x) {
          return this._parser.registerEscHandler(C, x);
        }
        registerOscHandler(C, x) {
          return this._parser.registerOscHandler(C, new S.OscHandler(x));
        }
        bell() {
          return this._onRequestBell.fire(), !0;
        }
        lineFeed() {
          return this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._optionsService.rawOptions.convertEol && (this._activeBuffer.x = 0), this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData())) : this._activeBuffer.y >= this._bufferService.rows ? this._activeBuffer.y = this._bufferService.rows - 1 : this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = !1, this._activeBuffer.x >= this._bufferService.cols && this._activeBuffer.x--, this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._onLineFeed.fire(), !0;
        }
        carriageReturn() {
          return this._activeBuffer.x = 0, !0;
        }
        backspace() {
          var C;
          if (!this._coreService.decPrivateModes.reverseWraparound)
            return this._restrictCursor(), this._activeBuffer.x > 0 && this._activeBuffer.x--, !0;
          if (this._restrictCursor(this._bufferService.cols), this._activeBuffer.x > 0)
            this._activeBuffer.x--;
          else if (this._activeBuffer.x === 0 && this._activeBuffer.y > this._activeBuffer.scrollTop && this._activeBuffer.y <= this._activeBuffer.scrollBottom && ((C = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)) != null && C.isWrapped)) {
            this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = !1, this._activeBuffer.y--, this._activeBuffer.x = this._bufferService.cols - 1;
            const x = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
            x.hasWidth(this._activeBuffer.x) && !x.hasContent(this._activeBuffer.x) && this._activeBuffer.x--;
          }
          return this._restrictCursor(), !0;
        }
        tab() {
          if (this._activeBuffer.x >= this._bufferService.cols)
            return !0;
          const C = this._activeBuffer.x;
          return this._activeBuffer.x = this._activeBuffer.nextStop(), this._optionsService.rawOptions.screenReaderMode && this._onA11yTab.fire(this._activeBuffer.x - C), !0;
        }
        shiftOut() {
          return this._charsetService.setgLevel(1), !0;
        }
        shiftIn() {
          return this._charsetService.setgLevel(0), !0;
        }
        _restrictCursor(C = this._bufferService.cols - 1) {
          this._activeBuffer.x = Math.min(C, Math.max(0, this._activeBuffer.x)), this._activeBuffer.y = this._coreService.decPrivateModes.origin ? Math.min(this._activeBuffer.scrollBottom, Math.max(this._activeBuffer.scrollTop, this._activeBuffer.y)) : Math.min(this._bufferService.rows - 1, Math.max(0, this._activeBuffer.y)), this._dirtyRowTracker.markDirty(this._activeBuffer.y);
        }
        _setCursor(C, x) {
          this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._coreService.decPrivateModes.origin ? (this._activeBuffer.x = C, this._activeBuffer.y = this._activeBuffer.scrollTop + x) : (this._activeBuffer.x = C, this._activeBuffer.y = x), this._restrictCursor(), this._dirtyRowTracker.markDirty(this._activeBuffer.y);
        }
        _moveCursor(C, x) {
          this._restrictCursor(), this._setCursor(this._activeBuffer.x + C, this._activeBuffer.y + x);
        }
        cursorUp(C) {
          const x = this._activeBuffer.y - this._activeBuffer.scrollTop;
          return x >= 0 ? this._moveCursor(0, -Math.min(x, C.params[0] || 1)) : this._moveCursor(0, -(C.params[0] || 1)), !0;
        }
        cursorDown(C) {
          const x = this._activeBuffer.scrollBottom - this._activeBuffer.y;
          return x >= 0 ? this._moveCursor(0, Math.min(x, C.params[0] || 1)) : this._moveCursor(0, C.params[0] || 1), !0;
        }
        cursorForward(C) {
          return this._moveCursor(C.params[0] || 1, 0), !0;
        }
        cursorBackward(C) {
          return this._moveCursor(-(C.params[0] || 1), 0), !0;
        }
        cursorNextLine(C) {
          return this.cursorDown(C), this._activeBuffer.x = 0, !0;
        }
        cursorPrecedingLine(C) {
          return this.cursorUp(C), this._activeBuffer.x = 0, !0;
        }
        cursorCharAbsolute(C) {
          return this._setCursor((C.params[0] || 1) - 1, this._activeBuffer.y), !0;
        }
        cursorPosition(C) {
          return this._setCursor(C.length >= 2 ? (C.params[1] || 1) - 1 : 0, (C.params[0] || 1) - 1), !0;
        }
        charPosAbsolute(C) {
          return this._setCursor((C.params[0] || 1) - 1, this._activeBuffer.y), !0;
        }
        hPositionRelative(C) {
          return this._moveCursor(C.params[0] || 1, 0), !0;
        }
        linePosAbsolute(C) {
          return this._setCursor(this._activeBuffer.x, (C.params[0] || 1) - 1), !0;
        }
        vPositionRelative(C) {
          return this._moveCursor(0, C.params[0] || 1), !0;
        }
        hVPosition(C) {
          return this.cursorPosition(C), !0;
        }
        tabClear(C) {
          const x = C.params[0];
          return x === 0 ? delete this._activeBuffer.tabs[this._activeBuffer.x] : x === 3 && (this._activeBuffer.tabs = {}), !0;
        }
        cursorForwardTab(C) {
          if (this._activeBuffer.x >= this._bufferService.cols)
            return !0;
          let x = C.params[0] || 1;
          for (; x--; )
            this._activeBuffer.x = this._activeBuffer.nextStop();
          return !0;
        }
        cursorBackwardTab(C) {
          if (this._activeBuffer.x >= this._bufferService.cols)
            return !0;
          let x = C.params[0] || 1;
          for (; x--; )
            this._activeBuffer.x = this._activeBuffer.prevStop();
          return !0;
        }
        selectProtected(C) {
          const x = C.params[0];
          return x === 1 && (this._curAttrData.bg |= 536870912), x !== 2 && x !== 0 || (this._curAttrData.bg &= -536870913), !0;
        }
        _eraseInBufferLine(C, x, A, O = !1, I = !1) {
          const q = this._activeBuffer.lines.get(this._activeBuffer.ybase + C);
          q.replaceCells(x, A, this._activeBuffer.getNullCell(this._eraseAttrData()), I), O && (q.isWrapped = !1);
        }
        _resetBufferLine(C, x = !1) {
          const A = this._activeBuffer.lines.get(this._activeBuffer.ybase + C);
          A && (A.fill(this._activeBuffer.getNullCell(this._eraseAttrData()), x), this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + C), A.isWrapped = !1);
        }
        eraseInDisplay(C, x = !1) {
          let A;
          switch (this._restrictCursor(this._bufferService.cols), C.params[0]) {
            case 0:
              for (A = this._activeBuffer.y, this._dirtyRowTracker.markDirty(A), this._eraseInBufferLine(A++, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, x); A < this._bufferService.rows; A++)
                this._resetBufferLine(A, x);
              this._dirtyRowTracker.markDirty(A);
              break;
            case 1:
              for (A = this._activeBuffer.y, this._dirtyRowTracker.markDirty(A), this._eraseInBufferLine(A, 0, this._activeBuffer.x + 1, !0, x), this._activeBuffer.x + 1 >= this._bufferService.cols && (this._activeBuffer.lines.get(A + 1).isWrapped = !1); A--; )
                this._resetBufferLine(A, x);
              this._dirtyRowTracker.markDirty(0);
              break;
            case 2:
              for (A = this._bufferService.rows, this._dirtyRowTracker.markDirty(A - 1); A--; )
                this._resetBufferLine(A, x);
              this._dirtyRowTracker.markDirty(0);
              break;
            case 3:
              const O = this._activeBuffer.lines.length - this._bufferService.rows;
              O > 0 && (this._activeBuffer.lines.trimStart(O), this._activeBuffer.ybase = Math.max(this._activeBuffer.ybase - O, 0), this._activeBuffer.ydisp = Math.max(this._activeBuffer.ydisp - O, 0), this._onScroll.fire(0));
          }
          return !0;
        }
        eraseInLine(C, x = !1) {
          switch (this._restrictCursor(this._bufferService.cols), C.params[0]) {
            case 0:
              this._eraseInBufferLine(this._activeBuffer.y, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, x);
              break;
            case 1:
              this._eraseInBufferLine(this._activeBuffer.y, 0, this._activeBuffer.x + 1, !1, x);
              break;
            case 2:
              this._eraseInBufferLine(this._activeBuffer.y, 0, this._bufferService.cols, !0, x);
          }
          return this._dirtyRowTracker.markDirty(this._activeBuffer.y), !0;
        }
        insertLines(C) {
          this._restrictCursor();
          let x = C.params[0] || 1;
          if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop)
            return !0;
          const A = this._activeBuffer.ybase + this._activeBuffer.y, O = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom, I = this._bufferService.rows - 1 + this._activeBuffer.ybase - O + 1;
          for (; x--; )
            this._activeBuffer.lines.splice(I - 1, 1), this._activeBuffer.lines.splice(A, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, !0;
        }
        deleteLines(C) {
          this._restrictCursor();
          let x = C.params[0] || 1;
          if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop)
            return !0;
          const A = this._activeBuffer.ybase + this._activeBuffer.y;
          let O;
          for (O = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom, O = this._bufferService.rows - 1 + this._activeBuffer.ybase - O; x--; )
            this._activeBuffer.lines.splice(A, 1), this._activeBuffer.lines.splice(O, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, !0;
        }
        insertChars(C) {
          this._restrictCursor();
          const x = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
          return x && (x.insertCells(this._activeBuffer.x, C.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), !0;
        }
        deleteChars(C) {
          this._restrictCursor();
          const x = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
          return x && (x.deleteCells(this._activeBuffer.x, C.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), !0;
        }
        scrollUp(C) {
          let x = C.params[0] || 1;
          for (; x--; )
            this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 1), this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
        }
        scrollDown(C) {
          let x = C.params[0] || 1;
          for (; x--; )
            this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 1), this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 0, this._activeBuffer.getBlankLine(s.DEFAULT_ATTR_DATA));
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
        }
        scrollLeft(C) {
          if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop)
            return !0;
          const x = C.params[0] || 1;
          for (let A = this._activeBuffer.scrollTop; A <= this._activeBuffer.scrollBottom; ++A) {
            const O = this._activeBuffer.lines.get(this._activeBuffer.ybase + A);
            O.deleteCells(0, x, this._activeBuffer.getNullCell(this._eraseAttrData())), O.isWrapped = !1;
          }
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
        }
        scrollRight(C) {
          if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop)
            return !0;
          const x = C.params[0] || 1;
          for (let A = this._activeBuffer.scrollTop; A <= this._activeBuffer.scrollBottom; ++A) {
            const O = this._activeBuffer.lines.get(this._activeBuffer.ybase + A);
            O.insertCells(0, x, this._activeBuffer.getNullCell(this._eraseAttrData())), O.isWrapped = !1;
          }
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
        }
        insertColumns(C) {
          if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop)
            return !0;
          const x = C.params[0] || 1;
          for (let A = this._activeBuffer.scrollTop; A <= this._activeBuffer.scrollBottom; ++A) {
            const O = this._activeBuffer.lines.get(this._activeBuffer.ybase + A);
            O.insertCells(this._activeBuffer.x, x, this._activeBuffer.getNullCell(this._eraseAttrData())), O.isWrapped = !1;
          }
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
        }
        deleteColumns(C) {
          if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop)
            return !0;
          const x = C.params[0] || 1;
          for (let A = this._activeBuffer.scrollTop; A <= this._activeBuffer.scrollBottom; ++A) {
            const O = this._activeBuffer.lines.get(this._activeBuffer.ybase + A);
            O.deleteCells(this._activeBuffer.x, x, this._activeBuffer.getNullCell(this._eraseAttrData())), O.isWrapped = !1;
          }
          return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
        }
        eraseChars(C) {
          this._restrictCursor();
          const x = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
          return x && (x.replaceCells(this._activeBuffer.x, this._activeBuffer.x + (C.params[0] || 1), this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), !0;
        }
        repeatPrecedingCharacter(C) {
          const x = this._parser.precedingJoinState;
          if (!x)
            return !0;
          const A = C.params[0] || 1, O = u.UnicodeService.extractWidth(x), I = this._activeBuffer.x - O, q = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).getString(I), X = new Uint32Array(q.length * A);
          let J = 0;
          for (let w = 0; w < q.length; ) {
            const U = q.codePointAt(w) || 0;
            X[J++] = U, w += U > 65535 ? 2 : 1;
          }
          let P = J;
          for (let w = 1; w < A; ++w)
            X.copyWithin(P, 0, J), P += J;
          return this.print(X, 0, P), !0;
        }
        sendDeviceAttributesPrimary(C) {
          return C.params[0] > 0 || (this._is("xterm") || this._is("rxvt-unicode") || this._is("screen") ? this._coreService.triggerDataEvent(a.C0.ESC + "[?1;2c") : this._is("linux") && this._coreService.triggerDataEvent(a.C0.ESC + "[?6c")), !0;
        }
        sendDeviceAttributesSecondary(C) {
          return C.params[0] > 0 || (this._is("xterm") ? this._coreService.triggerDataEvent(a.C0.ESC + "[>0;276;0c") : this._is("rxvt-unicode") ? this._coreService.triggerDataEvent(a.C0.ESC + "[>85;95;0c") : this._is("linux") ? this._coreService.triggerDataEvent(C.params[0] + "c") : this._is("screen") && this._coreService.triggerDataEvent(a.C0.ESC + "[>83;40003;0c")), !0;
        }
        _is(C) {
          return (this._optionsService.rawOptions.termName + "").indexOf(C) === 0;
        }
        setMode(C) {
          for (let x = 0; x < C.length; x++)
            switch (C.params[x]) {
              case 4:
                this._coreService.modes.insertMode = !0;
                break;
              case 20:
                this._optionsService.options.convertEol = !0;
            }
          return !0;
        }
        setModePrivate(C) {
          for (let x = 0; x < C.length; x++)
            switch (C.params[x]) {
              case 1:
                this._coreService.decPrivateModes.applicationCursorKeys = !0;
                break;
              case 2:
                this._charsetService.setgCharset(0, d.DEFAULT_CHARSET), this._charsetService.setgCharset(1, d.DEFAULT_CHARSET), this._charsetService.setgCharset(2, d.DEFAULT_CHARSET), this._charsetService.setgCharset(3, d.DEFAULT_CHARSET);
                break;
              case 3:
                this._optionsService.rawOptions.windowOptions.setWinLines && (this._bufferService.resize(132, this._bufferService.rows), this._onRequestReset.fire());
                break;
              case 6:
                this._coreService.decPrivateModes.origin = !0, this._setCursor(0, 0);
                break;
              case 7:
                this._coreService.decPrivateModes.wraparound = !0;
                break;
              case 12:
                this._optionsService.options.cursorBlink = !0;
                break;
              case 45:
                this._coreService.decPrivateModes.reverseWraparound = !0;
                break;
              case 66:
                this._logService.debug("Serial port requested application keypad."), this._coreService.decPrivateModes.applicationKeypad = !0, this._onRequestSyncScrollBar.fire();
                break;
              case 9:
                this._coreMouseService.activeProtocol = "X10";
                break;
              case 1e3:
                this._coreMouseService.activeProtocol = "VT200";
                break;
              case 1002:
                this._coreMouseService.activeProtocol = "DRAG";
                break;
              case 1003:
                this._coreMouseService.activeProtocol = "ANY";
                break;
              case 1004:
                this._coreService.decPrivateModes.sendFocus = !0, this._onRequestSendFocus.fire();
                break;
              case 1005:
                this._logService.debug("DECSET 1005 not supported (see #2507)");
                break;
              case 1006:
                this._coreMouseService.activeEncoding = "SGR";
                break;
              case 1015:
                this._logService.debug("DECSET 1015 not supported (see #2507)");
                break;
              case 1016:
                this._coreMouseService.activeEncoding = "SGR_PIXELS";
                break;
              case 25:
                this._coreService.isCursorHidden = !1;
                break;
              case 1048:
                this.saveCursor();
                break;
              case 1049:
                this.saveCursor();
              case 47:
              case 1047:
                this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()), this._coreService.isCursorInitialized = !0, this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1), this._onRequestSyncScrollBar.fire();
                break;
              case 2004:
                this._coreService.decPrivateModes.bracketedPasteMode = !0;
            }
          return !0;
        }
        resetMode(C) {
          for (let x = 0; x < C.length; x++)
            switch (C.params[x]) {
              case 4:
                this._coreService.modes.insertMode = !1;
                break;
              case 20:
                this._optionsService.options.convertEol = !1;
            }
          return !0;
        }
        resetModePrivate(C) {
          for (let x = 0; x < C.length; x++)
            switch (C.params[x]) {
              case 1:
                this._coreService.decPrivateModes.applicationCursorKeys = !1;
                break;
              case 3:
                this._optionsService.rawOptions.windowOptions.setWinLines && (this._bufferService.resize(80, this._bufferService.rows), this._onRequestReset.fire());
                break;
              case 6:
                this._coreService.decPrivateModes.origin = !1, this._setCursor(0, 0);
                break;
              case 7:
                this._coreService.decPrivateModes.wraparound = !1;
                break;
              case 12:
                this._optionsService.options.cursorBlink = !1;
                break;
              case 45:
                this._coreService.decPrivateModes.reverseWraparound = !1;
                break;
              case 66:
                this._logService.debug("Switching back to normal keypad."), this._coreService.decPrivateModes.applicationKeypad = !1, this._onRequestSyncScrollBar.fire();
                break;
              case 9:
              case 1e3:
              case 1002:
              case 1003:
                this._coreMouseService.activeProtocol = "NONE";
                break;
              case 1004:
                this._coreService.decPrivateModes.sendFocus = !1;
                break;
              case 1005:
                this._logService.debug("DECRST 1005 not supported (see #2507)");
                break;
              case 1006:
              case 1016:
                this._coreMouseService.activeEncoding = "DEFAULT";
                break;
              case 1015:
                this._logService.debug("DECRST 1015 not supported (see #2507)");
                break;
              case 25:
                this._coreService.isCursorHidden = !0;
                break;
              case 1048:
                this.restoreCursor();
                break;
              case 1049:
              case 47:
              case 1047:
                this._bufferService.buffers.activateNormalBuffer(), C.params[x] === 1049 && this.restoreCursor(), this._coreService.isCursorInitialized = !0, this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1), this._onRequestSyncScrollBar.fire();
                break;
              case 2004:
                this._coreService.decPrivateModes.bracketedPasteMode = !1;
            }
          return !0;
        }
        requestMode(C, x) {
          const A = this._coreService.decPrivateModes, { activeProtocol: O, activeEncoding: I } = this._coreMouseService, q = this._coreService, { buffers: X, cols: J } = this._bufferService, { active: P, alt: w } = X, U = this._optionsService.rawOptions, F = (se) => se ? 1 : 2, G = C.params[0];
          return K = G, ee = x ? G === 2 ? 4 : G === 4 ? F(q.modes.insertMode) : G === 12 ? 3 : G === 20 ? F(U.convertEol) : 0 : G === 1 ? F(A.applicationCursorKeys) : G === 3 ? U.windowOptions.setWinLines ? J === 80 ? 2 : J === 132 ? 1 : 0 : 0 : G === 6 ? F(A.origin) : G === 7 ? F(A.wraparound) : G === 8 ? 3 : G === 9 ? F(O === "X10") : G === 12 ? F(U.cursorBlink) : G === 25 ? F(!q.isCursorHidden) : G === 45 ? F(A.reverseWraparound) : G === 66 ? F(A.applicationKeypad) : G === 67 ? 4 : G === 1e3 ? F(O === "VT200") : G === 1002 ? F(O === "DRAG") : G === 1003 ? F(O === "ANY") : G === 1004 ? F(A.sendFocus) : G === 1005 ? 4 : G === 1006 ? F(I === "SGR") : G === 1015 ? 4 : G === 1016 ? F(I === "SGR_PIXELS") : G === 1048 ? 1 : G === 47 || G === 1047 || G === 1049 ? F(P === w) : G === 2004 ? F(A.bracketedPasteMode) : 0, q.triggerDataEvent(`${a.C0.ESC}[${x ? "" : "?"}${K};${ee}$y`), !0;
          var K, ee;
        }
        _updateAttrColor(C, x, A, O, I) {
          return x === 2 ? (C |= 50331648, C &= -16777216, C |= h.AttributeData.fromColorRGB([A, O, I])) : x === 5 && (C &= -50331904, C |= 33554432 | 255 & A), C;
        }
        _extractColor(C, x, A) {
          const O = [0, 0, -1, 0, 0, 0];
          let I = 0, q = 0;
          do {
            if (O[q + I] = C.params[x + q], C.hasSubParams(x + q)) {
              const X = C.getSubParams(x + q);
              let J = 0;
              do
                O[1] === 5 && (I = 1), O[q + J + 1 + I] = X[J];
              while (++J < X.length && J + q + 1 + I < O.length);
              break;
            }
            if (O[1] === 5 && q + I >= 2 || O[1] === 2 && q + I >= 5)
              break;
            O[1] && (I = 1);
          } while (++q + x < C.length && q + I < O.length);
          for (let X = 2; X < O.length; ++X)
            O[X] === -1 && (O[X] = 0);
          switch (O[0]) {
            case 38:
              A.fg = this._updateAttrColor(A.fg, O[1], O[3], O[4], O[5]);
              break;
            case 48:
              A.bg = this._updateAttrColor(A.bg, O[1], O[3], O[4], O[5]);
              break;
            case 58:
              A.extended = A.extended.clone(), A.extended.underlineColor = this._updateAttrColor(A.extended.underlineColor, O[1], O[3], O[4], O[5]);
          }
          return q;
        }
        _processUnderline(C, x) {
          x.extended = x.extended.clone(), (!~C || C > 5) && (C = 1), x.extended.underlineStyle = C, x.fg |= 268435456, C === 0 && (x.fg &= -268435457), x.updateExtended();
        }
        _processSGR0(C) {
          C.fg = s.DEFAULT_ATTR_DATA.fg, C.bg = s.DEFAULT_ATTR_DATA.bg, C.extended = C.extended.clone(), C.extended.underlineStyle = 0, C.extended.underlineColor &= -67108864, C.updateExtended();
        }
        charAttributes(C) {
          if (C.length === 1 && C.params[0] === 0)
            return this._processSGR0(this._curAttrData), !0;
          const x = C.length;
          let A;
          const O = this._curAttrData;
          for (let I = 0; I < x; I++)
            A = C.params[I], A >= 30 && A <= 37 ? (O.fg &= -50331904, O.fg |= 16777216 | A - 30) : A >= 40 && A <= 47 ? (O.bg &= -50331904, O.bg |= 16777216 | A - 40) : A >= 90 && A <= 97 ? (O.fg &= -50331904, O.fg |= 16777224 | A - 90) : A >= 100 && A <= 107 ? (O.bg &= -50331904, O.bg |= 16777224 | A - 100) : A === 0 ? this._processSGR0(O) : A === 1 ? O.fg |= 134217728 : A === 3 ? O.bg |= 67108864 : A === 4 ? (O.fg |= 268435456, this._processUnderline(C.hasSubParams(I) ? C.getSubParams(I)[0] : 1, O)) : A === 5 ? O.fg |= 536870912 : A === 7 ? O.fg |= 67108864 : A === 8 ? O.fg |= 1073741824 : A === 9 ? O.fg |= 2147483648 : A === 2 ? O.bg |= 134217728 : A === 21 ? this._processUnderline(2, O) : A === 22 ? (O.fg &= -134217729, O.bg &= -134217729) : A === 23 ? O.bg &= -67108865 : A === 24 ? (O.fg &= -268435457, this._processUnderline(0, O)) : A === 25 ? O.fg &= -536870913 : A === 27 ? O.fg &= -67108865 : A === 28 ? O.fg &= -1073741825 : A === 29 ? O.fg &= 2147483647 : A === 39 ? (O.fg &= -67108864, O.fg |= 16777215 & s.DEFAULT_ATTR_DATA.fg) : A === 49 ? (O.bg &= -67108864, O.bg |= 16777215 & s.DEFAULT_ATTR_DATA.bg) : A === 38 || A === 48 || A === 58 ? I += this._extractColor(C, I, O) : A === 53 ? O.bg |= 1073741824 : A === 55 ? O.bg &= -1073741825 : A === 59 ? (O.extended = O.extended.clone(), O.extended.underlineColor = -1, O.updateExtended()) : A === 100 ? (O.fg &= -67108864, O.fg |= 16777215 & s.DEFAULT_ATTR_DATA.fg, O.bg &= -67108864, O.bg |= 16777215 & s.DEFAULT_ATTR_DATA.bg) : this._logService.debug("Unknown SGR attribute: %d.", A);
          return !0;
        }
        deviceStatus(C) {
          switch (C.params[0]) {
            case 5:
              this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);
              break;
            case 6:
              const x = this._activeBuffer.y + 1, A = this._activeBuffer.x + 1;
              this._coreService.triggerDataEvent(`${a.C0.ESC}[${x};${A}R`);
          }
          return !0;
        }
        deviceStatusPrivate(C) {
          if (C.params[0] === 6) {
            const x = this._activeBuffer.y + 1, A = this._activeBuffer.x + 1;
            this._coreService.triggerDataEvent(`${a.C0.ESC}[?${x};${A}R`);
          }
          return !0;
        }
        softReset(C) {
          return this._coreService.isCursorHidden = !1, this._onRequestSyncScrollBar.fire(), this._activeBuffer.scrollTop = 0, this._activeBuffer.scrollBottom = this._bufferService.rows - 1, this._curAttrData = s.DEFAULT_ATTR_DATA.clone(), this._coreService.reset(), this._charsetService.reset(), this._activeBuffer.savedX = 0, this._activeBuffer.savedY = this._activeBuffer.ybase, this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg, this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg, this._activeBuffer.savedCharset = this._charsetService.charset, this._coreService.decPrivateModes.origin = !1, !0;
        }
        setCursorStyle(C) {
          const x = C.params[0] || 1;
          switch (x) {
            case 1:
            case 2:
              this._optionsService.options.cursorStyle = "block";
              break;
            case 3:
            case 4:
              this._optionsService.options.cursorStyle = "underline";
              break;
            case 5:
            case 6:
              this._optionsService.options.cursorStyle = "bar";
          }
          const A = x % 2 == 1;
          return this._optionsService.options.cursorBlink = A, !0;
        }
        setScrollRegion(C) {
          const x = C.params[0] || 1;
          let A;
          return (C.length < 2 || (A = C.params[1]) > this._bufferService.rows || A === 0) && (A = this._bufferService.rows), A > x && (this._activeBuffer.scrollTop = x - 1, this._activeBuffer.scrollBottom = A - 1, this._setCursor(0, 0)), !0;
        }
        windowOptions(C) {
          if (!T(C.params[0], this._optionsService.rawOptions.windowOptions))
            return !0;
          const x = C.length > 1 ? C.params[1] : 0;
          switch (C.params[0]) {
            case 14:
              x !== 2 && this._onRequestWindowsOptionsReport.fire(L.GET_WIN_SIZE_PIXELS);
              break;
            case 16:
              this._onRequestWindowsOptionsReport.fire(L.GET_CELL_SIZE_PIXELS);
              break;
            case 18:
              this._bufferService && this._coreService.triggerDataEvent(`${a.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);
              break;
            case 22:
              x !== 0 && x !== 2 || (this._windowTitleStack.push(this._windowTitle), this._windowTitleStack.length > 10 && this._windowTitleStack.shift()), x !== 0 && x !== 1 || (this._iconNameStack.push(this._iconName), this._iconNameStack.length > 10 && this._iconNameStack.shift());
              break;
            case 23:
              x !== 0 && x !== 2 || this._windowTitleStack.length && this.setTitle(this._windowTitleStack.pop()), x !== 0 && x !== 1 || this._iconNameStack.length && this.setIconName(this._iconNameStack.pop());
          }
          return !0;
        }
        saveCursor(C) {
          return this._activeBuffer.savedX = this._activeBuffer.x, this._activeBuffer.savedY = this._activeBuffer.ybase + this._activeBuffer.y, this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg, this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg, this._activeBuffer.savedCharset = this._charsetService.charset, !0;
        }
        restoreCursor(C) {
          return this._activeBuffer.x = this._activeBuffer.savedX || 0, this._activeBuffer.y = Math.max(this._activeBuffer.savedY - this._activeBuffer.ybase, 0), this._curAttrData.fg = this._activeBuffer.savedCurAttrData.fg, this._curAttrData.bg = this._activeBuffer.savedCurAttrData.bg, this._charsetService.charset = this._savedCharset, this._activeBuffer.savedCharset && (this._charsetService.charset = this._activeBuffer.savedCharset), this._restrictCursor(), !0;
        }
        setTitle(C) {
          return this._windowTitle = C, this._onTitleChange.fire(C), !0;
        }
        setIconName(C) {
          return this._iconName = C, !0;
        }
        setOrReportIndexedColor(C) {
          const x = [], A = C.split(";");
          for (; A.length > 1; ) {
            const O = A.shift(), I = A.shift();
            if (/^\d+$/.exec(O)) {
              const q = parseInt(O);
              if (V(q))
                if (I === "?")
                  x.push({ type: 0, index: q });
                else {
                  const X = (0, b.parseColor)(I);
                  X && x.push({ type: 1, index: q, color: X });
                }
            }
          }
          return x.length && this._onColor.fire(x), !0;
        }
        setHyperlink(C) {
          const x = C.split(";");
          return !(x.length < 2) && (x[1] ? this._createHyperlink(x[0], x[1]) : !x[0] && this._finishHyperlink());
        }
        _createHyperlink(C, x) {
          this._getCurrentLinkId() && this._finishHyperlink();
          const A = C.split(":");
          let O;
          const I = A.findIndex((q) => q.startsWith("id="));
          return I !== -1 && (O = A[I].slice(3) || void 0), this._curAttrData.extended = this._curAttrData.extended.clone(), this._curAttrData.extended.urlId = this._oscLinkService.registerLink({ id: O, uri: x }), this._curAttrData.updateExtended(), !0;
        }
        _finishHyperlink() {
          return this._curAttrData.extended = this._curAttrData.extended.clone(), this._curAttrData.extended.urlId = 0, this._curAttrData.updateExtended(), !0;
        }
        _setOrReportSpecialColor(C, x) {
          const A = C.split(";");
          for (let O = 0; O < A.length && !(x >= this._specialColors.length); ++O, ++x)
            if (A[O] === "?")
              this._onColor.fire([{ type: 0, index: this._specialColors[x] }]);
            else {
              const I = (0, b.parseColor)(A[O]);
              I && this._onColor.fire([{ type: 1, index: this._specialColors[x], color: I }]);
            }
          return !0;
        }
        setOrReportFgColor(C) {
          return this._setOrReportSpecialColor(C, 0);
        }
        setOrReportBgColor(C) {
          return this._setOrReportSpecialColor(C, 1);
        }
        setOrReportCursorColor(C) {
          return this._setOrReportSpecialColor(C, 2);
        }
        restoreIndexedColor(C) {
          if (!C)
            return this._onColor.fire([{ type: 2 }]), !0;
          const x = [], A = C.split(";");
          for (let O = 0; O < A.length; ++O)
            if (/^\d+$/.exec(A[O])) {
              const I = parseInt(A[O]);
              V(I) && x.push({ type: 2, index: I });
            }
          return x.length && this._onColor.fire(x), !0;
        }
        restoreFgColor(C) {
          return this._onColor.fire([{ type: 2, index: 256 }]), !0;
        }
        restoreBgColor(C) {
          return this._onColor.fire([{ type: 2, index: 257 }]), !0;
        }
        restoreCursorColor(C) {
          return this._onColor.fire([{ type: 2, index: 258 }]), !0;
        }
        nextLine() {
          return this._activeBuffer.x = 0, this.index(), !0;
        }
        keypadApplicationMode() {
          return this._logService.debug("Serial port requested application keypad."), this._coreService.decPrivateModes.applicationKeypad = !0, this._onRequestSyncScrollBar.fire(), !0;
        }
        keypadNumericMode() {
          return this._logService.debug("Switching back to normal keypad."), this._coreService.decPrivateModes.applicationKeypad = !1, this._onRequestSyncScrollBar.fire(), !0;
        }
        selectDefaultCharset() {
          return this._charsetService.setgLevel(0), this._charsetService.setgCharset(0, d.DEFAULT_CHARSET), !0;
        }
        selectCharset(C) {
          return C.length !== 2 ? (this.selectDefaultCharset(), !0) : (C[0] === "/" || this._charsetService.setgCharset(R[C[0]], d.CHARSETS[C[1]] || d.DEFAULT_CHARSET), !0);
        }
        index() {
          return this._restrictCursor(), this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData())) : this._activeBuffer.y >= this._bufferService.rows && (this._activeBuffer.y = this._bufferService.rows - 1), this._restrictCursor(), !0;
        }
        tabSet() {
          return this._activeBuffer.tabs[this._activeBuffer.x] = !0, !0;
        }
        reverseIndex() {
          if (this._restrictCursor(), this._activeBuffer.y === this._activeBuffer.scrollTop) {
            const C = this._activeBuffer.scrollBottom - this._activeBuffer.scrollTop;
            this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase + this._activeBuffer.y, C, 1), this._activeBuffer.lines.set(this._activeBuffer.ybase + this._activeBuffer.y, this._activeBuffer.getBlankLine(this._eraseAttrData())), this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);
          } else
            this._activeBuffer.y--, this._restrictCursor();
          return !0;
        }
        fullReset() {
          return this._parser.reset(), this._onRequestReset.fire(), !0;
        }
        reset() {
          this._curAttrData = s.DEFAULT_ATTR_DATA.clone(), this._eraseAttrDataInternal = s.DEFAULT_ATTR_DATA.clone();
        }
        _eraseAttrData() {
          return this._eraseAttrDataInternal.bg &= -67108864, this._eraseAttrDataInternal.bg |= 67108863 & this._curAttrData.bg, this._eraseAttrDataInternal;
        }
        setgLevel(C) {
          return this._charsetService.setgLevel(C), !0;
        }
        screenAlignmentPattern() {
          const C = new t.CellData();
          C.content = 4194373, C.fg = this._curAttrData.fg, C.bg = this._curAttrData.bg, this._setCursor(0, 0);
          for (let x = 0; x < this._bufferService.rows; ++x) {
            const A = this._activeBuffer.ybase + this._activeBuffer.y + x, O = this._activeBuffer.lines.get(A);
            O && (O.fill(C), O.isWrapped = !1);
          }
          return this._dirtyRowTracker.markAllDirty(), this._setCursor(0, 0), !0;
        }
        requestStatusString(C, x) {
          const A = this._bufferService.buffer, O = this._optionsService.rawOptions;
          return ((I) => (this._coreService.triggerDataEvent(`${a.C0.ESC}${I}${a.C0.ESC}\\`), !0))(C === '"q' ? `P1$r${this._curAttrData.isProtected() ? 1 : 0}"q` : C === '"p' ? 'P1$r61;1"p' : C === "r" ? `P1$r${A.scrollTop + 1};${A.scrollBottom + 1}r` : C === "m" ? "P1$r0m" : C === " q" ? `P1$r${{ block: 2, underline: 4, bar: 6 }[O.cursorStyle] - (O.cursorBlink ? 1 : 0)} q` : "P0$r");
        }
        markRangeDirty(C, x) {
          this._dirtyRowTracker.markRangeDirty(C, x);
        }
      }
      i.InputHandler = W;
      let j = class {
        constructor(z) {
          this._bufferService = z, this.clearRange();
        }
        clearRange() {
          this.start = this._bufferService.buffer.y, this.end = this._bufferService.buffer.y;
        }
        markDirty(z) {
          z < this.start ? this.start = z : z > this.end && (this.end = z);
        }
        markRangeDirty(z, C) {
          z > C && (H = z, z = C, C = H), z < this.start && (this.start = z), C > this.end && (this.end = C);
        }
        markAllDirty() {
          this.markRangeDirty(0, this._bufferService.rows - 1);
        }
      };
      function V(z) {
        return 0 <= z && z < 256;
      }
      j = o([c(0, g.IBufferService)], j);
    }, 844: (k, i) => {
      function n(o) {
        for (const c of o)
          c.dispose();
        o.length = 0;
      }
      Object.defineProperty(i, "__esModule", { value: !0 }), i.getDisposeArrayDisposable = i.disposeArray = i.toDisposable = i.MutableDisposable = i.Disposable = void 0, i.Disposable = class {
        constructor() {
          this._disposables = [], this._isDisposed = !1;
        }
        dispose() {
          this._isDisposed = !0;
          for (const o of this._disposables)
            o.dispose();
          this._disposables.length = 0;
        }
        register(o) {
          return this._disposables.push(o), o;
        }
        unregister(o) {
          const c = this._disposables.indexOf(o);
          c !== -1 && this._disposables.splice(c, 1);
        }
      }, i.MutableDisposable = class {
        constructor() {
          this._isDisposed = !1;
        }
        get value() {
          return this._isDisposed ? void 0 : this._value;
        }
        set value(o) {
          var c;
          this._isDisposed || o === this._value || ((c = this._value) == null || c.dispose(), this._value = o);
        }
        clear() {
          this.value = void 0;
        }
        dispose() {
          var o;
          this._isDisposed = !0, (o = this._value) == null || o.dispose(), this._value = void 0;
        }
      }, i.toDisposable = function(o) {
        return { dispose: o };
      }, i.disposeArray = n, i.getDisposeArrayDisposable = function(o) {
        return { dispose: () => n(o) };
      };
    }, 1505: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.FourKeyMap = i.TwoKeyMap = void 0;
      class n {
        constructor() {
          this._data = {};
        }
        set(c, a, d) {
          this._data[c] || (this._data[c] = {}), this._data[c][a] = d;
        }
        get(c, a) {
          return this._data[c] ? this._data[c][a] : void 0;
        }
        clear() {
          this._data = {};
        }
      }
      i.TwoKeyMap = n, i.FourKeyMap = class {
        constructor() {
          this._data = new n();
        }
        set(o, c, a, d, v) {
          this._data.get(o, c) || this._data.set(o, c, new n()), this._data.get(o, c).set(a, d, v);
        }
        get(o, c, a, d) {
          var v;
          return (v = this._data.get(o, c)) == null ? void 0 : v.get(a, d);
        }
        clear() {
          this._data.clear();
        }
      };
    }, 6114: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.isChromeOS = i.isLinux = i.isWindows = i.isIphone = i.isIpad = i.isMac = i.getSafariVersion = i.isSafari = i.isLegacyEdge = i.isFirefox = i.isNode = void 0, i.isNode = typeof process < "u" && "title" in process;
      const n = i.isNode ? "node" : navigator.userAgent, o = i.isNode ? "node" : navigator.platform;
      i.isFirefox = n.includes("Firefox"), i.isLegacyEdge = n.includes("Edge"), i.isSafari = /^((?!chrome|android).)*safari/i.test(n), i.getSafariVersion = function() {
        if (!i.isSafari)
          return 0;
        const c = n.match(/Version\/(\d+)/);
        return c === null || c.length < 2 ? 0 : parseInt(c[1]);
      }, i.isMac = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"].includes(o), i.isIpad = o === "iPad", i.isIphone = o === "iPhone", i.isWindows = ["Windows", "Win16", "Win32", "WinCE"].includes(o), i.isLinux = o.indexOf("Linux") >= 0, i.isChromeOS = /\bCrOS\b/.test(n);
    }, 6106: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.SortedList = void 0;
      let n = 0;
      i.SortedList = class {
        constructor(o) {
          this._getKey = o, this._array = [];
        }
        clear() {
          this._array.length = 0;
        }
        insert(o) {
          this._array.length !== 0 ? (n = this._search(this._getKey(o)), this._array.splice(n, 0, o)) : this._array.push(o);
        }
        delete(o) {
          if (this._array.length === 0)
            return !1;
          const c = this._getKey(o);
          if (c === void 0 || (n = this._search(c), n === -1) || this._getKey(this._array[n]) !== c)
            return !1;
          do
            if (this._array[n] === o)
              return this._array.splice(n, 1), !0;
          while (++n < this._array.length && this._getKey(this._array[n]) === c);
          return !1;
        }
        *getKeyIterator(o) {
          if (this._array.length !== 0 && (n = this._search(o), !(n < 0 || n >= this._array.length) && this._getKey(this._array[n]) === o))
            do
              yield this._array[n];
            while (++n < this._array.length && this._getKey(this._array[n]) === o);
        }
        forEachByKey(o, c) {
          if (this._array.length !== 0 && (n = this._search(o), !(n < 0 || n >= this._array.length) && this._getKey(this._array[n]) === o))
            do
              c(this._array[n]);
            while (++n < this._array.length && this._getKey(this._array[n]) === o);
        }
        values() {
          return [...this._array].values();
        }
        _search(o) {
          let c = 0, a = this._array.length - 1;
          for (; a >= c; ) {
            let d = c + a >> 1;
            const v = this._getKey(this._array[d]);
            if (v > o)
              a = d - 1;
            else {
              if (!(v < o)) {
                for (; d > 0 && this._getKey(this._array[d - 1]) === o; )
                  d--;
                return d;
              }
              c = d + 1;
            }
          }
          return c;
        }
      };
    }, 7226: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.DebouncedIdleTask = i.IdleTaskQueue = i.PriorityTaskQueue = void 0;
      const o = n(6114);
      class c {
        constructor() {
          this._tasks = [], this._i = 0;
        }
        enqueue(v) {
          this._tasks.push(v), this._start();
        }
        flush() {
          for (; this._i < this._tasks.length; )
            this._tasks[this._i]() || this._i++;
          this.clear();
        }
        clear() {
          this._idleCallback && (this._cancelCallback(this._idleCallback), this._idleCallback = void 0), this._i = 0, this._tasks.length = 0;
        }
        _start() {
          this._idleCallback || (this._idleCallback = this._requestCallback(this._process.bind(this)));
        }
        _process(v) {
          this._idleCallback = void 0;
          let m = 0, l = 0, s = v.timeRemaining(), r = 0;
          for (; this._i < this._tasks.length; ) {
            if (m = Date.now(), this._tasks[this._i]() || this._i++, m = Math.max(1, Date.now() - m), l = Math.max(m, l), r = v.timeRemaining(), 1.5 * l > r)
              return s - m < -20 && console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s - m))}ms`), void this._start();
            s = r;
          }
          this.clear();
        }
      }
      class a extends c {
        _requestCallback(v) {
          return setTimeout(() => v(this._createDeadline(16)));
        }
        _cancelCallback(v) {
          clearTimeout(v);
        }
        _createDeadline(v) {
          const m = Date.now() + v;
          return { timeRemaining: () => Math.max(0, m - Date.now()) };
        }
      }
      i.PriorityTaskQueue = a, i.IdleTaskQueue = !o.isNode && "requestIdleCallback" in window ? class extends c {
        _requestCallback(d) {
          return requestIdleCallback(d);
        }
        _cancelCallback(d) {
          cancelIdleCallback(d);
        }
      } : a, i.DebouncedIdleTask = class {
        constructor() {
          this._queue = new i.IdleTaskQueue();
        }
        set(d) {
          this._queue.clear(), this._queue.enqueue(d);
        }
        flush() {
          this._queue.flush();
        }
      };
    }, 9282: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.updateWindowsModeWrappedState = void 0;
      const o = n(643);
      i.updateWindowsModeWrappedState = function(c) {
        const a = c.buffer.lines.get(c.buffer.ybase + c.buffer.y - 1), d = a == null ? void 0 : a.get(c.cols - 1), v = c.buffer.lines.get(c.buffer.ybase + c.buffer.y);
        v && d && (v.isWrapped = d[o.CHAR_DATA_CODE_INDEX] !== o.NULL_CELL_CODE && d[o.CHAR_DATA_CODE_INDEX] !== o.WHITESPACE_CELL_CODE);
      };
    }, 3734: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.ExtendedAttrs = i.AttributeData = void 0;
      class n {
        constructor() {
          this.fg = 0, this.bg = 0, this.extended = new o();
        }
        static toColorRGB(a) {
          return [a >>> 16 & 255, a >>> 8 & 255, 255 & a];
        }
        static fromColorRGB(a) {
          return (255 & a[0]) << 16 | (255 & a[1]) << 8 | 255 & a[2];
        }
        clone() {
          const a = new n();
          return a.fg = this.fg, a.bg = this.bg, a.extended = this.extended.clone(), a;
        }
        isInverse() {
          return 67108864 & this.fg;
        }
        isBold() {
          return 134217728 & this.fg;
        }
        isUnderline() {
          return this.hasExtendedAttrs() && this.extended.underlineStyle !== 0 ? 1 : 268435456 & this.fg;
        }
        isBlink() {
          return 536870912 & this.fg;
        }
        isInvisible() {
          return 1073741824 & this.fg;
        }
        isItalic() {
          return 67108864 & this.bg;
        }
        isDim() {
          return 134217728 & this.bg;
        }
        isStrikethrough() {
          return 2147483648 & this.fg;
        }
        isProtected() {
          return 536870912 & this.bg;
        }
        isOverline() {
          return 1073741824 & this.bg;
        }
        getFgColorMode() {
          return 50331648 & this.fg;
        }
        getBgColorMode() {
          return 50331648 & this.bg;
        }
        isFgRGB() {
          return (50331648 & this.fg) == 50331648;
        }
        isBgRGB() {
          return (50331648 & this.bg) == 50331648;
        }
        isFgPalette() {
          return (50331648 & this.fg) == 16777216 || (50331648 & this.fg) == 33554432;
        }
        isBgPalette() {
          return (50331648 & this.bg) == 16777216 || (50331648 & this.bg) == 33554432;
        }
        isFgDefault() {
          return (50331648 & this.fg) == 0;
        }
        isBgDefault() {
          return (50331648 & this.bg) == 0;
        }
        isAttributeDefault() {
          return this.fg === 0 && this.bg === 0;
        }
        getFgColor() {
          switch (50331648 & this.fg) {
            case 16777216:
            case 33554432:
              return 255 & this.fg;
            case 50331648:
              return 16777215 & this.fg;
            default:
              return -1;
          }
        }
        getBgColor() {
          switch (50331648 & this.bg) {
            case 16777216:
            case 33554432:
              return 255 & this.bg;
            case 50331648:
              return 16777215 & this.bg;
            default:
              return -1;
          }
        }
        hasExtendedAttrs() {
          return 268435456 & this.bg;
        }
        updateExtended() {
          this.extended.isEmpty() ? this.bg &= -268435457 : this.bg |= 268435456;
        }
        getUnderlineColor() {
          if (268435456 & this.bg && ~this.extended.underlineColor)
            switch (50331648 & this.extended.underlineColor) {
              case 16777216:
              case 33554432:
                return 255 & this.extended.underlineColor;
              case 50331648:
                return 16777215 & this.extended.underlineColor;
              default:
                return this.getFgColor();
            }
          return this.getFgColor();
        }
        getUnderlineColorMode() {
          return 268435456 & this.bg && ~this.extended.underlineColor ? 50331648 & this.extended.underlineColor : this.getFgColorMode();
        }
        isUnderlineColorRGB() {
          return 268435456 & this.bg && ~this.extended.underlineColor ? (50331648 & this.extended.underlineColor) == 50331648 : this.isFgRGB();
        }
        isUnderlineColorPalette() {
          return 268435456 & this.bg && ~this.extended.underlineColor ? (50331648 & this.extended.underlineColor) == 16777216 || (50331648 & this.extended.underlineColor) == 33554432 : this.isFgPalette();
        }
        isUnderlineColorDefault() {
          return 268435456 & this.bg && ~this.extended.underlineColor ? (50331648 & this.extended.underlineColor) == 0 : this.isFgDefault();
        }
        getUnderlineStyle() {
          return 268435456 & this.fg ? 268435456 & this.bg ? this.extended.underlineStyle : 1 : 0;
        }
        getUnderlineVariantOffset() {
          return this.extended.underlineVariantOffset;
        }
      }
      i.AttributeData = n;
      class o {
        get ext() {
          return this._urlId ? -469762049 & this._ext | this.underlineStyle << 26 : this._ext;
        }
        set ext(a) {
          this._ext = a;
        }
        get underlineStyle() {
          return this._urlId ? 5 : (469762048 & this._ext) >> 26;
        }
        set underlineStyle(a) {
          this._ext &= -469762049, this._ext |= a << 26 & 469762048;
        }
        get underlineColor() {
          return 67108863 & this._ext;
        }
        set underlineColor(a) {
          this._ext &= -67108864, this._ext |= 67108863 & a;
        }
        get urlId() {
          return this._urlId;
        }
        set urlId(a) {
          this._urlId = a;
        }
        get underlineVariantOffset() {
          const a = (3758096384 & this._ext) >> 29;
          return a < 0 ? 4294967288 ^ a : a;
        }
        set underlineVariantOffset(a) {
          this._ext &= 536870911, this._ext |= a << 29 & 3758096384;
        }
        constructor(a = 0, d = 0) {
          this._ext = 0, this._urlId = 0, this._ext = a, this._urlId = d;
        }
        clone() {
          return new o(this._ext, this._urlId);
        }
        isEmpty() {
          return this.underlineStyle === 0 && this._urlId === 0;
        }
      }
      i.ExtendedAttrs = o;
    }, 9092: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.Buffer = i.MAX_BUFFER_SIZE = void 0;
      const o = n(6349), c = n(7226), a = n(3734), d = n(8437), v = n(4634), m = n(511), l = n(643), s = n(4863), r = n(7116);
      i.MAX_BUFFER_SIZE = 4294967295, i.Buffer = class {
        constructor(e, t, h) {
          this._hasScrollback = e, this._optionsService = t, this._bufferService = h, this.ydisp = 0, this.ybase = 0, this.y = 0, this.x = 0, this.tabs = {}, this.savedY = 0, this.savedX = 0, this.savedCurAttrData = d.DEFAULT_ATTR_DATA.clone(), this.savedCharset = r.DEFAULT_CHARSET, this.markers = [], this._nullCell = m.CellData.fromCharData([0, l.NULL_CELL_CHAR, l.NULL_CELL_WIDTH, l.NULL_CELL_CODE]), this._whitespaceCell = m.CellData.fromCharData([0, l.WHITESPACE_CELL_CHAR, l.WHITESPACE_CELL_WIDTH, l.WHITESPACE_CELL_CODE]), this._isClearing = !1, this._memoryCleanupQueue = new c.IdleTaskQueue(), this._memoryCleanupPosition = 0, this._cols = this._bufferService.cols, this._rows = this._bufferService.rows, this.lines = new o.CircularList(this._getCorrectBufferLength(this._rows)), this.scrollTop = 0, this.scrollBottom = this._rows - 1, this.setupTabStops();
        }
        getNullCell(e) {
          return e ? (this._nullCell.fg = e.fg, this._nullCell.bg = e.bg, this._nullCell.extended = e.extended) : (this._nullCell.fg = 0, this._nullCell.bg = 0, this._nullCell.extended = new a.ExtendedAttrs()), this._nullCell;
        }
        getWhitespaceCell(e) {
          return e ? (this._whitespaceCell.fg = e.fg, this._whitespaceCell.bg = e.bg, this._whitespaceCell.extended = e.extended) : (this._whitespaceCell.fg = 0, this._whitespaceCell.bg = 0, this._whitespaceCell.extended = new a.ExtendedAttrs()), this._whitespaceCell;
        }
        getBlankLine(e, t) {
          return new d.BufferLine(this._bufferService.cols, this.getNullCell(e), t);
        }
        get hasScrollback() {
          return this._hasScrollback && this.lines.maxLength > this._rows;
        }
        get isCursorInViewport() {
          const e = this.ybase + this.y - this.ydisp;
          return e >= 0 && e < this._rows;
        }
        _getCorrectBufferLength(e) {
          if (!this._hasScrollback)
            return e;
          const t = e + this._optionsService.rawOptions.scrollback;
          return t > i.MAX_BUFFER_SIZE ? i.MAX_BUFFER_SIZE : t;
        }
        fillViewportRows(e) {
          if (this.lines.length === 0) {
            e === void 0 && (e = d.DEFAULT_ATTR_DATA);
            let t = this._rows;
            for (; t--; )
              this.lines.push(this.getBlankLine(e));
          }
        }
        clear() {
          this.ydisp = 0, this.ybase = 0, this.y = 0, this.x = 0, this.lines = new o.CircularList(this._getCorrectBufferLength(this._rows)), this.scrollTop = 0, this.scrollBottom = this._rows - 1, this.setupTabStops();
        }
        resize(e, t) {
          const h = this.getNullCell(d.DEFAULT_ATTR_DATA);
          let g = 0;
          const u = this._getCorrectBufferLength(t);
          if (u > this.lines.maxLength && (this.lines.maxLength = u), this.lines.length > 0) {
            if (this._cols < e)
              for (let _ = 0; _ < this.lines.length; _++)
                g += +this.lines.get(_).resize(e, h);
            let S = 0;
            if (this._rows < t)
              for (let _ = this._rows; _ < t; _++)
                this.lines.length < t + this.ybase && (this._optionsService.rawOptions.windowsMode || this._optionsService.rawOptions.windowsPty.backend !== void 0 || this._optionsService.rawOptions.windowsPty.buildNumber !== void 0 ? this.lines.push(new d.BufferLine(e, h)) : this.ybase > 0 && this.lines.length <= this.ybase + this.y + S + 1 ? (this.ybase--, S++, this.ydisp > 0 && this.ydisp--) : this.lines.push(new d.BufferLine(e, h)));
            else
              for (let _ = this._rows; _ > t; _--)
                this.lines.length > t + this.ybase && (this.lines.length > this.ybase + this.y + 1 ? this.lines.pop() : (this.ybase++, this.ydisp++));
            if (u < this.lines.maxLength) {
              const _ = this.lines.length - u;
              _ > 0 && (this.lines.trimStart(_), this.ybase = Math.max(this.ybase - _, 0), this.ydisp = Math.max(this.ydisp - _, 0), this.savedY = Math.max(this.savedY - _, 0)), this.lines.maxLength = u;
            }
            this.x = Math.min(this.x, e - 1), this.y = Math.min(this.y, t - 1), S && (this.y += S), this.savedX = Math.min(this.savedX, e - 1), this.scrollTop = 0;
          }
          if (this.scrollBottom = t - 1, this._isReflowEnabled && (this._reflow(e, t), this._cols > e))
            for (let S = 0; S < this.lines.length; S++)
              g += +this.lines.get(S).resize(e, h);
          this._cols = e, this._rows = t, this._memoryCleanupQueue.clear(), g > 0.1 * this.lines.length && (this._memoryCleanupPosition = 0, this._memoryCleanupQueue.enqueue(() => this._batchedMemoryCleanup()));
        }
        _batchedMemoryCleanup() {
          let e = !0;
          this._memoryCleanupPosition >= this.lines.length && (this._memoryCleanupPosition = 0, e = !1);
          let t = 0;
          for (; this._memoryCleanupPosition < this.lines.length; )
            if (t += this.lines.get(this._memoryCleanupPosition++).cleanupMemory(), t > 100)
              return !0;
          return e;
        }
        get _isReflowEnabled() {
          const e = this._optionsService.rawOptions.windowsPty;
          return e && e.buildNumber ? this._hasScrollback && e.backend === "conpty" && e.buildNumber >= 21376 : this._hasScrollback && !this._optionsService.rawOptions.windowsMode;
        }
        _reflow(e, t) {
          this._cols !== e && (e > this._cols ? this._reflowLarger(e, t) : this._reflowSmaller(e, t));
        }
        _reflowLarger(e, t) {
          const h = (0, v.reflowLargerGetLinesToRemove)(this.lines, this._cols, e, this.ybase + this.y, this.getNullCell(d.DEFAULT_ATTR_DATA));
          if (h.length > 0) {
            const g = (0, v.reflowLargerCreateNewLayout)(this.lines, h);
            (0, v.reflowLargerApplyNewLayout)(this.lines, g.layout), this._reflowLargerAdjustViewport(e, t, g.countRemoved);
          }
        }
        _reflowLargerAdjustViewport(e, t, h) {
          const g = this.getNullCell(d.DEFAULT_ATTR_DATA);
          let u = h;
          for (; u-- > 0; )
            this.ybase === 0 ? (this.y > 0 && this.y--, this.lines.length < t && this.lines.push(new d.BufferLine(e, g))) : (this.ydisp === this.ybase && this.ydisp--, this.ybase--);
          this.savedY = Math.max(this.savedY - h, 0);
        }
        _reflowSmaller(e, t) {
          const h = this.getNullCell(d.DEFAULT_ATTR_DATA), g = [];
          let u = 0;
          for (let S = this.lines.length - 1; S >= 0; S--) {
            let _ = this.lines.get(S);
            if (!_ || !_.isWrapped && _.getTrimmedLength() <= e)
              continue;
            const b = [_];
            for (; _.isWrapped && S > 0; )
              _ = this.lines.get(--S), b.unshift(_);
            const R = this.ybase + this.y;
            if (R >= S && R < S + b.length)
              continue;
            const B = b[b.length - 1].getTrimmedLength(), T = (0, v.reflowSmallerGetNewLineLengths)(b, this._cols, e), L = T.length - b.length;
            let H;
            H = this.ybase === 0 && this.y !== this.lines.length - 1 ? Math.max(0, this.y - this.lines.maxLength + L) : Math.max(0, this.lines.length - this.lines.maxLength + L);
            const W = [];
            for (let A = 0; A < L; A++) {
              const O = this.getBlankLine(d.DEFAULT_ATTR_DATA, !0);
              W.push(O);
            }
            W.length > 0 && (g.push({ start: S + b.length + u, newLines: W }), u += W.length), b.push(...W);
            let j = T.length - 1, V = T[j];
            V === 0 && (j--, V = T[j]);
            let z = b.length - L - 1, C = B;
            for (; z >= 0; ) {
              const A = Math.min(C, V);
              if (b[j] === void 0)
                break;
              if (b[j].copyCellsFrom(b[z], C - A, V - A, A, !0), V -= A, V === 0 && (j--, V = T[j]), C -= A, C === 0) {
                z--;
                const O = Math.max(z, 0);
                C = (0, v.getWrappedLineTrimmedLength)(b, O, this._cols);
              }
            }
            for (let A = 0; A < b.length; A++)
              T[A] < e && b[A].setCell(T[A], h);
            let x = L - H;
            for (; x-- > 0; )
              this.ybase === 0 ? this.y < t - 1 ? (this.y++, this.lines.pop()) : (this.ybase++, this.ydisp++) : this.ybase < Math.min(this.lines.maxLength, this.lines.length + u) - t && (this.ybase === this.ydisp && this.ydisp++, this.ybase++);
            this.savedY = Math.min(this.savedY + L, this.ybase + t - 1);
          }
          if (g.length > 0) {
            const S = [], _ = [];
            for (let j = 0; j < this.lines.length; j++)
              _.push(this.lines.get(j));
            const b = this.lines.length;
            let R = b - 1, B = 0, T = g[B];
            this.lines.length = Math.min(this.lines.maxLength, this.lines.length + u);
            let L = 0;
            for (let j = Math.min(this.lines.maxLength - 1, b + u - 1); j >= 0; j--)
              if (T && T.start > R + L) {
                for (let V = T.newLines.length - 1; V >= 0; V--)
                  this.lines.set(j--, T.newLines[V]);
                j++, S.push({ index: R + 1, amount: T.newLines.length }), L += T.newLines.length, T = g[++B];
              } else
                this.lines.set(j, _[R--]);
            let H = 0;
            for (let j = S.length - 1; j >= 0; j--)
              S[j].index += H, this.lines.onInsertEmitter.fire(S[j]), H += S[j].amount;
            const W = Math.max(0, b + u - this.lines.maxLength);
            W > 0 && this.lines.onTrimEmitter.fire(W);
          }
        }
        translateBufferLineToString(e, t, h = 0, g) {
          const u = this.lines.get(e);
          return u ? u.translateToString(t, h, g) : "";
        }
        getWrappedRangeForLine(e) {
          let t = e, h = e;
          for (; t > 0 && this.lines.get(t).isWrapped; )
            t--;
          for (; h + 1 < this.lines.length && this.lines.get(h + 1).isWrapped; )
            h++;
          return { first: t, last: h };
        }
        setupTabStops(e) {
          for (e != null ? this.tabs[e] || (e = this.prevStop(e)) : (this.tabs = {}, e = 0); e < this._cols; e += this._optionsService.rawOptions.tabStopWidth)
            this.tabs[e] = !0;
        }
        prevStop(e) {
          for (e == null && (e = this.x); !this.tabs[--e] && e > 0; )
            ;
          return e >= this._cols ? this._cols - 1 : e < 0 ? 0 : e;
        }
        nextStop(e) {
          for (e == null && (e = this.x); !this.tabs[++e] && e < this._cols; )
            ;
          return e >= this._cols ? this._cols - 1 : e < 0 ? 0 : e;
        }
        clearMarkers(e) {
          this._isClearing = !0;
          for (let t = 0; t < this.markers.length; t++)
            this.markers[t].line === e && (this.markers[t].dispose(), this.markers.splice(t--, 1));
          this._isClearing = !1;
        }
        clearAllMarkers() {
          this._isClearing = !0;
          for (let e = 0; e < this.markers.length; e++)
            this.markers[e].dispose(), this.markers.splice(e--, 1);
          this._isClearing = !1;
        }
        addMarker(e) {
          const t = new s.Marker(e);
          return this.markers.push(t), t.register(this.lines.onTrim((h) => {
            t.line -= h, t.line < 0 && t.dispose();
          })), t.register(this.lines.onInsert((h) => {
            t.line >= h.index && (t.line += h.amount);
          })), t.register(this.lines.onDelete((h) => {
            t.line >= h.index && t.line < h.index + h.amount && t.dispose(), t.line > h.index && (t.line -= h.amount);
          })), t.register(t.onDispose(() => this._removeMarker(t))), t;
        }
        _removeMarker(e) {
          this._isClearing || this.markers.splice(this.markers.indexOf(e), 1);
        }
      };
    }, 8437: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.BufferLine = i.DEFAULT_ATTR_DATA = void 0;
      const o = n(3734), c = n(511), a = n(643), d = n(482);
      i.DEFAULT_ATTR_DATA = Object.freeze(new o.AttributeData());
      let v = 0;
      class m {
        constructor(s, r, e = !1) {
          this.isWrapped = e, this._combined = {}, this._extendedAttrs = {}, this._data = new Uint32Array(3 * s);
          const t = r || c.CellData.fromCharData([0, a.NULL_CELL_CHAR, a.NULL_CELL_WIDTH, a.NULL_CELL_CODE]);
          for (let h = 0; h < s; ++h)
            this.setCell(h, t);
          this.length = s;
        }
        get(s) {
          const r = this._data[3 * s + 0], e = 2097151 & r;
          return [this._data[3 * s + 1], 2097152 & r ? this._combined[s] : e ? (0, d.stringFromCodePoint)(e) : "", r >> 22, 2097152 & r ? this._combined[s].charCodeAt(this._combined[s].length - 1) : e];
        }
        set(s, r) {
          this._data[3 * s + 1] = r[a.CHAR_DATA_ATTR_INDEX], r[a.CHAR_DATA_CHAR_INDEX].length > 1 ? (this._combined[s] = r[1], this._data[3 * s + 0] = 2097152 | s | r[a.CHAR_DATA_WIDTH_INDEX] << 22) : this._data[3 * s + 0] = r[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | r[a.CHAR_DATA_WIDTH_INDEX] << 22;
        }
        getWidth(s) {
          return this._data[3 * s + 0] >> 22;
        }
        hasWidth(s) {
          return 12582912 & this._data[3 * s + 0];
        }
        getFg(s) {
          return this._data[3 * s + 1];
        }
        getBg(s) {
          return this._data[3 * s + 2];
        }
        hasContent(s) {
          return 4194303 & this._data[3 * s + 0];
        }
        getCodePoint(s) {
          const r = this._data[3 * s + 0];
          return 2097152 & r ? this._combined[s].charCodeAt(this._combined[s].length - 1) : 2097151 & r;
        }
        isCombined(s) {
          return 2097152 & this._data[3 * s + 0];
        }
        getString(s) {
          const r = this._data[3 * s + 0];
          return 2097152 & r ? this._combined[s] : 2097151 & r ? (0, d.stringFromCodePoint)(2097151 & r) : "";
        }
        isProtected(s) {
          return 536870912 & this._data[3 * s + 2];
        }
        loadCell(s, r) {
          return v = 3 * s, r.content = this._data[v + 0], r.fg = this._data[v + 1], r.bg = this._data[v + 2], 2097152 & r.content && (r.combinedData = this._combined[s]), 268435456 & r.bg && (r.extended = this._extendedAttrs[s]), r;
        }
        setCell(s, r) {
          2097152 & r.content && (this._combined[s] = r.combinedData), 268435456 & r.bg && (this._extendedAttrs[s] = r.extended), this._data[3 * s + 0] = r.content, this._data[3 * s + 1] = r.fg, this._data[3 * s + 2] = r.bg;
        }
        setCellFromCodepoint(s, r, e, t) {
          268435456 & t.bg && (this._extendedAttrs[s] = t.extended), this._data[3 * s + 0] = r | e << 22, this._data[3 * s + 1] = t.fg, this._data[3 * s + 2] = t.bg;
        }
        addCodepointToCell(s, r, e) {
          let t = this._data[3 * s + 0];
          2097152 & t ? this._combined[s] += (0, d.stringFromCodePoint)(r) : 2097151 & t ? (this._combined[s] = (0, d.stringFromCodePoint)(2097151 & t) + (0, d.stringFromCodePoint)(r), t &= -2097152, t |= 2097152) : t = r | 4194304, e && (t &= -12582913, t |= e << 22), this._data[3 * s + 0] = t;
        }
        insertCells(s, r, e) {
          if ((s %= this.length) && this.getWidth(s - 1) === 2 && this.setCellFromCodepoint(s - 1, 0, 1, e), r < this.length - s) {
            const t = new c.CellData();
            for (let h = this.length - s - r - 1; h >= 0; --h)
              this.setCell(s + r + h, this.loadCell(s + h, t));
            for (let h = 0; h < r; ++h)
              this.setCell(s + h, e);
          } else
            for (let t = s; t < this.length; ++t)
              this.setCell(t, e);
          this.getWidth(this.length - 1) === 2 && this.setCellFromCodepoint(this.length - 1, 0, 1, e);
        }
        deleteCells(s, r, e) {
          if (s %= this.length, r < this.length - s) {
            const t = new c.CellData();
            for (let h = 0; h < this.length - s - r; ++h)
              this.setCell(s + h, this.loadCell(s + r + h, t));
            for (let h = this.length - r; h < this.length; ++h)
              this.setCell(h, e);
          } else
            for (let t = s; t < this.length; ++t)
              this.setCell(t, e);
          s && this.getWidth(s - 1) === 2 && this.setCellFromCodepoint(s - 1, 0, 1, e), this.getWidth(s) !== 0 || this.hasContent(s) || this.setCellFromCodepoint(s, 0, 1, e);
        }
        replaceCells(s, r, e, t = !1) {
          if (t)
            for (s && this.getWidth(s - 1) === 2 && !this.isProtected(s - 1) && this.setCellFromCodepoint(s - 1, 0, 1, e), r < this.length && this.getWidth(r - 1) === 2 && !this.isProtected(r) && this.setCellFromCodepoint(r, 0, 1, e); s < r && s < this.length; )
              this.isProtected(s) || this.setCell(s, e), s++;
          else
            for (s && this.getWidth(s - 1) === 2 && this.setCellFromCodepoint(s - 1, 0, 1, e), r < this.length && this.getWidth(r - 1) === 2 && this.setCellFromCodepoint(r, 0, 1, e); s < r && s < this.length; )
              this.setCell(s++, e);
        }
        resize(s, r) {
          if (s === this.length)
            return 4 * this._data.length * 2 < this._data.buffer.byteLength;
          const e = 3 * s;
          if (s > this.length) {
            if (this._data.buffer.byteLength >= 4 * e)
              this._data = new Uint32Array(this._data.buffer, 0, e);
            else {
              const t = new Uint32Array(e);
              t.set(this._data), this._data = t;
            }
            for (let t = this.length; t < s; ++t)
              this.setCell(t, r);
          } else {
            this._data = this._data.subarray(0, e);
            const t = Object.keys(this._combined);
            for (let g = 0; g < t.length; g++) {
              const u = parseInt(t[g], 10);
              u >= s && delete this._combined[u];
            }
            const h = Object.keys(this._extendedAttrs);
            for (let g = 0; g < h.length; g++) {
              const u = parseInt(h[g], 10);
              u >= s && delete this._extendedAttrs[u];
            }
          }
          return this.length = s, 4 * e * 2 < this._data.buffer.byteLength;
        }
        cleanupMemory() {
          if (4 * this._data.length * 2 < this._data.buffer.byteLength) {
            const s = new Uint32Array(this._data.length);
            return s.set(this._data), this._data = s, 1;
          }
          return 0;
        }
        fill(s, r = !1) {
          if (r)
            for (let e = 0; e < this.length; ++e)
              this.isProtected(e) || this.setCell(e, s);
          else {
            this._combined = {}, this._extendedAttrs = {};
            for (let e = 0; e < this.length; ++e)
              this.setCell(e, s);
          }
        }
        copyFrom(s) {
          this.length !== s.length ? this._data = new Uint32Array(s._data) : this._data.set(s._data), this.length = s.length, this._combined = {};
          for (const r in s._combined)
            this._combined[r] = s._combined[r];
          this._extendedAttrs = {};
          for (const r in s._extendedAttrs)
            this._extendedAttrs[r] = s._extendedAttrs[r];
          this.isWrapped = s.isWrapped;
        }
        clone() {
          const s = new m(0);
          s._data = new Uint32Array(this._data), s.length = this.length;
          for (const r in this._combined)
            s._combined[r] = this._combined[r];
          for (const r in this._extendedAttrs)
            s._extendedAttrs[r] = this._extendedAttrs[r];
          return s.isWrapped = this.isWrapped, s;
        }
        getTrimmedLength() {
          for (let s = this.length - 1; s >= 0; --s)
            if (4194303 & this._data[3 * s + 0])
              return s + (this._data[3 * s + 0] >> 22);
          return 0;
        }
        getNoBgTrimmedLength() {
          for (let s = this.length - 1; s >= 0; --s)
            if (4194303 & this._data[3 * s + 0] || 50331648 & this._data[3 * s + 2])
              return s + (this._data[3 * s + 0] >> 22);
          return 0;
        }
        copyCellsFrom(s, r, e, t, h) {
          const g = s._data;
          if (h)
            for (let S = t - 1; S >= 0; S--) {
              for (let _ = 0; _ < 3; _++)
                this._data[3 * (e + S) + _] = g[3 * (r + S) + _];
              268435456 & g[3 * (r + S) + 2] && (this._extendedAttrs[e + S] = s._extendedAttrs[r + S]);
            }
          else
            for (let S = 0; S < t; S++) {
              for (let _ = 0; _ < 3; _++)
                this._data[3 * (e + S) + _] = g[3 * (r + S) + _];
              268435456 & g[3 * (r + S) + 2] && (this._extendedAttrs[e + S] = s._extendedAttrs[r + S]);
            }
          const u = Object.keys(s._combined);
          for (let S = 0; S < u.length; S++) {
            const _ = parseInt(u[S], 10);
            _ >= r && (this._combined[_ - r + e] = s._combined[_]);
          }
        }
        translateToString(s, r, e, t) {
          r = r ?? 0, e = e ?? this.length, s && (e = Math.min(e, this.getTrimmedLength())), t && (t.length = 0);
          let h = "";
          for (; r < e; ) {
            const g = this._data[3 * r + 0], u = 2097151 & g, S = 2097152 & g ? this._combined[r] : u ? (0, d.stringFromCodePoint)(u) : a.WHITESPACE_CELL_CHAR;
            if (h += S, t)
              for (let _ = 0; _ < S.length; ++_)
                t.push(r);
            r += g >> 22 || 1;
          }
          return t && t.push(r), h;
        }
      }
      i.BufferLine = m;
    }, 4841: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.getRangeLength = void 0, i.getRangeLength = function(n, o) {
        if (n.start.y > n.end.y)
          throw new Error(`Buffer range end (${n.end.x}, ${n.end.y}) cannot be before start (${n.start.x}, ${n.start.y})`);
        return o * (n.end.y - n.start.y) + (n.end.x - n.start.x + 1);
      };
    }, 4634: (k, i) => {
      function n(o, c, a) {
        if (c === o.length - 1)
          return o[c].getTrimmedLength();
        const d = !o[c].hasContent(a - 1) && o[c].getWidth(a - 1) === 1, v = o[c + 1].getWidth(0) === 2;
        return d && v ? a - 1 : a;
      }
      Object.defineProperty(i, "__esModule", { value: !0 }), i.getWrappedLineTrimmedLength = i.reflowSmallerGetNewLineLengths = i.reflowLargerApplyNewLayout = i.reflowLargerCreateNewLayout = i.reflowLargerGetLinesToRemove = void 0, i.reflowLargerGetLinesToRemove = function(o, c, a, d, v) {
        const m = [];
        for (let l = 0; l < o.length - 1; l++) {
          let s = l, r = o.get(++s);
          if (!r.isWrapped)
            continue;
          const e = [o.get(l)];
          for (; s < o.length && r.isWrapped; )
            e.push(r), r = o.get(++s);
          if (d >= l && d < s) {
            l += e.length - 1;
            continue;
          }
          let t = 0, h = n(e, t, c), g = 1, u = 0;
          for (; g < e.length; ) {
            const _ = n(e, g, c), b = _ - u, R = a - h, B = Math.min(b, R);
            e[t].copyCellsFrom(e[g], u, h, B, !1), h += B, h === a && (t++, h = 0), u += B, u === _ && (g++, u = 0), h === 0 && t !== 0 && e[t - 1].getWidth(a - 1) === 2 && (e[t].copyCellsFrom(e[t - 1], a - 1, h++, 1, !1), e[t - 1].setCell(a - 1, v));
          }
          e[t].replaceCells(h, a, v);
          let S = 0;
          for (let _ = e.length - 1; _ > 0 && (_ > t || e[_].getTrimmedLength() === 0); _--)
            S++;
          S > 0 && (m.push(l + e.length - S), m.push(S)), l += e.length - 1;
        }
        return m;
      }, i.reflowLargerCreateNewLayout = function(o, c) {
        const a = [];
        let d = 0, v = c[d], m = 0;
        for (let l = 0; l < o.length; l++)
          if (v === l) {
            const s = c[++d];
            o.onDeleteEmitter.fire({ index: l - m, amount: s }), l += s - 1, m += s, v = c[++d];
          } else
            a.push(l);
        return { layout: a, countRemoved: m };
      }, i.reflowLargerApplyNewLayout = function(o, c) {
        const a = [];
        for (let d = 0; d < c.length; d++)
          a.push(o.get(c[d]));
        for (let d = 0; d < a.length; d++)
          o.set(d, a[d]);
        o.length = c.length;
      }, i.reflowSmallerGetNewLineLengths = function(o, c, a) {
        const d = [], v = o.map((r, e) => n(o, e, c)).reduce((r, e) => r + e);
        let m = 0, l = 0, s = 0;
        for (; s < v; ) {
          if (v - s < a) {
            d.push(v - s);
            break;
          }
          m += a;
          const r = n(o, l, c);
          m > r && (m -= r, l++);
          const e = o[l].getWidth(m - 1) === 2;
          e && m--;
          const t = e ? a - 1 : a;
          d.push(t), s += t;
        }
        return d;
      }, i.getWrappedLineTrimmedLength = n;
    }, 5295: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.BufferSet = void 0;
      const o = n(8460), c = n(844), a = n(9092);
      class d extends c.Disposable {
        constructor(m, l) {
          super(), this._optionsService = m, this._bufferService = l, this._onBufferActivate = this.register(new o.EventEmitter()), this.onBufferActivate = this._onBufferActivate.event, this.reset(), this.register(this._optionsService.onSpecificOptionChange("scrollback", () => this.resize(this._bufferService.cols, this._bufferService.rows))), this.register(this._optionsService.onSpecificOptionChange("tabStopWidth", () => this.setupTabStops()));
        }
        reset() {
          this._normal = new a.Buffer(!0, this._optionsService, this._bufferService), this._normal.fillViewportRows(), this._alt = new a.Buffer(!1, this._optionsService, this._bufferService), this._activeBuffer = this._normal, this._onBufferActivate.fire({ activeBuffer: this._normal, inactiveBuffer: this._alt }), this.setupTabStops();
        }
        get alt() {
          return this._alt;
        }
        get active() {
          return this._activeBuffer;
        }
        get normal() {
          return this._normal;
        }
        activateNormalBuffer() {
          this._activeBuffer !== this._normal && (this._normal.x = this._alt.x, this._normal.y = this._alt.y, this._alt.clearAllMarkers(), this._alt.clear(), this._activeBuffer = this._normal, this._onBufferActivate.fire({ activeBuffer: this._normal, inactiveBuffer: this._alt }));
        }
        activateAltBuffer(m) {
          this._activeBuffer !== this._alt && (this._alt.fillViewportRows(m), this._alt.x = this._normal.x, this._alt.y = this._normal.y, this._activeBuffer = this._alt, this._onBufferActivate.fire({ activeBuffer: this._alt, inactiveBuffer: this._normal }));
        }
        resize(m, l) {
          this._normal.resize(m, l), this._alt.resize(m, l), this.setupTabStops(m);
        }
        setupTabStops(m) {
          this._normal.setupTabStops(m), this._alt.setupTabStops(m);
        }
      }
      i.BufferSet = d;
    }, 511: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.CellData = void 0;
      const o = n(482), c = n(643), a = n(3734);
      class d extends a.AttributeData {
        constructor() {
          super(...arguments), this.content = 0, this.fg = 0, this.bg = 0, this.extended = new a.ExtendedAttrs(), this.combinedData = "";
        }
        static fromCharData(m) {
          const l = new d();
          return l.setFromCharData(m), l;
        }
        isCombined() {
          return 2097152 & this.content;
        }
        getWidth() {
          return this.content >> 22;
        }
        getChars() {
          return 2097152 & this.content ? this.combinedData : 2097151 & this.content ? (0, o.stringFromCodePoint)(2097151 & this.content) : "";
        }
        getCode() {
          return this.isCombined() ? this.combinedData.charCodeAt(this.combinedData.length - 1) : 2097151 & this.content;
        }
        setFromCharData(m) {
          this.fg = m[c.CHAR_DATA_ATTR_INDEX], this.bg = 0;
          let l = !1;
          if (m[c.CHAR_DATA_CHAR_INDEX].length > 2)
            l = !0;
          else if (m[c.CHAR_DATA_CHAR_INDEX].length === 2) {
            const s = m[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0);
            if (55296 <= s && s <= 56319) {
              const r = m[c.CHAR_DATA_CHAR_INDEX].charCodeAt(1);
              56320 <= r && r <= 57343 ? this.content = 1024 * (s - 55296) + r - 56320 + 65536 | m[c.CHAR_DATA_WIDTH_INDEX] << 22 : l = !0;
            } else
              l = !0;
          } else
            this.content = m[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | m[c.CHAR_DATA_WIDTH_INDEX] << 22;
          l && (this.combinedData = m[c.CHAR_DATA_CHAR_INDEX], this.content = 2097152 | m[c.CHAR_DATA_WIDTH_INDEX] << 22);
        }
        getAsCharData() {
          return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
        }
      }
      i.CellData = d;
    }, 643: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.WHITESPACE_CELL_CODE = i.WHITESPACE_CELL_WIDTH = i.WHITESPACE_CELL_CHAR = i.NULL_CELL_CODE = i.NULL_CELL_WIDTH = i.NULL_CELL_CHAR = i.CHAR_DATA_CODE_INDEX = i.CHAR_DATA_WIDTH_INDEX = i.CHAR_DATA_CHAR_INDEX = i.CHAR_DATA_ATTR_INDEX = i.DEFAULT_EXT = i.DEFAULT_ATTR = i.DEFAULT_COLOR = void 0, i.DEFAULT_COLOR = 0, i.DEFAULT_ATTR = 256 | i.DEFAULT_COLOR << 9, i.DEFAULT_EXT = 0, i.CHAR_DATA_ATTR_INDEX = 0, i.CHAR_DATA_CHAR_INDEX = 1, i.CHAR_DATA_WIDTH_INDEX = 2, i.CHAR_DATA_CODE_INDEX = 3, i.NULL_CELL_CHAR = "", i.NULL_CELL_WIDTH = 1, i.NULL_CELL_CODE = 0, i.WHITESPACE_CELL_CHAR = " ", i.WHITESPACE_CELL_WIDTH = 1, i.WHITESPACE_CELL_CODE = 32;
    }, 4863: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.Marker = void 0;
      const o = n(8460), c = n(844);
      class a {
        get id() {
          return this._id;
        }
        constructor(v) {
          this.line = v, this.isDisposed = !1, this._disposables = [], this._id = a._nextId++, this._onDispose = this.register(new o.EventEmitter()), this.onDispose = this._onDispose.event;
        }
        dispose() {
          this.isDisposed || (this.isDisposed = !0, this.line = -1, this._onDispose.fire(), (0, c.disposeArray)(this._disposables), this._disposables.length = 0);
        }
        register(v) {
          return this._disposables.push(v), v;
        }
      }
      i.Marker = a, a._nextId = 1;
    }, 7116: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.DEFAULT_CHARSET = i.CHARSETS = void 0, i.CHARSETS = {}, i.DEFAULT_CHARSET = i.CHARSETS.B, i.CHARSETS[0] = { "`": "◆", a: "▒", b: "␉", c: "␌", d: "␍", e: "␊", f: "°", g: "±", h: "␤", i: "␋", j: "┘", k: "┐", l: "┌", m: "└", n: "┼", o: "⎺", p: "⎻", q: "─", r: "⎼", s: "⎽", t: "├", u: "┤", v: "┴", w: "┬", x: "│", y: "≤", z: "≥", "{": "π", "|": "≠", "}": "£", "~": "·" }, i.CHARSETS.A = { "#": "£" }, i.CHARSETS.B = void 0, i.CHARSETS[4] = { "#": "£", "@": "¾", "[": "ij", "\\": "½", "]": "|", "{": "¨", "|": "f", "}": "¼", "~": "´" }, i.CHARSETS.C = i.CHARSETS[5] = { "[": "Ä", "\\": "Ö", "]": "Å", "^": "Ü", "`": "é", "{": "ä", "|": "ö", "}": "å", "~": "ü" }, i.CHARSETS.R = { "#": "£", "@": "à", "[": "°", "\\": "ç", "]": "§", "{": "é", "|": "ù", "}": "è", "~": "¨" }, i.CHARSETS.Q = { "@": "à", "[": "â", "\\": "ç", "]": "ê", "^": "î", "`": "ô", "{": "é", "|": "ù", "}": "è", "~": "û" }, i.CHARSETS.K = { "@": "§", "[": "Ä", "\\": "Ö", "]": "Ü", "{": "ä", "|": "ö", "}": "ü", "~": "ß" }, i.CHARSETS.Y = { "#": "£", "@": "§", "[": "°", "\\": "ç", "]": "é", "`": "ù", "{": "à", "|": "ò", "}": "è", "~": "ì" }, i.CHARSETS.E = i.CHARSETS[6] = { "@": "Ä", "[": "Æ", "\\": "Ø", "]": "Å", "^": "Ü", "`": "ä", "{": "æ", "|": "ø", "}": "å", "~": "ü" }, i.CHARSETS.Z = { "#": "£", "@": "§", "[": "¡", "\\": "Ñ", "]": "¿", "{": "°", "|": "ñ", "}": "ç" }, i.CHARSETS.H = i.CHARSETS[7] = { "@": "É", "[": "Ä", "\\": "Ö", "]": "Å", "^": "Ü", "`": "é", "{": "ä", "|": "ö", "}": "å", "~": "ü" }, i.CHARSETS["="] = { "#": "ù", "@": "à", "[": "é", "\\": "ç", "]": "ê", "^": "î", _: "è", "`": "ô", "{": "ä", "|": "ö", "}": "ü", "~": "û" };
    }, 2584: (k, i) => {
      var n, o, c;
      Object.defineProperty(i, "__esModule", { value: !0 }), i.C1_ESCAPED = i.C1 = i.C0 = void 0, function(a) {
        a.NUL = "\0", a.SOH = "", a.STX = "", a.ETX = "", a.EOT = "", a.ENQ = "", a.ACK = "", a.BEL = "\x07", a.BS = "\b", a.HT = "	", a.LF = `
`, a.VT = "\v", a.FF = "\f", a.CR = "\r", a.SO = "", a.SI = "", a.DLE = "", a.DC1 = "", a.DC2 = "", a.DC3 = "", a.DC4 = "", a.NAK = "", a.SYN = "", a.ETB = "", a.CAN = "", a.EM = "", a.SUB = "", a.ESC = "\x1B", a.FS = "", a.GS = "", a.RS = "", a.US = "", a.SP = " ", a.DEL = "";
      }(n || (i.C0 = n = {})), function(a) {
        a.PAD = "", a.HOP = "", a.BPH = "", a.NBH = "", a.IND = "", a.NEL = "", a.SSA = "", a.ESA = "", a.HTS = "", a.HTJ = "", a.VTS = "", a.PLD = "", a.PLU = "", a.RI = "", a.SS2 = "", a.SS3 = "", a.DCS = "", a.PU1 = "", a.PU2 = "", a.STS = "", a.CCH = "", a.MW = "", a.SPA = "", a.EPA = "", a.SOS = "", a.SGCI = "", a.SCI = "", a.CSI = "", a.ST = "", a.OSC = "", a.PM = "", a.APC = "";
      }(o || (i.C1 = o = {})), function(a) {
        a.ST = `${n.ESC}\\`;
      }(c || (i.C1_ESCAPED = c = {}));
    }, 7399: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.evaluateKeyboardEvent = void 0;
      const o = n(2584), c = { 48: ["0", ")"], 49: ["1", "!"], 50: ["2", "@"], 51: ["3", "#"], 52: ["4", "$"], 53: ["5", "%"], 54: ["6", "^"], 55: ["7", "&"], 56: ["8", "*"], 57: ["9", "("], 186: [";", ":"], 187: ["=", "+"], 188: [",", "<"], 189: ["-", "_"], 190: [".", ">"], 191: ["/", "?"], 192: ["`", "~"], 219: ["[", "{"], 220: ["\\", "|"], 221: ["]", "}"], 222: ["'", '"'] };
      i.evaluateKeyboardEvent = function(a, d, v, m) {
        const l = { type: 0, cancel: !1, key: void 0 }, s = (a.shiftKey ? 1 : 0) | (a.altKey ? 2 : 0) | (a.ctrlKey ? 4 : 0) | (a.metaKey ? 8 : 0);
        switch (a.keyCode) {
          case 0:
            a.key === "UIKeyInputUpArrow" ? l.key = d ? o.C0.ESC + "OA" : o.C0.ESC + "[A" : a.key === "UIKeyInputLeftArrow" ? l.key = d ? o.C0.ESC + "OD" : o.C0.ESC + "[D" : a.key === "UIKeyInputRightArrow" ? l.key = d ? o.C0.ESC + "OC" : o.C0.ESC + "[C" : a.key === "UIKeyInputDownArrow" && (l.key = d ? o.C0.ESC + "OB" : o.C0.ESC + "[B");
            break;
          case 8:
            l.key = a.ctrlKey ? "\b" : o.C0.DEL, a.altKey && (l.key = o.C0.ESC + l.key);
            break;
          case 9:
            if (a.shiftKey) {
              l.key = o.C0.ESC + "[Z";
              break;
            }
            l.key = o.C0.HT, l.cancel = !0;
            break;
          case 13:
            l.key = a.altKey ? o.C0.ESC + o.C0.CR : o.C0.CR, l.cancel = !0;
            break;
          case 27:
            l.key = o.C0.ESC, a.altKey && (l.key = o.C0.ESC + o.C0.ESC), l.cancel = !0;
            break;
          case 37:
            if (a.metaKey)
              break;
            s ? (l.key = o.C0.ESC + "[1;" + (s + 1) + "D", l.key === o.C0.ESC + "[1;3D" && (l.key = o.C0.ESC + (v ? "b" : "[1;5D"))) : l.key = d ? o.C0.ESC + "OD" : o.C0.ESC + "[D";
            break;
          case 39:
            if (a.metaKey)
              break;
            s ? (l.key = o.C0.ESC + "[1;" + (s + 1) + "C", l.key === o.C0.ESC + "[1;3C" && (l.key = o.C0.ESC + (v ? "f" : "[1;5C"))) : l.key = d ? o.C0.ESC + "OC" : o.C0.ESC + "[C";
            break;
          case 38:
            if (a.metaKey)
              break;
            s ? (l.key = o.C0.ESC + "[1;" + (s + 1) + "A", v || l.key !== o.C0.ESC + "[1;3A" || (l.key = o.C0.ESC + "[1;5A")) : l.key = d ? o.C0.ESC + "OA" : o.C0.ESC + "[A";
            break;
          case 40:
            if (a.metaKey)
              break;
            s ? (l.key = o.C0.ESC + "[1;" + (s + 1) + "B", v || l.key !== o.C0.ESC + "[1;3B" || (l.key = o.C0.ESC + "[1;5B")) : l.key = d ? o.C0.ESC + "OB" : o.C0.ESC + "[B";
            break;
          case 45:
            a.shiftKey || a.ctrlKey || (l.key = o.C0.ESC + "[2~");
            break;
          case 46:
            l.key = s ? o.C0.ESC + "[3;" + (s + 1) + "~" : o.C0.ESC + "[3~";
            break;
          case 36:
            l.key = s ? o.C0.ESC + "[1;" + (s + 1) + "H" : d ? o.C0.ESC + "OH" : o.C0.ESC + "[H";
            break;
          case 35:
            l.key = s ? o.C0.ESC + "[1;" + (s + 1) + "F" : d ? o.C0.ESC + "OF" : o.C0.ESC + "[F";
            break;
          case 33:
            a.shiftKey ? l.type = 2 : a.ctrlKey ? l.key = o.C0.ESC + "[5;" + (s + 1) + "~" : l.key = o.C0.ESC + "[5~";
            break;
          case 34:
            a.shiftKey ? l.type = 3 : a.ctrlKey ? l.key = o.C0.ESC + "[6;" + (s + 1) + "~" : l.key = o.C0.ESC + "[6~";
            break;
          case 112:
            l.key = s ? o.C0.ESC + "[1;" + (s + 1) + "P" : o.C0.ESC + "OP";
            break;
          case 113:
            l.key = s ? o.C0.ESC + "[1;" + (s + 1) + "Q" : o.C0.ESC + "OQ";
            break;
          case 114:
            l.key = s ? o.C0.ESC + "[1;" + (s + 1) + "R" : o.C0.ESC + "OR";
            break;
          case 115:
            l.key = s ? o.C0.ESC + "[1;" + (s + 1) + "S" : o.C0.ESC + "OS";
            break;
          case 116:
            l.key = s ? o.C0.ESC + "[15;" + (s + 1) + "~" : o.C0.ESC + "[15~";
            break;
          case 117:
            l.key = s ? o.C0.ESC + "[17;" + (s + 1) + "~" : o.C0.ESC + "[17~";
            break;
          case 118:
            l.key = s ? o.C0.ESC + "[18;" + (s + 1) + "~" : o.C0.ESC + "[18~";
            break;
          case 119:
            l.key = s ? o.C0.ESC + "[19;" + (s + 1) + "~" : o.C0.ESC + "[19~";
            break;
          case 120:
            l.key = s ? o.C0.ESC + "[20;" + (s + 1) + "~" : o.C0.ESC + "[20~";
            break;
          case 121:
            l.key = s ? o.C0.ESC + "[21;" + (s + 1) + "~" : o.C0.ESC + "[21~";
            break;
          case 122:
            l.key = s ? o.C0.ESC + "[23;" + (s + 1) + "~" : o.C0.ESC + "[23~";
            break;
          case 123:
            l.key = s ? o.C0.ESC + "[24;" + (s + 1) + "~" : o.C0.ESC + "[24~";
            break;
          default:
            if (!a.ctrlKey || a.shiftKey || a.altKey || a.metaKey)
              if (v && !m || !a.altKey || a.metaKey)
                !v || a.altKey || a.ctrlKey || a.shiftKey || !a.metaKey ? a.key && !a.ctrlKey && !a.altKey && !a.metaKey && a.keyCode >= 48 && a.key.length === 1 ? l.key = a.key : a.key && a.ctrlKey && (a.key === "_" && (l.key = o.C0.US), a.key === "@" && (l.key = o.C0.NUL)) : a.keyCode === 65 && (l.type = 1);
              else {
                const r = c[a.keyCode], e = r == null ? void 0 : r[a.shiftKey ? 1 : 0];
                if (e)
                  l.key = o.C0.ESC + e;
                else if (a.keyCode >= 65 && a.keyCode <= 90) {
                  const t = a.ctrlKey ? a.keyCode - 64 : a.keyCode + 32;
                  let h = String.fromCharCode(t);
                  a.shiftKey && (h = h.toUpperCase()), l.key = o.C0.ESC + h;
                } else if (a.keyCode === 32)
                  l.key = o.C0.ESC + (a.ctrlKey ? o.C0.NUL : " ");
                else if (a.key === "Dead" && a.code.startsWith("Key")) {
                  let t = a.code.slice(3, 4);
                  a.shiftKey || (t = t.toLowerCase()), l.key = o.C0.ESC + t, l.cancel = !0;
                }
              }
            else
              a.keyCode >= 65 && a.keyCode <= 90 ? l.key = String.fromCharCode(a.keyCode - 64) : a.keyCode === 32 ? l.key = o.C0.NUL : a.keyCode >= 51 && a.keyCode <= 55 ? l.key = String.fromCharCode(a.keyCode - 51 + 27) : a.keyCode === 56 ? l.key = o.C0.DEL : a.keyCode === 219 ? l.key = o.C0.ESC : a.keyCode === 220 ? l.key = o.C0.FS : a.keyCode === 221 && (l.key = o.C0.GS);
        }
        return l;
      };
    }, 482: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.Utf8ToUtf32 = i.StringToUtf32 = i.utf32ToString = i.stringFromCodePoint = void 0, i.stringFromCodePoint = function(n) {
        return n > 65535 ? (n -= 65536, String.fromCharCode(55296 + (n >> 10)) + String.fromCharCode(n % 1024 + 56320)) : String.fromCharCode(n);
      }, i.utf32ToString = function(n, o = 0, c = n.length) {
        let a = "";
        for (let d = o; d < c; ++d) {
          let v = n[d];
          v > 65535 ? (v -= 65536, a += String.fromCharCode(55296 + (v >> 10)) + String.fromCharCode(v % 1024 + 56320)) : a += String.fromCharCode(v);
        }
        return a;
      }, i.StringToUtf32 = class {
        constructor() {
          this._interim = 0;
        }
        clear() {
          this._interim = 0;
        }
        decode(n, o) {
          const c = n.length;
          if (!c)
            return 0;
          let a = 0, d = 0;
          if (this._interim) {
            const v = n.charCodeAt(d++);
            56320 <= v && v <= 57343 ? o[a++] = 1024 * (this._interim - 55296) + v - 56320 + 65536 : (o[a++] = this._interim, o[a++] = v), this._interim = 0;
          }
          for (let v = d; v < c; ++v) {
            const m = n.charCodeAt(v);
            if (55296 <= m && m <= 56319) {
              if (++v >= c)
                return this._interim = m, a;
              const l = n.charCodeAt(v);
              56320 <= l && l <= 57343 ? o[a++] = 1024 * (m - 55296) + l - 56320 + 65536 : (o[a++] = m, o[a++] = l);
            } else
              m !== 65279 && (o[a++] = m);
          }
          return a;
        }
      }, i.Utf8ToUtf32 = class {
        constructor() {
          this.interim = new Uint8Array(3);
        }
        clear() {
          this.interim.fill(0);
        }
        decode(n, o) {
          const c = n.length;
          if (!c)
            return 0;
          let a, d, v, m, l = 0, s = 0, r = 0;
          if (this.interim[0]) {
            let h = !1, g = this.interim[0];
            g &= (224 & g) == 192 ? 31 : (240 & g) == 224 ? 15 : 7;
            let u, S = 0;
            for (; (u = 63 & this.interim[++S]) && S < 4; )
              g <<= 6, g |= u;
            const _ = (224 & this.interim[0]) == 192 ? 2 : (240 & this.interim[0]) == 224 ? 3 : 4, b = _ - S;
            for (; r < b; ) {
              if (r >= c)
                return 0;
              if (u = n[r++], (192 & u) != 128) {
                r--, h = !0;
                break;
              }
              this.interim[S++] = u, g <<= 6, g |= 63 & u;
            }
            h || (_ === 2 ? g < 128 ? r-- : o[l++] = g : _ === 3 ? g < 2048 || g >= 55296 && g <= 57343 || g === 65279 || (o[l++] = g) : g < 65536 || g > 1114111 || (o[l++] = g)), this.interim.fill(0);
          }
          const e = c - 4;
          let t = r;
          for (; t < c; ) {
            for (; !(!(t < e) || 128 & (a = n[t]) || 128 & (d = n[t + 1]) || 128 & (v = n[t + 2]) || 128 & (m = n[t + 3])); )
              o[l++] = a, o[l++] = d, o[l++] = v, o[l++] = m, t += 4;
            if (a = n[t++], a < 128)
              o[l++] = a;
            else if ((224 & a) == 192) {
              if (t >= c)
                return this.interim[0] = a, l;
              if (d = n[t++], (192 & d) != 128) {
                t--;
                continue;
              }
              if (s = (31 & a) << 6 | 63 & d, s < 128) {
                t--;
                continue;
              }
              o[l++] = s;
            } else if ((240 & a) == 224) {
              if (t >= c)
                return this.interim[0] = a, l;
              if (d = n[t++], (192 & d) != 128) {
                t--;
                continue;
              }
              if (t >= c)
                return this.interim[0] = a, this.interim[1] = d, l;
              if (v = n[t++], (192 & v) != 128) {
                t--;
                continue;
              }
              if (s = (15 & a) << 12 | (63 & d) << 6 | 63 & v, s < 2048 || s >= 55296 && s <= 57343 || s === 65279)
                continue;
              o[l++] = s;
            } else if ((248 & a) == 240) {
              if (t >= c)
                return this.interim[0] = a, l;
              if (d = n[t++], (192 & d) != 128) {
                t--;
                continue;
              }
              if (t >= c)
                return this.interim[0] = a, this.interim[1] = d, l;
              if (v = n[t++], (192 & v) != 128) {
                t--;
                continue;
              }
              if (t >= c)
                return this.interim[0] = a, this.interim[1] = d, this.interim[2] = v, l;
              if (m = n[t++], (192 & m) != 128) {
                t--;
                continue;
              }
              if (s = (7 & a) << 18 | (63 & d) << 12 | (63 & v) << 6 | 63 & m, s < 65536 || s > 1114111)
                continue;
              o[l++] = s;
            }
          }
          return l;
        }
      };
    }, 225: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.UnicodeV6 = void 0;
      const o = n(1480), c = [[768, 879], [1155, 1158], [1160, 1161], [1425, 1469], [1471, 1471], [1473, 1474], [1476, 1477], [1479, 1479], [1536, 1539], [1552, 1557], [1611, 1630], [1648, 1648], [1750, 1764], [1767, 1768], [1770, 1773], [1807, 1807], [1809, 1809], [1840, 1866], [1958, 1968], [2027, 2035], [2305, 2306], [2364, 2364], [2369, 2376], [2381, 2381], [2385, 2388], [2402, 2403], [2433, 2433], [2492, 2492], [2497, 2500], [2509, 2509], [2530, 2531], [2561, 2562], [2620, 2620], [2625, 2626], [2631, 2632], [2635, 2637], [2672, 2673], [2689, 2690], [2748, 2748], [2753, 2757], [2759, 2760], [2765, 2765], [2786, 2787], [2817, 2817], [2876, 2876], [2879, 2879], [2881, 2883], [2893, 2893], [2902, 2902], [2946, 2946], [3008, 3008], [3021, 3021], [3134, 3136], [3142, 3144], [3146, 3149], [3157, 3158], [3260, 3260], [3263, 3263], [3270, 3270], [3276, 3277], [3298, 3299], [3393, 3395], [3405, 3405], [3530, 3530], [3538, 3540], [3542, 3542], [3633, 3633], [3636, 3642], [3655, 3662], [3761, 3761], [3764, 3769], [3771, 3772], [3784, 3789], [3864, 3865], [3893, 3893], [3895, 3895], [3897, 3897], [3953, 3966], [3968, 3972], [3974, 3975], [3984, 3991], [3993, 4028], [4038, 4038], [4141, 4144], [4146, 4146], [4150, 4151], [4153, 4153], [4184, 4185], [4448, 4607], [4959, 4959], [5906, 5908], [5938, 5940], [5970, 5971], [6002, 6003], [6068, 6069], [6071, 6077], [6086, 6086], [6089, 6099], [6109, 6109], [6155, 6157], [6313, 6313], [6432, 6434], [6439, 6440], [6450, 6450], [6457, 6459], [6679, 6680], [6912, 6915], [6964, 6964], [6966, 6970], [6972, 6972], [6978, 6978], [7019, 7027], [7616, 7626], [7678, 7679], [8203, 8207], [8234, 8238], [8288, 8291], [8298, 8303], [8400, 8431], [12330, 12335], [12441, 12442], [43014, 43014], [43019, 43019], [43045, 43046], [64286, 64286], [65024, 65039], [65056, 65059], [65279, 65279], [65529, 65531]], a = [[68097, 68099], [68101, 68102], [68108, 68111], [68152, 68154], [68159, 68159], [119143, 119145], [119155, 119170], [119173, 119179], [119210, 119213], [119362, 119364], [917505, 917505], [917536, 917631], [917760, 917999]];
      let d;
      i.UnicodeV6 = class {
        constructor() {
          if (this.version = "6", !d) {
            d = new Uint8Array(65536), d.fill(1), d[0] = 0, d.fill(0, 1, 32), d.fill(0, 127, 160), d.fill(2, 4352, 4448), d[9001] = 2, d[9002] = 2, d.fill(2, 11904, 42192), d[12351] = 1, d.fill(2, 44032, 55204), d.fill(2, 63744, 64256), d.fill(2, 65040, 65050), d.fill(2, 65072, 65136), d.fill(2, 65280, 65377), d.fill(2, 65504, 65511);
            for (let v = 0; v < c.length; ++v)
              d.fill(0, c[v][0], c[v][1] + 1);
          }
        }
        wcwidth(v) {
          return v < 32 ? 0 : v < 127 ? 1 : v < 65536 ? d[v] : function(m, l) {
            let s, r = 0, e = l.length - 1;
            if (m < l[0][0] || m > l[e][1])
              return !1;
            for (; e >= r; )
              if (s = r + e >> 1, m > l[s][1])
                r = s + 1;
              else {
                if (!(m < l[s][0]))
                  return !0;
                e = s - 1;
              }
            return !1;
          }(v, a) ? 0 : v >= 131072 && v <= 196605 || v >= 196608 && v <= 262141 ? 2 : 1;
        }
        charProperties(v, m) {
          let l = this.wcwidth(v), s = l === 0 && m !== 0;
          if (s) {
            const r = o.UnicodeService.extractWidth(m);
            r === 0 ? s = !1 : r > l && (l = r);
          }
          return o.UnicodeService.createPropertyValue(0, l, s);
        }
      };
    }, 5981: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.WriteBuffer = void 0;
      const o = n(8460), c = n(844);
      class a extends c.Disposable {
        constructor(v) {
          super(), this._action = v, this._writeBuffer = [], this._callbacks = [], this._pendingData = 0, this._bufferOffset = 0, this._isSyncWriting = !1, this._syncCalls = 0, this._didUserInput = !1, this._onWriteParsed = this.register(new o.EventEmitter()), this.onWriteParsed = this._onWriteParsed.event;
        }
        handleUserInput() {
          this._didUserInput = !0;
        }
        writeSync(v, m) {
          if (m !== void 0 && this._syncCalls > m)
            return void (this._syncCalls = 0);
          if (this._pendingData += v.length, this._writeBuffer.push(v), this._callbacks.push(void 0), this._syncCalls++, this._isSyncWriting)
            return;
          let l;
          for (this._isSyncWriting = !0; l = this._writeBuffer.shift(); ) {
            this._action(l);
            const s = this._callbacks.shift();
            s && s();
          }
          this._pendingData = 0, this._bufferOffset = 2147483647, this._isSyncWriting = !1, this._syncCalls = 0;
        }
        write(v, m) {
          if (this._pendingData > 5e7)
            throw new Error("write data discarded, use flow control to avoid losing data");
          if (!this._writeBuffer.length) {
            if (this._bufferOffset = 0, this._didUserInput)
              return this._didUserInput = !1, this._pendingData += v.length, this._writeBuffer.push(v), this._callbacks.push(m), void this._innerWrite();
            setTimeout(() => this._innerWrite());
          }
          this._pendingData += v.length, this._writeBuffer.push(v), this._callbacks.push(m);
        }
        _innerWrite(v = 0, m = !0) {
          const l = v || Date.now();
          for (; this._writeBuffer.length > this._bufferOffset; ) {
            const s = this._writeBuffer[this._bufferOffset], r = this._action(s, m);
            if (r) {
              const t = (h) => Date.now() - l >= 12 ? setTimeout(() => this._innerWrite(0, h)) : this._innerWrite(l, h);
              return void r.catch((h) => (queueMicrotask(() => {
                throw h;
              }), Promise.resolve(!1))).then(t);
            }
            const e = this._callbacks[this._bufferOffset];
            if (e && e(), this._bufferOffset++, this._pendingData -= s.length, Date.now() - l >= 12)
              break;
          }
          this._writeBuffer.length > this._bufferOffset ? (this._bufferOffset > 50 && (this._writeBuffer = this._writeBuffer.slice(this._bufferOffset), this._callbacks = this._callbacks.slice(this._bufferOffset), this._bufferOffset = 0), setTimeout(() => this._innerWrite())) : (this._writeBuffer.length = 0, this._callbacks.length = 0, this._pendingData = 0, this._bufferOffset = 0), this._onWriteParsed.fire();
        }
      }
      i.WriteBuffer = a;
    }, 5941: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.toRgbString = i.parseColor = void 0;
      const n = /^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/, o = /^[\da-f]+$/;
      function c(a, d) {
        const v = a.toString(16), m = v.length < 2 ? "0" + v : v;
        switch (d) {
          case 4:
            return v[0];
          case 8:
            return m;
          case 12:
            return (m + m).slice(0, 3);
          default:
            return m + m;
        }
      }
      i.parseColor = function(a) {
        if (!a)
          return;
        let d = a.toLowerCase();
        if (d.indexOf("rgb:") === 0) {
          d = d.slice(4);
          const v = n.exec(d);
          if (v) {
            const m = v[1] ? 15 : v[4] ? 255 : v[7] ? 4095 : 65535;
            return [Math.round(parseInt(v[1] || v[4] || v[7] || v[10], 16) / m * 255), Math.round(parseInt(v[2] || v[5] || v[8] || v[11], 16) / m * 255), Math.round(parseInt(v[3] || v[6] || v[9] || v[12], 16) / m * 255)];
          }
        } else if (d.indexOf("#") === 0 && (d = d.slice(1), o.exec(d) && [3, 6, 9, 12].includes(d.length))) {
          const v = d.length / 3, m = [0, 0, 0];
          for (let l = 0; l < 3; ++l) {
            const s = parseInt(d.slice(v * l, v * l + v), 16);
            m[l] = v === 1 ? s << 4 : v === 2 ? s : v === 3 ? s >> 4 : s >> 8;
          }
          return m;
        }
      }, i.toRgbString = function(a, d = 16) {
        const [v, m, l] = a;
        return `rgb:${c(v, d)}/${c(m, d)}/${c(l, d)}`;
      };
    }, 5770: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.PAYLOAD_LIMIT = void 0, i.PAYLOAD_LIMIT = 1e7;
    }, 6351: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.DcsHandler = i.DcsParser = void 0;
      const o = n(482), c = n(8742), a = n(5770), d = [];
      i.DcsParser = class {
        constructor() {
          this._handlers = /* @__PURE__ */ Object.create(null), this._active = d, this._ident = 0, this._handlerFb = () => {
          }, this._stack = { paused: !1, loopPosition: 0, fallThrough: !1 };
        }
        dispose() {
          this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => {
          }, this._active = d;
        }
        registerHandler(m, l) {
          this._handlers[m] === void 0 && (this._handlers[m] = []);
          const s = this._handlers[m];
          return s.push(l), { dispose: () => {
            const r = s.indexOf(l);
            r !== -1 && s.splice(r, 1);
          } };
        }
        clearHandler(m) {
          this._handlers[m] && delete this._handlers[m];
        }
        setHandlerFallback(m) {
          this._handlerFb = m;
        }
        reset() {
          if (this._active.length)
            for (let m = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; m >= 0; --m)
              this._active[m].unhook(!1);
          this._stack.paused = !1, this._active = d, this._ident = 0;
        }
        hook(m, l) {
          if (this.reset(), this._ident = m, this._active = this._handlers[m] || d, this._active.length)
            for (let s = this._active.length - 1; s >= 0; s--)
              this._active[s].hook(l);
          else
            this._handlerFb(this._ident, "HOOK", l);
        }
        put(m, l, s) {
          if (this._active.length)
            for (let r = this._active.length - 1; r >= 0; r--)
              this._active[r].put(m, l, s);
          else
            this._handlerFb(this._ident, "PUT", (0, o.utf32ToString)(m, l, s));
        }
        unhook(m, l = !0) {
          if (this._active.length) {
            let s = !1, r = this._active.length - 1, e = !1;
            if (this._stack.paused && (r = this._stack.loopPosition - 1, s = l, e = this._stack.fallThrough, this._stack.paused = !1), !e && s === !1) {
              for (; r >= 0 && (s = this._active[r].unhook(m), s !== !0); r--)
                if (s instanceof Promise)
                  return this._stack.paused = !0, this._stack.loopPosition = r, this._stack.fallThrough = !1, s;
              r--;
            }
            for (; r >= 0; r--)
              if (s = this._active[r].unhook(!1), s instanceof Promise)
                return this._stack.paused = !0, this._stack.loopPosition = r, this._stack.fallThrough = !0, s;
          } else
            this._handlerFb(this._ident, "UNHOOK", m);
          this._active = d, this._ident = 0;
        }
      };
      const v = new c.Params();
      v.addParam(0), i.DcsHandler = class {
        constructor(m) {
          this._handler = m, this._data = "", this._params = v, this._hitLimit = !1;
        }
        hook(m) {
          this._params = m.length > 1 || m.params[0] ? m.clone() : v, this._data = "", this._hitLimit = !1;
        }
        put(m, l, s) {
          this._hitLimit || (this._data += (0, o.utf32ToString)(m, l, s), this._data.length > a.PAYLOAD_LIMIT && (this._data = "", this._hitLimit = !0));
        }
        unhook(m) {
          let l = !1;
          if (this._hitLimit)
            l = !1;
          else if (m && (l = this._handler(this._data, this._params), l instanceof Promise))
            return l.then((s) => (this._params = v, this._data = "", this._hitLimit = !1, s));
          return this._params = v, this._data = "", this._hitLimit = !1, l;
        }
      };
    }, 2015: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.EscapeSequenceParser = i.VT500_TRANSITION_TABLE = i.TransitionTable = void 0;
      const o = n(844), c = n(8742), a = n(6242), d = n(6351);
      class v {
        constructor(r) {
          this.table = new Uint8Array(r);
        }
        setDefault(r, e) {
          this.table.fill(r << 4 | e);
        }
        add(r, e, t, h) {
          this.table[e << 8 | r] = t << 4 | h;
        }
        addMany(r, e, t, h) {
          for (let g = 0; g < r.length; g++)
            this.table[e << 8 | r[g]] = t << 4 | h;
        }
      }
      i.TransitionTable = v;
      const m = 160;
      i.VT500_TRANSITION_TABLE = function() {
        const s = new v(4095), r = Array.apply(null, Array(256)).map((S, _) => _), e = (S, _) => r.slice(S, _), t = e(32, 127), h = e(0, 24);
        h.push(25), h.push.apply(h, e(28, 32));
        const g = e(0, 14);
        let u;
        for (u in s.setDefault(1, 0), s.addMany(t, 0, 2, 0), g)
          s.addMany([24, 26, 153, 154], u, 3, 0), s.addMany(e(128, 144), u, 3, 0), s.addMany(e(144, 152), u, 3, 0), s.add(156, u, 0, 0), s.add(27, u, 11, 1), s.add(157, u, 4, 8), s.addMany([152, 158, 159], u, 0, 7), s.add(155, u, 11, 3), s.add(144, u, 11, 9);
        return s.addMany(h, 0, 3, 0), s.addMany(h, 1, 3, 1), s.add(127, 1, 0, 1), s.addMany(h, 8, 0, 8), s.addMany(h, 3, 3, 3), s.add(127, 3, 0, 3), s.addMany(h, 4, 3, 4), s.add(127, 4, 0, 4), s.addMany(h, 6, 3, 6), s.addMany(h, 5, 3, 5), s.add(127, 5, 0, 5), s.addMany(h, 2, 3, 2), s.add(127, 2, 0, 2), s.add(93, 1, 4, 8), s.addMany(t, 8, 5, 8), s.add(127, 8, 5, 8), s.addMany([156, 27, 24, 26, 7], 8, 6, 0), s.addMany(e(28, 32), 8, 0, 8), s.addMany([88, 94, 95], 1, 0, 7), s.addMany(t, 7, 0, 7), s.addMany(h, 7, 0, 7), s.add(156, 7, 0, 0), s.add(127, 7, 0, 7), s.add(91, 1, 11, 3), s.addMany(e(64, 127), 3, 7, 0), s.addMany(e(48, 60), 3, 8, 4), s.addMany([60, 61, 62, 63], 3, 9, 4), s.addMany(e(48, 60), 4, 8, 4), s.addMany(e(64, 127), 4, 7, 0), s.addMany([60, 61, 62, 63], 4, 0, 6), s.addMany(e(32, 64), 6, 0, 6), s.add(127, 6, 0, 6), s.addMany(e(64, 127), 6, 0, 0), s.addMany(e(32, 48), 3, 9, 5), s.addMany(e(32, 48), 5, 9, 5), s.addMany(e(48, 64), 5, 0, 6), s.addMany(e(64, 127), 5, 7, 0), s.addMany(e(32, 48), 4, 9, 5), s.addMany(e(32, 48), 1, 9, 2), s.addMany(e(32, 48), 2, 9, 2), s.addMany(e(48, 127), 2, 10, 0), s.addMany(e(48, 80), 1, 10, 0), s.addMany(e(81, 88), 1, 10, 0), s.addMany([89, 90, 92], 1, 10, 0), s.addMany(e(96, 127), 1, 10, 0), s.add(80, 1, 11, 9), s.addMany(h, 9, 0, 9), s.add(127, 9, 0, 9), s.addMany(e(28, 32), 9, 0, 9), s.addMany(e(32, 48), 9, 9, 12), s.addMany(e(48, 60), 9, 8, 10), s.addMany([60, 61, 62, 63], 9, 9, 10), s.addMany(h, 11, 0, 11), s.addMany(e(32, 128), 11, 0, 11), s.addMany(e(28, 32), 11, 0, 11), s.addMany(h, 10, 0, 10), s.add(127, 10, 0, 10), s.addMany(e(28, 32), 10, 0, 10), s.addMany(e(48, 60), 10, 8, 10), s.addMany([60, 61, 62, 63], 10, 0, 11), s.addMany(e(32, 48), 10, 9, 12), s.addMany(h, 12, 0, 12), s.add(127, 12, 0, 12), s.addMany(e(28, 32), 12, 0, 12), s.addMany(e(32, 48), 12, 9, 12), s.addMany(e(48, 64), 12, 0, 11), s.addMany(e(64, 127), 12, 12, 13), s.addMany(e(64, 127), 10, 12, 13), s.addMany(e(64, 127), 9, 12, 13), s.addMany(h, 13, 13, 13), s.addMany(t, 13, 13, 13), s.add(127, 13, 0, 13), s.addMany([27, 156, 24, 26], 13, 14, 0), s.add(m, 0, 2, 0), s.add(m, 8, 5, 8), s.add(m, 6, 0, 6), s.add(m, 11, 0, 11), s.add(m, 13, 13, 13), s;
      }();
      class l extends o.Disposable {
        constructor(r = i.VT500_TRANSITION_TABLE) {
          super(), this._transitions = r, this._parseStack = { state: 0, handlers: [], handlerPos: 0, transition: 0, chunkPos: 0 }, this.initialState = 0, this.currentState = this.initialState, this._params = new c.Params(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0, this._printHandlerFb = (e, t, h) => {
          }, this._executeHandlerFb = (e) => {
          }, this._csiHandlerFb = (e, t) => {
          }, this._escHandlerFb = (e) => {
          }, this._errorHandlerFb = (e) => e, this._printHandler = this._printHandlerFb, this._executeHandlers = /* @__PURE__ */ Object.create(null), this._csiHandlers = /* @__PURE__ */ Object.create(null), this._escHandlers = /* @__PURE__ */ Object.create(null), this.register((0, o.toDisposable)(() => {
            this._csiHandlers = /* @__PURE__ */ Object.create(null), this._executeHandlers = /* @__PURE__ */ Object.create(null), this._escHandlers = /* @__PURE__ */ Object.create(null);
          })), this._oscParser = this.register(new a.OscParser()), this._dcsParser = this.register(new d.DcsParser()), this._errorHandler = this._errorHandlerFb, this.registerEscHandler({ final: "\\" }, () => !0);
        }
        _identifier(r, e = [64, 126]) {
          let t = 0;
          if (r.prefix) {
            if (r.prefix.length > 1)
              throw new Error("only one byte as prefix supported");
            if (t = r.prefix.charCodeAt(0), t && 60 > t || t > 63)
              throw new Error("prefix must be in range 0x3c .. 0x3f");
          }
          if (r.intermediates) {
            if (r.intermediates.length > 2)
              throw new Error("only two bytes as intermediates are supported");
            for (let g = 0; g < r.intermediates.length; ++g) {
              const u = r.intermediates.charCodeAt(g);
              if (32 > u || u > 47)
                throw new Error("intermediate must be in range 0x20 .. 0x2f");
              t <<= 8, t |= u;
            }
          }
          if (r.final.length !== 1)
            throw new Error("final must be a single byte");
          const h = r.final.charCodeAt(0);
          if (e[0] > h || h > e[1])
            throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);
          return t <<= 8, t |= h, t;
        }
        identToString(r) {
          const e = [];
          for (; r; )
            e.push(String.fromCharCode(255 & r)), r >>= 8;
          return e.reverse().join("");
        }
        setPrintHandler(r) {
          this._printHandler = r;
        }
        clearPrintHandler() {
          this._printHandler = this._printHandlerFb;
        }
        registerEscHandler(r, e) {
          const t = this._identifier(r, [48, 126]);
          this._escHandlers[t] === void 0 && (this._escHandlers[t] = []);
          const h = this._escHandlers[t];
          return h.push(e), { dispose: () => {
            const g = h.indexOf(e);
            g !== -1 && h.splice(g, 1);
          } };
        }
        clearEscHandler(r) {
          this._escHandlers[this._identifier(r, [48, 126])] && delete this._escHandlers[this._identifier(r, [48, 126])];
        }
        setEscHandlerFallback(r) {
          this._escHandlerFb = r;
        }
        setExecuteHandler(r, e) {
          this._executeHandlers[r.charCodeAt(0)] = e;
        }
        clearExecuteHandler(r) {
          this._executeHandlers[r.charCodeAt(0)] && delete this._executeHandlers[r.charCodeAt(0)];
        }
        setExecuteHandlerFallback(r) {
          this._executeHandlerFb = r;
        }
        registerCsiHandler(r, e) {
          const t = this._identifier(r);
          this._csiHandlers[t] === void 0 && (this._csiHandlers[t] = []);
          const h = this._csiHandlers[t];
          return h.push(e), { dispose: () => {
            const g = h.indexOf(e);
            g !== -1 && h.splice(g, 1);
          } };
        }
        clearCsiHandler(r) {
          this._csiHandlers[this._identifier(r)] && delete this._csiHandlers[this._identifier(r)];
        }
        setCsiHandlerFallback(r) {
          this._csiHandlerFb = r;
        }
        registerDcsHandler(r, e) {
          return this._dcsParser.registerHandler(this._identifier(r), e);
        }
        clearDcsHandler(r) {
          this._dcsParser.clearHandler(this._identifier(r));
        }
        setDcsHandlerFallback(r) {
          this._dcsParser.setHandlerFallback(r);
        }
        registerOscHandler(r, e) {
          return this._oscParser.registerHandler(r, e);
        }
        clearOscHandler(r) {
          this._oscParser.clearHandler(r);
        }
        setOscHandlerFallback(r) {
          this._oscParser.setHandlerFallback(r);
        }
        setErrorHandler(r) {
          this._errorHandler = r;
        }
        clearErrorHandler() {
          this._errorHandler = this._errorHandlerFb;
        }
        reset() {
          this.currentState = this.initialState, this._oscParser.reset(), this._dcsParser.reset(), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0, this._parseStack.state !== 0 && (this._parseStack.state = 2, this._parseStack.handlers = []);
        }
        _preserveStack(r, e, t, h, g) {
          this._parseStack.state = r, this._parseStack.handlers = e, this._parseStack.handlerPos = t, this._parseStack.transition = h, this._parseStack.chunkPos = g;
        }
        parse(r, e, t) {
          let h, g = 0, u = 0, S = 0;
          if (this._parseStack.state)
            if (this._parseStack.state === 2)
              this._parseStack.state = 0, S = this._parseStack.chunkPos + 1;
            else {
              if (t === void 0 || this._parseStack.state === 1)
                throw this._parseStack.state = 1, new Error("improper continuation due to previous async handler, giving up parsing");
              const _ = this._parseStack.handlers;
              let b = this._parseStack.handlerPos - 1;
              switch (this._parseStack.state) {
                case 3:
                  if (t === !1 && b > -1) {
                    for (; b >= 0 && (h = _[b](this._params), h !== !0); b--)
                      if (h instanceof Promise)
                        return this._parseStack.handlerPos = b, h;
                  }
                  this._parseStack.handlers = [];
                  break;
                case 4:
                  if (t === !1 && b > -1) {
                    for (; b >= 0 && (h = _[b](), h !== !0); b--)
                      if (h instanceof Promise)
                        return this._parseStack.handlerPos = b, h;
                  }
                  this._parseStack.handlers = [];
                  break;
                case 6:
                  if (g = r[this._parseStack.chunkPos], h = this._dcsParser.unhook(g !== 24 && g !== 26, t), h)
                    return h;
                  g === 27 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0;
                  break;
                case 5:
                  if (g = r[this._parseStack.chunkPos], h = this._oscParser.end(g !== 24 && g !== 26, t), h)
                    return h;
                  g === 27 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0;
              }
              this._parseStack.state = 0, S = this._parseStack.chunkPos + 1, this.precedingJoinState = 0, this.currentState = 15 & this._parseStack.transition;
            }
          for (let _ = S; _ < e; ++_) {
            switch (g = r[_], u = this._transitions.table[this.currentState << 8 | (g < 160 ? g : m)], u >> 4) {
              case 2:
                for (let L = _ + 1; ; ++L) {
                  if (L >= e || (g = r[L]) < 32 || g > 126 && g < m) {
                    this._printHandler(r, _, L), _ = L - 1;
                    break;
                  }
                  if (++L >= e || (g = r[L]) < 32 || g > 126 && g < m) {
                    this._printHandler(r, _, L), _ = L - 1;
                    break;
                  }
                  if (++L >= e || (g = r[L]) < 32 || g > 126 && g < m) {
                    this._printHandler(r, _, L), _ = L - 1;
                    break;
                  }
                  if (++L >= e || (g = r[L]) < 32 || g > 126 && g < m) {
                    this._printHandler(r, _, L), _ = L - 1;
                    break;
                  }
                }
                break;
              case 3:
                this._executeHandlers[g] ? this._executeHandlers[g]() : this._executeHandlerFb(g), this.precedingJoinState = 0;
                break;
              case 0:
                break;
              case 1:
                if (this._errorHandler({ position: _, code: g, currentState: this.currentState, collect: this._collect, params: this._params, abort: !1 }).abort)
                  return;
                break;
              case 7:
                const b = this._csiHandlers[this._collect << 8 | g];
                let R = b ? b.length - 1 : -1;
                for (; R >= 0 && (h = b[R](this._params), h !== !0); R--)
                  if (h instanceof Promise)
                    return this._preserveStack(3, b, R, u, _), h;
                R < 0 && this._csiHandlerFb(this._collect << 8 | g, this._params), this.precedingJoinState = 0;
                break;
              case 8:
                do
                  switch (g) {
                    case 59:
                      this._params.addParam(0);
                      break;
                    case 58:
                      this._params.addSubParam(-1);
                      break;
                    default:
                      this._params.addDigit(g - 48);
                  }
                while (++_ < e && (g = r[_]) > 47 && g < 60);
                _--;
                break;
              case 9:
                this._collect <<= 8, this._collect |= g;
                break;
              case 10:
                const B = this._escHandlers[this._collect << 8 | g];
                let T = B ? B.length - 1 : -1;
                for (; T >= 0 && (h = B[T](), h !== !0); T--)
                  if (h instanceof Promise)
                    return this._preserveStack(4, B, T, u, _), h;
                T < 0 && this._escHandlerFb(this._collect << 8 | g), this.precedingJoinState = 0;
                break;
              case 11:
                this._params.reset(), this._params.addParam(0), this._collect = 0;
                break;
              case 12:
                this._dcsParser.hook(this._collect << 8 | g, this._params);
                break;
              case 13:
                for (let L = _ + 1; ; ++L)
                  if (L >= e || (g = r[L]) === 24 || g === 26 || g === 27 || g > 127 && g < m) {
                    this._dcsParser.put(r, _, L), _ = L - 1;
                    break;
                  }
                break;
              case 14:
                if (h = this._dcsParser.unhook(g !== 24 && g !== 26), h)
                  return this._preserveStack(6, [], 0, u, _), h;
                g === 27 && (u |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0;
                break;
              case 4:
                this._oscParser.start();
                break;
              case 5:
                for (let L = _ + 1; ; L++)
                  if (L >= e || (g = r[L]) < 32 || g > 127 && g < m) {
                    this._oscParser.put(r, _, L), _ = L - 1;
                    break;
                  }
                break;
              case 6:
                if (h = this._oscParser.end(g !== 24 && g !== 26), h)
                  return this._preserveStack(5, [], 0, u, _), h;
                g === 27 && (u |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0;
            }
            this.currentState = 15 & u;
          }
        }
      }
      i.EscapeSequenceParser = l;
    }, 6242: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.OscHandler = i.OscParser = void 0;
      const o = n(5770), c = n(482), a = [];
      i.OscParser = class {
        constructor() {
          this._state = 0, this._active = a, this._id = -1, this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => {
          }, this._stack = { paused: !1, loopPosition: 0, fallThrough: !1 };
        }
        registerHandler(d, v) {
          this._handlers[d] === void 0 && (this._handlers[d] = []);
          const m = this._handlers[d];
          return m.push(v), { dispose: () => {
            const l = m.indexOf(v);
            l !== -1 && m.splice(l, 1);
          } };
        }
        clearHandler(d) {
          this._handlers[d] && delete this._handlers[d];
        }
        setHandlerFallback(d) {
          this._handlerFb = d;
        }
        dispose() {
          this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => {
          }, this._active = a;
        }
        reset() {
          if (this._state === 2)
            for (let d = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; d >= 0; --d)
              this._active[d].end(!1);
          this._stack.paused = !1, this._active = a, this._id = -1, this._state = 0;
        }
        _start() {
          if (this._active = this._handlers[this._id] || a, this._active.length)
            for (let d = this._active.length - 1; d >= 0; d--)
              this._active[d].start();
          else
            this._handlerFb(this._id, "START");
        }
        _put(d, v, m) {
          if (this._active.length)
            for (let l = this._active.length - 1; l >= 0; l--)
              this._active[l].put(d, v, m);
          else
            this._handlerFb(this._id, "PUT", (0, c.utf32ToString)(d, v, m));
        }
        start() {
          this.reset(), this._state = 1;
        }
        put(d, v, m) {
          if (this._state !== 3) {
            if (this._state === 1)
              for (; v < m; ) {
                const l = d[v++];
                if (l === 59) {
                  this._state = 2, this._start();
                  break;
                }
                if (l < 48 || 57 < l)
                  return void (this._state = 3);
                this._id === -1 && (this._id = 0), this._id = 10 * this._id + l - 48;
              }
            this._state === 2 && m - v > 0 && this._put(d, v, m);
          }
        }
        end(d, v = !0) {
          if (this._state !== 0) {
            if (this._state !== 3)
              if (this._state === 1 && this._start(), this._active.length) {
                let m = !1, l = this._active.length - 1, s = !1;
                if (this._stack.paused && (l = this._stack.loopPosition - 1, m = v, s = this._stack.fallThrough, this._stack.paused = !1), !s && m === !1) {
                  for (; l >= 0 && (m = this._active[l].end(d), m !== !0); l--)
                    if (m instanceof Promise)
                      return this._stack.paused = !0, this._stack.loopPosition = l, this._stack.fallThrough = !1, m;
                  l--;
                }
                for (; l >= 0; l--)
                  if (m = this._active[l].end(!1), m instanceof Promise)
                    return this._stack.paused = !0, this._stack.loopPosition = l, this._stack.fallThrough = !0, m;
              } else
                this._handlerFb(this._id, "END", d);
            this._active = a, this._id = -1, this._state = 0;
          }
        }
      }, i.OscHandler = class {
        constructor(d) {
          this._handler = d, this._data = "", this._hitLimit = !1;
        }
        start() {
          this._data = "", this._hitLimit = !1;
        }
        put(d, v, m) {
          this._hitLimit || (this._data += (0, c.utf32ToString)(d, v, m), this._data.length > o.PAYLOAD_LIMIT && (this._data = "", this._hitLimit = !0));
        }
        end(d) {
          let v = !1;
          if (this._hitLimit)
            v = !1;
          else if (d && (v = this._handler(this._data), v instanceof Promise))
            return v.then((m) => (this._data = "", this._hitLimit = !1, m));
          return this._data = "", this._hitLimit = !1, v;
        }
      };
    }, 8742: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.Params = void 0;
      const n = 2147483647;
      class o {
        static fromArray(a) {
          const d = new o();
          if (!a.length)
            return d;
          for (let v = Array.isArray(a[0]) ? 1 : 0; v < a.length; ++v) {
            const m = a[v];
            if (Array.isArray(m))
              for (let l = 0; l < m.length; ++l)
                d.addSubParam(m[l]);
            else
              d.addParam(m);
          }
          return d;
        }
        constructor(a = 32, d = 32) {
          if (this.maxLength = a, this.maxSubParamsLength = d, d > 256)
            throw new Error("maxSubParamsLength must not be greater than 256");
          this.params = new Int32Array(a), this.length = 0, this._subParams = new Int32Array(d), this._subParamsLength = 0, this._subParamsIdx = new Uint16Array(a), this._rejectDigits = !1, this._rejectSubDigits = !1, this._digitIsSub = !1;
        }
        clone() {
          const a = new o(this.maxLength, this.maxSubParamsLength);
          return a.params.set(this.params), a.length = this.length, a._subParams.set(this._subParams), a._subParamsLength = this._subParamsLength, a._subParamsIdx.set(this._subParamsIdx), a._rejectDigits = this._rejectDigits, a._rejectSubDigits = this._rejectSubDigits, a._digitIsSub = this._digitIsSub, a;
        }
        toArray() {
          const a = [];
          for (let d = 0; d < this.length; ++d) {
            a.push(this.params[d]);
            const v = this._subParamsIdx[d] >> 8, m = 255 & this._subParamsIdx[d];
            m - v > 0 && a.push(Array.prototype.slice.call(this._subParams, v, m));
          }
          return a;
        }
        reset() {
          this.length = 0, this._subParamsLength = 0, this._rejectDigits = !1, this._rejectSubDigits = !1, this._digitIsSub = !1;
        }
        addParam(a) {
          if (this._digitIsSub = !1, this.length >= this.maxLength)
            this._rejectDigits = !0;
          else {
            if (a < -1)
              throw new Error("values lesser than -1 are not allowed");
            this._subParamsIdx[this.length] = this._subParamsLength << 8 | this._subParamsLength, this.params[this.length++] = a > n ? n : a;
          }
        }
        addSubParam(a) {
          if (this._digitIsSub = !0, this.length)
            if (this._rejectDigits || this._subParamsLength >= this.maxSubParamsLength)
              this._rejectSubDigits = !0;
            else {
              if (a < -1)
                throw new Error("values lesser than -1 are not allowed");
              this._subParams[this._subParamsLength++] = a > n ? n : a, this._subParamsIdx[this.length - 1]++;
            }
        }
        hasSubParams(a) {
          return (255 & this._subParamsIdx[a]) - (this._subParamsIdx[a] >> 8) > 0;
        }
        getSubParams(a) {
          const d = this._subParamsIdx[a] >> 8, v = 255 & this._subParamsIdx[a];
          return v - d > 0 ? this._subParams.subarray(d, v) : null;
        }
        getSubParamsAll() {
          const a = {};
          for (let d = 0; d < this.length; ++d) {
            const v = this._subParamsIdx[d] >> 8, m = 255 & this._subParamsIdx[d];
            m - v > 0 && (a[d] = this._subParams.slice(v, m));
          }
          return a;
        }
        addDigit(a) {
          let d;
          if (this._rejectDigits || !(d = this._digitIsSub ? this._subParamsLength : this.length) || this._digitIsSub && this._rejectSubDigits)
            return;
          const v = this._digitIsSub ? this._subParams : this.params, m = v[d - 1];
          v[d - 1] = ~m ? Math.min(10 * m + a, n) : a;
        }
      }
      i.Params = o;
    }, 5741: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.AddonManager = void 0, i.AddonManager = class {
        constructor() {
          this._addons = [];
        }
        dispose() {
          for (let n = this._addons.length - 1; n >= 0; n--)
            this._addons[n].instance.dispose();
        }
        loadAddon(n, o) {
          const c = { instance: o, dispose: o.dispose, isDisposed: !1 };
          this._addons.push(c), o.dispose = () => this._wrappedAddonDispose(c), o.activate(n);
        }
        _wrappedAddonDispose(n) {
          if (n.isDisposed)
            return;
          let o = -1;
          for (let c = 0; c < this._addons.length; c++)
            if (this._addons[c] === n) {
              o = c;
              break;
            }
          if (o === -1)
            throw new Error("Could not dispose an addon that has not been loaded");
          n.isDisposed = !0, n.dispose.apply(n.instance), this._addons.splice(o, 1);
        }
      };
    }, 8771: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.BufferApiView = void 0;
      const o = n(3785), c = n(511);
      i.BufferApiView = class {
        constructor(a, d) {
          this._buffer = a, this.type = d;
        }
        init(a) {
          return this._buffer = a, this;
        }
        get cursorY() {
          return this._buffer.y;
        }
        get cursorX() {
          return this._buffer.x;
        }
        get viewportY() {
          return this._buffer.ydisp;
        }
        get baseY() {
          return this._buffer.ybase;
        }
        get length() {
          return this._buffer.lines.length;
        }
        getLine(a) {
          const d = this._buffer.lines.get(a);
          if (d)
            return new o.BufferLineApiView(d);
        }
        getNullCell() {
          return new c.CellData();
        }
      };
    }, 3785: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.BufferLineApiView = void 0;
      const o = n(511);
      i.BufferLineApiView = class {
        constructor(c) {
          this._line = c;
        }
        get isWrapped() {
          return this._line.isWrapped;
        }
        get length() {
          return this._line.length;
        }
        getCell(c, a) {
          if (!(c < 0 || c >= this._line.length))
            return a ? (this._line.loadCell(c, a), a) : this._line.loadCell(c, new o.CellData());
        }
        translateToString(c, a, d) {
          return this._line.translateToString(c, a, d);
        }
      };
    }, 8285: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.BufferNamespaceApi = void 0;
      const o = n(8771), c = n(8460), a = n(844);
      class d extends a.Disposable {
        constructor(m) {
          super(), this._core = m, this._onBufferChange = this.register(new c.EventEmitter()), this.onBufferChange = this._onBufferChange.event, this._normal = new o.BufferApiView(this._core.buffers.normal, "normal"), this._alternate = new o.BufferApiView(this._core.buffers.alt, "alternate"), this._core.buffers.onBufferActivate(() => this._onBufferChange.fire(this.active));
        }
        get active() {
          if (this._core.buffers.active === this._core.buffers.normal)
            return this.normal;
          if (this._core.buffers.active === this._core.buffers.alt)
            return this.alternate;
          throw new Error("Active buffer is neither normal nor alternate");
        }
        get normal() {
          return this._normal.init(this._core.buffers.normal);
        }
        get alternate() {
          return this._alternate.init(this._core.buffers.alt);
        }
      }
      i.BufferNamespaceApi = d;
    }, 7975: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.ParserApi = void 0, i.ParserApi = class {
        constructor(n) {
          this._core = n;
        }
        registerCsiHandler(n, o) {
          return this._core.registerCsiHandler(n, (c) => o(c.toArray()));
        }
        addCsiHandler(n, o) {
          return this.registerCsiHandler(n, o);
        }
        registerDcsHandler(n, o) {
          return this._core.registerDcsHandler(n, (c, a) => o(c, a.toArray()));
        }
        addDcsHandler(n, o) {
          return this.registerDcsHandler(n, o);
        }
        registerEscHandler(n, o) {
          return this._core.registerEscHandler(n, o);
        }
        addEscHandler(n, o) {
          return this.registerEscHandler(n, o);
        }
        registerOscHandler(n, o) {
          return this._core.registerOscHandler(n, o);
        }
        addOscHandler(n, o) {
          return this.registerOscHandler(n, o);
        }
      };
    }, 7090: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.UnicodeApi = void 0, i.UnicodeApi = class {
        constructor(n) {
          this._core = n;
        }
        register(n) {
          this._core.unicodeService.register(n);
        }
        get versions() {
          return this._core.unicodeService.versions;
        }
        get activeVersion() {
          return this._core.unicodeService.activeVersion;
        }
        set activeVersion(n) {
          this._core.unicodeService.activeVersion = n;
        }
      };
    }, 744: function(k, i, n) {
      var o = this && this.__decorate || function(s, r, e, t) {
        var h, g = arguments.length, u = g < 3 ? r : t === null ? t = Object.getOwnPropertyDescriptor(r, e) : t;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          u = Reflect.decorate(s, r, e, t);
        else
          for (var S = s.length - 1; S >= 0; S--)
            (h = s[S]) && (u = (g < 3 ? h(u) : g > 3 ? h(r, e, u) : h(r, e)) || u);
        return g > 3 && u && Object.defineProperty(r, e, u), u;
      }, c = this && this.__param || function(s, r) {
        return function(e, t) {
          r(e, t, s);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.BufferService = i.MINIMUM_ROWS = i.MINIMUM_COLS = void 0;
      const a = n(8460), d = n(844), v = n(5295), m = n(2585);
      i.MINIMUM_COLS = 2, i.MINIMUM_ROWS = 1;
      let l = i.BufferService = class extends d.Disposable {
        get buffer() {
          return this.buffers.active;
        }
        constructor(s) {
          super(), this.isUserScrolling = !1, this._onResize = this.register(new a.EventEmitter()), this.onResize = this._onResize.event, this._onScroll = this.register(new a.EventEmitter()), this.onScroll = this._onScroll.event, this.cols = Math.max(s.rawOptions.cols || 0, i.MINIMUM_COLS), this.rows = Math.max(s.rawOptions.rows || 0, i.MINIMUM_ROWS), this.buffers = this.register(new v.BufferSet(s, this));
        }
        resize(s, r) {
          this.cols = s, this.rows = r, this.buffers.resize(s, r), this._onResize.fire({ cols: s, rows: r });
        }
        reset() {
          this.buffers.reset(), this.isUserScrolling = !1;
        }
        scroll(s, r = !1) {
          const e = this.buffer;
          let t;
          t = this._cachedBlankLine, t && t.length === this.cols && t.getFg(0) === s.fg && t.getBg(0) === s.bg || (t = e.getBlankLine(s, r), this._cachedBlankLine = t), t.isWrapped = r;
          const h = e.ybase + e.scrollTop, g = e.ybase + e.scrollBottom;
          if (e.scrollTop === 0) {
            const u = e.lines.isFull;
            g === e.lines.length - 1 ? u ? e.lines.recycle().copyFrom(t) : e.lines.push(t.clone()) : e.lines.splice(g + 1, 0, t.clone()), u ? this.isUserScrolling && (e.ydisp = Math.max(e.ydisp - 1, 0)) : (e.ybase++, this.isUserScrolling || e.ydisp++);
          } else {
            const u = g - h + 1;
            e.lines.shiftElements(h + 1, u - 1, -1), e.lines.set(g, t.clone());
          }
          this.isUserScrolling || (e.ydisp = e.ybase), this._onScroll.fire(e.ydisp);
        }
        scrollLines(s, r, e) {
          const t = this.buffer;
          if (s < 0) {
            if (t.ydisp === 0)
              return;
            this.isUserScrolling = !0;
          } else
            s + t.ydisp >= t.ybase && (this.isUserScrolling = !1);
          const h = t.ydisp;
          t.ydisp = Math.max(Math.min(t.ydisp + s, t.ybase), 0), h !== t.ydisp && (r || this._onScroll.fire(t.ydisp));
        }
      };
      i.BufferService = l = o([c(0, m.IOptionsService)], l);
    }, 7994: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.CharsetService = void 0, i.CharsetService = class {
        constructor() {
          this.glevel = 0, this._charsets = [];
        }
        reset() {
          this.charset = void 0, this._charsets = [], this.glevel = 0;
        }
        setgLevel(n) {
          this.glevel = n, this.charset = this._charsets[n];
        }
        setgCharset(n, o) {
          this._charsets[n] = o, this.glevel === n && (this.charset = o);
        }
      };
    }, 1753: function(k, i, n) {
      var o = this && this.__decorate || function(t, h, g, u) {
        var S, _ = arguments.length, b = _ < 3 ? h : u === null ? u = Object.getOwnPropertyDescriptor(h, g) : u;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          b = Reflect.decorate(t, h, g, u);
        else
          for (var R = t.length - 1; R >= 0; R--)
            (S = t[R]) && (b = (_ < 3 ? S(b) : _ > 3 ? S(h, g, b) : S(h, g)) || b);
        return _ > 3 && b && Object.defineProperty(h, g, b), b;
      }, c = this && this.__param || function(t, h) {
        return function(g, u) {
          h(g, u, t);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.CoreMouseService = void 0;
      const a = n(2585), d = n(8460), v = n(844), m = { NONE: { events: 0, restrict: () => !1 }, X10: { events: 1, restrict: (t) => t.button !== 4 && t.action === 1 && (t.ctrl = !1, t.alt = !1, t.shift = !1, !0) }, VT200: { events: 19, restrict: (t) => t.action !== 32 }, DRAG: { events: 23, restrict: (t) => t.action !== 32 || t.button !== 3 }, ANY: { events: 31, restrict: (t) => !0 } };
      function l(t, h) {
        let g = (t.ctrl ? 16 : 0) | (t.shift ? 4 : 0) | (t.alt ? 8 : 0);
        return t.button === 4 ? (g |= 64, g |= t.action) : (g |= 3 & t.button, 4 & t.button && (g |= 64), 8 & t.button && (g |= 128), t.action === 32 ? g |= 32 : t.action !== 0 || h || (g |= 3)), g;
      }
      const s = String.fromCharCode, r = { DEFAULT: (t) => {
        const h = [l(t, !1) + 32, t.col + 32, t.row + 32];
        return h[0] > 255 || h[1] > 255 || h[2] > 255 ? "" : `\x1B[M${s(h[0])}${s(h[1])}${s(h[2])}`;
      }, SGR: (t) => {
        const h = t.action === 0 && t.button !== 4 ? "m" : "M";
        return `\x1B[<${l(t, !0)};${t.col};${t.row}${h}`;
      }, SGR_PIXELS: (t) => {
        const h = t.action === 0 && t.button !== 4 ? "m" : "M";
        return `\x1B[<${l(t, !0)};${t.x};${t.y}${h}`;
      } };
      let e = i.CoreMouseService = class extends v.Disposable {
        constructor(t, h) {
          super(), this._bufferService = t, this._coreService = h, this._protocols = {}, this._encodings = {}, this._activeProtocol = "", this._activeEncoding = "", this._lastEvent = null, this._onProtocolChange = this.register(new d.EventEmitter()), this.onProtocolChange = this._onProtocolChange.event;
          for (const g of Object.keys(m))
            this.addProtocol(g, m[g]);
          for (const g of Object.keys(r))
            this.addEncoding(g, r[g]);
          this.reset();
        }
        addProtocol(t, h) {
          this._protocols[t] = h;
        }
        addEncoding(t, h) {
          this._encodings[t] = h;
        }
        get activeProtocol() {
          return this._activeProtocol;
        }
        get areMouseEventsActive() {
          return this._protocols[this._activeProtocol].events !== 0;
        }
        set activeProtocol(t) {
          if (!this._protocols[t])
            throw new Error(`unknown protocol "${t}"`);
          this._activeProtocol = t, this._onProtocolChange.fire(this._protocols[t].events);
        }
        get activeEncoding() {
          return this._activeEncoding;
        }
        set activeEncoding(t) {
          if (!this._encodings[t])
            throw new Error(`unknown encoding "${t}"`);
          this._activeEncoding = t;
        }
        reset() {
          this.activeProtocol = "NONE", this.activeEncoding = "DEFAULT", this._lastEvent = null;
        }
        triggerMouseEvent(t) {
          if (t.col < 0 || t.col >= this._bufferService.cols || t.row < 0 || t.row >= this._bufferService.rows || t.button === 4 && t.action === 32 || t.button === 3 && t.action !== 32 || t.button !== 4 && (t.action === 2 || t.action === 3) || (t.col++, t.row++, t.action === 32 && this._lastEvent && this._equalEvents(this._lastEvent, t, this._activeEncoding === "SGR_PIXELS")) || !this._protocols[this._activeProtocol].restrict(t))
            return !1;
          const h = this._encodings[this._activeEncoding](t);
          return h && (this._activeEncoding === "DEFAULT" ? this._coreService.triggerBinaryEvent(h) : this._coreService.triggerDataEvent(h, !0)), this._lastEvent = t, !0;
        }
        explainEvents(t) {
          return { down: !!(1 & t), up: !!(2 & t), drag: !!(4 & t), move: !!(8 & t), wheel: !!(16 & t) };
        }
        _equalEvents(t, h, g) {
          if (g) {
            if (t.x !== h.x || t.y !== h.y)
              return !1;
          } else if (t.col !== h.col || t.row !== h.row)
            return !1;
          return t.button === h.button && t.action === h.action && t.ctrl === h.ctrl && t.alt === h.alt && t.shift === h.shift;
        }
      };
      i.CoreMouseService = e = o([c(0, a.IBufferService), c(1, a.ICoreService)], e);
    }, 6975: function(k, i, n) {
      var o = this && this.__decorate || function(e, t, h, g) {
        var u, S = arguments.length, _ = S < 3 ? t : g === null ? g = Object.getOwnPropertyDescriptor(t, h) : g;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          _ = Reflect.decorate(e, t, h, g);
        else
          for (var b = e.length - 1; b >= 0; b--)
            (u = e[b]) && (_ = (S < 3 ? u(_) : S > 3 ? u(t, h, _) : u(t, h)) || _);
        return S > 3 && _ && Object.defineProperty(t, h, _), _;
      }, c = this && this.__param || function(e, t) {
        return function(h, g) {
          t(h, g, e);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.CoreService = void 0;
      const a = n(1439), d = n(8460), v = n(844), m = n(2585), l = Object.freeze({ insertMode: !1 }), s = Object.freeze({ applicationCursorKeys: !1, applicationKeypad: !1, bracketedPasteMode: !1, origin: !1, reverseWraparound: !1, sendFocus: !1, wraparound: !0 });
      let r = i.CoreService = class extends v.Disposable {
        constructor(e, t, h) {
          super(), this._bufferService = e, this._logService = t, this._optionsService = h, this.isCursorInitialized = !1, this.isCursorHidden = !1, this._onData = this.register(new d.EventEmitter()), this.onData = this._onData.event, this._onUserInput = this.register(new d.EventEmitter()), this.onUserInput = this._onUserInput.event, this._onBinary = this.register(new d.EventEmitter()), this.onBinary = this._onBinary.event, this._onRequestScrollToBottom = this.register(new d.EventEmitter()), this.onRequestScrollToBottom = this._onRequestScrollToBottom.event, this.modes = (0, a.clone)(l), this.decPrivateModes = (0, a.clone)(s);
        }
        reset() {
          this.modes = (0, a.clone)(l), this.decPrivateModes = (0, a.clone)(s);
        }
        triggerDataEvent(e, t = !1) {
          if (this._optionsService.rawOptions.disableStdin)
            return;
          const h = this._bufferService.buffer;
          t && this._optionsService.rawOptions.scrollOnUserInput && h.ybase !== h.ydisp && this._onRequestScrollToBottom.fire(), t && this._onUserInput.fire(), this._logService.debug(`sending data "${e}"`, () => e.split("").map((g) => g.charCodeAt(0))), this._onData.fire(e);
        }
        triggerBinaryEvent(e) {
          this._optionsService.rawOptions.disableStdin || (this._logService.debug(`sending binary "${e}"`, () => e.split("").map((t) => t.charCodeAt(0))), this._onBinary.fire(e));
        }
      };
      i.CoreService = r = o([c(0, m.IBufferService), c(1, m.ILogService), c(2, m.IOptionsService)], r);
    }, 9074: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.DecorationService = void 0;
      const o = n(8055), c = n(8460), a = n(844), d = n(6106);
      let v = 0, m = 0;
      class l extends a.Disposable {
        get decorations() {
          return this._decorations.values();
        }
        constructor() {
          super(), this._decorations = new d.SortedList((e) => e == null ? void 0 : e.marker.line), this._onDecorationRegistered = this.register(new c.EventEmitter()), this.onDecorationRegistered = this._onDecorationRegistered.event, this._onDecorationRemoved = this.register(new c.EventEmitter()), this.onDecorationRemoved = this._onDecorationRemoved.event, this.register((0, a.toDisposable)(() => this.reset()));
        }
        registerDecoration(e) {
          if (e.marker.isDisposed)
            return;
          const t = new s(e);
          if (t) {
            const h = t.marker.onDispose(() => t.dispose());
            t.onDispose(() => {
              t && (this._decorations.delete(t) && this._onDecorationRemoved.fire(t), h.dispose());
            }), this._decorations.insert(t), this._onDecorationRegistered.fire(t);
          }
          return t;
        }
        reset() {
          for (const e of this._decorations.values())
            e.dispose();
          this._decorations.clear();
        }
        *getDecorationsAtCell(e, t, h) {
          let g = 0, u = 0;
          for (const S of this._decorations.getKeyIterator(t))
            g = S.options.x ?? 0, u = g + (S.options.width ?? 1), e >= g && e < u && (!h || (S.options.layer ?? "bottom") === h) && (yield S);
        }
        forEachDecorationAtCell(e, t, h, g) {
          this._decorations.forEachByKey(t, (u) => {
            v = u.options.x ?? 0, m = v + (u.options.width ?? 1), e >= v && e < m && (!h || (u.options.layer ?? "bottom") === h) && g(u);
          });
        }
      }
      i.DecorationService = l;
      class s extends a.Disposable {
        get isDisposed() {
          return this._isDisposed;
        }
        get backgroundColorRGB() {
          return this._cachedBg === null && (this.options.backgroundColor ? this._cachedBg = o.css.toColor(this.options.backgroundColor) : this._cachedBg = void 0), this._cachedBg;
        }
        get foregroundColorRGB() {
          return this._cachedFg === null && (this.options.foregroundColor ? this._cachedFg = o.css.toColor(this.options.foregroundColor) : this._cachedFg = void 0), this._cachedFg;
        }
        constructor(e) {
          super(), this.options = e, this.onRenderEmitter = this.register(new c.EventEmitter()), this.onRender = this.onRenderEmitter.event, this._onDispose = this.register(new c.EventEmitter()), this.onDispose = this._onDispose.event, this._cachedBg = null, this._cachedFg = null, this.marker = e.marker, this.options.overviewRulerOptions && !this.options.overviewRulerOptions.position && (this.options.overviewRulerOptions.position = "full");
        }
        dispose() {
          this._onDispose.fire(), super.dispose();
        }
      }
    }, 4348: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.InstantiationService = i.ServiceCollection = void 0;
      const o = n(2585), c = n(8343);
      class a {
        constructor(...v) {
          this._entries = /* @__PURE__ */ new Map();
          for (const [m, l] of v)
            this.set(m, l);
        }
        set(v, m) {
          const l = this._entries.get(v);
          return this._entries.set(v, m), l;
        }
        forEach(v) {
          for (const [m, l] of this._entries.entries())
            v(m, l);
        }
        has(v) {
          return this._entries.has(v);
        }
        get(v) {
          return this._entries.get(v);
        }
      }
      i.ServiceCollection = a, i.InstantiationService = class {
        constructor() {
          this._services = new a(), this._services.set(o.IInstantiationService, this);
        }
        setService(d, v) {
          this._services.set(d, v);
        }
        getService(d) {
          return this._services.get(d);
        }
        createInstance(d, ...v) {
          const m = (0, c.getServiceDependencies)(d).sort((r, e) => r.index - e.index), l = [];
          for (const r of m) {
            const e = this._services.get(r.id);
            if (!e)
              throw new Error(`[createInstance] ${d.name} depends on UNKNOWN service ${r.id}.`);
            l.push(e);
          }
          const s = m.length > 0 ? m[0].index : v.length;
          if (v.length !== s)
            throw new Error(`[createInstance] First service dependency of ${d.name} at position ${s + 1} conflicts with ${v.length} static arguments`);
          return new d(...v, ...l);
        }
      };
    }, 7866: function(k, i, n) {
      var o = this && this.__decorate || function(s, r, e, t) {
        var h, g = arguments.length, u = g < 3 ? r : t === null ? t = Object.getOwnPropertyDescriptor(r, e) : t;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          u = Reflect.decorate(s, r, e, t);
        else
          for (var S = s.length - 1; S >= 0; S--)
            (h = s[S]) && (u = (g < 3 ? h(u) : g > 3 ? h(r, e, u) : h(r, e)) || u);
        return g > 3 && u && Object.defineProperty(r, e, u), u;
      }, c = this && this.__param || function(s, r) {
        return function(e, t) {
          r(e, t, s);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.traceCall = i.setTraceLogger = i.LogService = void 0;
      const a = n(844), d = n(2585), v = { trace: d.LogLevelEnum.TRACE, debug: d.LogLevelEnum.DEBUG, info: d.LogLevelEnum.INFO, warn: d.LogLevelEnum.WARN, error: d.LogLevelEnum.ERROR, off: d.LogLevelEnum.OFF };
      let m, l = i.LogService = class extends a.Disposable {
        get logLevel() {
          return this._logLevel;
        }
        constructor(s) {
          super(), this._optionsService = s, this._logLevel = d.LogLevelEnum.OFF, this._updateLogLevel(), this.register(this._optionsService.onSpecificOptionChange("logLevel", () => this._updateLogLevel())), m = this;
        }
        _updateLogLevel() {
          this._logLevel = v[this._optionsService.rawOptions.logLevel];
        }
        _evalLazyOptionalParams(s) {
          for (let r = 0; r < s.length; r++)
            typeof s[r] == "function" && (s[r] = s[r]());
        }
        _log(s, r, e) {
          this._evalLazyOptionalParams(e), s.call(console, (this._optionsService.options.logger ? "" : "xterm.js: ") + r, ...e);
        }
        trace(s, ...r) {
          var e;
          this._logLevel <= d.LogLevelEnum.TRACE && this._log(((e = this._optionsService.options.logger) == null ? void 0 : e.trace.bind(this._optionsService.options.logger)) ?? console.log, s, r);
        }
        debug(s, ...r) {
          var e;
          this._logLevel <= d.LogLevelEnum.DEBUG && this._log(((e = this._optionsService.options.logger) == null ? void 0 : e.debug.bind(this._optionsService.options.logger)) ?? console.log, s, r);
        }
        info(s, ...r) {
          var e;
          this._logLevel <= d.LogLevelEnum.INFO && this._log(((e = this._optionsService.options.logger) == null ? void 0 : e.info.bind(this._optionsService.options.logger)) ?? console.info, s, r);
        }
        warn(s, ...r) {
          var e;
          this._logLevel <= d.LogLevelEnum.WARN && this._log(((e = this._optionsService.options.logger) == null ? void 0 : e.warn.bind(this._optionsService.options.logger)) ?? console.warn, s, r);
        }
        error(s, ...r) {
          var e;
          this._logLevel <= d.LogLevelEnum.ERROR && this._log(((e = this._optionsService.options.logger) == null ? void 0 : e.error.bind(this._optionsService.options.logger)) ?? console.error, s, r);
        }
      };
      i.LogService = l = o([c(0, d.IOptionsService)], l), i.setTraceLogger = function(s) {
        m = s;
      }, i.traceCall = function(s, r, e) {
        if (typeof e.value != "function")
          throw new Error("not supported");
        const t = e.value;
        e.value = function(...h) {
          if (m.logLevel !== d.LogLevelEnum.TRACE)
            return t.apply(this, h);
          m.trace(`GlyphRenderer#${t.name}(${h.map((u) => JSON.stringify(u)).join(", ")})`);
          const g = t.apply(this, h);
          return m.trace(`GlyphRenderer#${t.name} return`, g), g;
        };
      };
    }, 7302: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.OptionsService = i.DEFAULT_OPTIONS = void 0;
      const o = n(8460), c = n(844), a = n(6114);
      i.DEFAULT_OPTIONS = { cols: 80, rows: 24, cursorBlink: !1, cursorStyle: "block", cursorWidth: 1, cursorInactiveStyle: "outline", customGlyphs: !0, drawBoldTextInBrightColors: !0, documentOverride: null, fastScrollModifier: "alt", fastScrollSensitivity: 5, fontFamily: "courier-new, courier, monospace", fontSize: 15, fontWeight: "normal", fontWeightBold: "bold", ignoreBracketedPasteMode: !1, lineHeight: 1, letterSpacing: 0, linkHandler: null, logLevel: "info", logger: null, scrollback: 1e3, scrollOnUserInput: !0, scrollSensitivity: 1, screenReaderMode: !1, smoothScrollDuration: 0, macOptionIsMeta: !1, macOptionClickForcesSelection: !1, minimumContrastRatio: 1, disableStdin: !1, allowProposedApi: !1, allowTransparency: !1, tabStopWidth: 8, theme: {}, rescaleOverlappingGlyphs: !1, rightClickSelectsWord: a.isMac, windowOptions: {}, windowsMode: !1, windowsPty: {}, wordSeparator: " ()[]{}',\"`", altClickMovesCursor: !0, convertEol: !1, termName: "xterm", cancelEvents: !1, overviewRulerWidth: 0 };
      const d = ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"];
      class v extends c.Disposable {
        constructor(l) {
          super(), this._onOptionChange = this.register(new o.EventEmitter()), this.onOptionChange = this._onOptionChange.event;
          const s = { ...i.DEFAULT_OPTIONS };
          for (const r in l)
            if (r in s)
              try {
                const e = l[r];
                s[r] = this._sanitizeAndValidateOption(r, e);
              } catch (e) {
                console.error(e);
              }
          this.rawOptions = s, this.options = { ...s }, this._setupOptions(), this.register((0, c.toDisposable)(() => {
            this.rawOptions.linkHandler = null, this.rawOptions.documentOverride = null;
          }));
        }
        onSpecificOptionChange(l, s) {
          return this.onOptionChange((r) => {
            r === l && s(this.rawOptions[l]);
          });
        }
        onMultipleOptionChange(l, s) {
          return this.onOptionChange((r) => {
            l.indexOf(r) !== -1 && s();
          });
        }
        _setupOptions() {
          const l = (r) => {
            if (!(r in i.DEFAULT_OPTIONS))
              throw new Error(`No option with key "${r}"`);
            return this.rawOptions[r];
          }, s = (r, e) => {
            if (!(r in i.DEFAULT_OPTIONS))
              throw new Error(`No option with key "${r}"`);
            e = this._sanitizeAndValidateOption(r, e), this.rawOptions[r] !== e && (this.rawOptions[r] = e, this._onOptionChange.fire(r));
          };
          for (const r in this.rawOptions) {
            const e = { get: l.bind(this, r), set: s.bind(this, r) };
            Object.defineProperty(this.options, r, e);
          }
        }
        _sanitizeAndValidateOption(l, s) {
          switch (l) {
            case "cursorStyle":
              if (s || (s = i.DEFAULT_OPTIONS[l]), !/* @__PURE__ */ function(r) {
                return r === "block" || r === "underline" || r === "bar";
              }(s))
                throw new Error(`"${s}" is not a valid value for ${l}`);
              break;
            case "wordSeparator":
              s || (s = i.DEFAULT_OPTIONS[l]);
              break;
            case "fontWeight":
            case "fontWeightBold":
              if (typeof s == "number" && 1 <= s && s <= 1e3)
                break;
              s = d.includes(s) ? s : i.DEFAULT_OPTIONS[l];
              break;
            case "cursorWidth":
              s = Math.floor(s);
            case "lineHeight":
            case "tabStopWidth":
              if (s < 1)
                throw new Error(`${l} cannot be less than 1, value: ${s}`);
              break;
            case "minimumContrastRatio":
              s = Math.max(1, Math.min(21, Math.round(10 * s) / 10));
              break;
            case "scrollback":
              if ((s = Math.min(s, 4294967295)) < 0)
                throw new Error(`${l} cannot be less than 0, value: ${s}`);
              break;
            case "fastScrollSensitivity":
            case "scrollSensitivity":
              if (s <= 0)
                throw new Error(`${l} cannot be less than or equal to 0, value: ${s}`);
              break;
            case "rows":
            case "cols":
              if (!s && s !== 0)
                throw new Error(`${l} must be numeric, value: ${s}`);
              break;
            case "windowsPty":
              s = s ?? {};
          }
          return s;
        }
      }
      i.OptionsService = v;
    }, 2660: function(k, i, n) {
      var o = this && this.__decorate || function(v, m, l, s) {
        var r, e = arguments.length, t = e < 3 ? m : s === null ? s = Object.getOwnPropertyDescriptor(m, l) : s;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
          t = Reflect.decorate(v, m, l, s);
        else
          for (var h = v.length - 1; h >= 0; h--)
            (r = v[h]) && (t = (e < 3 ? r(t) : e > 3 ? r(m, l, t) : r(m, l)) || t);
        return e > 3 && t && Object.defineProperty(m, l, t), t;
      }, c = this && this.__param || function(v, m) {
        return function(l, s) {
          m(l, s, v);
        };
      };
      Object.defineProperty(i, "__esModule", { value: !0 }), i.OscLinkService = void 0;
      const a = n(2585);
      let d = i.OscLinkService = class {
        constructor(v) {
          this._bufferService = v, this._nextId = 1, this._entriesWithId = /* @__PURE__ */ new Map(), this._dataByLinkId = /* @__PURE__ */ new Map();
        }
        registerLink(v) {
          const m = this._bufferService.buffer;
          if (v.id === void 0) {
            const h = m.addMarker(m.ybase + m.y), g = { data: v, id: this._nextId++, lines: [h] };
            return h.onDispose(() => this._removeMarkerFromLink(g, h)), this._dataByLinkId.set(g.id, g), g.id;
          }
          const l = v, s = this._getEntryIdKey(l), r = this._entriesWithId.get(s);
          if (r)
            return this.addLineToLink(r.id, m.ybase + m.y), r.id;
          const e = m.addMarker(m.ybase + m.y), t = { id: this._nextId++, key: this._getEntryIdKey(l), data: l, lines: [e] };
          return e.onDispose(() => this._removeMarkerFromLink(t, e)), this._entriesWithId.set(t.key, t), this._dataByLinkId.set(t.id, t), t.id;
        }
        addLineToLink(v, m) {
          const l = this._dataByLinkId.get(v);
          if (l && l.lines.every((s) => s.line !== m)) {
            const s = this._bufferService.buffer.addMarker(m);
            l.lines.push(s), s.onDispose(() => this._removeMarkerFromLink(l, s));
          }
        }
        getLinkData(v) {
          var m;
          return (m = this._dataByLinkId.get(v)) == null ? void 0 : m.data;
        }
        _getEntryIdKey(v) {
          return `${v.id};;${v.uri}`;
        }
        _removeMarkerFromLink(v, m) {
          const l = v.lines.indexOf(m);
          l !== -1 && (v.lines.splice(l, 1), v.lines.length === 0 && (v.data.id !== void 0 && this._entriesWithId.delete(v.key), this._dataByLinkId.delete(v.id)));
        }
      };
      i.OscLinkService = d = o([c(0, a.IBufferService)], d);
    }, 8343: (k, i) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.createDecorator = i.getServiceDependencies = i.serviceRegistry = void 0;
      const n = "di$target", o = "di$dependencies";
      i.serviceRegistry = /* @__PURE__ */ new Map(), i.getServiceDependencies = function(c) {
        return c[o] || [];
      }, i.createDecorator = function(c) {
        if (i.serviceRegistry.has(c))
          return i.serviceRegistry.get(c);
        const a = function(d, v, m) {
          if (arguments.length !== 3)
            throw new Error("@IServiceName-decorator can only be used to decorate a parameter");
          (function(l, s, r) {
            s[n] === s ? s[o].push({ id: l, index: r }) : (s[o] = [{ id: l, index: r }], s[n] = s);
          })(a, d, m);
        };
        return a.toString = () => c, i.serviceRegistry.set(c, a), a;
      };
    }, 2585: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.IDecorationService = i.IUnicodeService = i.IOscLinkService = i.IOptionsService = i.ILogService = i.LogLevelEnum = i.IInstantiationService = i.ICharsetService = i.ICoreService = i.ICoreMouseService = i.IBufferService = void 0;
      const o = n(8343);
      var c;
      i.IBufferService = (0, o.createDecorator)("BufferService"), i.ICoreMouseService = (0, o.createDecorator)("CoreMouseService"), i.ICoreService = (0, o.createDecorator)("CoreService"), i.ICharsetService = (0, o.createDecorator)("CharsetService"), i.IInstantiationService = (0, o.createDecorator)("InstantiationService"), function(a) {
        a[a.TRACE = 0] = "TRACE", a[a.DEBUG = 1] = "DEBUG", a[a.INFO = 2] = "INFO", a[a.WARN = 3] = "WARN", a[a.ERROR = 4] = "ERROR", a[a.OFF = 5] = "OFF";
      }(c || (i.LogLevelEnum = c = {})), i.ILogService = (0, o.createDecorator)("LogService"), i.IOptionsService = (0, o.createDecorator)("OptionsService"), i.IOscLinkService = (0, o.createDecorator)("OscLinkService"), i.IUnicodeService = (0, o.createDecorator)("UnicodeService"), i.IDecorationService = (0, o.createDecorator)("DecorationService");
    }, 1480: (k, i, n) => {
      Object.defineProperty(i, "__esModule", { value: !0 }), i.UnicodeService = void 0;
      const o = n(8460), c = n(225);
      class a {
        static extractShouldJoin(v) {
          return (1 & v) != 0;
        }
        static extractWidth(v) {
          return v >> 1 & 3;
        }
        static extractCharKind(v) {
          return v >> 3;
        }
        static createPropertyValue(v, m, l = !1) {
          return (16777215 & v) << 3 | (3 & m) << 1 | (l ? 1 : 0);
        }
        constructor() {
          this._providers = /* @__PURE__ */ Object.create(null), this._active = "", this._onChange = new o.EventEmitter(), this.onChange = this._onChange.event;
          const v = new c.UnicodeV6();
          this.register(v), this._active = v.version, this._activeProvider = v;
        }
        dispose() {
          this._onChange.dispose();
        }
        get versions() {
          return Object.keys(this._providers);
        }
        get activeVersion() {
          return this._active;
        }
        set activeVersion(v) {
          if (!this._providers[v])
            throw new Error(`unknown Unicode version "${v}"`);
          this._active = v, this._activeProvider = this._providers[v], this._onChange.fire(v);
        }
        register(v) {
          this._providers[v.version] = v;
        }
        wcwidth(v) {
          return this._activeProvider.wcwidth(v);
        }
        getStringCellWidth(v) {
          let m = 0, l = 0;
          const s = v.length;
          for (let r = 0; r < s; ++r) {
            let e = v.charCodeAt(r);
            if (55296 <= e && e <= 56319) {
              if (++r >= s)
                return m + this.wcwidth(e);
              const g = v.charCodeAt(r);
              56320 <= g && g <= 57343 ? e = 1024 * (e - 55296) + g - 56320 + 65536 : m += this.wcwidth(g);
            }
            const t = this.charProperties(e, l);
            let h = a.extractWidth(t);
            a.extractShouldJoin(t) && (h -= a.extractWidth(l)), m += h, l = t;
          }
          return m;
        }
        charProperties(v, m) {
          return this._activeProvider.charProperties(v, m);
        }
      }
      i.UnicodeService = a;
    } }, y = {};
    function D(k) {
      var i = y[k];
      if (i !== void 0)
        return i.exports;
      var n = y[k] = { exports: {} };
      return p[k].call(n.exports, n, n.exports, D), n.exports;
    }
    var M = {};
    return (() => {
      var k = M;
      Object.defineProperty(k, "__esModule", { value: !0 }), k.Terminal = void 0;
      const i = D(9042), n = D(3236), o = D(844), c = D(5741), a = D(8285), d = D(7975), v = D(7090), m = ["cols", "rows"];
      class l extends o.Disposable {
        constructor(r) {
          super(), this._core = this.register(new n.Terminal(r)), this._addonManager = this.register(new c.AddonManager()), this._publicOptions = { ...this._core.options };
          const e = (h) => this._core.options[h], t = (h, g) => {
            this._checkReadonlyOptions(h), this._core.options[h] = g;
          };
          for (const h in this._core.options) {
            const g = { get: e.bind(this, h), set: t.bind(this, h) };
            Object.defineProperty(this._publicOptions, h, g);
          }
        }
        _checkReadonlyOptions(r) {
          if (m.includes(r))
            throw new Error(`Option "${r}" can only be set in the constructor`);
        }
        _checkProposedApi() {
          if (!this._core.optionsService.rawOptions.allowProposedApi)
            throw new Error("You must set the allowProposedApi option to true to use proposed API");
        }
        get onBell() {
          return this._core.onBell;
        }
        get onBinary() {
          return this._core.onBinary;
        }
        get onCursorMove() {
          return this._core.onCursorMove;
        }
        get onData() {
          return this._core.onData;
        }
        get onKey() {
          return this._core.onKey;
        }
        get onLineFeed() {
          return this._core.onLineFeed;
        }
        get onRender() {
          return this._core.onRender;
        }
        get onResize() {
          return this._core.onResize;
        }
        get onScroll() {
          return this._core.onScroll;
        }
        get onSelectionChange() {
          return this._core.onSelectionChange;
        }
        get onTitleChange() {
          return this._core.onTitleChange;
        }
        get onWriteParsed() {
          return this._core.onWriteParsed;
        }
        get element() {
          return this._core.element;
        }
        get parser() {
          return this._parser || (this._parser = new d.ParserApi(this._core)), this._parser;
        }
        get unicode() {
          return this._checkProposedApi(), new v.UnicodeApi(this._core);
        }
        get textarea() {
          return this._core.textarea;
        }
        get rows() {
          return this._core.rows;
        }
        get cols() {
          return this._core.cols;
        }
        get buffer() {
          return this._buffer || (this._buffer = this.register(new a.BufferNamespaceApi(this._core))), this._buffer;
        }
        get markers() {
          return this._checkProposedApi(), this._core.markers;
        }
        get modes() {
          const r = this._core.coreService.decPrivateModes;
          let e = "none";
          switch (this._core.coreMouseService.activeProtocol) {
            case "X10":
              e = "x10";
              break;
            case "VT200":
              e = "vt200";
              break;
            case "DRAG":
              e = "drag";
              break;
            case "ANY":
              e = "any";
          }
          return { applicationCursorKeysMode: r.applicationCursorKeys, applicationKeypadMode: r.applicationKeypad, bracketedPasteMode: r.bracketedPasteMode, insertMode: this._core.coreService.modes.insertMode, mouseTrackingMode: e, originMode: r.origin, reverseWraparoundMode: r.reverseWraparound, sendFocusMode: r.sendFocus, wraparoundMode: r.wraparound };
        }
        get options() {
          return this._publicOptions;
        }
        set options(r) {
          for (const e in r)
            this._publicOptions[e] = r[e];
        }
        blur() {
          this._core.blur();
        }
        focus() {
          this._core.focus();
        }
        input(r, e = !0) {
          this._core.input(r, e);
        }
        resize(r, e) {
          this._verifyIntegers(r, e), this._core.resize(r, e);
        }
        open(r) {
          this._core.open(r);
        }
        attachCustomKeyEventHandler(r) {
          this._core.attachCustomKeyEventHandler(r);
        }
        attachCustomWheelEventHandler(r) {
          this._core.attachCustomWheelEventHandler(r);
        }
        registerLinkProvider(r) {
          return this._core.registerLinkProvider(r);
        }
        registerCharacterJoiner(r) {
          return this._checkProposedApi(), this._core.registerCharacterJoiner(r);
        }
        deregisterCharacterJoiner(r) {
          this._checkProposedApi(), this._core.deregisterCharacterJoiner(r);
        }
        registerMarker(r = 0) {
          return this._verifyIntegers(r), this._core.registerMarker(r);
        }
        registerDecoration(r) {
          return this._checkProposedApi(), this._verifyPositiveIntegers(r.x ?? 0, r.width ?? 0, r.height ?? 0), this._core.registerDecoration(r);
        }
        hasSelection() {
          return this._core.hasSelection();
        }
        select(r, e, t) {
          this._verifyIntegers(r, e, t), this._core.select(r, e, t);
        }
        getSelection() {
          return this._core.getSelection();
        }
        getSelectionPosition() {
          return this._core.getSelectionPosition();
        }
        clearSelection() {
          this._core.clearSelection();
        }
        selectAll() {
          this._core.selectAll();
        }
        selectLines(r, e) {
          this._verifyIntegers(r, e), this._core.selectLines(r, e);
        }
        dispose() {
          super.dispose();
        }
        scrollLines(r) {
          this._verifyIntegers(r), this._core.scrollLines(r);
        }
        scrollPages(r) {
          this._verifyIntegers(r), this._core.scrollPages(r);
        }
        scrollToTop() {
          this._core.scrollToTop();
        }
        scrollToBottom() {
          this._core.scrollToBottom();
        }
        scrollToLine(r) {
          this._verifyIntegers(r), this._core.scrollToLine(r);
        }
        clear() {
          this._core.clear();
        }
        write(r, e) {
          this._core.write(r, e);
        }
        writeln(r, e) {
          this._core.write(r), this._core.write(`\r
`, e);
        }
        paste(r) {
          this._core.paste(r);
        }
        refresh(r, e) {
          this._verifyIntegers(r, e), this._core.refresh(r, e);
        }
        reset() {
          this._core.reset();
        }
        clearTextureAtlas() {
          this._core.clearTextureAtlas();
        }
        loadAddon(r) {
          this._addonManager.loadAddon(this, r);
        }
        static get strings() {
          return i;
        }
        _verifyIntegers(...r) {
          for (const e of r)
            if (e === 1 / 0 || isNaN(e) || e % 1 != 0)
              throw new Error("This API only accepts integers");
        }
        _verifyPositiveIntegers(...r) {
          for (const e of r)
            if (e && (e === 1 / 0 || isNaN(e) || e % 1 != 0 || e < 0))
              throw new Error("This API only accepts positive integers");
        }
      }
      k.Terminal = l;
    })(), M;
  })());
})(Ut);
var Bs = Ut.exports;
const Ms = /* @__PURE__ */ Nt(Bs);
var zt = { exports: {} };
(function(E, f) {
  (function(p, y) {
    E.exports = y();
  })(self, () => (() => {
    var p = {};
    return (() => {
      var y = p;
      Object.defineProperty(y, "__esModule", { value: !0 }), y.FitAddon = void 0, y.FitAddon = class {
        activate(D) {
          this._terminal = D;
        }
        dispose() {
        }
        fit() {
          const D = this.proposeDimensions();
          if (!D || !this._terminal || isNaN(D.cols) || isNaN(D.rows))
            return;
          const M = this._terminal._core;
          this._terminal.rows === D.rows && this._terminal.cols === D.cols || (M._renderService.clear(), this._terminal.resize(D.cols, D.rows));
        }
        proposeDimensions() {
          if (!this._terminal || !this._terminal.element || !this._terminal.element.parentElement)
            return;
          const D = this._terminal._core, M = D._renderService.dimensions;
          if (M.css.cell.width === 0 || M.css.cell.height === 0)
            return;
          const k = this._terminal.options.scrollback === 0 ? 0 : D.viewport.scrollBarWidth, i = window.getComputedStyle(this._terminal.element.parentElement), n = parseInt(i.getPropertyValue("height")), o = Math.max(0, parseInt(i.getPropertyValue("width"))), c = window.getComputedStyle(this._terminal.element), a = n - (parseInt(c.getPropertyValue("padding-top")) + parseInt(c.getPropertyValue("padding-bottom"))), d = o - (parseInt(c.getPropertyValue("padding-right")) + parseInt(c.getPropertyValue("padding-left"))) - k;
          return { cols: Math.max(2, Math.floor(d / M.css.cell.width)), rows: Math.max(1, Math.floor(a / M.css.cell.height)) };
        }
      };
    })(), p;
  })());
})(zt);
var Ts = zt.exports;
const Os = /* @__PURE__ */ Nt(Ts);
const {
  SvelteComponent: Ps,
  append: xt,
  assign: Is,
  attr: Dt,
  binding_callbacks: Hs,
  check_outros: Fs,
  create_component: $e,
  destroy_component: et,
  detach: Ze,
  element: Rt,
  flush: Y,
  get_spread_object: Ws,
  get_spread_update: Ns,
  group_outros: Us,
  init: js,
  insert: Qe,
  mount_component: tt,
  safe_not_equal: zs,
  set_data: qs,
  space: At,
  text: Ks,
  transition_in: Le,
  transition_out: Pe
} = window.__gradio__svelte__internal, { onMount: Vs } = window.__gradio__svelte__internal;
function Bt(E) {
  let f, p;
  const y = [
    { autoscroll: (
      /*gradio*/
      E[0].autoscroll
    ) },
    { i18n: (
      /*gradio*/
      E[0].i18n
    ) },
    /*loading_status*/
    E[9]
  ];
  let D = {};
  for (let M = 0; M < y.length; M += 1)
    D = Is(D, y[M]);
  return f = new As({ props: D }), {
    c() {
      $e(f.$$.fragment);
    },
    m(M, k) {
      tt(f, M, k), p = !0;
    },
    p(M, k) {
      const i = k[0] & /*gradio, loading_status*/
      513 ? Ns(y, [
        k[0] & /*gradio*/
        1 && { autoscroll: (
          /*gradio*/
          M[0].autoscroll
        ) },
        k[0] & /*gradio*/
        1 && { i18n: (
          /*gradio*/
          M[0].i18n
        ) },
        k[0] & /*loading_status*/
        512 && Ws(
          /*loading_status*/
          M[9]
        )
      ]) : {};
      f.$set(i);
    },
    i(M) {
      p || (Le(f.$$.fragment, M), p = !0);
    },
    o(M) {
      Pe(f.$$.fragment, M), p = !1;
    },
    d(M) {
      et(f, M);
    }
  };
}
function Gs(E) {
  let f;
  return {
    c() {
      f = Ks(
        /*label*/
        E[1]
      );
    },
    m(p, y) {
      Qe(p, f, y);
    },
    p(p, y) {
      y[0] & /*label*/
      2 && qs(
        f,
        /*label*/
        p[1]
      );
    },
    d(p) {
      p && Ze(f);
    }
  };
}
function Xs(E) {
  let f, p, y, D, M, k, i = (
    /*loading_status*/
    E[9] && Bt(E)
  );
  return y = new zi({
    props: {
      show_label: (
        /*show_label*/
        E[6]
      ),
      info: void 0,
      $$slots: { default: [Gs] },
      $$scope: { ctx: E }
    }
  }), {
    c() {
      i && i.c(), f = At(), p = Rt("div"), $e(y.$$.fragment), D = At(), M = Rt("div"), Dt(M, "class", "svelte-1jxdgz3"), Dt(p, "class", "svelte-1jxdgz3");
    },
    m(n, o) {
      i && i.m(n, o), Qe(n, f, o), Qe(n, p, o), tt(y, p, null), xt(p, D), xt(p, M), E[49](M), k = !0;
    },
    p(n, o) {
      /*loading_status*/
      n[9] ? i ? (i.p(n, o), o[0] & /*loading_status*/
      512 && Le(i, 1)) : (i = Bt(n), i.c(), Le(i, 1), i.m(f.parentNode, f)) : i && (Us(), Pe(i, 1, 1, () => {
        i = null;
      }), Fs());
      const c = {};
      o[0] & /*show_label*/
      64 && (c.show_label = /*show_label*/
      n[6]), o[0] & /*label*/
      2 | o[1] & /*$$scope*/
      1048576 && (c.$$scope = { dirty: o, ctx: n }), y.$set(c);
    },
    i(n) {
      k || (Le(i), Le(y.$$.fragment, n), k = !0);
    },
    o(n) {
      Pe(i), Pe(y.$$.fragment, n), k = !1;
    },
    d(n) {
      n && (Ze(f), Ze(p)), i && i.d(n), et(y), E[49](null);
    }
  };
}
function Js(E) {
  let f, p;
  return f = new oi({
    props: {
      visible: (
        /*visible*/
        E[5]
      ),
      elem_id: (
        /*elem_id*/
        E[3]
      ),
      scale: (
        /*scale*/
        E[7]
      ),
      min_width: (
        /*min_width*/
        E[8]
      ),
      elem_classes: [
        .../*elem_classes*/
        E[4],
        /*dark*/
        E[2] ? "dark" : ""
      ],
      allow_overflow: !1,
      padding: !0,
      $$slots: { default: [Xs] },
      $$scope: { ctx: E }
    }
  }), {
    c() {
      $e(f.$$.fragment);
    },
    m(y, D) {
      tt(f, y, D), p = !0;
    },
    p(y, D) {
      const M = {};
      D[0] & /*visible*/
      32 && (M.visible = /*visible*/
      y[5]), D[0] & /*elem_id*/
      8 && (M.elem_id = /*elem_id*/
      y[3]), D[0] & /*scale*/
      128 && (M.scale = /*scale*/
      y[7]), D[0] & /*min_width*/
      256 && (M.min_width = /*min_width*/
      y[8]), D[0] & /*elem_classes, dark*/
      20 && (M.elem_classes = [
        .../*elem_classes*/
        y[4],
        /*dark*/
        y[2] ? "dark" : ""
      ]), D[0] & /*termNode, show_label, label, gradio, loading_status*/
      1603 | D[1] & /*$$scope*/
      1048576 && (M.$$scope = { dirty: D, ctx: y }), f.$set(M);
    },
    i(y) {
      p || (Le(f.$$.fragment, y), p = !0);
    },
    o(y) {
      Pe(f.$$.fragment, y), p = !1;
    },
    d(y) {
      et(f, y);
    }
  };
}
function Ys(E, f, p) {
  let y, { gradio: D } = f, { log_file: M = "" } = f, { label: k = `log of ${M}` } = f, { dark: i = !1 } = f, { elem_id: n = "" } = f, { elem_classes: o = ["terminal-block"] } = f, { visible: c = !0 } = f, { value: a = "" } = f, { show_label: d } = f, { scale: v = null } = f, { min_width: m = void 0 } = f, { loading_status: l = void 0 } = f, { xterm_allow_proposed_api: s } = f, { xterm_allow_transparency: r } = f, { xterm_alt_click_moves_cursor: e } = f, { xterm_convert_eol: t } = f, { xterm_cursor_blink: h } = f, { xterm_cursor_inactive_style: g } = f, { xterm_cursor_style: u } = f, { xterm_cursor_width: S } = f, { xterm_custom_glyphs: _ } = f, { xterm_disable_stdin: b } = f, { xterm_document_override: R } = f, { xterm_draw_bold_text_in_bright_colors: B } = f, { xterm_fast_scroll_modifier: T } = f, { xterm_fast_scroll_sensitivity: L } = f, { xterm_font_family: H } = f, { xterm_font_size: W } = f, { xterm_font_weight: j } = f, { xterm_font_weight_bold: V } = f, { xterm_ignore_bracketed_paste_mode: z } = f, { xterm_letter_spacing: C } = f, { xterm_line_height: x } = f, { xterm_log_level: A } = f, { xterm_mac_option_click_forces_selection: O } = f, { xterm_mac_option_is_meta: I } = f, { xterm_minimum_contrast_ratio: q } = f, { xterm_overview_ruler_width: X } = f, { xterm_rescale_overlapping_glyphs: J } = f, { xterm_right_click_selects_word: P } = f, { xterm_screen_reader_mode: w } = f, { xterm_scroll_on_user_input: U } = f, { xterm_scroll_sensitivity: F } = f, { xterm_scrollback: G } = f, { xterm_smooth_scroll_duration: K } = f, { xterm_tab_stop_width: ee } = f, { xterm_windows_mode: se } = f, ie, oe;
  Vs(() => {
    p(48, ie = new Ms.Terminal({
      theme: y,
      allowProposedApi: s,
      allowTransparency: r,
      altClickMovesCursor: e,
      convertEol: t,
      cursorBlink: h,
      cursorInactiveStyle: g,
      cursorStyle: u,
      cursorWidth: S,
      customGlyphs: _,
      disableStdin: b,
      documentOverride: R,
      drawBoldTextInBrightColors: B,
      fastScrollModifier: T,
      fastScrollSensitivity: L,
      fontFamily: H,
      fontSize: W,
      fontWeight: j,
      fontWeightBold: V,
      ignoreBracketedPasteMode: z,
      letterSpacing: C,
      lineHeight: x,
      logLevel: A,
      macOptionClickForcesSelection: O,
      macOptionIsMeta: I,
      minimumContrastRatio: q,
      overviewRulerWidth: X,
      rescaleOverlappingGlyphs: J,
      rightClickSelectsWord: P,
      screenReaderMode: w,
      scrollOnUserInput: U,
      scrollSensitivity: F,
      smoothScrollDuration: K,
      tabStopWidth: ee,
      scrollback: G,
      windowsMode: se
    })), ie.open(oe);
    const N = new Os.FitAddon();
    ie.loadAddon(N), setTimeout(
      () => {
        N.fit();
      },
      300
    );
    const we = () => {
      N.fit();
    };
    return window.addEventListener("resize", we), () => {
      window.removeEventListener("resize", we);
    };
  });
  function Z(N) {
    Hs[N ? "unshift" : "push"](() => {
      oe = N, p(10, oe);
    });
  }
  return E.$$set = (N) => {
    "gradio" in N && p(0, D = N.gradio), "log_file" in N && p(11, M = N.log_file), "label" in N && p(1, k = N.label), "dark" in N && p(2, i = N.dark), "elem_id" in N && p(3, n = N.elem_id), "elem_classes" in N && p(4, o = N.elem_classes), "visible" in N && p(5, c = N.visible), "value" in N && p(12, a = N.value), "show_label" in N && p(6, d = N.show_label), "scale" in N && p(7, v = N.scale), "min_width" in N && p(8, m = N.min_width), "loading_status" in N && p(9, l = N.loading_status), "xterm_allow_proposed_api" in N && p(13, s = N.xterm_allow_proposed_api), "xterm_allow_transparency" in N && p(14, r = N.xterm_allow_transparency), "xterm_alt_click_moves_cursor" in N && p(15, e = N.xterm_alt_click_moves_cursor), "xterm_convert_eol" in N && p(16, t = N.xterm_convert_eol), "xterm_cursor_blink" in N && p(17, h = N.xterm_cursor_blink), "xterm_cursor_inactive_style" in N && p(18, g = N.xterm_cursor_inactive_style), "xterm_cursor_style" in N && p(19, u = N.xterm_cursor_style), "xterm_cursor_width" in N && p(20, S = N.xterm_cursor_width), "xterm_custom_glyphs" in N && p(21, _ = N.xterm_custom_glyphs), "xterm_disable_stdin" in N && p(22, b = N.xterm_disable_stdin), "xterm_document_override" in N && p(23, R = N.xterm_document_override), "xterm_draw_bold_text_in_bright_colors" in N && p(24, B = N.xterm_draw_bold_text_in_bright_colors), "xterm_fast_scroll_modifier" in N && p(25, T = N.xterm_fast_scroll_modifier), "xterm_fast_scroll_sensitivity" in N && p(26, L = N.xterm_fast_scroll_sensitivity), "xterm_font_family" in N && p(27, H = N.xterm_font_family), "xterm_font_size" in N && p(28, W = N.xterm_font_size), "xterm_font_weight" in N && p(29, j = N.xterm_font_weight), "xterm_font_weight_bold" in N && p(30, V = N.xterm_font_weight_bold), "xterm_ignore_bracketed_paste_mode" in N && p(31, z = N.xterm_ignore_bracketed_paste_mode), "xterm_letter_spacing" in N && p(32, C = N.xterm_letter_spacing), "xterm_line_height" in N && p(33, x = N.xterm_line_height), "xterm_log_level" in N && p(34, A = N.xterm_log_level), "xterm_mac_option_click_forces_selection" in N && p(35, O = N.xterm_mac_option_click_forces_selection), "xterm_mac_option_is_meta" in N && p(36, I = N.xterm_mac_option_is_meta), "xterm_minimum_contrast_ratio" in N && p(37, q = N.xterm_minimum_contrast_ratio), "xterm_overview_ruler_width" in N && p(38, X = N.xterm_overview_ruler_width), "xterm_rescale_overlapping_glyphs" in N && p(39, J = N.xterm_rescale_overlapping_glyphs), "xterm_right_click_selects_word" in N && p(40, P = N.xterm_right_click_selects_word), "xterm_screen_reader_mode" in N && p(41, w = N.xterm_screen_reader_mode), "xterm_scroll_on_user_input" in N && p(42, U = N.xterm_scroll_on_user_input), "xterm_scroll_sensitivity" in N && p(43, F = N.xterm_scroll_sensitivity), "xterm_scrollback" in N && p(44, G = N.xterm_scrollback), "xterm_smooth_scroll_duration" in N && p(45, K = N.xterm_smooth_scroll_duration), "xterm_tab_stop_width" in N && p(46, ee = N.xterm_tab_stop_width), "xterm_windows_mode" in N && p(47, se = N.xterm_windows_mode);
  }, E.$$.update = () => {
    E.$$.dirty[0] & /*dark*/
    4 && (y = i ? {
      foreground: "white",
      background: "#1F2937"
    } : {
      foreground: "#1F2937",
      background: "white",
      selectionBackground: "#e5e7eb"
    }), E.$$.dirty[0] & /*value*/
    4096 | E.$$.dirty[1] & /*term*/
    131072 && ie && a && a.trim() !== "" && ie.write(a.replace(/\n/g, `
\r`));
  }, [
    D,
    k,
    i,
    n,
    o,
    c,
    d,
    v,
    m,
    l,
    oe,
    M,
    a,
    s,
    r,
    e,
    t,
    h,
    g,
    u,
    S,
    _,
    b,
    R,
    B,
    T,
    L,
    H,
    W,
    j,
    V,
    z,
    C,
    x,
    A,
    O,
    I,
    q,
    X,
    J,
    P,
    w,
    U,
    F,
    G,
    K,
    ee,
    se,
    ie,
    Z
  ];
}
class Zs extends Ps {
  constructor(f) {
    super(), js(
      this,
      f,
      Ys,
      Js,
      zs,
      {
        gradio: 0,
        log_file: 11,
        label: 1,
        dark: 2,
        elem_id: 3,
        elem_classes: 4,
        visible: 5,
        value: 12,
        show_label: 6,
        scale: 7,
        min_width: 8,
        loading_status: 9,
        xterm_allow_proposed_api: 13,
        xterm_allow_transparency: 14,
        xterm_alt_click_moves_cursor: 15,
        xterm_convert_eol: 16,
        xterm_cursor_blink: 17,
        xterm_cursor_inactive_style: 18,
        xterm_cursor_style: 19,
        xterm_cursor_width: 20,
        xterm_custom_glyphs: 21,
        xterm_disable_stdin: 22,
        xterm_document_override: 23,
        xterm_draw_bold_text_in_bright_colors: 24,
        xterm_fast_scroll_modifier: 25,
        xterm_fast_scroll_sensitivity: 26,
        xterm_font_family: 27,
        xterm_font_size: 28,
        xterm_font_weight: 29,
        xterm_font_weight_bold: 30,
        xterm_ignore_bracketed_paste_mode: 31,
        xterm_letter_spacing: 32,
        xterm_line_height: 33,
        xterm_log_level: 34,
        xterm_mac_option_click_forces_selection: 35,
        xterm_mac_option_is_meta: 36,
        xterm_minimum_contrast_ratio: 37,
        xterm_overview_ruler_width: 38,
        xterm_rescale_overlapping_glyphs: 39,
        xterm_right_click_selects_word: 40,
        xterm_screen_reader_mode: 41,
        xterm_scroll_on_user_input: 42,
        xterm_scroll_sensitivity: 43,
        xterm_scrollback: 44,
        xterm_smooth_scroll_duration: 45,
        xterm_tab_stop_width: 46,
        xterm_windows_mode: 47
      },
      null,
      [-1, -1]
    );
  }
  get gradio() {
    return this.$$.ctx[0];
  }
  set gradio(f) {
    this.$$set({ gradio: f }), Y();
  }
  get log_file() {
    return this.$$.ctx[11];
  }
  set log_file(f) {
    this.$$set({ log_file: f }), Y();
  }
  get label() {
    return this.$$.ctx[1];
  }
  set label(f) {
    this.$$set({ label: f }), Y();
  }
  get dark() {
    return this.$$.ctx[2];
  }
  set dark(f) {
    this.$$set({ dark: f }), Y();
  }
  get elem_id() {
    return this.$$.ctx[3];
  }
  set elem_id(f) {
    this.$$set({ elem_id: f }), Y();
  }
  get elem_classes() {
    return this.$$.ctx[4];
  }
  set elem_classes(f) {
    this.$$set({ elem_classes: f }), Y();
  }
  get visible() {
    return this.$$.ctx[5];
  }
  set visible(f) {
    this.$$set({ visible: f }), Y();
  }
  get value() {
    return this.$$.ctx[12];
  }
  set value(f) {
    this.$$set({ value: f }), Y();
  }
  get show_label() {
    return this.$$.ctx[6];
  }
  set show_label(f) {
    this.$$set({ show_label: f }), Y();
  }
  get scale() {
    return this.$$.ctx[7];
  }
  set scale(f) {
    this.$$set({ scale: f }), Y();
  }
  get min_width() {
    return this.$$.ctx[8];
  }
  set min_width(f) {
    this.$$set({ min_width: f }), Y();
  }
  get loading_status() {
    return this.$$.ctx[9];
  }
  set loading_status(f) {
    this.$$set({ loading_status: f }), Y();
  }
  get xterm_allow_proposed_api() {
    return this.$$.ctx[13];
  }
  set xterm_allow_proposed_api(f) {
    this.$$set({ xterm_allow_proposed_api: f }), Y();
  }
  get xterm_allow_transparency() {
    return this.$$.ctx[14];
  }
  set xterm_allow_transparency(f) {
    this.$$set({ xterm_allow_transparency: f }), Y();
  }
  get xterm_alt_click_moves_cursor() {
    return this.$$.ctx[15];
  }
  set xterm_alt_click_moves_cursor(f) {
    this.$$set({ xterm_alt_click_moves_cursor: f }), Y();
  }
  get xterm_convert_eol() {
    return this.$$.ctx[16];
  }
  set xterm_convert_eol(f) {
    this.$$set({ xterm_convert_eol: f }), Y();
  }
  get xterm_cursor_blink() {
    return this.$$.ctx[17];
  }
  set xterm_cursor_blink(f) {
    this.$$set({ xterm_cursor_blink: f }), Y();
  }
  get xterm_cursor_inactive_style() {
    return this.$$.ctx[18];
  }
  set xterm_cursor_inactive_style(f) {
    this.$$set({ xterm_cursor_inactive_style: f }), Y();
  }
  get xterm_cursor_style() {
    return this.$$.ctx[19];
  }
  set xterm_cursor_style(f) {
    this.$$set({ xterm_cursor_style: f }), Y();
  }
  get xterm_cursor_width() {
    return this.$$.ctx[20];
  }
  set xterm_cursor_width(f) {
    this.$$set({ xterm_cursor_width: f }), Y();
  }
  get xterm_custom_glyphs() {
    return this.$$.ctx[21];
  }
  set xterm_custom_glyphs(f) {
    this.$$set({ xterm_custom_glyphs: f }), Y();
  }
  get xterm_disable_stdin() {
    return this.$$.ctx[22];
  }
  set xterm_disable_stdin(f) {
    this.$$set({ xterm_disable_stdin: f }), Y();
  }
  get xterm_document_override() {
    return this.$$.ctx[23];
  }
  set xterm_document_override(f) {
    this.$$set({ xterm_document_override: f }), Y();
  }
  get xterm_draw_bold_text_in_bright_colors() {
    return this.$$.ctx[24];
  }
  set xterm_draw_bold_text_in_bright_colors(f) {
    this.$$set({ xterm_draw_bold_text_in_bright_colors: f }), Y();
  }
  get xterm_fast_scroll_modifier() {
    return this.$$.ctx[25];
  }
  set xterm_fast_scroll_modifier(f) {
    this.$$set({ xterm_fast_scroll_modifier: f }), Y();
  }
  get xterm_fast_scroll_sensitivity() {
    return this.$$.ctx[26];
  }
  set xterm_fast_scroll_sensitivity(f) {
    this.$$set({ xterm_fast_scroll_sensitivity: f }), Y();
  }
  get xterm_font_family() {
    return this.$$.ctx[27];
  }
  set xterm_font_family(f) {
    this.$$set({ xterm_font_family: f }), Y();
  }
  get xterm_font_size() {
    return this.$$.ctx[28];
  }
  set xterm_font_size(f) {
    this.$$set({ xterm_font_size: f }), Y();
  }
  get xterm_font_weight() {
    return this.$$.ctx[29];
  }
  set xterm_font_weight(f) {
    this.$$set({ xterm_font_weight: f }), Y();
  }
  get xterm_font_weight_bold() {
    return this.$$.ctx[30];
  }
  set xterm_font_weight_bold(f) {
    this.$$set({ xterm_font_weight_bold: f }), Y();
  }
  get xterm_ignore_bracketed_paste_mode() {
    return this.$$.ctx[31];
  }
  set xterm_ignore_bracketed_paste_mode(f) {
    this.$$set({ xterm_ignore_bracketed_paste_mode: f }), Y();
  }
  get xterm_letter_spacing() {
    return this.$$.ctx[32];
  }
  set xterm_letter_spacing(f) {
    this.$$set({ xterm_letter_spacing: f }), Y();
  }
  get xterm_line_height() {
    return this.$$.ctx[33];
  }
  set xterm_line_height(f) {
    this.$$set({ xterm_line_height: f }), Y();
  }
  get xterm_log_level() {
    return this.$$.ctx[34];
  }
  set xterm_log_level(f) {
    this.$$set({ xterm_log_level: f }), Y();
  }
  get xterm_mac_option_click_forces_selection() {
    return this.$$.ctx[35];
  }
  set xterm_mac_option_click_forces_selection(f) {
    this.$$set({ xterm_mac_option_click_forces_selection: f }), Y();
  }
  get xterm_mac_option_is_meta() {
    return this.$$.ctx[36];
  }
  set xterm_mac_option_is_meta(f) {
    this.$$set({ xterm_mac_option_is_meta: f }), Y();
  }
  get xterm_minimum_contrast_ratio() {
    return this.$$.ctx[37];
  }
  set xterm_minimum_contrast_ratio(f) {
    this.$$set({ xterm_minimum_contrast_ratio: f }), Y();
  }
  get xterm_overview_ruler_width() {
    return this.$$.ctx[38];
  }
  set xterm_overview_ruler_width(f) {
    this.$$set({ xterm_overview_ruler_width: f }), Y();
  }
  get xterm_rescale_overlapping_glyphs() {
    return this.$$.ctx[39];
  }
  set xterm_rescale_overlapping_glyphs(f) {
    this.$$set({ xterm_rescale_overlapping_glyphs: f }), Y();
  }
  get xterm_right_click_selects_word() {
    return this.$$.ctx[40];
  }
  set xterm_right_click_selects_word(f) {
    this.$$set({ xterm_right_click_selects_word: f }), Y();
  }
  get xterm_screen_reader_mode() {
    return this.$$.ctx[41];
  }
  set xterm_screen_reader_mode(f) {
    this.$$set({ xterm_screen_reader_mode: f }), Y();
  }
  get xterm_scroll_on_user_input() {
    return this.$$.ctx[42];
  }
  set xterm_scroll_on_user_input(f) {
    this.$$set({ xterm_scroll_on_user_input: f }), Y();
  }
  get xterm_scroll_sensitivity() {
    return this.$$.ctx[43];
  }
  set xterm_scroll_sensitivity(f) {
    this.$$set({ xterm_scroll_sensitivity: f }), Y();
  }
  get xterm_scrollback() {
    return this.$$.ctx[44];
  }
  set xterm_scrollback(f) {
    this.$$set({ xterm_scrollback: f }), Y();
  }
  get xterm_smooth_scroll_duration() {
    return this.$$.ctx[45];
  }
  set xterm_smooth_scroll_duration(f) {
    this.$$set({ xterm_smooth_scroll_duration: f }), Y();
  }
  get xterm_tab_stop_width() {
    return this.$$.ctx[46];
  }
  set xterm_tab_stop_width(f) {
    this.$$set({ xterm_tab_stop_width: f }), Y();
  }
  get xterm_windows_mode() {
    return this.$$.ctx[47];
  }
  set xterm_windows_mode(f) {
    this.$$set({ xterm_windows_mode: f }), Y();
  }
}
export {
  Zs as default
};
